backendless 6.6.2 → 6.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backendless.d.ts +12 -12
- package/dist/backendless.js +27 -24
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/data/store.js +24 -21
- package/es/users/index.js +2 -2
- package/lib/data/store.js +24 -21
- package/lib/users/index.js +2 -2
- package/package.json +1 -1
- package/src/data/store.js +17 -13
- package/src/users/index.js +2 -2
package/backendless.d.ts
CHANGED
|
@@ -680,9 +680,9 @@ declare module Backendless {
|
|
|
680
680
|
|
|
681
681
|
function createEmailConfirmationURL(identity: string | number): Promise<object>;
|
|
682
682
|
|
|
683
|
-
function enableUser(userId: string): Promise<void>;
|
|
683
|
+
function enableUser(userId: string | number): Promise<void>;
|
|
684
684
|
|
|
685
|
-
function disableUser(userId: string): Promise<void>;
|
|
685
|
+
function disableUser(userId: string | number): Promise<void>;
|
|
686
686
|
|
|
687
687
|
function getAuthorizationUrlLink(providerCode: string, fieldsMapping?: object, scope?: string, redirect?: boolean, redirectAfterLoginUrl?: string, callbackUrlDomain?: string): Promise<string>;
|
|
688
688
|
}
|
|
@@ -1433,7 +1433,7 @@ declare module Backendless {
|
|
|
1433
1433
|
|
|
1434
1434
|
deepSave<T = object>(obj: T | object): Promise<T>;
|
|
1435
1435
|
|
|
1436
|
-
remove(id: object | string): Promise<object>;
|
|
1436
|
+
remove(id: object | string | number): Promise<object>;
|
|
1437
1437
|
|
|
1438
1438
|
find<T = object>(obj?: Backendless.DataQueryBuilder | DataQueryI): Promise<Array<T>>;
|
|
1439
1439
|
|
|
@@ -1441,25 +1441,25 @@ declare module Backendless {
|
|
|
1441
1441
|
|
|
1442
1442
|
countInGroup(obj?: Backendless.GroupQueryBuilder | GroupQueryI): Promise<number>;
|
|
1443
1443
|
|
|
1444
|
-
findById<T = object>(objectId: string, query?: Backendless.DataQueryBuilder | DataQueryI): Promise<T>;
|
|
1444
|
+
findById<T = object>(objectId: string | number, query?: Backendless.DataQueryBuilder | DataQueryI): Promise<T>;
|
|
1445
1445
|
findById<T = object>(primaryKeys: object, query?: Backendless.DataQueryBuilder | DataQueryI): Promise<T>;
|
|
1446
1446
|
|
|
1447
1447
|
findFirst<T = object>(query?: Backendless.DataQueryBuilder | DataQueryI): Promise<T>;
|
|
1448
1448
|
|
|
1449
1449
|
findLast<T = object>(query?: Backendless.DataQueryBuilder | DataQueryI): Promise<T>;
|
|
1450
1450
|
|
|
1451
|
-
loadRelations<T = object>(parent: string | object, query: Backendless.LoadRelationsQueryBuilder | RelationsQueryI): Promise<Array<T>>;
|
|
1451
|
+
loadRelations<T = object>(parent: string | number | object, query: Backendless.LoadRelationsQueryBuilder | RelationsQueryI): Promise<Array<T>>;
|
|
1452
1452
|
|
|
1453
1453
|
getObjectCount(query?: Backendless.DataQueryBuilder | string): Promise<number>
|
|
1454
1454
|
|
|
1455
|
-
setRelation(parent: object, columnName: string, children: Array<object | string>): Promise<string>;
|
|
1456
|
-
setRelation(parent: object, columnName: string, whereClause: string): Promise<string>;
|
|
1455
|
+
setRelation(parent: object | string | number, columnName: string, children: Array<object | string | number>): Promise<string>;
|
|
1456
|
+
setRelation(parent: object | string | number, columnName: string, whereClause: string): Promise<string>;
|
|
1457
1457
|
|
|
1458
|
-
addRelation(parent: object, columnName: string, children: Array<object | string>): Promise<string>;
|
|
1459
|
-
addRelation(parent: object, columnName: string, whereClause: string): Promise<string>;
|
|
1458
|
+
addRelation(parent: object | string | number, columnName: string, children: Array<object | string | number>): Promise<string>;
|
|
1459
|
+
addRelation(parent: object | string | number, columnName: string, whereClause: string): Promise<string>;
|
|
1460
1460
|
|
|
1461
|
-
deleteRelation(parent: object, columnName: string, children: Array<object | string>): Promise<string>;
|
|
1462
|
-
deleteRelation(parent: object, columnName: string, whereClause: string): Promise<string>;
|
|
1461
|
+
deleteRelation(parent: object | string | number, columnName: string, children: Array<object | string | number>): Promise<string>;
|
|
1462
|
+
deleteRelation(parent: object | string | number, columnName: string, whereClause: string): Promise<string>;
|
|
1463
1463
|
|
|
1464
1464
|
bulkCreate(objects: Array<object>): Promise<Array<string>>;
|
|
1465
1465
|
|
|
@@ -1467,7 +1467,7 @@ declare module Backendless {
|
|
|
1467
1467
|
|
|
1468
1468
|
bulkUpdate(whereClause: string, changes: object): Promise<string>;
|
|
1469
1469
|
|
|
1470
|
-
bulkDelete(where: string | Array<string
|
|
1470
|
+
bulkDelete(where: string | Array<string | number | { objectId: string | number, [key: string]: any }>): Promise<string>;
|
|
1471
1471
|
|
|
1472
1472
|
rt(): EventHandler;
|
|
1473
1473
|
}
|
package/dist/backendless.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ********************************************************************************************************************
|
|
3
|
-
* Backendless SDK for JavaScript. Version: 6.6.
|
|
3
|
+
* Backendless SDK for JavaScript. Version: 6.6.4
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2012-2023 BACKENDLESS.COM. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -16669,12 +16669,12 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
16669
16669
|
case 0:
|
|
16670
16670
|
objectId = object && object.objectId || object;
|
|
16671
16671
|
|
|
16672
|
-
if (!(!objectId || typeof objectId !== 'string')) {
|
|
16672
|
+
if (!(!objectId || typeof objectId !== 'string' && typeof objectId !== 'number')) {
|
|
16673
16673
|
_context3.next = 3;
|
|
16674
16674
|
break;
|
|
16675
16675
|
}
|
|
16676
16676
|
|
|
16677
|
-
throw new Error('Object Id must be provided and must be a string.');
|
|
16677
|
+
throw new Error('Object Id must be provided and must be a string or number.');
|
|
16678
16678
|
|
|
16679
16679
|
case 3:
|
|
16680
16680
|
return _context3.abrupt("return", this.app.request["delete"]({
|
|
@@ -16822,12 +16822,12 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
16822
16822
|
break;
|
|
16823
16823
|
|
|
16824
16824
|
case 8:
|
|
16825
|
-
if (!(!objectId || typeof objectId !== 'string')) {
|
|
16825
|
+
if (!(!objectId || typeof objectId !== 'string' && typeof objectId !== 'number')) {
|
|
16826
16826
|
_context7.next = 10;
|
|
16827
16827
|
break;
|
|
16828
16828
|
}
|
|
16829
16829
|
|
|
16830
|
-
throw new Error('Object Id must be provided and must be a string or an object of primary keys.');
|
|
16830
|
+
throw new Error('Object Id must be provided and must be a string or number or an object of primary keys.');
|
|
16831
16831
|
|
|
16832
16832
|
case 10:
|
|
16833
16833
|
if (query) {
|
|
@@ -16927,46 +16927,49 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
16927
16927
|
key: "getObjectCount",
|
|
16928
16928
|
value: function () {
|
|
16929
16929
|
var _getObjectCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(condition) {
|
|
16930
|
-
var distinct;
|
|
16930
|
+
var distinct, groupBy;
|
|
16931
16931
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
16932
16932
|
while (1) {
|
|
16933
16933
|
switch (_context10.prev = _context10.next) {
|
|
16934
16934
|
case 0:
|
|
16935
16935
|
distinct = undefined;
|
|
16936
|
+
groupBy = undefined;
|
|
16936
16937
|
|
|
16937
16938
|
if (!condition) {
|
|
16938
|
-
_context10.next =
|
|
16939
|
+
_context10.next = 11;
|
|
16939
16940
|
break;
|
|
16940
16941
|
}
|
|
16941
16942
|
|
|
16942
16943
|
if (!(condition instanceof _dataQueryBuilder["default"])) {
|
|
16943
|
-
_context10.next =
|
|
16944
|
+
_context10.next = 9;
|
|
16944
16945
|
break;
|
|
16945
16946
|
}
|
|
16946
16947
|
|
|
16947
16948
|
distinct = condition.getDistinct() || undefined;
|
|
16949
|
+
groupBy = condition.getGroupBy() || undefined;
|
|
16948
16950
|
condition = condition.getWhereClause() || undefined;
|
|
16949
|
-
_context10.next =
|
|
16951
|
+
_context10.next = 11;
|
|
16950
16952
|
break;
|
|
16951
16953
|
|
|
16952
|
-
case
|
|
16954
|
+
case 9:
|
|
16953
16955
|
if (!(typeof condition !== 'string')) {
|
|
16954
|
-
_context10.next =
|
|
16956
|
+
_context10.next = 11;
|
|
16955
16957
|
break;
|
|
16956
16958
|
}
|
|
16957
16959
|
|
|
16958
16960
|
throw new Error('Condition must be a string or an instance of DataQueryBuilder.');
|
|
16959
16961
|
|
|
16960
|
-
case
|
|
16962
|
+
case 11:
|
|
16961
16963
|
return _context10.abrupt("return", this.app.request.post({
|
|
16962
16964
|
url: this.app.urls.dataTableCount(this.className),
|
|
16963
16965
|
data: {
|
|
16964
16966
|
where: condition,
|
|
16965
|
-
distinct: distinct
|
|
16967
|
+
distinct: distinct,
|
|
16968
|
+
groupBy: groupBy
|
|
16966
16969
|
}
|
|
16967
16970
|
}));
|
|
16968
16971
|
|
|
16969
|
-
case
|
|
16972
|
+
case 12:
|
|
16970
16973
|
case "end":
|
|
16971
16974
|
return _context10.stop();
|
|
16972
16975
|
}
|
|
@@ -16994,12 +16997,12 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
16994
16997
|
case 0:
|
|
16995
16998
|
parentObjectId = parent && parent.objectId || parent;
|
|
16996
16999
|
|
|
16997
|
-
if (!(!parentObjectId || typeof parentObjectId !== 'string')) {
|
|
17000
|
+
if (!(!parentObjectId || typeof parentObjectId !== 'string' && typeof parentObjectId !== 'number')) {
|
|
16998
17001
|
_context11.next = 3;
|
|
16999
17002
|
break;
|
|
17000
17003
|
}
|
|
17001
17004
|
|
|
17002
|
-
throw new Error('Parent Object Id must be provided and must be a string.');
|
|
17005
|
+
throw new Error('Parent Object Id must be provided and must be a string or number.');
|
|
17003
17006
|
|
|
17004
17007
|
case 3:
|
|
17005
17008
|
_ref = queryBuilder instanceof _loadRelationsQueryBuilder["default"] ? queryBuilder.toJSON() : queryBuilder, relationName = _ref.relationName, relationModel = _ref.relationModel, query = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
@@ -17266,8 +17269,8 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
17266
17269
|
objectIds = condition.map(function (object) {
|
|
17267
17270
|
var objectId = object && object.objectId || object;
|
|
17268
17271
|
|
|
17269
|
-
if (!objectId || typeof objectId !== 'string') {
|
|
17270
|
-
throw new Error('Can not transform "objects" to "whereClause". ' + 'Item must be a string or an object with property "objectId" as string.');
|
|
17272
|
+
if (!objectId || typeof objectId !== 'string' && typeof objectId !== 'number') {
|
|
17273
|
+
throw new Error('Can not transform "objects" to "whereClause". ' + 'Item must be a string or number or an object with property "objectId" as string.');
|
|
17271
17274
|
}
|
|
17272
17275
|
|
|
17273
17276
|
return "'".concat(objectId, "'");
|
|
@@ -17321,8 +17324,8 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
17321
17324
|
value: function changeRelation(method, parent, columnName, children) {
|
|
17322
17325
|
var parentId = parent && parent.objectId || parent;
|
|
17323
17326
|
|
|
17324
|
-
if (!parentId || typeof parentId !== 'string') {
|
|
17325
|
-
throw new Error('Relation Parent must be provided and must be a string or an object with objectId property.');
|
|
17327
|
+
if (!parentId || typeof parentId !== 'string' && typeof parentId !== 'number') {
|
|
17328
|
+
throw new Error('Relation Parent must be provided and must be a string or number or an object with objectId property.');
|
|
17326
17329
|
}
|
|
17327
17330
|
|
|
17328
17331
|
if (!columnName || typeof columnName !== 'string') {
|
|
@@ -17341,8 +17344,8 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
17341
17344
|
condition.childrenIds = children.map(function (child) {
|
|
17342
17345
|
var childId = child && child.objectId || child;
|
|
17343
17346
|
|
|
17344
|
-
if (!childId || typeof childId !== 'string') {
|
|
17345
|
-
throw new Error('Child Id must be provided and must be a string.');
|
|
17347
|
+
if (!childId || typeof childId !== 'string' && typeof childId !== 'number') {
|
|
17348
|
+
throw new Error('Child Id must be provided and must be a string or number.');
|
|
17346
17349
|
}
|
|
17347
17350
|
|
|
17348
17351
|
return childId;
|
|
@@ -25760,12 +25763,12 @@ var Users = /*#__PURE__*/function () {
|
|
|
25760
25763
|
while (1) {
|
|
25761
25764
|
switch (_context26.prev = _context26.next) {
|
|
25762
25765
|
case 0:
|
|
25763
|
-
if (!(!userId || typeof userId !== 'string')) {
|
|
25766
|
+
if (!(!userId || typeof userId !== 'string' && typeof userId !== 'number')) {
|
|
25764
25767
|
_context26.next = 2;
|
|
25765
25768
|
break;
|
|
25766
25769
|
}
|
|
25767
25770
|
|
|
25768
|
-
throw new Error('User objectId must be non empty string');
|
|
25771
|
+
throw new Error('User objectId must be non empty string/number');
|
|
25769
25772
|
|
|
25770
25773
|
case 2:
|
|
25771
25774
|
if (!(!userStatus || typeof userStatus !== 'string')) {
|