@apigames/sdk-core 25.1.5 → 25.1.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,4 +1,4 @@
|
|
|
1
|
-
import { IResourceContainer, IResourceObject, IResourceObjectAttributes, IResourceObjectRelationships, ResourceObjectUri } from '..';
|
|
1
|
+
import { IResourceContainer, IResourceObject, IResourceObjectAttributes, IResourceObjectRelationships, ResourceObjectSaveOptions, ResourceObjectUri } from '..';
|
|
2
2
|
export declare enum ResourceObjectMode {
|
|
3
3
|
NewDocument = 0,
|
|
4
4
|
ExistingDocument = 1
|
|
@@ -11,10 +11,6 @@ export type ResourceObjectMetadata = {
|
|
|
11
11
|
searchScore?: number;
|
|
12
12
|
distance?: number;
|
|
13
13
|
};
|
|
14
|
-
export type ResourceObjectSaveOptions = {
|
|
15
|
-
onRewritePostPayload?: (payload: any) => any;
|
|
16
|
-
onRewritePatchPayload?: (payload: any) => any;
|
|
17
|
-
};
|
|
18
14
|
export default class ResourceObject implements IResourceObject {
|
|
19
15
|
private _container;
|
|
20
16
|
private _id;
|
|
@@ -191,10 +191,10 @@ class ResourceObject {
|
|
|
191
191
|
};
|
|
192
192
|
if ((0, json_1.isDefined)(this.id))
|
|
193
193
|
payload.data.id = this.id;
|
|
194
|
-
if ((0, json_1.isDefined)(this.attributes)) {
|
|
194
|
+
if ((0, json_1.isDefined)(this.attributes) && (0, json_1.isFalse)((0, json_1.isEmpty)(this.attributes))) {
|
|
195
195
|
payload.data.attributes = this.SerializeAttributesPayload(this.shadowAttributes, this.attributes);
|
|
196
196
|
}
|
|
197
|
-
if ((0, json_1.isDefined)(this.relationships)) {
|
|
197
|
+
if ((0, json_1.isDefined)(this.relationships) && (0, json_1.isFalse)((0, json_1.isEmpty)(this.relationships))) {
|
|
198
198
|
payload.data.relationships = this.SerializeRelationshipsPayload(this.shadowRelationships, this.relationships);
|
|
199
199
|
}
|
|
200
200
|
(0, json_1.redactUndefinedValues)(payload);
|
|
@@ -207,10 +207,10 @@ class ResourceObject {
|
|
|
207
207
|
id: this.id,
|
|
208
208
|
},
|
|
209
209
|
};
|
|
210
|
-
if ((0, json_1.isDefined)(this.attributes)) {
|
|
210
|
+
if ((0, json_1.isDefined)(this.attributes) && (0, json_1.isFalse)((0, json_1.isEmpty)(this.attributes))) {
|
|
211
211
|
payload.data.attributes = this.SerializeAttributesPayload(this.shadowAttributes, this.attributes);
|
|
212
212
|
}
|
|
213
|
-
if ((0, json_1.isDefined)(this.relationships)) {
|
|
213
|
+
if ((0, json_1.isDefined)(this.relationships) && (0, json_1.isFalse)((0, json_1.isEmpty)(this.relationships))) {
|
|
214
214
|
payload.data.relationships = this.SerializeRelationshipsPayload(this.shadowRelationships, this.relationships);
|
|
215
215
|
}
|
|
216
216
|
(0, json_1.redactUndefinedValues)(payload);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ISDKError, ISDKRequestError, ISDKException, ISDKRequestException, } from './sdk.errors';
|
|
2
|
-
export { IResourceContainer, ResourceContainerFacetValue, ResourceContainerFacets, ResourceContainerIncludedResourceTypes, ResourceFacetField, ResourceFieldName, ResourceFilterName, ResourceFilterValue, ResourceObjectType, ResourceSortOption, ResourceIncludeOption, IResourceObject, IResourceObjectAttributes, IResourceObjectRelationships, GeospatialPoint, ResourceObjectAttributeBase, ResourceObjectAttributesLoadType, ResourceObjectRelationshipLinkObject, ResourceObjectRelationshipLink, ResourceObjectRelationshipsLinks, ResourceObjectRelationshipsLoadType, ResourceObjectRelationship, ResourceObjectRelationships, ResourceObjectUri, ResourceObjectRelationshipBase, } from './resource.interfaces';
|
|
2
|
+
export { IResourceContainer, ResourceContainerFacetValue, ResourceContainerFacets, ResourceContainerIncludedResourceTypes, ResourceFacetField, ResourceFieldName, ResourceFilterName, ResourceFilterValue, ResourceObjectType, ResourceSortOption, ResourceIncludeOption, ResourceObjectSaveOptions, IResourceObject, IResourceObjectAttributes, IResourceObjectRelationships, GeospatialPoint, ResourceObjectAttributeBase, ResourceObjectAttributesLoadType, ResourceObjectRelationshipLinkObject, ResourceObjectRelationshipLink, ResourceObjectRelationshipsLinks, ResourceObjectRelationshipsLoadType, ResourceObjectRelationship, ResourceObjectRelationships, ResourceObjectUri, ResourceObjectRelationshipBase, } from './resource.interfaces';
|
|
@@ -64,6 +64,10 @@ export declare class ResourceObjectRelationshipBase {
|
|
|
64
64
|
protected LoadRelationships(expectedType: string, value: any): ResourceObjectRelationships;
|
|
65
65
|
static RelationshipType(relationshipName: string): string;
|
|
66
66
|
}
|
|
67
|
+
export type ResourceObjectSaveOptions = {
|
|
68
|
+
onRewritePostPayload?: (payload: any) => any;
|
|
69
|
+
onRewritePatchPayload?: (payload: any) => any;
|
|
70
|
+
};
|
|
67
71
|
export interface IResourceObject {
|
|
68
72
|
type: ResourceObjectType;
|
|
69
73
|
id?: ResourceObjectIdentifier;
|
|
@@ -72,7 +76,7 @@ export interface IResourceObject {
|
|
|
72
76
|
uri: ResourceObjectUri;
|
|
73
77
|
LoadData(value: any): IResourceObject;
|
|
74
78
|
Delete(): Promise<void>;
|
|
75
|
-
Save(): Promise<void>;
|
|
79
|
+
Save(options?: ResourceObjectSaveOptions): Promise<void>;
|
|
76
80
|
UpdateAttributes(value: any): void;
|
|
77
81
|
UpdateRelationships(value: any): void;
|
|
78
82
|
}
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"description": "API Games SDK Core",
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"version": "25.1.
|
|
16
|
+
"version": "25.1.7",
|
|
17
17
|
"main": "lib/index.js",
|
|
18
18
|
"types": "lib/index.d.ts",
|
|
19
19
|
"scripts": {
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/jest": "^30.0.0",
|
|
42
|
-
"@types/node": "^24.
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
44
|
-
"@typescript-eslint/parser": "^8.
|
|
42
|
+
"@types/node": "^24.12.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
44
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
45
45
|
"date-and-time": "^3.6.0",
|
|
46
46
|
"eslint": "^8.57.1",
|
|
47
47
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
48
48
|
"eslint-plugin-import": "^2.32.0",
|
|
49
49
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
50
|
-
"jest": "^30.
|
|
50
|
+
"jest": "^30.3.0",
|
|
51
51
|
"ts-jest": "^29.4.6",
|
|
52
52
|
"typescript": "^5.9.3"
|
|
53
53
|
},
|