backendless 6.3.3 → 6.3.7

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.
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * ********************************************************************************************************************
3
- * Backendless SDK for JavaScript. Version: 6.3.3
3
+ * Backendless SDK for JavaScript. Version: 6.3.7
4
4
  *
5
- * Copyright 2012-2021 BACKENDLESS.COM. All Rights Reserved.
5
+ * Copyright 2012-2022 BACKENDLESS.COM. All Rights Reserved.
6
6
  *
7
7
  * NOTICE: All information contained herein is, and remains the property of Backendless.com and its suppliers,
8
8
  * if any. The intellectual and technical concepts contained herein are proprietary to Backendless.com and its
@@ -15098,6 +15098,32 @@ var Data = /*#__PURE__*/function () {
15098
15098
 
15099
15099
  return describe;
15100
15100
  }()
15101
+ }, {
15102
+ key: "getTableNameById",
15103
+ value: function () {
15104
+ var _getTableNameById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(tableId) {
15105
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
15106
+ while (1) {
15107
+ switch (_context2.prev = _context2.next) {
15108
+ case 0:
15109
+ return _context2.abrupt("return", this.app.request.get({
15110
+ url: this.app.urls.dataTableNameById(tableId)
15111
+ }));
15112
+
15113
+ case 1:
15114
+ case "end":
15115
+ return _context2.stop();
15116
+ }
15117
+ }
15118
+ }, _callee2, this);
15119
+ }));
15120
+
15121
+ function getTableNameById(_x2) {
15122
+ return _getTableNameById.apply(this, arguments);
15123
+ }
15124
+
15125
+ return getTableNameById;
15126
+ }()
15101
15127
  }, {
15102
15128
  key: "mapTableToClass",
15103
15129
  value: function mapTableToClass(tableName, clientClass) {
@@ -16951,7 +16977,7 @@ var Files = /*#__PURE__*/function () {
16951
16977
  query.overwrite = overwrite;
16952
16978
  }
16953
16979
 
16954
- filePath = _utils["default"].preventSlashInPath(filePath);
16980
+ filePath = _utils["default"].trimSlashesInPath(filePath);
16955
16981
  fileName = _utils["default"].sanitizeFileName(fileName);
16956
16982
  return _context.abrupt("return", this.app.request.put({
16957
16983
  url: "".concat(this.app.urls.fileBinaryPath(filePath), "/").concat(fileName),
@@ -16991,7 +17017,7 @@ var Files = /*#__PURE__*/function () {
16991
17017
  query.overwrite = overwrite;
16992
17018
  }
16993
17019
 
16994
- filePath = _utils["default"].preventSlashInPath(filePath);
17020
+ filePath = _utils["default"].trimSlashesInPath(filePath);
16995
17021
  pathTokens = _utils["default"].parseFilePath(filePath);
16996
17022
 
16997
17023
  if (pathTokens.fileName) {
@@ -17010,7 +17036,7 @@ var Files = /*#__PURE__*/function () {
17010
17036
  }
17011
17037
 
17012
17038
  return _context2.abrupt("return", this.app.request.post({
17013
- url: "".concat(this.app.urls.filePath(filePath), "/").concat(fileName || ''),
17039
+ url: "".concat(this.app.urls.filePath(filePath), "/").concat(fileName),
17014
17040
  query: query,
17015
17041
  data: {
17016
17042
  url: file
@@ -17054,25 +17080,189 @@ var Files = /*#__PURE__*/function () {
17054
17080
  return upload;
17055
17081
  }()
17056
17082
  }, {
17057
- key: "listing",
17083
+ key: "append",
17058
17084
  value: function () {
17059
- var _listing = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(filePath, pattern, sub, pagesize, offset) {
17060
- var query;
17085
+ var _append = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(filePath, fileName, fileContent) {
17086
+ var pathTokens,
17087
+ _args3 = arguments;
17061
17088
  return _regenerator["default"].wrap(function _callee3$(_context3) {
17062
17089
  while (1) {
17063
17090
  switch (_context3.prev = _context3.next) {
17091
+ case 0:
17092
+ if (!(!filePath || typeof filePath !== 'string')) {
17093
+ _context3.next = 2;
17094
+ break;
17095
+ }
17096
+
17097
+ throw new Error('"filePath" must be provided and must be a string.');
17098
+
17099
+ case 2:
17100
+ filePath = _utils["default"].trimSlashesInPath(filePath);
17101
+
17102
+ if (_args3.length === 2) {
17103
+ fileContent = fileName;
17104
+ fileName = undefined;
17105
+ pathTokens = _utils["default"].parseFilePath(filePath);
17106
+
17107
+ if (pathTokens.fileName) {
17108
+ filePath = pathTokens.filePath;
17109
+ fileName = pathTokens.fileName;
17110
+ }
17111
+ }
17112
+
17113
+ if (fileName) {
17114
+ _context3.next = 6;
17115
+ break;
17116
+ }
17117
+
17118
+ throw new Error('Can not resolve target file name');
17119
+
17120
+ case 6:
17121
+ fileName = _utils["default"].sanitizeFileName(fileName);
17122
+
17123
+ if (!(typeof fileContent === 'string')) {
17124
+ _context3.next = 9;
17125
+ break;
17126
+ }
17127
+
17128
+ return _context3.abrupt("return", this.app.request.post({
17129
+ url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
17130
+ data: {
17131
+ url: fileContent
17132
+ }
17133
+ }));
17134
+
17135
+ case 9:
17136
+ if (!_utils["default"].isBytesArray(fileContent)) {
17137
+ _context3.next = 14;
17138
+ break;
17139
+ }
17140
+
17141
+ _context3.next = 12;
17142
+ return _utils["default"].toBase64(fileContent);
17143
+
17144
+ case 12:
17145
+ fileContent = _context3.sent;
17146
+ return _context3.abrupt("return", this.app.request.put({
17147
+ url: "".concat(this.app.urls.fileAppendBinaryPath(filePath), "/").concat(fileName),
17148
+ headers: {
17149
+ 'Content-Type': 'text/plain'
17150
+ },
17151
+ data: fileContent
17152
+ }));
17153
+
17154
+ case 14:
17155
+ return _context3.abrupt("return", this.app.request.post({
17156
+ url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
17157
+ form: {
17158
+ file: fileContent
17159
+ }
17160
+ }));
17161
+
17162
+ case 15:
17163
+ case "end":
17164
+ return _context3.stop();
17165
+ }
17166
+ }
17167
+ }, _callee3, this);
17168
+ }));
17169
+
17170
+ function append(_x8, _x9, _x10) {
17171
+ return _append.apply(this, arguments);
17172
+ }
17173
+
17174
+ return append;
17175
+ }()
17176
+ }, {
17177
+ key: "appendText",
17178
+ value: function () {
17179
+ var _appendText = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(filePath, fileName, textContent) {
17180
+ var pathTokens,
17181
+ _args4 = arguments;
17182
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
17183
+ while (1) {
17184
+ switch (_context4.prev = _context4.next) {
17185
+ case 0:
17186
+ if (!(!filePath || typeof filePath !== 'string')) {
17187
+ _context4.next = 2;
17188
+ break;
17189
+ }
17190
+
17191
+ throw new Error('"filePath" must be provided and must be a string.');
17192
+
17193
+ case 2:
17194
+ filePath = _utils["default"].trimSlashesInPath(filePath);
17195
+
17196
+ if (_args4.length === 2) {
17197
+ textContent = fileName;
17198
+ fileName = undefined;
17199
+ pathTokens = _utils["default"].parseFilePath(filePath);
17200
+
17201
+ if (pathTokens.fileName) {
17202
+ filePath = pathTokens.filePath;
17203
+ fileName = pathTokens.fileName;
17204
+ }
17205
+ }
17206
+
17207
+ if (fileName) {
17208
+ _context4.next = 6;
17209
+ break;
17210
+ }
17211
+
17212
+ throw new Error('Can not resolve target file name');
17213
+
17214
+ case 6:
17215
+ if (!(typeof textContent !== 'string')) {
17216
+ _context4.next = 8;
17217
+ break;
17218
+ }
17219
+
17220
+ throw new Error('"textContent" must be a string');
17221
+
17222
+ case 8:
17223
+ fileName = _utils["default"].sanitizeFileName(fileName);
17224
+ return _context4.abrupt("return", this.app.request.put({
17225
+ url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
17226
+ headers: {
17227
+ 'Content-Type': 'text/plain'
17228
+ },
17229
+ data: textContent
17230
+ }));
17231
+
17232
+ case 10:
17233
+ case "end":
17234
+ return _context4.stop();
17235
+ }
17236
+ }
17237
+ }, _callee4, this);
17238
+ }));
17239
+
17240
+ function appendText(_x11, _x12, _x13) {
17241
+ return _appendText.apply(this, arguments);
17242
+ }
17243
+
17244
+ return appendText;
17245
+ }()
17246
+ }, {
17247
+ key: "listing",
17248
+ value: function () {
17249
+ var _listing = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(filePath, pattern, sub, pagesize, offset) {
17250
+ var query;
17251
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
17252
+ while (1) {
17253
+ switch (_context5.prev = _context5.next) {
17064
17254
  case 0:
17065
17255
  query = {};
17066
17256
 
17067
17257
  if (!(!filePath || typeof filePath !== 'string')) {
17068
- _context3.next = 3;
17258
+ _context5.next = 3;
17069
17259
  break;
17070
17260
  }
17071
17261
 
17072
17262
  throw new Error('"filePath" must be provided and must be a string.');
17073
17263
 
17074
17264
  case 3:
17075
- filePath = _utils["default"].preventSlashInPath(filePath);
17265
+ filePath = _utils["default"].trimSlashesInPath(filePath);
17076
17266
 
17077
17267
  if (pattern && typeof pattern === 'string') {
17078
17268
  query.pattern = pattern;
@@ -17090,20 +17280,20 @@ var Files = /*#__PURE__*/function () {
17090
17280
  query.offset = offset;
17091
17281
  }
17092
17282
 
17093
- return _context3.abrupt("return", this.app.request.get({
17283
+ return _context5.abrupt("return", this.app.request.get({
17094
17284
  url: this.app.urls.filePath(filePath),
17095
17285
  query: query
17096
17286
  }));
17097
17287
 
17098
17288
  case 9:
17099
17289
  case "end":
17100
- return _context3.stop();
17290
+ return _context5.stop();
17101
17291
  }
17102
17292
  }
17103
- }, _callee3, this);
17293
+ }, _callee5, this);
17104
17294
  }));
17105
17295
 
17106
- function listing(_x8, _x9, _x10, _x11, _x12) {
17296
+ function listing(_x14, _x15, _x16, _x17, _x18) {
17107
17297
  return _listing.apply(this, arguments);
17108
17298
  }
17109
17299
 
@@ -17112,13 +17302,13 @@ var Files = /*#__PURE__*/function () {
17112
17302
  }, {
17113
17303
  key: "renameFile",
17114
17304
  value: function () {
17115
- var _renameFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(oldPathName, newName) {
17116
- return _regenerator["default"].wrap(function _callee4$(_context4) {
17305
+ var _renameFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(oldPathName, newName) {
17306
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
17117
17307
  while (1) {
17118
- switch (_context4.prev = _context4.next) {
17308
+ switch (_context6.prev = _context6.next) {
17119
17309
  case 0:
17120
17310
  if (!(!oldPathName || typeof oldPathName !== 'string')) {
17121
- _context4.next = 2;
17311
+ _context6.next = 2;
17122
17312
  break;
17123
17313
  }
17124
17314
 
@@ -17126,14 +17316,14 @@ var Files = /*#__PURE__*/function () {
17126
17316
 
17127
17317
  case 2:
17128
17318
  if (!(!newName || typeof newName !== 'string')) {
17129
- _context4.next = 4;
17319
+ _context6.next = 4;
17130
17320
  break;
17131
17321
  }
17132
17322
 
17133
17323
  throw new Error('New File Name must be provided and must be a string.');
17134
17324
 
17135
17325
  case 4:
17136
- return _context4.abrupt("return", this.app.request.put({
17326
+ return _context6.abrupt("return", this.app.request.put({
17137
17327
  url: this.app.urls.fileRename(),
17138
17328
  data: {
17139
17329
  oldPathName: _utils["default"].ensureSlashInPath(oldPathName),
@@ -17143,13 +17333,13 @@ var Files = /*#__PURE__*/function () {
17143
17333
 
17144
17334
  case 5:
17145
17335
  case "end":
17146
- return _context4.stop();
17336
+ return _context6.stop();
17147
17337
  }
17148
17338
  }
17149
- }, _callee4, this);
17339
+ }, _callee6, this);
17150
17340
  }));
17151
17341
 
17152
- function renameFile(_x13, _x14) {
17342
+ function renameFile(_x19, _x20) {
17153
17343
  return _renameFile.apply(this, arguments);
17154
17344
  }
17155
17345
 
@@ -17158,12 +17348,12 @@ var Files = /*#__PURE__*/function () {
17158
17348
  }, {
17159
17349
  key: "moveFile",
17160
17350
  value: function () {
17161
- var _moveFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(sourcePath, targetPath) {
17162
- return _regenerator["default"].wrap(function _callee5$(_context5) {
17351
+ var _moveFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(sourcePath, targetPath) {
17352
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
17163
17353
  while (1) {
17164
- switch (_context5.prev = _context5.next) {
17354
+ switch (_context7.prev = _context7.next) {
17165
17355
  case 0:
17166
- return _context5.abrupt("return", this.app.request.put({
17356
+ return _context7.abrupt("return", this.app.request.put({
17167
17357
  url: this.app.urls.fileMove(),
17168
17358
  data: {
17169
17359
  sourcePath: _utils["default"].ensureSlashInPath(sourcePath),
@@ -17173,13 +17363,13 @@ var Files = /*#__PURE__*/function () {
17173
17363
 
17174
17364
  case 1:
17175
17365
  case "end":
17176
- return _context5.stop();
17366
+ return _context7.stop();
17177
17367
  }
17178
17368
  }
17179
- }, _callee5, this);
17369
+ }, _callee7, this);
17180
17370
  }));
17181
17371
 
17182
- function moveFile(_x15, _x16) {
17372
+ function moveFile(_x21, _x22) {
17183
17373
  return _moveFile.apply(this, arguments);
17184
17374
  }
17185
17375
 
@@ -17188,12 +17378,12 @@ var Files = /*#__PURE__*/function () {
17188
17378
  }, {
17189
17379
  key: "copyFile",
17190
17380
  value: function () {
17191
- var _copyFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(sourcePath, targetPath) {
17192
- return _regenerator["default"].wrap(function _callee6$(_context6) {
17381
+ var _copyFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(sourcePath, targetPath) {
17382
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
17193
17383
  while (1) {
17194
- switch (_context6.prev = _context6.next) {
17384
+ switch (_context8.prev = _context8.next) {
17195
17385
  case 0:
17196
- return _context6.abrupt("return", this.app.request.put({
17386
+ return _context8.abrupt("return", this.app.request.put({
17197
17387
  url: this.app.urls.fileCopy(),
17198
17388
  data: {
17199
17389
  sourcePath: _utils["default"].ensureSlashInPath(sourcePath),
@@ -17203,13 +17393,13 @@ var Files = /*#__PURE__*/function () {
17203
17393
 
17204
17394
  case 1:
17205
17395
  case "end":
17206
- return _context6.stop();
17396
+ return _context8.stop();
17207
17397
  }
17208
17398
  }
17209
- }, _callee6, this);
17399
+ }, _callee8, this);
17210
17400
  }));
17211
17401
 
17212
- function copyFile(_x17, _x18) {
17402
+ function copyFile(_x23, _x24) {
17213
17403
  return _copyFile.apply(this, arguments);
17214
17404
  }
17215
17405
 
@@ -17218,13 +17408,13 @@ var Files = /*#__PURE__*/function () {
17218
17408
  }, {
17219
17409
  key: "remove",
17220
17410
  value: function () {
17221
- var _remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(filePath) {
17222
- return _regenerator["default"].wrap(function _callee7$(_context7) {
17411
+ var _remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(filePath) {
17412
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
17223
17413
  while (1) {
17224
- switch (_context7.prev = _context7.next) {
17414
+ switch (_context9.prev = _context9.next) {
17225
17415
  case 0:
17226
17416
  if (!(!filePath || typeof filePath !== 'string')) {
17227
- _context7.next = 2;
17417
+ _context9.next = 2;
17228
17418
  break;
17229
17419
  }
17230
17420
 
@@ -17235,19 +17425,19 @@ var Files = /*#__PURE__*/function () {
17235
17425
  filePath = this.app.urls.filePath(filePath);
17236
17426
  }
17237
17427
 
17238
- return _context7.abrupt("return", this.app.request["delete"]({
17428
+ return _context9.abrupt("return", this.app.request["delete"]({
17239
17429
  url: filePath
17240
17430
  }));
17241
17431
 
17242
17432
  case 4:
17243
17433
  case "end":
17244
- return _context7.stop();
17434
+ return _context9.stop();
17245
17435
  }
17246
17436
  }
17247
- }, _callee7, this);
17437
+ }, _callee9, this);
17248
17438
  }));
17249
17439
 
17250
- function remove(_x19) {
17440
+ function remove(_x25) {
17251
17441
  return _remove.apply(this, arguments);
17252
17442
  }
17253
17443
 
@@ -17256,21 +17446,21 @@ var Files = /*#__PURE__*/function () {
17256
17446
  }, {
17257
17447
  key: "exists",
17258
17448
  value: function () {
17259
- var _exists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(filePath) {
17260
- return _regenerator["default"].wrap(function _callee8$(_context8) {
17449
+ var _exists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(filePath) {
17450
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
17261
17451
  while (1) {
17262
- switch (_context8.prev = _context8.next) {
17452
+ switch (_context10.prev = _context10.next) {
17263
17453
  case 0:
17264
17454
  if (!(!filePath || typeof filePath !== 'string')) {
17265
- _context8.next = 2;
17455
+ _context10.next = 2;
17266
17456
  break;
17267
17457
  }
17268
17458
 
17269
17459
  throw new Error('"filePath" must be provided and must be a string.');
17270
17460
 
17271
17461
  case 2:
17272
- filePath = _utils["default"].preventSlashInPath(filePath);
17273
- return _context8.abrupt("return", this.app.request.get({
17462
+ filePath = _utils["default"].trimSlashesInPath(filePath);
17463
+ return _context10.abrupt("return", this.app.request.get({
17274
17464
  url: this.app.urls.filePath(filePath),
17275
17465
  query: {
17276
17466
  action: 'exists'
@@ -17279,13 +17469,13 @@ var Files = /*#__PURE__*/function () {
17279
17469
 
17280
17470
  case 4:
17281
17471
  case "end":
17282
- return _context8.stop();
17472
+ return _context10.stop();
17283
17473
  }
17284
17474
  }
17285
- }, _callee8, this);
17475
+ }, _callee10, this);
17286
17476
  }));
17287
17477
 
17288
- function exists(_x20) {
17478
+ function exists(_x26) {
17289
17479
  return _exists.apply(this, arguments);
17290
17480
  }
17291
17481
 
@@ -17294,33 +17484,33 @@ var Files = /*#__PURE__*/function () {
17294
17484
  }, {
17295
17485
  key: "removeDirectory",
17296
17486
  value: function () {
17297
- var _removeDirectory = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(directoryPath) {
17298
- return _regenerator["default"].wrap(function _callee9$(_context9) {
17487
+ var _removeDirectory = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(directoryPath) {
17488
+ return _regenerator["default"].wrap(function _callee11$(_context11) {
17299
17489
  while (1) {
17300
- switch (_context9.prev = _context9.next) {
17490
+ switch (_context11.prev = _context11.next) {
17301
17491
  case 0:
17302
17492
  if (!(!directoryPath || typeof directoryPath !== 'string')) {
17303
- _context9.next = 2;
17493
+ _context11.next = 2;
17304
17494
  break;
17305
17495
  }
17306
17496
 
17307
17497
  throw new Error('Directory "path" must be provided and must be a string.');
17308
17498
 
17309
17499
  case 2:
17310
- directoryPath = _utils["default"].preventSlashInPath(directoryPath);
17311
- return _context9.abrupt("return", this.app.request["delete"]({
17500
+ directoryPath = _utils["default"].trimSlashesInPath(directoryPath);
17501
+ return _context11.abrupt("return", this.app.request["delete"]({
17312
17502
  url: this.app.urls.filePath(directoryPath)
17313
17503
  }));
17314
17504
 
17315
17505
  case 4:
17316
17506
  case "end":
17317
- return _context9.stop();
17507
+ return _context11.stop();
17318
17508
  }
17319
17509
  }
17320
- }, _callee9, this);
17510
+ }, _callee11, this);
17321
17511
  }));
17322
17512
 
17323
- function removeDirectory(_x21) {
17513
+ function removeDirectory(_x27) {
17324
17514
  return _removeDirectory.apply(this, arguments);
17325
17515
  }
17326
17516
 
@@ -17329,13 +17519,13 @@ var Files = /*#__PURE__*/function () {
17329
17519
  }, {
17330
17520
  key: "getFileCount",
17331
17521
  value: function () {
17332
- var _getFileCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(filesPath, pattern, sub, countDirectories) {
17333
- return _regenerator["default"].wrap(function _callee10$(_context10) {
17522
+ var _getFileCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(filesPath, pattern, sub, countDirectories) {
17523
+ return _regenerator["default"].wrap(function _callee12$(_context12) {
17334
17524
  while (1) {
17335
- switch (_context10.prev = _context10.next) {
17525
+ switch (_context12.prev = _context12.next) {
17336
17526
  case 0:
17337
17527
  if (!(!filesPath || typeof filesPath !== 'string')) {
17338
- _context10.next = 2;
17528
+ _context12.next = 2;
17339
17529
  break;
17340
17530
  }
17341
17531
 
@@ -17343,15 +17533,15 @@ var Files = /*#__PURE__*/function () {
17343
17533
 
17344
17534
  case 2:
17345
17535
  if (!(pattern && typeof pattern !== 'string')) {
17346
- _context10.next = 4;
17536
+ _context12.next = 4;
17347
17537
  break;
17348
17538
  }
17349
17539
 
17350
17540
  throw new Error('Files Pattern must be provided and must be a string.');
17351
17541
 
17352
17542
  case 4:
17353
- filesPath = _utils["default"].preventSlashInPath(filesPath);
17354
- return _context10.abrupt("return", this.app.request.get({
17543
+ filesPath = _utils["default"].trimSlashesInPath(filesPath);
17544
+ return _context12.abrupt("return", this.app.request.get({
17355
17545
  url: this.app.urls.filePath(filesPath),
17356
17546
  query: {
17357
17547
  action: 'count',
@@ -17363,13 +17553,13 @@ var Files = /*#__PURE__*/function () {
17363
17553
 
17364
17554
  case 6:
17365
17555
  case "end":
17366
- return _context10.stop();
17556
+ return _context12.stop();
17367
17557
  }
17368
17558
  }
17369
- }, _callee10, this);
17559
+ }, _callee12, this);
17370
17560
  }));
17371
17561
 
17372
- function getFileCount(_x22, _x23, _x24, _x25) {
17562
+ function getFileCount(_x28, _x29, _x30, _x31) {
17373
17563
  return _getFileCount.apply(this, arguments);
17374
17564
  }
17375
17565
 
@@ -17464,11 +17654,32 @@ var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime
17464
17654
  var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
17465
17655
 
17466
17656
  var FilesUtils = {
17657
+ isBytesArray: function isBytesArray(data) {
17658
+ if (typeof Buffer !== 'undefined' && data instanceof Buffer) {
17659
+ return true;
17660
+ }
17661
+
17662
+ if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
17663
+ return true;
17664
+ }
17665
+
17666
+ return Array.isArray(data);
17667
+ },
17467
17668
  ensureSlashInPath: function ensureSlashInPath(path) {
17468
17669
  return !path.startsWith('/') ? "/".concat(path) : path;
17469
17670
  },
17470
- preventSlashInPath: function preventSlashInPath(path) {
17471
- return path && path.startsWith('/') ? path.slice(1) : path;
17671
+ trimSlashesInPath: function trimSlashesInPath(path) {
17672
+ if (path) {
17673
+ if (path.startsWith('/')) {
17674
+ path = path.slice(1);
17675
+ }
17676
+
17677
+ if (path.endsWith('/')) {
17678
+ path = path.slice(0, path.length - 1);
17679
+ }
17680
+ }
17681
+
17682
+ return path;
17472
17683
  },
17473
17684
  parseFilePath: function parseFilePath(path) {
17474
17685
  var result = {
@@ -18164,7 +18375,7 @@ var LocalCache = /*#__PURE__*/function () {
18164
18375
  function LocalCache(app) {
18165
18376
  (0, _classCallCheck2["default"])(this, LocalCache);
18166
18377
  this.app = app;
18167
- this.storageName = "".concat(STORAGE_KEY_NAMESPACE, "_").concat(this.app.appId);
18378
+ this.storageName = this.app.appId ? "".concat(STORAGE_KEY_NAMESPACE, "_").concat(this.app.appId) : STORAGE_KEY_NAMESPACE;
18168
18379
  var Storage = _utils["default"].isLocalStorageSupported ? _localStorage["default"] : _virtualStorage["default"];
18169
18380
  this.setStorage(Storage);
18170
18381
  this.Keys = {
@@ -18431,6 +18642,10 @@ var Logging = /*#__PURE__*/function () {
18431
18642
  }, {
18432
18643
  key: "push",
18433
18644
  value: function push(logger, logLevel, message, exception) {
18645
+ if (typeof message !== 'string') {
18646
+ throw new Error('"message" must be a string');
18647
+ }
18648
+
18434
18649
  this.pool.push({
18435
18650
  logger: logger,
18436
18651
  message: message,
@@ -21842,6 +22057,11 @@ var Urls = /*#__PURE__*/function () {
21842
22057
  value: function dataObjectPermission(tableName, permissionType, objectId) {
21843
22058
  return "".concat(this.dataTable(tableName), "/permissions/").concat(permissionType, "/").concat(objectId);
21844
22059
  }
22060
+ }, {
22061
+ key: "dataTableNameById",
22062
+ value: function dataTableNameById(tableId) {
22063
+ return "".concat(this.data(), "/").concat(tableId, "/table-name");
22064
+ }
21845
22065
  }, {
21846
22066
  key: "transactions",
21847
22067
  value: function transactions() {
@@ -21964,6 +22184,16 @@ var Urls = /*#__PURE__*/function () {
21964
22184
  key: "fileBinaryPath",
21965
22185
  value: function fileBinaryPath(path) {
21966
22186
  return "".concat(this.files(), "/binary/").concat(path);
22187
+ }
22188
+ }, {
22189
+ key: "fileAppendPath",
22190
+ value: function fileAppendPath(path) {
22191
+ return "".concat(this.files(), "/append/").concat(path);
22192
+ }
22193
+ }, {
22194
+ key: "fileAppendBinaryPath",
22195
+ value: function fileAppendBinaryPath(path) {
22196
+ return "".concat(this.files(), "/append/binary/").concat(path);
21967
22197
  } //users
21968
22198
 
21969
22199
  }, {