@apigames/sdk-core 1.0.6 → 1.0.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.
|
@@ -11,6 +11,8 @@ export default class ResourceObject implements IResourceObject {
|
|
|
11
11
|
constructor(container: IResourceContainer);
|
|
12
12
|
protected LoadAttributes(value: any): void;
|
|
13
13
|
protected LoadRelationships(value: any): void;
|
|
14
|
+
protected UpdateAttributes(value: any): void;
|
|
15
|
+
protected UpdateRelationships(value: any): void;
|
|
14
16
|
LoadData(value: any): IResourceObject;
|
|
15
17
|
protected GetInsertPayload(): any;
|
|
16
18
|
protected GetUpdatePayload(): any;
|
|
@@ -28,6 +28,12 @@ class ResourceObject {
|
|
|
28
28
|
LoadRelationships(value) {
|
|
29
29
|
throw new Error('Method or Property not implemented.');
|
|
30
30
|
}
|
|
31
|
+
UpdateAttributes(value) {
|
|
32
|
+
throw new Error('Method or Property not implemented.');
|
|
33
|
+
}
|
|
34
|
+
UpdateRelationships(value) {
|
|
35
|
+
throw new Error('Method or Property not implemented.');
|
|
36
|
+
}
|
|
31
37
|
LoadData(value) {
|
|
32
38
|
if (!(0, json_1.hasProperty)(value, 'type') || (value.type !== this.type)) {
|
|
33
39
|
throw new __1.SDKException('INVALID-RESOURCE-MAPPING', 'The resource data being loaded cannot be '
|
|
@@ -106,11 +112,11 @@ class ResourceObject {
|
|
|
106
112
|
throw new __1.SDKException('INVALID-LOCATION', 'The save operation was unable to retrieve the location '
|
|
107
113
|
+ 'of the resource created by the API.');
|
|
108
114
|
}
|
|
109
|
-
if (!this.HasHeader(response.headers, '
|
|
115
|
+
if (!this.HasHeader(response.headers, 'x-api-resource-id')) {
|
|
110
116
|
throw new __1.SDKException('INVALID-RESOURCE-ID', 'The save operation was unable to retrieve the '
|
|
111
117
|
+ 'identifier of the resource created by the API.');
|
|
112
118
|
}
|
|
113
|
-
this.id = this.GetHeaderValue(response.headers, '
|
|
119
|
+
this.id = this.GetHeaderValue(response.headers, 'x-api-resource-id');
|
|
114
120
|
this._uri = this.GetHeaderValue(response.headers, 'location');
|
|
115
121
|
this._mode = ResourceObjectMode.ExistingDocument;
|
|
116
122
|
});
|