@apigames/sdk-core 22.1.7 → 22.1.10

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.
@@ -80,6 +80,7 @@ class ResourceContainer {
80
80
  else {
81
81
  this._data = obj;
82
82
  }
83
+ this._countQueryHash = undefined;
83
84
  }
84
85
  RemoveResourceFromMemoryStructure(resource) {
85
86
  if (this.isResourceList(this.data)) {
@@ -91,6 +92,7 @@ class ResourceContainer {
91
92
  else if (this.isResourceObject(this.data) && this.data.id === resource.id) {
92
93
  this._data = undefined;
93
94
  }
95
+ this._countQueryHash = undefined;
94
96
  }
95
97
  LoadResourceData(resourceData) {
96
98
  if ((0, json_1.hasProperty)(resourceData, 'type') && (0, json_1.isString)(resourceData.type)) {
@@ -242,6 +242,12 @@ class ResourceObject {
242
242
  else {
243
243
  yield this.UpdateResource();
244
244
  }
245
+ if ((0, json_1.isDefined)(this.attributes)) {
246
+ this.shadowAttributes.LoadData(this.attributes);
247
+ }
248
+ if ((0, json_1.isDefined)(this.relationships)) {
249
+ this.shadowRelationships.LoadData(this.relationships);
250
+ }
245
251
  });
246
252
  }
247
253
  get type() {
package/lib/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './interfaces';
2
2
  export * from './exceptions';
3
3
  export * from './classes';
4
4
  export * from './helpers';
5
+ export * from './type-guards';
package/lib/index.js CHANGED
@@ -18,3 +18,4 @@ __exportStar(require("./interfaces"), exports);
18
18
  __exportStar(require("./exceptions"), exports);
19
19
  __exportStar(require("./classes"), exports);
20
20
  __exportStar(require("./helpers"), exports);
21
+ __exportStar(require("./type-guards"), exports);
@@ -0,0 +1,3 @@
1
+ import { ResourceContainer, ResourceObject } from '../classes';
2
+ export declare function isResourceContainer(value: any): value is ResourceContainer;
3
+ export declare function isResourceObject(value: any): value is ResourceObject;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isResourceObject = exports.isResourceContainer = void 0;
4
+ const json_1 = require("@apigames/json");
5
+ const classes_1 = require("../classes");
6
+ function isResourceContainer(value) {
7
+ return (0, json_1.isDefinedAndNotNull)(value) && (value instanceof classes_1.ResourceContainer);
8
+ }
9
+ exports.isResourceContainer = isResourceContainer;
10
+ function isResourceObject(value) {
11
+ return (0, json_1.isDefinedAndNotNull)(value)
12
+ && (value instanceof classes_1.ResourceObject)
13
+ && (typeof value.type === 'string');
14
+ }
15
+ exports.isResourceObject = isResourceObject;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "description": "API Games SDK Core",
15
15
  "license": "MIT",
16
- "version": "22.1.7",
16
+ "version": "22.1.10",
17
17
  "main": "lib/index.js",
18
18
  "types": "lib/index.d.ts",
19
19
  "scripts": {
@@ -33,8 +33,8 @@
33
33
  "test:watch": "jest --watch"
34
34
  },
35
35
  "dependencies": {
36
- "@apigames/json": "22.1.2",
37
- "@apigames/rest-client": "22.1.3",
36
+ "@apigames/json": "22.1.3",
37
+ "@apigames/rest-client": "22.1.4",
38
38
  "object-hash": "2.2.0"
39
39
  },
40
40
  "devDependencies": {
@@ -42,14 +42,14 @@
42
42
  "@types/date-and-time": "^0.13.0",
43
43
  "@types/jest": "27.4.1",
44
44
  "@types/node": "14.18.12",
45
- "@typescript-eslint/eslint-plugin": "5.16.0",
46
- "@typescript-eslint/parser": "5.16.0",
45
+ "@typescript-eslint/eslint-plugin": "5.18.0",
46
+ "@typescript-eslint/parser": "5.18.0",
47
47
  "eslint": "8.12.0",
48
48
  "eslint-config-airbnb": "19.0.4",
49
- "eslint-plugin-import": "2.25.4",
49
+ "eslint-plugin-import": "2.26.0",
50
50
  "eslint-plugin-jsx-a11y": "6.5.1",
51
51
  "eslint-plugin-react": "7.29.4",
52
- "eslint-plugin-react-hooks": "4.3.0",
52
+ "eslint-plugin-react-hooks": "4.4.0",
53
53
  "jest": "27.5.1",
54
54
  "ts-jest": "27.1.4",
55
55
  "typescript": "4.6.3"