3.1.6 • Published 2 years ago

uo-wix-data v3.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

About

This is an unofficial NPM Package which includes some functions from the Wix Data API by Wix. The purpose of this package is to use Wix Data (database collections) in a different environment (site or Node.js app). It uses HTTP requests to connect to Wix.

Installation

npm install uo-wix-data --save

Check documentaiton for more steps.

Documentation

On your wix site create a backend file called http-functions.js and inside it put the code that is in uowd-http.js.

Getting started

1. Create a Wix site (blank template) and enable Developer mode.

2. On your wix site create a backend file called http-functions.js (if not created already) and inside it put the code from uowd-http.js.

3. In const wdToken = "foobar"; replace foobar with your secret token.

4. On your Node.JS file import uo-wix-data with const wixData = require("uo-wix-data") and set up wixData.setup("username", "my-site", "token") replacing username with your wix username, my-site with your site name and token with your secret token.

Functions

  • setup(username, siteName, token) - Sets everything up and returns the WixData object.
  • enableDevMode(void) - Sends requests to published site.
  • disableDevMode(void) - Sends requests to saved site.

WixData object

  • get
  • query
    • eq, ne, gt, ge, lt, lt, le, between, contains, starsWith, endsWith, hasAll, hasSome, isEmpty, isNotEmpty, ascending, descending, limit, include, find, count
  • get
  • query
  • insert
  • bulkInsert
  • insertReference
  • isReferenced
  • queryReferenced
  • update
  • bulkUpdate
  • save
  • remove
  • bulkRemove
  • removeReference
  • replaceReferences

Example:

const wixData = require("uo-wix-data")
  .setup("username", "my-site", "foobar");

// Example
wixData.query("Users").eq("name", "John").find().then((result) => {
    console.log(result.items[0]);
});

Version 3.0.0

  • Changed setup function to return WixData object
  • Added new functions:
    • insertReference
    • isReferenced
    • queryReferenced
    • save
    • removeReference
    • replaceReferences

Version 2.0.0

  • Added new functions:
    • bulkInsert
    • bulkUpdate
    • bulkRemove
    • query.include
    • query.count
    • enableDevMode
    • disableDevMode
  • Changed some error messages:
    • type_invalid to invalid_type
    • token_invalid to invalid_token
    • query_type_invalid to invalid_query_type
    • query_failed to find_failed
3.1.6

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

3.1.3

2 years ago

3.0.4

2 years ago

3.1.2

2 years ago

3.0.3

2 years ago

3.1.1

2 years ago

3.0.2

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.1.5

2 years ago

3.1.4

2 years ago

3.0.0

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago