@sonoransoftware/sonoran.js 1.0.19 → 1.0.22
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.
- package/.eslintrc.js +10 -10
- package/.github/workflows/npm-publish.yml +34 -34
- package/.prettierrc.js +6 -6
- package/dist/builders/cad/DispatchCall.d.ts +92 -92
- package/dist/builders/cad/DispatchCall.js +144 -144
- package/dist/builders/cad/index.d.ts +1 -1
- package/dist/builders/cad/index.js +17 -17
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +19 -19
- package/dist/constants.d.ts +230 -230
- package/dist/constants.js +27 -27
- package/dist/errors/LibraryErrors.d.ts +19 -19
- package/dist/errors/LibraryErrors.js +47 -47
- package/dist/errors/Messages.d.ts +1 -1
- package/dist/errors/Messages.js +8 -8
- package/dist/errors/index.d.ts +2 -2
- package/dist/errors/index.js +18 -18
- package/dist/index.d.ts +4 -4
- package/dist/index.js +24 -24
- package/dist/instance/Instance.d.ts +24 -24
- package/dist/instance/Instance.js +139 -139
- package/dist/instance/instance.types.d.ts +17 -17
- package/dist/instance/instance.types.js +2 -2
- package/dist/libs/rest/src/index.d.ts +6 -6
- package/dist/libs/rest/src/index.js +22 -22
- package/dist/libs/rest/src/lib/REST.d.ts +101 -101
- package/dist/libs/rest/src/lib/REST.js +136 -129
- package/dist/libs/rest/src/lib/RequestManager.d.ts +59 -59
- package/dist/libs/rest/src/lib/RequestManager.js +191 -191
- package/dist/libs/rest/src/lib/errors/APIError.d.ts +9 -9
- package/dist/libs/rest/src/lib/errors/APIError.js +17 -17
- package/dist/libs/rest/src/lib/errors/HTTPError.d.ts +17 -17
- package/dist/libs/rest/src/lib/errors/HTTPError.js +23 -23
- package/dist/libs/rest/src/lib/errors/RateLimitError.d.ts +13 -13
- package/dist/libs/rest/src/lib/errors/RateLimitError.js +19 -19
- package/dist/libs/rest/src/lib/errors/index.d.ts +4 -4
- package/dist/libs/rest/src/lib/errors/index.js +20 -20
- package/dist/libs/rest/src/lib/handlers/IHandler.d.ts +7 -7
- package/dist/libs/rest/src/lib/handlers/IHandler.js +2 -2
- package/dist/libs/rest/src/lib/handlers/SequentialHandler.d.ts +45 -45
- package/dist/libs/rest/src/lib/handlers/SequentialHandler.js +143 -143
- package/dist/libs/rest/src/lib/utils/constants.d.ts +533 -527
- package/dist/libs/rest/src/lib/utils/constants.js +463 -455
- package/dist/libs/rest/src/lib/utils/utils.d.ts +1 -1
- package/dist/libs/rest/src/lib/utils/utils.js +22 -22
- package/dist/managers/BaseManager.d.ts +14 -14
- package/dist/managers/BaseManager.js +18 -18
- package/dist/managers/CADActiveUnitsManager.d.ts +15 -15
- package/dist/managers/CADActiveUnitsManager.js +38 -38
- package/dist/managers/CADManager.d.ts +29 -29
- package/dist/managers/CADManager.js +86 -86
- package/dist/managers/CADServerManager.d.ts +8 -8
- package/dist/managers/CADServerManager.js +28 -28
- package/dist/managers/CMSManager.d.ts +101 -101
- package/dist/managers/CMSManager.js +266 -266
- package/dist/managers/CMSServerManager.d.ts +8 -8
- package/dist/managers/CMSServerManager.js +34 -34
- package/dist/managers/CacheManager.d.ts +10 -10
- package/dist/managers/CacheManager.js +36 -36
- package/dist/managers/DataManager.d.ts +31 -31
- package/dist/managers/DataManager.js +58 -58
- package/dist/structures/Base.d.ts +9 -9
- package/dist/structures/Base.js +24 -24
- package/dist/structures/CADActiveUnit.d.ts +47 -47
- package/dist/structures/CADActiveUnit.js +66 -66
- package/dist/structures/CADServer.d.ts +26 -26
- package/dist/structures/CADServer.js +15 -15
- package/dist/structures/CMSServer.d.ts +18 -18
- package/dist/structures/CMSServer.js +12 -12
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +17 -17
- package/dist/utils/utils.d.ts +13 -13
- package/dist/utils/utils.js +79 -79
- package/docs/CAD-Methods-and-Usage.md +58 -58
- package/docs/CMS-Methods-and-Usage.md +211 -211
- package/docs/REST-Methods-and-Usage.md +46 -46
- package/package.json +48 -48
- package/readme.md +53 -53
- package/src/constants.ts +248 -248
- package/src/instance/Instance.ts +121 -121
- package/src/instance/instance.types.ts +17 -17
- package/src/libs/rest/src/lib/REST.ts +241 -234
- package/src/libs/rest/src/lib/RequestManager.ts +260 -260
- package/src/libs/rest/src/lib/handlers/SequentialHandler.ts +160 -160
- package/src/libs/rest/src/lib/utils/constants.ts +1012 -997
- package/src/managers/CADManager.ts +63 -63
- package/src/managers/CMSManager.ts +226 -226
- package/src/managers/CMSServerManager.ts +32 -32
- package/tsconfig.json +71 -71
package/.eslintrc.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
|
|
4
|
-
parserOptions: {
|
|
5
|
-
sourceType: 'module',
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
'prettier/prettier': 'error',
|
|
9
|
-
},
|
|
10
|
-
plugins: ['@typescript-eslint', 'prettier'],
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: '@typescript-eslint/parser',
|
|
3
|
+
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
|
|
4
|
+
parserOptions: {
|
|
5
|
+
sourceType: 'module',
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'prettier/prettier': 'error',
|
|
9
|
+
},
|
|
10
|
+
plugins: ['@typescript-eslint', 'prettier'],
|
|
11
11
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Publish Sonoran.js NPM
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: 16
|
|
18
|
-
- run: npm i
|
|
19
|
-
- run: npm run build
|
|
20
|
-
|
|
21
|
-
publish-npm:
|
|
22
|
-
needs: build
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
steps:
|
|
25
|
-
- uses: actions/checkout@v3
|
|
26
|
-
- uses: actions/setup-node@v3
|
|
27
|
-
with:
|
|
28
|
-
node-version: 16
|
|
29
|
-
registry-url: https://registry.npmjs.org/
|
|
30
|
-
- run: npm i
|
|
31
|
-
- run: npm run build
|
|
32
|
-
- run: npm publish
|
|
33
|
-
env:
|
|
34
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Publish Sonoran.js NPM
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: actions/setup-node@v3
|
|
16
|
+
with:
|
|
17
|
+
node-version: 16
|
|
18
|
+
- run: npm i
|
|
19
|
+
- run: npm run build
|
|
20
|
+
|
|
21
|
+
publish-npm:
|
|
22
|
+
needs: build
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v3
|
|
26
|
+
- uses: actions/setup-node@v3
|
|
27
|
+
with:
|
|
28
|
+
node-version: 16
|
|
29
|
+
registry-url: https://registry.npmjs.org/
|
|
30
|
+
- run: npm i
|
|
31
|
+
- run: npm run build
|
|
32
|
+
- run: npm publish
|
|
33
|
+
env:
|
|
34
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/.prettierrc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
semi: false,
|
|
3
|
-
singleQuote: true,
|
|
4
|
-
trailingComma: 'es6',
|
|
5
|
-
arrowParens: 'always',
|
|
6
|
-
printWidth: 80,
|
|
1
|
+
module.exports = {
|
|
2
|
+
semi: false,
|
|
3
|
+
singleQuote: true,
|
|
4
|
+
trailingComma: 'es6',
|
|
5
|
+
arrowParens: 'always',
|
|
6
|
+
printWidth: 80,
|
|
7
7
|
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { CADNewDispatchBuilderOptions } from '../../constants';
|
|
2
|
-
import { CADDispatchOriginEnums, CADDispatchStatusEnums } from '../../libs/rest/src';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a constructed dispatch call for API requests
|
|
5
|
-
*/
|
|
6
|
-
export declare class DispatchCallBuilder {
|
|
7
|
-
readonly data: CADNewDispatchBuilderOptions;
|
|
8
|
-
/**
|
|
9
|
-
* Dispatch Call Builder used for API calls with Sonoran CAD to create a new dispatch call.
|
|
10
|
-
* @param data Data Options (CADNewDispatchBuilderOptions) used to build the new dispatch call
|
|
11
|
-
*/
|
|
12
|
-
constructor(data?: CADNewDispatchBuilderOptions);
|
|
13
|
-
/**
|
|
14
|
-
* Sets the origin for this dispatch call
|
|
15
|
-
* @param origin Origin enum used for this dispatch call for information purposes
|
|
16
|
-
*/
|
|
17
|
-
setOrigin(origin: CADDispatchOriginEnums): this;
|
|
18
|
-
/**
|
|
19
|
-
* Sets the status for this dispatch call
|
|
20
|
-
* @param status Status enum used for the dispatch call for information purposes
|
|
21
|
-
*/
|
|
22
|
-
setStatus(status: CADDispatchStatusEnums): this;
|
|
23
|
-
/**
|
|
24
|
-
* Sets the priority level for this dispatch call
|
|
25
|
-
* @param priority Priority level used for the dispatch call for information purposes
|
|
26
|
-
*/
|
|
27
|
-
setPriority(priority: 1 | 2 | 3): this;
|
|
28
|
-
/**
|
|
29
|
-
* Sets the block for this dispatch call
|
|
30
|
-
* @param block Block used for the dispatch call for information purposes
|
|
31
|
-
*/
|
|
32
|
-
setBlock(block: string): this;
|
|
33
|
-
/**
|
|
34
|
-
* Sets the address for this dispatch call
|
|
35
|
-
* @param address Address used for the dispatch call for information purposes
|
|
36
|
-
*/
|
|
37
|
-
setAddress(address: string): this;
|
|
38
|
-
/**
|
|
39
|
-
* Sets the postal for this dispatch call
|
|
40
|
-
* @param postal Postal used for the dispatch call for information purposes
|
|
41
|
-
*/
|
|
42
|
-
setPostal(postal: string): this;
|
|
43
|
-
/**
|
|
44
|
-
* Sets the title for this dispatch call
|
|
45
|
-
* @param title Title used for the dispatch call for information purposes
|
|
46
|
-
*/
|
|
47
|
-
setTitle(title: string): this;
|
|
48
|
-
/**
|
|
49
|
-
* Sets the code for this dispatch call
|
|
50
|
-
* @param code Code used for the dispatch call for information purposes
|
|
51
|
-
*/
|
|
52
|
-
setCode(code: string): this;
|
|
53
|
-
/**
|
|
54
|
-
* Sets the primary tracking preference for this dispatch call
|
|
55
|
-
* @param primaryUnit Primary unit identifier
|
|
56
|
-
*/
|
|
57
|
-
setPrimary(primaryUnit: number): this;
|
|
58
|
-
/**
|
|
59
|
-
* Sets the track primary preference for this dispatch call
|
|
60
|
-
* @param preference Preference for tracking primary
|
|
61
|
-
*/
|
|
62
|
-
setTrackPrimaryPreference(preference: boolean): this;
|
|
63
|
-
/**
|
|
64
|
-
* Sets the description for this dispatch call
|
|
65
|
-
* @param description Description for a dispatch call
|
|
66
|
-
*/
|
|
67
|
-
setDescription(description: string): this;
|
|
68
|
-
/**
|
|
69
|
-
* Sets metadata for this dispatch call that can be used later on
|
|
70
|
-
* @param metaData Dictionary of metadata to store with a dispatch call, can be used later on
|
|
71
|
-
*/
|
|
72
|
-
setMetadata(metaData: Record<string, string>): this;
|
|
73
|
-
/**
|
|
74
|
-
* Sets specified units for this dispatch call
|
|
75
|
-
* @param units Units to be removed from a call
|
|
76
|
-
*/
|
|
77
|
-
setUnits(units: string[]): this;
|
|
78
|
-
/**
|
|
79
|
-
* Adds specified units from this dispatch call
|
|
80
|
-
* @param units Units to be removed from a call
|
|
81
|
-
*/
|
|
82
|
-
addUnits(...units: string[]): this;
|
|
83
|
-
/**
|
|
84
|
-
* Removes specified units from this dispatch call
|
|
85
|
-
* @param units Units to be removed from a call
|
|
86
|
-
*/
|
|
87
|
-
removeUnits(...units: string[]): this;
|
|
88
|
-
/**
|
|
89
|
-
* Transforms the dispatch call to a plain object
|
|
90
|
-
*/
|
|
91
|
-
toJSON(): CADNewDispatchBuilderOptions;
|
|
92
|
-
}
|
|
1
|
+
import { CADNewDispatchBuilderOptions } from '../../constants';
|
|
2
|
+
import { CADDispatchOriginEnums, CADDispatchStatusEnums } from '../../libs/rest/src';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a constructed dispatch call for API requests
|
|
5
|
+
*/
|
|
6
|
+
export declare class DispatchCallBuilder {
|
|
7
|
+
readonly data: CADNewDispatchBuilderOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Dispatch Call Builder used for API calls with Sonoran CAD to create a new dispatch call.
|
|
10
|
+
* @param data Data Options (CADNewDispatchBuilderOptions) used to build the new dispatch call
|
|
11
|
+
*/
|
|
12
|
+
constructor(data?: CADNewDispatchBuilderOptions);
|
|
13
|
+
/**
|
|
14
|
+
* Sets the origin for this dispatch call
|
|
15
|
+
* @param origin Origin enum used for this dispatch call for information purposes
|
|
16
|
+
*/
|
|
17
|
+
setOrigin(origin: CADDispatchOriginEnums): this;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the status for this dispatch call
|
|
20
|
+
* @param status Status enum used for the dispatch call for information purposes
|
|
21
|
+
*/
|
|
22
|
+
setStatus(status: CADDispatchStatusEnums): this;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the priority level for this dispatch call
|
|
25
|
+
* @param priority Priority level used for the dispatch call for information purposes
|
|
26
|
+
*/
|
|
27
|
+
setPriority(priority: 1 | 2 | 3): this;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the block for this dispatch call
|
|
30
|
+
* @param block Block used for the dispatch call for information purposes
|
|
31
|
+
*/
|
|
32
|
+
setBlock(block: string): this;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the address for this dispatch call
|
|
35
|
+
* @param address Address used for the dispatch call for information purposes
|
|
36
|
+
*/
|
|
37
|
+
setAddress(address: string): this;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the postal for this dispatch call
|
|
40
|
+
* @param postal Postal used for the dispatch call for information purposes
|
|
41
|
+
*/
|
|
42
|
+
setPostal(postal: string): this;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the title for this dispatch call
|
|
45
|
+
* @param title Title used for the dispatch call for information purposes
|
|
46
|
+
*/
|
|
47
|
+
setTitle(title: string): this;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the code for this dispatch call
|
|
50
|
+
* @param code Code used for the dispatch call for information purposes
|
|
51
|
+
*/
|
|
52
|
+
setCode(code: string): this;
|
|
53
|
+
/**
|
|
54
|
+
* Sets the primary tracking preference for this dispatch call
|
|
55
|
+
* @param primaryUnit Primary unit identifier
|
|
56
|
+
*/
|
|
57
|
+
setPrimary(primaryUnit: number): this;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the track primary preference for this dispatch call
|
|
60
|
+
* @param preference Preference for tracking primary
|
|
61
|
+
*/
|
|
62
|
+
setTrackPrimaryPreference(preference: boolean): this;
|
|
63
|
+
/**
|
|
64
|
+
* Sets the description for this dispatch call
|
|
65
|
+
* @param description Description for a dispatch call
|
|
66
|
+
*/
|
|
67
|
+
setDescription(description: string): this;
|
|
68
|
+
/**
|
|
69
|
+
* Sets metadata for this dispatch call that can be used later on
|
|
70
|
+
* @param metaData Dictionary of metadata to store with a dispatch call, can be used later on
|
|
71
|
+
*/
|
|
72
|
+
setMetadata(metaData: Record<string, string>): this;
|
|
73
|
+
/**
|
|
74
|
+
* Sets specified units for this dispatch call
|
|
75
|
+
* @param units Units to be removed from a call
|
|
76
|
+
*/
|
|
77
|
+
setUnits(units: string[]): this;
|
|
78
|
+
/**
|
|
79
|
+
* Adds specified units from this dispatch call
|
|
80
|
+
* @param units Units to be removed from a call
|
|
81
|
+
*/
|
|
82
|
+
addUnits(...units: string[]): this;
|
|
83
|
+
/**
|
|
84
|
+
* Removes specified units from this dispatch call
|
|
85
|
+
* @param units Units to be removed from a call
|
|
86
|
+
*/
|
|
87
|
+
removeUnits(...units: string[]): this;
|
|
88
|
+
/**
|
|
89
|
+
* Transforms the dispatch call to a plain object
|
|
90
|
+
*/
|
|
91
|
+
toJSON(): CADNewDispatchBuilderOptions;
|
|
92
|
+
}
|
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DispatchCallBuilder = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Represents a constructed dispatch call for API requests
|
|
6
|
-
*/
|
|
7
|
-
class DispatchCallBuilder {
|
|
8
|
-
/**
|
|
9
|
-
* Dispatch Call Builder used for API calls with Sonoran CAD to create a new dispatch call.
|
|
10
|
-
* @param data Data Options (CADNewDispatchBuilderOptions) used to build the new dispatch call
|
|
11
|
-
*/
|
|
12
|
-
constructor(data = {}) {
|
|
13
|
-
this.data = { ...data };
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Sets the origin for this dispatch call
|
|
17
|
-
* @param origin Origin enum used for this dispatch call for information purposes
|
|
18
|
-
*/
|
|
19
|
-
setOrigin(origin) {
|
|
20
|
-
this.data.origin = origin;
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Sets the status for this dispatch call
|
|
25
|
-
* @param status Status enum used for the dispatch call for information purposes
|
|
26
|
-
*/
|
|
27
|
-
setStatus(status) {
|
|
28
|
-
this.data.status = status;
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Sets the priority level for this dispatch call
|
|
33
|
-
* @param priority Priority level used for the dispatch call for information purposes
|
|
34
|
-
*/
|
|
35
|
-
setPriority(priority) {
|
|
36
|
-
this.data.priority = priority;
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Sets the block for this dispatch call
|
|
41
|
-
* @param block Block used for the dispatch call for information purposes
|
|
42
|
-
*/
|
|
43
|
-
setBlock(block) {
|
|
44
|
-
this.data.block = block;
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Sets the address for this dispatch call
|
|
49
|
-
* @param address Address used for the dispatch call for information purposes
|
|
50
|
-
*/
|
|
51
|
-
setAddress(address) {
|
|
52
|
-
this.data.address = address;
|
|
53
|
-
return this;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Sets the postal for this dispatch call
|
|
57
|
-
* @param postal Postal used for the dispatch call for information purposes
|
|
58
|
-
*/
|
|
59
|
-
setPostal(postal) {
|
|
60
|
-
this.data.postal = postal;
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Sets the title for this dispatch call
|
|
65
|
-
* @param title Title used for the dispatch call for information purposes
|
|
66
|
-
*/
|
|
67
|
-
setTitle(title) {
|
|
68
|
-
this.data.title = title;
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Sets the code for this dispatch call
|
|
73
|
-
* @param code Code used for the dispatch call for information purposes
|
|
74
|
-
*/
|
|
75
|
-
setCode(code) {
|
|
76
|
-
this.data.code = code;
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Sets the primary tracking preference for this dispatch call
|
|
81
|
-
* @param primaryUnit Primary unit identifier
|
|
82
|
-
*/
|
|
83
|
-
setPrimary(primaryUnit) {
|
|
84
|
-
this.data.primary = primaryUnit;
|
|
85
|
-
return this;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Sets the track primary preference for this dispatch call
|
|
89
|
-
* @param preference Preference for tracking primary
|
|
90
|
-
*/
|
|
91
|
-
setTrackPrimaryPreference(preference) {
|
|
92
|
-
this.data.trackPrimary = preference;
|
|
93
|
-
return this;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Sets the description for this dispatch call
|
|
97
|
-
* @param description Description for a dispatch call
|
|
98
|
-
*/
|
|
99
|
-
setDescription(description) {
|
|
100
|
-
this.data.description = description;
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Sets metadata for this dispatch call that can be used later on
|
|
105
|
-
* @param metaData Dictionary of metadata to store with a dispatch call, can be used later on
|
|
106
|
-
*/
|
|
107
|
-
setMetadata(metaData) {
|
|
108
|
-
this.data.metaData = metaData;
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Sets specified units for this dispatch call
|
|
113
|
-
* @param units Units to be removed from a call
|
|
114
|
-
*/
|
|
115
|
-
setUnits(units) {
|
|
116
|
-
this.data.units = units;
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Adds specified units from this dispatch call
|
|
121
|
-
* @param units Units to be removed from a call
|
|
122
|
-
*/
|
|
123
|
-
addUnits(...units) {
|
|
124
|
-
var _a;
|
|
125
|
-
(_a = this.data.units) === null || _a === void 0 ? void 0 : _a.push(...units);
|
|
126
|
-
return this;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Removes specified units from this dispatch call
|
|
130
|
-
* @param units Units to be removed from a call
|
|
131
|
-
*/
|
|
132
|
-
removeUnits(...units) {
|
|
133
|
-
var _a;
|
|
134
|
-
(_a = this.data.units) === null || _a === void 0 ? void 0 : _a.filter((unit) => !units.includes(unit));
|
|
135
|
-
return this;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Transforms the dispatch call to a plain object
|
|
139
|
-
*/
|
|
140
|
-
toJSON() {
|
|
141
|
-
return { ...this.data };
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
exports.DispatchCallBuilder = DispatchCallBuilder;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DispatchCallBuilder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents a constructed dispatch call for API requests
|
|
6
|
+
*/
|
|
7
|
+
class DispatchCallBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* Dispatch Call Builder used for API calls with Sonoran CAD to create a new dispatch call.
|
|
10
|
+
* @param data Data Options (CADNewDispatchBuilderOptions) used to build the new dispatch call
|
|
11
|
+
*/
|
|
12
|
+
constructor(data = {}) {
|
|
13
|
+
this.data = { ...data };
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Sets the origin for this dispatch call
|
|
17
|
+
* @param origin Origin enum used for this dispatch call for information purposes
|
|
18
|
+
*/
|
|
19
|
+
setOrigin(origin) {
|
|
20
|
+
this.data.origin = origin;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets the status for this dispatch call
|
|
25
|
+
* @param status Status enum used for the dispatch call for information purposes
|
|
26
|
+
*/
|
|
27
|
+
setStatus(status) {
|
|
28
|
+
this.data.status = status;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sets the priority level for this dispatch call
|
|
33
|
+
* @param priority Priority level used for the dispatch call for information purposes
|
|
34
|
+
*/
|
|
35
|
+
setPriority(priority) {
|
|
36
|
+
this.data.priority = priority;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Sets the block for this dispatch call
|
|
41
|
+
* @param block Block used for the dispatch call for information purposes
|
|
42
|
+
*/
|
|
43
|
+
setBlock(block) {
|
|
44
|
+
this.data.block = block;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Sets the address for this dispatch call
|
|
49
|
+
* @param address Address used for the dispatch call for information purposes
|
|
50
|
+
*/
|
|
51
|
+
setAddress(address) {
|
|
52
|
+
this.data.address = address;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Sets the postal for this dispatch call
|
|
57
|
+
* @param postal Postal used for the dispatch call for information purposes
|
|
58
|
+
*/
|
|
59
|
+
setPostal(postal) {
|
|
60
|
+
this.data.postal = postal;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Sets the title for this dispatch call
|
|
65
|
+
* @param title Title used for the dispatch call for information purposes
|
|
66
|
+
*/
|
|
67
|
+
setTitle(title) {
|
|
68
|
+
this.data.title = title;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Sets the code for this dispatch call
|
|
73
|
+
* @param code Code used for the dispatch call for information purposes
|
|
74
|
+
*/
|
|
75
|
+
setCode(code) {
|
|
76
|
+
this.data.code = code;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Sets the primary tracking preference for this dispatch call
|
|
81
|
+
* @param primaryUnit Primary unit identifier
|
|
82
|
+
*/
|
|
83
|
+
setPrimary(primaryUnit) {
|
|
84
|
+
this.data.primary = primaryUnit;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Sets the track primary preference for this dispatch call
|
|
89
|
+
* @param preference Preference for tracking primary
|
|
90
|
+
*/
|
|
91
|
+
setTrackPrimaryPreference(preference) {
|
|
92
|
+
this.data.trackPrimary = preference;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Sets the description for this dispatch call
|
|
97
|
+
* @param description Description for a dispatch call
|
|
98
|
+
*/
|
|
99
|
+
setDescription(description) {
|
|
100
|
+
this.data.description = description;
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Sets metadata for this dispatch call that can be used later on
|
|
105
|
+
* @param metaData Dictionary of metadata to store with a dispatch call, can be used later on
|
|
106
|
+
*/
|
|
107
|
+
setMetadata(metaData) {
|
|
108
|
+
this.data.metaData = metaData;
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Sets specified units for this dispatch call
|
|
113
|
+
* @param units Units to be removed from a call
|
|
114
|
+
*/
|
|
115
|
+
setUnits(units) {
|
|
116
|
+
this.data.units = units;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Adds specified units from this dispatch call
|
|
121
|
+
* @param units Units to be removed from a call
|
|
122
|
+
*/
|
|
123
|
+
addUnits(...units) {
|
|
124
|
+
var _a;
|
|
125
|
+
(_a = this.data.units) === null || _a === void 0 ? void 0 : _a.push(...units);
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Removes specified units from this dispatch call
|
|
130
|
+
* @param units Units to be removed from a call
|
|
131
|
+
*/
|
|
132
|
+
removeUnits(...units) {
|
|
133
|
+
var _a;
|
|
134
|
+
(_a = this.data.units) === null || _a === void 0 ? void 0 : _a.filter((unit) => !units.includes(unit));
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Transforms the dispatch call to a plain object
|
|
139
|
+
*/
|
|
140
|
+
toJSON() {
|
|
141
|
+
return { ...this.data };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.DispatchCallBuilder = DispatchCallBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './DispatchCall';
|
|
1
|
+
export * from './DispatchCall';
|
|
@@ -1,17 +1,17 @@
|
|
|
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("./DispatchCall"), 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("./DispatchCall"), exports);
|
package/dist/builders/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './cad';
|
|
1
|
+
export * from './cad';
|
package/dist/builders/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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("./cad"), exports);
|
|
18
|
-
// export * from './cms';
|
|
19
|
-
// export * from './global';
|
|
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("./cad"), exports);
|
|
18
|
+
// export * from './cms';
|
|
19
|
+
// export * from './global';
|