@cloudize/sdk-core 23.1.4 → 23.2.0

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,21 +1,21 @@
1
- import { ResourceObjectClass } from './resource.object';
2
- export type SDKResourceMap = {
3
- [index: string]: ResourceObjectClass;
4
- };
5
- export declare class SDKConfiguration {
6
- private _accessToken;
7
- private _apiKey;
8
- private _hostName;
9
- private _resourceMap;
10
- constructor();
11
- RegisterResourceClass(type: string, resourceClass: ResourceObjectClass): void;
12
- ResourceClass(type: string): ResourceObjectClass;
13
- FormatURL(path: string): string;
14
- get accessToken(): string;
15
- set accessToken(value: string);
16
- get apiKey(): string;
17
- set apiKey(value: string);
18
- get hostName(): string;
19
- set hostName(value: string);
20
- }
21
- export declare function SDKConfig(): SDKConfiguration;
1
+ import { ResourceObjectClass } from './resource.object';
2
+ export type SDKResourceMap = {
3
+ [index: string]: ResourceObjectClass;
4
+ };
5
+ export declare class SDKConfiguration {
6
+ private _accessToken;
7
+ private _apiKey;
8
+ private _hostName;
9
+ private _resourceMap;
10
+ constructor();
11
+ RegisterResourceClass(type: string, resourceClass: ResourceObjectClass): void;
12
+ ResourceClass(type: string): ResourceObjectClass;
13
+ FormatURL(path: string): string;
14
+ get accessToken(): string;
15
+ set accessToken(value: string);
16
+ get apiKey(): string;
17
+ set apiKey(value: string);
18
+ get hostName(): string;
19
+ set hostName(value: string);
20
+ }
21
+ export declare function SDKConfig(): SDKConfiguration;
@@ -1,46 +1,46 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SDKConfig = exports.SDKConfiguration = void 0;
4
- const json_1 = require("@cloudize/json");
5
- class SDKConfiguration {
6
- constructor() {
7
- this._resourceMap = {};
8
- }
9
- RegisterResourceClass(type, resourceClass) {
10
- this._resourceMap[type] = resourceClass;
11
- }
12
- ResourceClass(type) {
13
- return this._resourceMap[type];
14
- }
15
- FormatURL(path) {
16
- let url = this.hostName;
17
- url = url.endsWith('/') ? url.slice(0, -1) : url;
18
- return path.startsWith('/') ? `${url}${path}` : `${url}/${path}`;
19
- }
20
- get accessToken() {
21
- return this._accessToken;
22
- }
23
- set accessToken(value) {
24
- this._accessToken = value;
25
- }
26
- get apiKey() {
27
- return this._apiKey;
28
- }
29
- set apiKey(value) {
30
- this._apiKey = value;
31
- }
32
- get hostName() {
33
- return this._hostName;
34
- }
35
- set hostName(value) {
36
- this._hostName = value;
37
- }
38
- }
39
- exports.SDKConfiguration = SDKConfiguration;
40
- let configInstance;
41
- function SDKConfig() {
42
- if ((0, json_1.isUndefined)(configInstance))
43
- configInstance = new SDKConfiguration();
44
- return configInstance;
45
- }
46
- exports.SDKConfig = SDKConfig;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SDKConfig = exports.SDKConfiguration = void 0;
4
+ const json_1 = require("@cloudize/json");
5
+ class SDKConfiguration {
6
+ constructor() {
7
+ this._resourceMap = {};
8
+ }
9
+ RegisterResourceClass(type, resourceClass) {
10
+ this._resourceMap[type] = resourceClass;
11
+ }
12
+ ResourceClass(type) {
13
+ return this._resourceMap[type];
14
+ }
15
+ FormatURL(path) {
16
+ let url = this.hostName;
17
+ url = url.endsWith('/') ? url.slice(0, -1) : url;
18
+ return path.startsWith('/') ? `${url}${path}` : `${url}/${path}`;
19
+ }
20
+ get accessToken() {
21
+ return this._accessToken;
22
+ }
23
+ set accessToken(value) {
24
+ this._accessToken = value;
25
+ }
26
+ get apiKey() {
27
+ return this._apiKey;
28
+ }
29
+ set apiKey(value) {
30
+ this._apiKey = value;
31
+ }
32
+ get hostName() {
33
+ return this._hostName;
34
+ }
35
+ set hostName(value) {
36
+ this._hostName = value;
37
+ }
38
+ }
39
+ exports.SDKConfiguration = SDKConfiguration;
40
+ let configInstance;
41
+ function SDKConfig() {
42
+ if ((0, json_1.isUndefined)(configInstance))
43
+ configInstance = new SDKConfiguration();
44
+ return configInstance;
45
+ }
46
+ exports.SDKConfig = SDKConfig;
@@ -1 +1 @@
1
- export { default as SDKException } from './sdk.exception';
1
+ export { default as SDKException } from './sdk.exception';
@@ -1,8 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SDKException = void 0;
7
- var sdk_exception_1 = require("./sdk.exception");
8
- Object.defineProperty(exports, "SDKException", { enumerable: true, get: function () { return __importDefault(sdk_exception_1).default; } });
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SDKException = void 0;
7
+ var sdk_exception_1 = require("./sdk.exception");
8
+ Object.defineProperty(exports, "SDKException", { enumerable: true, get: function () { return __importDefault(sdk_exception_1).default; } });
@@ -1,6 +1,6 @@
1
- import { ISDKException } from '..';
2
- export default class SDKException extends Error implements ISDKException {
3
- private _code;
4
- constructor(code: string, message: string);
5
- get code(): string;
6
- }
1
+ import { ISDKException } from '..';
2
+ export default class SDKException extends Error implements ISDKException {
3
+ private _code;
4
+ constructor(code: string, message: string);
5
+ get code(): string;
6
+ }
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class SDKException extends Error {
4
- constructor(code, message) {
5
- super(message);
6
- this._code = '';
7
- this.name = 'SDKException';
8
- this._code = code;
9
- }
10
- get code() {
11
- return this._code;
12
- }
13
- }
14
- exports.default = SDKException;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class SDKException extends Error {
4
+ constructor(code, message) {
5
+ super(message);
6
+ this._code = '';
7
+ this.name = 'SDKException';
8
+ this._code = code;
9
+ }
10
+ get code() {
11
+ return this._code;
12
+ }
13
+ }
14
+ exports.default = SDKException;
@@ -1,3 +1,3 @@
1
- import { GeospatialPoint } from '../interfaces';
2
- export declare function LoadDateTime(value: string): Date;
3
- export declare function LoadGeospatialPoint(geospatialPoint: GeospatialPoint, value: any): GeospatialPoint;
1
+ import { GeospatialPoint } from '../interfaces';
2
+ export declare function LoadDateTime(value: string): Date;
3
+ export declare function LoadGeospatialPoint(geospatialPoint: GeospatialPoint, value: any): GeospatialPoint;
@@ -1,30 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoadGeospatialPoint = exports.LoadDateTime = void 0;
4
- const json_1 = require("@cloudize/json");
5
- const interfaces_1 = require("../interfaces");
6
- function LoadDateTime(value) {
7
- if ((0, json_1.isDefined)(value))
8
- return new Date(value);
9
- return undefined;
10
- }
11
- exports.LoadDateTime = LoadDateTime;
12
- function LoadGeospatialPoint(geospatialPoint, value) {
13
- if ((0, json_1.isUndefinedOrNull)(geospatialPoint)) {
14
- if ((0, json_1.isDefined)(value) && (0, json_1.isObject)(value) && (Object.keys(value).length === 2)
15
- && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
16
- && (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
17
- const result = new interfaces_1.GeospatialPoint();
18
- result.LoadData(value);
19
- return result;
20
- }
21
- }
22
- else if ((0, json_1.isDefined)(value) && (0, json_1.isObject)(value) && (Object.keys(value).length <= 2)
23
- && (((0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude))
24
- || ((0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)))) {
25
- geospatialPoint.LoadData(value);
26
- return geospatialPoint;
27
- }
28
- return undefined;
29
- }
30
- exports.LoadGeospatialPoint = LoadGeospatialPoint;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadGeospatialPoint = exports.LoadDateTime = void 0;
4
+ const json_1 = require("@cloudize/json");
5
+ const interfaces_1 = require("../interfaces");
6
+ function LoadDateTime(value) {
7
+ if ((0, json_1.isDefined)(value))
8
+ return new Date(value);
9
+ return undefined;
10
+ }
11
+ exports.LoadDateTime = LoadDateTime;
12
+ function LoadGeospatialPoint(geospatialPoint, value) {
13
+ if ((0, json_1.isUndefinedOrNull)(geospatialPoint)) {
14
+ if ((0, json_1.isDefined)(value) && (0, json_1.isObject)(value) && (Object.keys(value).length === 2)
15
+ && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
16
+ && (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
17
+ const result = new interfaces_1.GeospatialPoint();
18
+ result.LoadData(value);
19
+ return result;
20
+ }
21
+ }
22
+ else if ((0, json_1.isDefined)(value) && (0, json_1.isObject)(value) && (Object.keys(value).length <= 2)
23
+ && (((0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude))
24
+ || ((0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)))) {
25
+ geospatialPoint.LoadData(value);
26
+ return geospatialPoint;
27
+ }
28
+ return undefined;
29
+ }
30
+ exports.LoadGeospatialPoint = LoadGeospatialPoint;
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './interfaces';
2
- export * from './exceptions';
3
- export * from './classes';
4
- export * from './helpers';
5
- export * from './type-guards';
1
+ export * from './interfaces';
2
+ export * from './exceptions';
3
+ export * from './classes';
4
+ export * from './helpers';
5
+ export * from './type-guards';
package/lib/index.js CHANGED
@@ -1,21 +1,21 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./interfaces"), exports);
18
- __exportStar(require("./exceptions"), exports);
19
- __exportStar(require("./classes"), exports);
20
- __exportStar(require("./helpers"), exports);
21
- __exportStar(require("./type-guards"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces"), exports);
18
+ __exportStar(require("./exceptions"), exports);
19
+ __exportStar(require("./classes"), exports);
20
+ __exportStar(require("./helpers"), exports);
21
+ __exportStar(require("./type-guards"), exports);
@@ -1,2 +1,2 @@
1
- export { ISDKError, ISDKRequestError, ISDKException, ISDKRequestException, } from './sdk.errors';
2
- export { IResourceContainer, ResourceContainerIncludedResourceTypes, ResourceFilterName, ResourceFilterValue, ResourceSortOption, ResourceIncludeOption, IResourceObject, IResourceObjectAttributes, IResourceObjectRelationships, GeospatialPoint, ResourceObjectAttributeBase, ResourceObjectAttributesLoadType, ResourceObjectRelationshipLinkObject, ResourceObjectRelationshipLink, ResourceObjectRelationshipsLinks, ResourceObjectRelationshipsLoadType, ResourceObjectRelationship, ResourceObjectRelationships, ResourceObjectUri, ResourceObjectRelationshipBase, } from './resource.interfaces';
1
+ export { ISDKError, ISDKRequestError, ISDKException, ISDKRequestException, } from './sdk.errors';
2
+ export { IResourceContainer, ResourceContainerIncludedResourceTypes, ResourceFilterName, ResourceFilterValue, ResourceSortOption, ResourceIncludeOption, IResourceObject, IResourceObjectAttributes, IResourceObjectRelationships, GeospatialPoint, ResourceObjectAttributeBase, ResourceObjectAttributesLoadType, ResourceObjectRelationshipLinkObject, ResourceObjectRelationshipLink, ResourceObjectRelationshipsLinks, ResourceObjectRelationshipsLoadType, ResourceObjectRelationship, ResourceObjectRelationships, ResourceObjectUri, ResourceObjectRelationshipBase, } from './resource.interfaces';
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceObjectRelationshipBase = exports.ResourceObjectRelationship = exports.ResourceObjectRelationshipsLoadType = exports.ResourceObjectAttributesLoadType = exports.ResourceObjectAttributeBase = exports.GeospatialPoint = void 0;
4
- var resource_interfaces_1 = require("./resource.interfaces");
5
- Object.defineProperty(exports, "GeospatialPoint", { enumerable: true, get: function () { return resource_interfaces_1.GeospatialPoint; } });
6
- Object.defineProperty(exports, "ResourceObjectAttributeBase", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectAttributeBase; } });
7
- Object.defineProperty(exports, "ResourceObjectAttributesLoadType", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectAttributesLoadType; } });
8
- Object.defineProperty(exports, "ResourceObjectRelationshipsLoadType", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectRelationshipsLoadType; } });
9
- Object.defineProperty(exports, "ResourceObjectRelationship", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectRelationship; } });
10
- Object.defineProperty(exports, "ResourceObjectRelationshipBase", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectRelationshipBase; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResourceObjectRelationshipBase = exports.ResourceObjectRelationship = exports.ResourceObjectRelationshipsLoadType = exports.ResourceObjectAttributesLoadType = exports.ResourceObjectAttributeBase = exports.GeospatialPoint = void 0;
4
+ var resource_interfaces_1 = require("./resource.interfaces");
5
+ Object.defineProperty(exports, "GeospatialPoint", { enumerable: true, get: function () { return resource_interfaces_1.GeospatialPoint; } });
6
+ Object.defineProperty(exports, "ResourceObjectAttributeBase", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectAttributeBase; } });
7
+ Object.defineProperty(exports, "ResourceObjectAttributesLoadType", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectAttributesLoadType; } });
8
+ Object.defineProperty(exports, "ResourceObjectRelationshipsLoadType", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectRelationshipsLoadType; } });
9
+ Object.defineProperty(exports, "ResourceObjectRelationship", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectRelationship; } });
10
+ Object.defineProperty(exports, "ResourceObjectRelationshipBase", { enumerable: true, get: function () { return resource_interfaces_1.ResourceObjectRelationshipBase; } });
@@ -1,94 +1,94 @@
1
- import { IRestClient } from '@cloudize/rest-client';
2
- import { ResourceFilterType, ResourceHeaderParams } from '../classes';
3
- export type ResourceObjectType = string;
4
- export type ResourceObjectIdentifier = string;
5
- export declare enum ResourceObjectAttributesLoadType {
6
- Replace = 0,
7
- Update = 1
8
- }
9
- export interface IResourceObjectAttributes {
10
- LoadData(data: any, action: ResourceObjectAttributesLoadType): void;
11
- }
12
- export type ResourceObjectRelationshipLinkObject = {
13
- type: ResourceObjectType;
14
- id: ResourceObjectIdentifier;
15
- };
16
- export type ResourceObjectRelationshipLink = {
17
- data: ResourceObjectRelationshipLinkObject;
18
- };
19
- export type ResourceObjectRelationshipsLinks = {
20
- data: ResourceObjectRelationshipLinkObject[];
21
- };
22
- export type ResourceContainerIncludedResources = {
23
- [id: string]: IResourceObject;
24
- };
25
- export type ResourceContainerIncludedResourceTypes = {
26
- [type: string]: ResourceContainerIncludedResources;
27
- };
28
- export declare class ResourceObjectRelationship {
29
- private _includes;
30
- readonly type: ResourceObjectType;
31
- id: ResourceObjectIdentifier | null;
32
- constructor(includes: ResourceContainerIncludedResourceTypes, type: ResourceObjectType, id?: ResourceObjectIdentifier);
33
- clear(): void;
34
- get target(): IResourceObject;
35
- }
36
- export type ResourceObjectRelationships = ResourceObjectRelationship[];
37
- export declare enum ResourceObjectRelationshipsLoadType {
38
- Replace = 0,
39
- Update = 1
40
- }
41
- export interface IResourceObjectRelationships {
42
- LoadData(data: any, action: ResourceObjectRelationshipsLoadType): void;
43
- }
44
- export type ResourceObjectUri = string;
45
- export declare class ResourceObjectAttributeBase {
46
- protected static LoadDateTime(value: string): Date;
47
- protected static LoadGeospatialPoint(geospatialPoint: GeospatialPoint, value: any): GeospatialPoint;
48
- }
49
- export declare class GeospatialPoint extends ResourceObjectAttributeBase implements IResourceObjectAttributes {
50
- longitude: number;
51
- latitude: number;
52
- LoadData(data: any): void;
53
- }
54
- export declare class ResourceObjectRelationshipBase {
55
- private _includes;
56
- constructor(includes: ResourceContainerIncludedResourceTypes);
57
- protected LoadRelationship(expectedType: string, value: any): ResourceObjectRelationship;
58
- protected LoadRelationships(expectedType: string, value: any): ResourceObjectRelationships;
59
- static RelationshipType(relationshipName: string): string;
60
- }
61
- export interface IResourceObject {
62
- type: ResourceObjectType;
63
- id?: ResourceObjectIdentifier;
64
- attributes: IResourceObjectAttributes;
65
- relationships: IResourceObjectRelationships;
66
- uri: ResourceObjectUri;
67
- LoadData(value: any): IResourceObject;
68
- Delete(): Promise<void>;
69
- Save(): Promise<void>;
70
- UpdateAttributes(value: any): void;
71
- UpdateRelationships(value: any): void;
72
- }
73
- export type ResourceFilterName = string;
74
- export type ResourceFilterValue = string;
75
- export type ResourceSortOption = string;
76
- export type ResourceIncludeOption = string;
77
- export interface IResourceContainer {
78
- data: IResourceObject | IResourceObject[];
79
- includes: ResourceContainerIncludedResourceTypes;
80
- restClient: IRestClient;
81
- uri: string;
82
- Filter(filter: ResourceFilterName, selector: ResourceFilterType, value: ResourceFilterValue): IResourceContainer;
83
- GetHeaders(action: string): ResourceHeaderParams;
84
- Sort(option: ResourceSortOption): IResourceContainer;
85
- Include(include: ResourceIncludeOption): IResourceContainer;
86
- PageOffset(pageOffset: number, pageSize: number): IResourceContainer;
87
- PageNumber(pageNumber: number, pageSize: number): IResourceContainer;
88
- Add(): IResourceObject;
89
- Count(): Promise<number>;
90
- Delete(resource: IResourceObject): Promise<void>;
91
- Find(): Promise<void>;
92
- Get(id: string): Promise<void>;
93
- IncludedObject(type: ResourceObjectType, id: ResourceObjectIdentifier): IResourceObject;
94
- }
1
+ import { IRestClient } from '@cloudize/rest-client';
2
+ import { ResourceFilterType, ResourceHeaderParams } from '../classes';
3
+ export type ResourceObjectType = string;
4
+ export type ResourceObjectIdentifier = string;
5
+ export declare enum ResourceObjectAttributesLoadType {
6
+ Replace = 0,
7
+ Update = 1
8
+ }
9
+ export interface IResourceObjectAttributes {
10
+ LoadData(data: any, action: ResourceObjectAttributesLoadType): void;
11
+ }
12
+ export type ResourceObjectRelationshipLinkObject = {
13
+ type: ResourceObjectType;
14
+ id: ResourceObjectIdentifier;
15
+ };
16
+ export type ResourceObjectRelationshipLink = {
17
+ data: ResourceObjectRelationshipLinkObject;
18
+ };
19
+ export type ResourceObjectRelationshipsLinks = {
20
+ data: ResourceObjectRelationshipLinkObject[];
21
+ };
22
+ export type ResourceContainerIncludedResources = {
23
+ [id: string]: IResourceObject;
24
+ };
25
+ export type ResourceContainerIncludedResourceTypes = {
26
+ [type: string]: ResourceContainerIncludedResources;
27
+ };
28
+ export declare class ResourceObjectRelationship {
29
+ private _includes;
30
+ readonly type: ResourceObjectType;
31
+ id: ResourceObjectIdentifier | null;
32
+ constructor(includes: ResourceContainerIncludedResourceTypes, type: ResourceObjectType, id?: ResourceObjectIdentifier);
33
+ clear(): void;
34
+ get target(): IResourceObject;
35
+ }
36
+ export type ResourceObjectRelationships = ResourceObjectRelationship[];
37
+ export declare enum ResourceObjectRelationshipsLoadType {
38
+ Replace = 0,
39
+ Update = 1
40
+ }
41
+ export interface IResourceObjectRelationships {
42
+ LoadData(data: any, action: ResourceObjectRelationshipsLoadType): void;
43
+ }
44
+ export type ResourceObjectUri = string;
45
+ export declare class ResourceObjectAttributeBase {
46
+ protected static LoadDateTime(value: string): Date;
47
+ protected static LoadGeospatialPoint(geospatialPoint: GeospatialPoint, value: any): GeospatialPoint;
48
+ }
49
+ export declare class GeospatialPoint extends ResourceObjectAttributeBase implements IResourceObjectAttributes {
50
+ longitude: number;
51
+ latitude: number;
52
+ LoadData(data: any): void;
53
+ }
54
+ export declare class ResourceObjectRelationshipBase {
55
+ private _includes;
56
+ constructor(includes: ResourceContainerIncludedResourceTypes);
57
+ protected LoadRelationship(expectedType: string, value: any): ResourceObjectRelationship;
58
+ protected LoadRelationships(expectedType: string, value: any): ResourceObjectRelationships;
59
+ static RelationshipType(relationshipName: string): string;
60
+ }
61
+ export interface IResourceObject {
62
+ type: ResourceObjectType;
63
+ id?: ResourceObjectIdentifier;
64
+ attributes: IResourceObjectAttributes;
65
+ relationships: IResourceObjectRelationships;
66
+ uri: ResourceObjectUri;
67
+ LoadData(value: any): IResourceObject;
68
+ Delete(): Promise<void>;
69
+ Save(): Promise<void>;
70
+ UpdateAttributes(value: any): void;
71
+ UpdateRelationships(value: any): void;
72
+ }
73
+ export type ResourceFilterName = string;
74
+ export type ResourceFilterValue = string;
75
+ export type ResourceSortOption = string;
76
+ export type ResourceIncludeOption = string;
77
+ export interface IResourceContainer {
78
+ data: IResourceObject | IResourceObject[];
79
+ includes: ResourceContainerIncludedResourceTypes;
80
+ restClient: IRestClient;
81
+ uri: string;
82
+ Filter(filter: ResourceFilterName, selector: ResourceFilterType, value: ResourceFilterValue): IResourceContainer;
83
+ GetHeaders(action: string): ResourceHeaderParams;
84
+ Sort(option: ResourceSortOption): IResourceContainer;
85
+ Include(include: ResourceIncludeOption): IResourceContainer;
86
+ PageOffset(pageOffset: number, pageSize: number): IResourceContainer;
87
+ PageNumber(pageNumber: number, pageSize: number): IResourceContainer;
88
+ Add(): IResourceObject;
89
+ Count(): Promise<number>;
90
+ Delete(resource: IResourceObject): Promise<void>;
91
+ Find(): Promise<void>;
92
+ Get(id: string): Promise<void>;
93
+ IncludedObject(type: ResourceObjectType, id: ResourceObjectIdentifier): IResourceObject;
94
+ }