@apigames/sdk-core 22.2.0 → 22.2.2
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.
|
@@ -122,12 +122,17 @@ class ResourceObject {
|
|
|
122
122
|
if ((0, json_1.isUndefined)(shadow)
|
|
123
123
|
|| (0, json_1.isUndefined)(shadow[fieldName])
|
|
124
124
|
|| ((shadow[fieldName].type !== data[fieldName].type) || (shadow[fieldName].id !== data[fieldName].id))) {
|
|
125
|
-
|
|
126
|
-
data:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
if (data[fieldName].id === null) {
|
|
126
|
+
payload[fieldName] = { data: null };
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
payload[fieldName] = {
|
|
130
|
+
data: {
|
|
131
|
+
type: data[fieldName].type,
|
|
132
|
+
id: data[fieldName].id,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
}
|
|
@@ -27,9 +27,10 @@ export declare type ResourceContainerIncludedResourceTypes = {
|
|
|
27
27
|
};
|
|
28
28
|
export declare class ResourceObjectRelationship {
|
|
29
29
|
private _includes;
|
|
30
|
-
type: ResourceObjectType;
|
|
31
|
-
id: ResourceObjectIdentifier;
|
|
30
|
+
readonly type: ResourceObjectType;
|
|
31
|
+
id: ResourceObjectIdentifier | null;
|
|
32
32
|
constructor(includes: ResourceContainerIncludedResourceTypes, type: ResourceObjectType, id?: ResourceObjectIdentifier);
|
|
33
|
+
clear(): void;
|
|
33
34
|
get target(): IResourceObject;
|
|
34
35
|
}
|
|
35
36
|
export declare type ResourceObjectRelationships = ResourceObjectRelationship[];
|
|
@@ -15,6 +15,9 @@ class ResourceObjectRelationship {
|
|
|
15
15
|
if (id)
|
|
16
16
|
this.id = id;
|
|
17
17
|
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.id = null;
|
|
20
|
+
}
|
|
18
21
|
get target() {
|
|
19
22
|
if ((0, json_1.isDefined)(this.type) && (0, json_1.isDefined)(this.id) && (0, json_1.isDefined)(this._includes[this.type][this.id])) {
|
|
20
23
|
return this._includes[this.type][this.id];
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"description": "API Games SDK Core",
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"version": "22.2.
|
|
16
|
+
"version": "22.2.2",
|
|
17
17
|
"main": "lib/index.js",
|
|
18
18
|
"types": "lib/index.d.ts",
|
|
19
19
|
"scripts": {
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"test:watch": "jest --watch"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@apigames/json": "22.2.
|
|
37
|
-
"@apigames/rest-client": "22.2.
|
|
36
|
+
"@apigames/json": "22.2.1",
|
|
37
|
+
"@apigames/rest-client": "22.2.1",
|
|
38
38
|
"object-hash": "3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"date-and-time": "^2.4.1",
|
|
42
42
|
"@types/date-and-time": "^0.13.0",
|
|
43
43
|
"@types/jest": "28.1.8",
|
|
44
|
-
"@types/node": "16.11.
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
46
|
-
"@typescript-eslint/parser": "5.
|
|
47
|
-
"eslint": "8.
|
|
44
|
+
"@types/node": "16.11.62",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "5.38.1",
|
|
46
|
+
"@typescript-eslint/parser": "5.38.1",
|
|
47
|
+
"eslint": "8.24.0",
|
|
48
48
|
"eslint-config-airbnb": "19.0.4",
|
|
49
49
|
"eslint-plugin-import": "2.26.0",
|
|
50
50
|
"eslint-plugin-jsx-a11y": "6.6.1",
|