@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
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { Instance } from '../instance/Instance';
|
|
2
|
-
import { CMSSubscriptionVersionEnum } from '../constants';
|
|
3
|
-
import { REST } from '../libs/rest/src';
|
|
4
|
-
import { BaseManager } from './BaseManager';
|
|
5
|
-
import * as globalTypes from '../constants';
|
|
6
|
-
import { CMSServerManager } from './CMSServerManager';
|
|
7
|
-
/**
|
|
8
|
-
* Manages all Sonoran CMS data and methods to interact with the public API.
|
|
9
|
-
*/
|
|
10
|
-
export declare class CMSManager extends BaseManager {
|
|
11
|
-
readonly ready: boolean;
|
|
12
|
-
readonly version: CMSSubscriptionVersionEnum;
|
|
13
|
-
readonly failReason: unknown;
|
|
14
|
-
rest: REST | undefined;
|
|
15
|
-
servers: CMSServerManager | undefined;
|
|
16
|
-
constructor(instance: Instance);
|
|
17
|
-
protected buildManager(instance: Instance): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Verifies the whitelist of a given account with the given parameters to search of said account.
|
|
20
|
-
* @param {Object | string} data The object or [accId | apiId as a string] that contains data to get a community account to verify if it has whitelist to the specified server. *If given as a string it will default to the set or default cms server id (1).
|
|
21
|
-
* @param {string} [data.accId] The account id to find a community account.
|
|
22
|
-
* @param {string} [data.apiId] The api id to find a community account.
|
|
23
|
-
* @param {string} [data.serverId] The username to find a community account.
|
|
24
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
25
|
-
*/
|
|
26
|
-
verifyWhitelist(data: {
|
|
27
|
-
accId?: string;
|
|
28
|
-
apiId?: string;
|
|
29
|
-
serverId?: number;
|
|
30
|
-
} | string): Promise<globalTypes.CMSVerifyWhitelistPromiseResult>;
|
|
31
|
-
/**
|
|
32
|
-
* Gets a full whitelist allowed list for a specific server.
|
|
33
|
-
* @param {number} serverId (Optional) Server ID to get the whole allow list for, if not specified it will grab the default server ID that is set.
|
|
34
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
35
|
-
*/
|
|
36
|
-
getFullWhitelist(serverId?: number): Promise<globalTypes.CMSGetFullWhitelistPromiseResult>;
|
|
37
|
-
/**
|
|
38
|
-
* Gets a community account by `accId`, `apiId`, or `username`.
|
|
39
|
-
* @param {Object} params The object that contains parameters to get a community account.
|
|
40
|
-
* @param {string} [data.accId] The account id to find a community account.
|
|
41
|
-
* @param {string} [data.apiId] The api id to find a community account.
|
|
42
|
-
* @param {string} [data.username] The username to find a community account.
|
|
43
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
44
|
-
*/
|
|
45
|
-
getComAccount(params: {
|
|
46
|
-
accId?: string;
|
|
47
|
-
apiId?: string;
|
|
48
|
-
username?: string;
|
|
49
|
-
discord?: string;
|
|
50
|
-
}): Promise<globalTypes.CMSGetComAccountPromiseResult>;
|
|
51
|
-
/**
|
|
52
|
-
* Gets a community account by `accId`, `apiId`, or `username`.
|
|
53
|
-
* @param {Object} params The object that contains parameters to get a community account.
|
|
54
|
-
* @param {string} [data.accId] (Optional) The account id to find a community account.
|
|
55
|
-
* @param {string} [data.apiId] (Optional) The api id to find a community account.
|
|
56
|
-
* @param {string} [data.username] (Optional) The username to find a community account.
|
|
57
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
58
|
-
*/
|
|
59
|
-
getAccountRanks(params: {
|
|
60
|
-
accId?: string;
|
|
61
|
-
apiId?: string;
|
|
62
|
-
username?: string;
|
|
63
|
-
discord?: string;
|
|
64
|
-
}): Promise<globalTypes.CMSGetAccountRanksPromiseResult>;
|
|
65
|
-
/**
|
|
66
|
-
* Clocks in or out an account by `accId` or `apiId`.
|
|
67
|
-
* @param {Object} data The object that contains critical data to clock in or out an account.
|
|
68
|
-
* @param {string} [data.accId] (Optional) The account id to clock in or out.
|
|
69
|
-
* @param {string} [data.apiId] (Optional) The api id to clock in or out.
|
|
70
|
-
* @param {boolean} [data.forceClockIn] If true, it will override any current clock in with a new clock in at the time of the request.
|
|
71
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
72
|
-
*/
|
|
73
|
-
clockInOut(data: {
|
|
74
|
-
accId?: string;
|
|
75
|
-
apiId?: string;
|
|
76
|
-
forceClockIn?: boolean;
|
|
77
|
-
}): Promise<globalTypes.CMSClockInOutPromiseResult>;
|
|
78
|
-
/**
|
|
79
|
-
* Check if a given [apiId] is attached to any account within the community CMS.
|
|
80
|
-
* @param {string} apiId The api id to check for an account.
|
|
81
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
82
|
-
*/
|
|
83
|
-
checkComApiId(apiId: string): Promise<globalTypes.CMSCheckComApiIdPromiseResult>;
|
|
84
|
-
/**
|
|
85
|
-
* Gets all department information within the community CMS.
|
|
86
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
87
|
-
*/
|
|
88
|
-
getDepartments(): Promise<globalTypes.CMSGetDepartmentsPromiseResult>;
|
|
89
|
-
/**
|
|
90
|
-
* Sets a community account's ranks for the CMS community.
|
|
91
|
-
* @param {string} accountId The object that contains critical data to clock in or out an account.
|
|
92
|
-
* @param {Object} changes The object that contains change data for setting account ranks.
|
|
93
|
-
* @param {Object} [changes.set] (Optional) The object that contains primary and secondary data for setting account ranks.
|
|
94
|
-
* @param {string} [changes.set.primary] (Optional) The primary rank ID wanting to set to the account.
|
|
95
|
-
* @param {string} [changes.set.secondary] (Optional) The secondary rank ID(s) wanting to set to the account.
|
|
96
|
-
* @param {Array} [changes.add] (Optional) The secondary rank IDs wanting to add to the account.
|
|
97
|
-
* @param {Array} [changes.remove] (Optional) The secondary rank IDs wanting to remove to the account.
|
|
98
|
-
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
99
|
-
*/
|
|
100
|
-
setAccountRanks(accountId: string, changes: globalTypes.CMSSetAccountRanksChangesObject): Promise<globalTypes.CMSSetAccountRanksPromiseResult>;
|
|
101
|
-
}
|
|
1
|
+
import { Instance } from '../instance/Instance';
|
|
2
|
+
import { CMSSubscriptionVersionEnum } from '../constants';
|
|
3
|
+
import { REST } from '../libs/rest/src';
|
|
4
|
+
import { BaseManager } from './BaseManager';
|
|
5
|
+
import * as globalTypes from '../constants';
|
|
6
|
+
import { CMSServerManager } from './CMSServerManager';
|
|
7
|
+
/**
|
|
8
|
+
* Manages all Sonoran CMS data and methods to interact with the public API.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CMSManager extends BaseManager {
|
|
11
|
+
readonly ready: boolean;
|
|
12
|
+
readonly version: CMSSubscriptionVersionEnum;
|
|
13
|
+
readonly failReason: unknown;
|
|
14
|
+
rest: REST | undefined;
|
|
15
|
+
servers: CMSServerManager | undefined;
|
|
16
|
+
constructor(instance: Instance);
|
|
17
|
+
protected buildManager(instance: Instance): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Verifies the whitelist of a given account with the given parameters to search of said account.
|
|
20
|
+
* @param {Object | string} data The object or [accId | apiId as a string] that contains data to get a community account to verify if it has whitelist to the specified server. *If given as a string it will default to the set or default cms server id (1).
|
|
21
|
+
* @param {string} [data.accId] The account id to find a community account.
|
|
22
|
+
* @param {string} [data.apiId] The api id to find a community account.
|
|
23
|
+
* @param {string} [data.serverId] The username to find a community account.
|
|
24
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
25
|
+
*/
|
|
26
|
+
verifyWhitelist(data: {
|
|
27
|
+
accId?: string;
|
|
28
|
+
apiId?: string;
|
|
29
|
+
serverId?: number;
|
|
30
|
+
} | string): Promise<globalTypes.CMSVerifyWhitelistPromiseResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets a full whitelist allowed list for a specific server.
|
|
33
|
+
* @param {number} serverId (Optional) Server ID to get the whole allow list for, if not specified it will grab the default server ID that is set.
|
|
34
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
35
|
+
*/
|
|
36
|
+
getFullWhitelist(serverId?: number): Promise<globalTypes.CMSGetFullWhitelistPromiseResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Gets a community account by `accId`, `apiId`, or `username`.
|
|
39
|
+
* @param {Object} params The object that contains parameters to get a community account.
|
|
40
|
+
* @param {string} [data.accId] The account id to find a community account.
|
|
41
|
+
* @param {string} [data.apiId] The api id to find a community account.
|
|
42
|
+
* @param {string} [data.username] The username to find a community account.
|
|
43
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
44
|
+
*/
|
|
45
|
+
getComAccount(params: {
|
|
46
|
+
accId?: string;
|
|
47
|
+
apiId?: string;
|
|
48
|
+
username?: string;
|
|
49
|
+
discord?: string;
|
|
50
|
+
}): Promise<globalTypes.CMSGetComAccountPromiseResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Gets a community account by `accId`, `apiId`, or `username`.
|
|
53
|
+
* @param {Object} params The object that contains parameters to get a community account.
|
|
54
|
+
* @param {string} [data.accId] (Optional) The account id to find a community account.
|
|
55
|
+
* @param {string} [data.apiId] (Optional) The api id to find a community account.
|
|
56
|
+
* @param {string} [data.username] (Optional) The username to find a community account.
|
|
57
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the account data object if found.
|
|
58
|
+
*/
|
|
59
|
+
getAccountRanks(params: {
|
|
60
|
+
accId?: string;
|
|
61
|
+
apiId?: string;
|
|
62
|
+
username?: string;
|
|
63
|
+
discord?: string;
|
|
64
|
+
}): Promise<globalTypes.CMSGetAccountRanksPromiseResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Clocks in or out an account by `accId` or `apiId`.
|
|
67
|
+
* @param {Object} data The object that contains critical data to clock in or out an account.
|
|
68
|
+
* @param {string} [data.accId] (Optional) The account id to clock in or out.
|
|
69
|
+
* @param {string} [data.apiId] (Optional) The api id to clock in or out.
|
|
70
|
+
* @param {boolean} [data.forceClockIn] If true, it will override any current clock in with a new clock in at the time of the request.
|
|
71
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
72
|
+
*/
|
|
73
|
+
clockInOut(data: {
|
|
74
|
+
accId?: string;
|
|
75
|
+
apiId?: string;
|
|
76
|
+
forceClockIn?: boolean;
|
|
77
|
+
}): Promise<globalTypes.CMSClockInOutPromiseResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Check if a given [apiId] is attached to any account within the community CMS.
|
|
80
|
+
* @param {string} apiId The api id to check for an account.
|
|
81
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
82
|
+
*/
|
|
83
|
+
checkComApiId(apiId: string): Promise<globalTypes.CMSCheckComApiIdPromiseResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Gets all department information within the community CMS.
|
|
86
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
87
|
+
*/
|
|
88
|
+
getDepartments(): Promise<globalTypes.CMSGetDepartmentsPromiseResult>;
|
|
89
|
+
/**
|
|
90
|
+
* Sets a community account's ranks for the CMS community.
|
|
91
|
+
* @param {string} accountId The object that contains critical data to clock in or out an account.
|
|
92
|
+
* @param {Object} changes The object that contains change data for setting account ranks.
|
|
93
|
+
* @param {Object} [changes.set] (Optional) The object that contains primary and secondary data for setting account ranks.
|
|
94
|
+
* @param {string} [changes.set.primary] (Optional) The primary rank ID wanting to set to the account.
|
|
95
|
+
* @param {string} [changes.set.secondary] (Optional) The secondary rank ID(s) wanting to set to the account.
|
|
96
|
+
* @param {Array} [changes.add] (Optional) The secondary rank IDs wanting to add to the account.
|
|
97
|
+
* @param {Array} [changes.remove] (Optional) The secondary rank IDs wanting to remove to the account.
|
|
98
|
+
* @returns {Promise} Promise object represents if the request was successful with reason for failure if needed.
|
|
99
|
+
*/
|
|
100
|
+
setAccountRanks(accountId: string, changes: globalTypes.CMSSetAccountRanksChangesObject): Promise<globalTypes.CMSSetAccountRanksPromiseResult>;
|
|
101
|
+
}
|