backendless 6.3.10 → 6.3.13-test.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backendless",
3
- "version": "6.3.10",
3
+ "version": "6.3.13-test.1",
4
4
  "description": "Backendless JavaScript SDK for Node.js and the browser",
5
5
  "browser": "dist/backendless.js",
6
6
  "main": "lib/index.js",
@@ -18,13 +18,12 @@
18
18
  "dev": "watch 'npm run build:commonjs' ./src",
19
19
  "clean": "rimraf lib dist es",
20
20
  "lint": "eslint src --fix",
21
- "check": "npm run lint && npm run test",
22
21
  "coverage": "nyc --reporter=html --reporter=text --cache=false npm run test:unit",
23
22
  "test": "npm run test:tsc && npm run coverage",
24
23
  "test:tsc": "tsc ./test/tsd.ts",
25
24
  "test:unit": "cross-env NODE_ENV=test mocha --recursive test/unit/specs",
26
25
  "test:e2e": "cross-env NODE_ENV=test mocha --require @babel/register test/e2e/specs/*",
27
- "build": "npm run clean && npm run check && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min",
26
+ "build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min",
28
27
  "build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
29
28
  "build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
30
29
  "build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack",
@@ -50,7 +49,7 @@
50
49
  "author": "info@backendless.com",
51
50
  "license": "ISC",
52
51
  "devDependencies": {
53
- "@babel/cli": "^7.14.5",
52
+ "@babel/cli": "^7.17.10",
54
53
  "@babel/core": "^7.14.6",
55
54
  "@babel/plugin-proposal-class-properties": "^7.14.5",
56
55
  "@babel/plugin-proposal-decorators": "^7.14.5",
@@ -92,6 +91,6 @@
92
91
  "dependencies": {
93
92
  "@babel/runtime": "^7.14.6",
94
93
  "backendless-request": "^0.2.0",
95
- "backendless-rt-client": "0.0.25"
94
+ "backendless-rt-client": "0.0.25-test.1"
96
95
  }
97
96
  }
package/src/data/store.js CHANGED
@@ -312,14 +312,14 @@ export default class DataStore {
312
312
  * @private
313
313
  * */
314
314
  parseRelationsResponse(result, RelationModel) {
315
- return convertToClientRecords(result, RelationModel, this.classToTableMap)
315
+ return convertToClientRecords(result, RelationModel, this)
316
316
  }
317
317
 
318
318
  /**
319
319
  * @private
320
320
  * */
321
321
  parseResponse(result) {
322
- return convertToClientRecords(result, this.model, this.classToTableMap)
322
+ return convertToClientRecords(result, this.model, this)
323
323
  }
324
324
 
325
325
  /**
@@ -419,16 +419,17 @@ const convertToServerRecord = (() => {
419
419
  })()
420
420
 
421
421
  const convertToClientRecords = (() => {
422
- return (records, RootModel, classToTableMap) => {
422
+ return (records, RootModel, dataStore) => {
423
423
  if (!records) {
424
424
  return records
425
425
  }
426
426
 
427
427
  const context = {
428
428
  RootModel,
429
- classToTableMap,
430
- subIds : {},
431
- postAssign: [],
429
+ app : dataStore.app,
430
+ classToTableMap: dataStore.classToTableMap,
431
+ subIds : {},
432
+ postAssign : [],
432
433
  }
433
434
 
434
435
  const result = Array.isArray(records)
@@ -448,7 +449,19 @@ const convertToClientRecords = (() => {
448
449
  delete source[prop].__subID
449
450
 
450
451
  } else {
451
- const Model = context.classToTableMap[source[prop].___class] || Utils.globalScope[source[prop].___class]
452
+ let Model = context.classToTableMap[source[prop].___class]
453
+
454
+ if (!Model && context.app.useTableClassesFromGlobalScope && Utils.globalScope[source[prop].___class]) {
455
+ // eslint-disable-next-line no-console
456
+ console.warn(
457
+ 'Resolving DataTable classes from the global scope is deprecated ' +
458
+ 'and it won\'t be supported in the nearest future. ' +
459
+ 'Instead, you should register your DataTable classes ' +
460
+ 'using the following method Backendless.Data.mapTableToClass'
461
+ )
462
+
463
+ Model = Utils.globalScope[source[prop].___class]
464
+ }
452
465
 
453
466
  target[prop] = Model ? new Model() : {}
454
467
 
package/src/index.js CHANGED
@@ -15,6 +15,10 @@ const DEFAULT_PROPS = {
15
15
  XMLHttpRequest: typeof XMLHttpRequest !== 'undefined'
16
16
  ? XMLHttpRequest
17
17
  : undefined,
18
+
19
+ //TODO: this is a temporary to disable getting DataTable classes from the global scope
20
+ //TODO: it will be removed in the nearest future
21
+ useTableClassesFromGlobalScope: true,
18
22
  }
19
23
 
20
24
  const STATELESS_PROPS = ['appId', 'apiKey', 'domain']
@@ -255,6 +259,15 @@ class Backendless {
255
259
  )
256
260
  }
257
261
 
262
+ ///--------useTableClassesFromGlobalScope-------///
263
+ get useTableClassesFromGlobalScope() {
264
+ return this.__useTableClassesFromGlobalScope
265
+ }
266
+
267
+ set useTableClassesFromGlobalScope(useTableClassesFromGlobalScope) {
268
+ this.__useTableClassesFromGlobalScope = !!useTableClassesFromGlobalScope
269
+ }
270
+
258
271
  ///--------debugMode-------///
259
272
  get debugMode() {
260
273
  return this.__debugMode
@@ -115,6 +115,12 @@ export default class Channel extends RTScopeConnector {
115
115
  return this
116
116
  }
117
117
 
118
+ removeCommandListener(callback) {
119
+ super.removeCommandListeners.call(this, callback)
120
+
121
+ return this
122
+ }
123
+
118
124
  removeCommandListeners(callback) {
119
125
  super.removeCommandListeners.call(this, callback)
120
126
 
@@ -94,6 +94,12 @@ export default class RemoteSharedObject extends RTScopeConnector {
94
94
  return this
95
95
  }
96
96
 
97
+ removeCommandListener(callback) {
98
+ super.removeCommandListeners.call(this, callback)
99
+
100
+ return this
101
+ }
102
+
97
103
  removeCommandListeners(callback) {
98
104
  super.removeCommandListeners.call(this, callback)
99
105
 
@@ -307,10 +307,10 @@ export default class Users {
307
307
  })
308
308
  }
309
309
 
310
- getAuthorizationUrlLink(providerCode, fieldsMapping, scope, redirect, redirectAfterLoginUrl) {
310
+ getAuthorizationUrlLink(providerCode, fieldsMapping, scope, redirect, redirectAfterLoginUrl, callbackUrlDomain) {
311
311
  return this.app.request.post({
312
312
  url : this.app.urls.userAuthorizationURL(providerCode),
313
- data: { fieldsMapping, permissions: scope, redirect, redirectAfterLoginUrl }
313
+ data: { fieldsMapping, permissions: scope, redirect, redirectAfterLoginUrl, callbackUrlDomain }
314
314
  })
315
315
  }
316
316