@edgeiq/edgeiq-api-js 1.2.2 → 1.2.5

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.
Files changed (172) hide show
  1. package/README.md +55 -55
  2. package/dist/__tests__/auth.test.d.ts +1 -1
  3. package/dist/__tests__/auth.test.js +143 -143
  4. package/dist/__tests__/command.test.d.ts +1 -0
  5. package/dist/__tests__/command.test.js +201 -0
  6. package/dist/__tests__/companies.test.d.ts +1 -1
  7. package/dist/__tests__/companies.test.js +196 -196
  8. package/dist/__tests__/deviceErrors.test.d.ts +1 -0
  9. package/dist/__tests__/deviceErrors.test.js +72 -0
  10. package/dist/__tests__/deviceTypes.test.d.ts +1 -1
  11. package/dist/__tests__/deviceTypes.test.js +172 -172
  12. package/dist/__tests__/devices.test.d.ts +1 -1
  13. package/dist/__tests__/devices.test.js +204 -204
  14. package/dist/__tests__/discoveredDevice.test.d.ts +1 -1
  15. package/dist/__tests__/discoveredDevice.test.js +126 -126
  16. package/dist/__tests__/ingestors.test.d.ts +1 -1
  17. package/dist/__tests__/ingestors.test.js +172 -172
  18. package/dist/__tests__/integrations.test.d.ts +1 -1
  19. package/dist/__tests__/integrations.test.js +192 -192
  20. package/dist/__tests__/notifications.test.d.ts +1 -1
  21. package/dist/__tests__/notifications.test.js +72 -72
  22. package/dist/__tests__/pollableAttributes.test.d.ts +1 -1
  23. package/dist/__tests__/pollableAttributes.test.js +172 -172
  24. package/dist/__tests__/rules.test.d.ts +1 -1
  25. package/dist/__tests__/rules.test.js +172 -172
  26. package/dist/__tests__/translators.test.d.ts +1 -1
  27. package/dist/__tests__/translators.test.js +172 -172
  28. package/dist/__tests__/users.test.d.ts +1 -1
  29. package/dist/__tests__/users.test.js +208 -208
  30. package/dist/auth/index.d.ts +8 -8
  31. package/dist/auth/index.js +158 -158
  32. package/dist/bulkResponses/index.d.ts +8 -8
  33. package/dist/bulkResponses/index.js +124 -124
  34. package/dist/bulkResponses/models.d.ts +43 -43
  35. package/dist/bulkResponses/models.js +2 -2
  36. package/dist/commands/index.d.ts +13 -9
  37. package/dist/commands/index.js +344 -224
  38. package/dist/commands/models.d.ts +38 -28
  39. package/dist/commands/models.js +15 -2
  40. package/dist/companies/index.d.ts +7 -7
  41. package/dist/companies/index.js +198 -198
  42. package/dist/companies/models.d.ts +94 -94
  43. package/dist/companies/models.js +2 -2
  44. package/dist/constants.d.ts +135 -132
  45. package/dist/constants.js +151 -148
  46. package/dist/core/ModelClass.d.ts +13 -13
  47. package/dist/core/ModelClass.js +19 -19
  48. package/dist/core/handleResponseError.d.ts +2 -2
  49. package/dist/core/handleResponseError.js +167 -167
  50. package/dist/core/index.d.ts +19 -19
  51. package/dist/core/index.js +63 -63
  52. package/dist/deviceConfigs/index.d.ts +9 -9
  53. package/dist/deviceConfigs/index.js +224 -224
  54. package/dist/deviceConfigs/models.d.ts +38 -38
  55. package/dist/deviceConfigs/models.js +2 -2
  56. package/dist/deviceErrors/index.d.ts +8 -0
  57. package/dist/deviceErrors/index.js +124 -0
  58. package/dist/deviceErrors/models.d.ts +19 -0
  59. package/dist/deviceErrors/models.js +2 -0
  60. package/dist/deviceLocationObservations/index.d.ts +5 -5
  61. package/dist/deviceLocationObservations/index.js +189 -189
  62. package/dist/deviceLocationObservations/models.d.ts +26 -26
  63. package/dist/deviceLocationObservations/models.js +2 -2
  64. package/dist/deviceTemplates/index.d.ts +9 -9
  65. package/dist/deviceTemplates/index.js +226 -226
  66. package/dist/deviceTemplates/models.d.ts +36 -36
  67. package/dist/deviceTemplates/models.js +2 -2
  68. package/dist/deviceTransferRequests/index.d.ts +7 -7
  69. package/dist/deviceTransferRequests/index.js +198 -198
  70. package/dist/deviceTransferRequests/models.d.ts +26 -26
  71. package/dist/deviceTransferRequests/models.js +2 -2
  72. package/dist/deviceTypes/index.d.ts +20 -19
  73. package/dist/deviceTypes/index.js +464 -440
  74. package/dist/deviceTypes/models.d.ts +104 -104
  75. package/dist/deviceTypes/models.js +2 -2
  76. package/dist/devices/index.d.ts +21 -20
  77. package/dist/devices/index.js +511 -487
  78. package/dist/devices/models.d.ts +114 -114
  79. package/dist/devices/models.js +2 -2
  80. package/dist/discoveredDevices/index.d.ts +14 -14
  81. package/dist/discoveredDevices/index.js +335 -335
  82. package/dist/discoveredDevices/models.d.ts +41 -41
  83. package/dist/discoveredDevices/models.js +2 -2
  84. package/dist/downstreamSystems/index.d.ts +7 -7
  85. package/dist/downstreamSystems/index.js +198 -198
  86. package/dist/downstreamSystems/models.d.ts +17 -17
  87. package/dist/downstreamSystems/models.js +2 -2
  88. package/dist/escrowDevices/index.d.ts +9 -9
  89. package/dist/escrowDevices/index.js +224 -224
  90. package/dist/escrowDevices/models.d.ts +21 -21
  91. package/dist/escrowDevices/models.js +2 -2
  92. package/dist/filtersParser.d.ts +5 -5
  93. package/dist/filtersParser.js +52 -52
  94. package/dist/gatewayCommands/index.d.ts +10 -10
  95. package/dist/gatewayCommands/index.js +261 -261
  96. package/dist/gatewayCommands/models.d.ts +41 -41
  97. package/dist/gatewayCommands/models.js +2 -2
  98. package/dist/helpers.d.ts +3 -3
  99. package/dist/helpers.js +11 -11
  100. package/dist/index.d.ts +61 -58
  101. package/dist/index.js +105 -101
  102. package/dist/ingestors/index.d.ts +9 -9
  103. package/dist/ingestors/index.js +224 -224
  104. package/dist/ingestors/models.d.ts +37 -37
  105. package/dist/ingestors/models.js +2 -2
  106. package/dist/integrations/index.d.ts +9 -9
  107. package/dist/integrations/index.js +306 -306
  108. package/dist/integrations/models.d.ts +61 -61
  109. package/dist/integrations/models.js +2 -2
  110. package/dist/models/index.d.ts +1893 -1893
  111. package/dist/models/index.js +2 -2
  112. package/dist/models.d.ts +67 -67
  113. package/dist/models.js +2 -2
  114. package/dist/notifications/index.d.ts +8 -8
  115. package/dist/notifications/index.js +124 -124
  116. package/dist/notifications/models.d.ts +19 -19
  117. package/dist/notifications/models.js +2 -2
  118. package/dist/pollableAttributes/index.d.ts +7 -7
  119. package/dist/pollableAttributes/index.js +198 -198
  120. package/dist/pollableAttributes/models.d.ts +28 -28
  121. package/dist/pollableAttributes/models.js +2 -2
  122. package/dist/regions/index.d.ts +5 -5
  123. package/dist/regions/index.js +173 -173
  124. package/dist/regions/models.d.ts +17 -17
  125. package/dist/regions/models.js +2 -2
  126. package/dist/reports/index.d.ts +8 -8
  127. package/dist/reports/index.js +199 -199
  128. package/dist/reports/models.d.ts +25 -25
  129. package/dist/reports/models.js +2 -2
  130. package/dist/rules/index.d.ts +9 -9
  131. package/dist/rules/index.js +224 -224
  132. package/dist/rules/models.d.ts +108 -108
  133. package/dist/rules/models.js +2 -2
  134. package/dist/secrets/index.d.ts +5 -5
  135. package/dist/secrets/index.js +173 -173
  136. package/dist/secrets/models.d.ts +16 -16
  137. package/dist/secrets/models.js +2 -2
  138. package/dist/softwareUpdates/index.d.ts +9 -9
  139. package/dist/softwareUpdates/index.js +224 -224
  140. package/dist/softwareUpdates/models.d.ts +22 -22
  141. package/dist/softwareUpdates/models.js +2 -2
  142. package/dist/stats/index.d.ts +9 -8
  143. package/dist/stats/index.js +140 -116
  144. package/dist/stats/models.d.ts +27 -27
  145. package/dist/stats/models.js +2 -2
  146. package/dist/systemCommandJobs/index.d.ts +5 -5
  147. package/dist/systemCommandJobs/index.js +173 -173
  148. package/dist/systemCommandJobs/models.d.ts +32 -32
  149. package/dist/systemCommandJobs/models.js +2 -2
  150. package/dist/systemCommands/index.d.ts +7 -7
  151. package/dist/systemCommands/index.js +198 -198
  152. package/dist/systemCommands/models.d.ts +32 -32
  153. package/dist/systemCommands/models.js +2 -2
  154. package/dist/testConstants.d.ts +47 -46
  155. package/dist/testConstants.js +229 -221
  156. package/dist/translators/index.d.ts +9 -9
  157. package/dist/translators/index.js +224 -224
  158. package/dist/translators/models.d.ts +21 -21
  159. package/dist/translators/models.js +2 -2
  160. package/dist/userTypes/index.d.ts +7 -7
  161. package/dist/userTypes/index.js +198 -198
  162. package/dist/userTypes/models.d.ts +79 -79
  163. package/dist/userTypes/models.js +2 -2
  164. package/dist/users/index.d.ts +12 -12
  165. package/dist/users/index.js +300 -300
  166. package/dist/users/models.d.ts +41 -41
  167. package/dist/users/models.js +2 -2
  168. package/package.json +56 -56
  169. package/dist/__tests__/testConstants.d.ts +0 -7
  170. package/dist/__tests__/testConstants.js +0 -14
  171. package/dist/example/index.d.ts +0 -1
  172. package/dist/example/index.js +0 -5
@@ -1,132 +1,135 @@
1
- export declare const defaultBaseUrl = "https://api.edgeiq.io/api/v1/platform/";
2
- export declare const Errors: {
3
- noInstance: string;
4
- instanceInitiated: string;
5
- };
6
- export declare const ResponseErrorsNames: {
7
- disconnected: string;
8
- unauthorized: string;
9
- timeout: string;
10
- credentials: string;
11
- issueCommand: string;
12
- csvUpload: string;
13
- fileUpload: string;
14
- duplicatedDevice: string;
15
- deviceCharacters: string;
16
- duplicateKey: string;
17
- uniqueConstraint: string;
18
- deviceConfig: string;
19
- unEditableIntegration: string;
20
- integrationMissinValues: string;
21
- createError: string;
22
- unexpected: string;
23
- deviceLocationMissingValues: string;
24
- };
25
- export declare const ResponseErrorsMessages: {
26
- disconnected: string;
27
- unauthorized: string;
28
- timeout: string;
29
- credentials: string;
30
- noUser: string;
31
- invalidPassword: string;
32
- token: string;
33
- notFound: string;
34
- issueCommand: string;
35
- csvUpload: string;
36
- fileUpload: string;
37
- deviceId: (unique_id: string) => string;
38
- deviceCharacters: string;
39
- emailUsed: (email: string) => string;
40
- uniqueConstraint: (model: string) => string;
41
- unEditableIntegration: (type: string) => string;
42
- integrationMissinValues: (type: string, values: string[]) => string;
43
- unexpected: string;
44
- invalidTokenExpiration: string;
45
- };
46
- export declare const ErrorParts: {
47
- deviceExists: string;
48
- uniqueIdError: string;
49
- duplicateKey: string;
50
- uniqueConstraint: string;
51
- };
52
- export declare const getAttachMessage: (model: string, action: string, baseModel: string) => string;
53
- export declare const BaseEndpoints: {
54
- auth: string;
55
- bulkResponse: string;
56
- notification: string;
57
- command: string;
58
- company: string;
59
- deviceConfig: string;
60
- deviceTransferRequest: string;
61
- deviceTemplate: string;
62
- deviceType: string;
63
- device: string;
64
- deviceLocationObservation: string;
65
- discoveredDevice: string;
66
- downstreamSystem: string;
67
- escrowDevice: string;
68
- file: string;
69
- gatewayCommand: string;
70
- gatewayCsvUpload: string;
71
- ingestor: string;
72
- integration: string;
73
- pollableAttribute: string;
74
- region: string;
75
- report: string;
76
- rule: string;
77
- secret: string;
78
- softwareUpdate: string;
79
- stats: string;
80
- systemCommand: string;
81
- systemCommandJob: string;
82
- translator: string;
83
- userType: string;
84
- user: string;
85
- };
86
- export declare const Endpoints: {
87
- me: string;
88
- login: string;
89
- apiTokenReset: string;
90
- passwordResetRequest: string;
91
- passwordReset: string;
92
- bulkResponse: string;
93
- notification: string;
94
- command: string;
95
- company: string;
96
- deviceConfig: string;
97
- deviceTransferRequest: string;
98
- deviceTemplate: string;
99
- deviceType: string;
100
- device: string;
101
- deviceLocationObservation: string;
102
- downstreamSystem: string;
103
- discoveredDevice: string;
104
- escrowDevice: string;
105
- gatewayCommand: string;
106
- ingestor: string;
107
- integration: string;
108
- pollableAttribute: string;
109
- region: string;
110
- report: string;
111
- rule: string;
112
- secret: string;
113
- softwareUpdate: string;
114
- statsDevicesByHeartbeat: string;
115
- statsDevicesByType: string;
116
- statsCellUsage: string;
117
- systemCommand: string;
118
- systemCommandJob: string;
119
- translator: string;
120
- userType: string;
121
- user: string;
122
- };
123
- export declare const MethodsActions: {
124
- post: string;
125
- put: string;
126
- delete: string;
127
- get: string;
128
- };
129
- export declare const DefaultPagination: {
130
- page: number;
131
- itemsPerPage: number;
132
- };
1
+ export declare const defaultBaseUrl = "https://api.edgeiq.io/api/v1/platform/";
2
+ export declare const Errors: {
3
+ noInstance: string;
4
+ instanceInitiated: string;
5
+ };
6
+ export declare const ResponseErrorsNames: {
7
+ disconnected: string;
8
+ unauthorized: string;
9
+ timeout: string;
10
+ credentials: string;
11
+ issueCommand: string;
12
+ csvUpload: string;
13
+ fileUpload: string;
14
+ duplicatedDevice: string;
15
+ deviceCharacters: string;
16
+ duplicateKey: string;
17
+ uniqueConstraint: string;
18
+ deviceConfig: string;
19
+ unEditableIntegration: string;
20
+ integrationMissinValues: string;
21
+ createError: string;
22
+ unexpected: string;
23
+ deviceLocationMissingValues: string;
24
+ };
25
+ export declare const ResponseErrorsMessages: {
26
+ disconnected: string;
27
+ unauthorized: string;
28
+ timeout: string;
29
+ credentials: string;
30
+ noUser: string;
31
+ invalidPassword: string;
32
+ token: string;
33
+ notFound: string;
34
+ issueCommand: string;
35
+ csvUpload: string;
36
+ fileUpload: string;
37
+ deviceId: (unique_id: string) => string;
38
+ deviceCharacters: string;
39
+ emailUsed: (email: string) => string;
40
+ uniqueConstraint: (model: string) => string;
41
+ unEditableIntegration: (type: string) => string;
42
+ integrationMissinValues: (type: string, values: string[]) => string;
43
+ unexpected: string;
44
+ invalidTokenExpiration: string;
45
+ };
46
+ export declare const ErrorParts: {
47
+ deviceExists: string;
48
+ uniqueIdError: string;
49
+ duplicateKey: string;
50
+ uniqueConstraint: string;
51
+ };
52
+ export declare const getAttachMessage: (model: string, action: string, baseModel: string) => string;
53
+ export declare const BaseEndpoints: {
54
+ auth: string;
55
+ bulkResponse: string;
56
+ notification: string;
57
+ command: string;
58
+ company: string;
59
+ deviceConfig: string;
60
+ deviceError: string;
61
+ deviceTransferRequest: string;
62
+ deviceTemplate: string;
63
+ deviceType: string;
64
+ device: string;
65
+ deviceLocationObservation: string;
66
+ discoveredDevice: string;
67
+ downstreamSystem: string;
68
+ escrowDevice: string;
69
+ file: string;
70
+ gatewayCommand: string;
71
+ gatewayCsvUpload: string;
72
+ ingestor: string;
73
+ integration: string;
74
+ pollableAttribute: string;
75
+ region: string;
76
+ report: string;
77
+ rule: string;
78
+ secret: string;
79
+ softwareUpdate: string;
80
+ stats: string;
81
+ systemCommand: string;
82
+ systemCommandJob: string;
83
+ translator: string;
84
+ userType: string;
85
+ user: string;
86
+ };
87
+ export declare const Endpoints: {
88
+ me: string;
89
+ login: string;
90
+ apiTokenReset: string;
91
+ passwordResetRequest: string;
92
+ passwordReset: string;
93
+ bulkResponse: string;
94
+ notification: string;
95
+ command: string;
96
+ company: string;
97
+ deviceConfig: string;
98
+ deviceError: string;
99
+ deviceTransferRequest: string;
100
+ deviceTemplate: string;
101
+ deviceType: string;
102
+ device: string;
103
+ deviceLocationObservation: string;
104
+ downstreamSystem: string;
105
+ discoveredDevice: string;
106
+ escrowDevice: string;
107
+ gatewayCommand: string;
108
+ ingestor: string;
109
+ integration: string;
110
+ pollableAttribute: string;
111
+ region: string;
112
+ report: string;
113
+ rule: string;
114
+ secret: string;
115
+ softwareUpdate: string;
116
+ statsDevicesByHeartbeat: string;
117
+ statsDiscoveredDevicesByHeartbeat: string;
118
+ statsDevicesByType: string;
119
+ statsCellUsage: string;
120
+ systemCommand: string;
121
+ systemCommandJob: string;
122
+ translator: string;
123
+ userType: string;
124
+ user: string;
125
+ };
126
+ export declare const MethodsActions: {
127
+ post: string;
128
+ put: string;
129
+ delete: string;
130
+ get: string;
131
+ };
132
+ export declare const DefaultPagination: {
133
+ page: number;
134
+ itemsPerPage: number;
135
+ };
package/dist/constants.js CHANGED
@@ -1,148 +1,151 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultPagination = exports.MethodsActions = exports.Endpoints = exports.BaseEndpoints = exports.getAttachMessage = exports.ErrorParts = exports.ResponseErrorsMessages = exports.ResponseErrorsNames = exports.Errors = exports.defaultBaseUrl = void 0;
4
- exports.defaultBaseUrl = 'https://api.edgeiq.io/api/v1/platform/';
5
- exports.Errors = {
6
- noInstance: 'Use EdgeIQAPI.init() instead',
7
- instanceInitiated: 'Instantiation failed: EdgeIQAPI has already been initiated.',
8
- };
9
- exports.ResponseErrorsNames = {
10
- disconnected: 'No connection error',
11
- unauthorized: 'Unauthorization error',
12
- timeout: 'Timeout error',
13
- credentials: 'Credentials error',
14
- issueCommand: 'Issue command error',
15
- csvUpload: 'CSV upload error',
16
- fileUpload: 'File upload error',
17
- duplicatedDevice: 'Duplicated device unique id',
18
- deviceCharacters: 'Invalid unique id characters',
19
- duplicateKey: 'Duplicate key error',
20
- uniqueConstraint: 'Unique constraint error',
21
- deviceConfig: 'Device config error',
22
- unEditableIntegration: 'Uneditable Integration type',
23
- integrationMissinValues: 'Integration missing required values',
24
- createError: 'Unable to create resource',
25
- unexpected: 'Unexpected error',
26
- deviceLocationMissingValues: 'Device location observation missing required values',
27
- };
28
- exports.ResponseErrorsMessages = {
29
- disconnected: 'Please check your internet connection. If your internet appear to be fine, our services may be undergoing maintenance. Please try again in a few minutes.',
30
- unauthorized: 'You are not authorized to perform this action. Logging you out. Login to refresh your session permissions.',
31
- timeout: 'Your session has expired. Please login to resume your session.',
32
- credentials: 'There was a problem checking these credentials. Please try again.',
33
- noUser: 'That username wasn’t found in the system.',
34
- invalidPassword: 'Invalid password',
35
- token: 'Invalid token.',
36
- notFound: 'not found',
37
- issueCommand: 'There was an error issuing this command. Please try again.',
38
- csvUpload: 'There was an error performing this CSV operation. Please try again.',
39
- fileUpload: 'There was an error uploading files for this software package. Please try again.',
40
- deviceId: function (unique_id) {
41
- return "A Device with unique id '" + unique_id + "' already exists";
42
- },
43
- deviceCharacters: 'A unique ID can only contain lower case letters, numbers or special characters -, : or _',
44
- emailUsed: function (email) {
45
- return "A user with email '" + email + "' already exists";
46
- },
47
- uniqueConstraint: function (model) {
48
- return "A " + model + " with the same key already exists";
49
- },
50
- unEditableIntegration: function (type) {
51
- return "Intregration of type " + type + " cannot be edited";
52
- },
53
- integrationMissinValues: function (type, values) {
54
- return "The " + (values.length === 1 ? 'value' : 'values') + " " + values.join(', ') + " " + (values.length === 1 ? 'is' : 'are') + " required for integration of type: " + type;
55
- },
56
- unexpected: 'Unexpected error has ocurred',
57
- invalidTokenExpiration: 'Invalid session token expiration. Session token expiration must be greater than 0 and less than one week.',
58
- };
59
- exports.ErrorParts = {
60
- deviceExists: 'A Device with unique id',
61
- uniqueIdError: "\"unique_id\" can only contain lower case letters, numbers or the special charaters \"-\", \":\", or \"_\"",
62
- duplicateKey: 'duplicate key error collection',
63
- uniqueConstraint: 'duplicate key value violates unique constraint',
64
- };
65
- var getAttachMessage = function (model, action, baseModel) {
66
- return model + " " + (action === 'attach' ? 'attached to' : 'detached from') + " " + baseModel;
67
- };
68
- exports.getAttachMessage = getAttachMessage;
69
- exports.BaseEndpoints = {
70
- auth: 'user',
71
- bulkResponse: 'bulk_responses',
72
- notification: 'notifications',
73
- command: 'commands',
74
- company: 'companies',
75
- deviceConfig: 'device_configs',
76
- deviceTransferRequest: 'device_transfer_requests',
77
- deviceTemplate: 'device_templates',
78
- deviceType: 'device_types',
79
- device: 'devices',
80
- deviceLocationObservation: 'device_location_observations',
81
- discoveredDevice: 'discovered_devices',
82
- downstreamSystem: 'downstream_systems',
83
- escrowDevice: 'escrow_devices',
84
- file: 'files',
85
- gatewayCommand: 'gateway_commands',
86
- gatewayCsvUpload: 'gateway_csv_upload',
87
- ingestor: 'ingestors',
88
- integration: 'integrations',
89
- pollableAttribute: 'pollable_attributes',
90
- region: 'regions',
91
- report: 'reports',
92
- rule: 'rules',
93
- secret: 'secrets',
94
- softwareUpdate: 'software_updates',
95
- stats: 'stats',
96
- systemCommand: 'system_commands',
97
- systemCommandJob: 'system_command_jobs',
98
- translator: 'translators',
99
- userType: 'user_types',
100
- user: 'users',
101
- };
102
- exports.Endpoints = {
103
- me: 'me',
104
- login: exports.BaseEndpoints.auth + "/authenticate",
105
- apiTokenReset: exports.BaseEndpoints.auth + "/api_token_reset",
106
- passwordResetRequest: exports.BaseEndpoints.auth + "/password_reset_request",
107
- passwordReset: exports.BaseEndpoints.auth + "/password_reset",
108
- bulkResponse: "" + exports.BaseEndpoints.bulkResponse,
109
- notification: "" + exports.BaseEndpoints.notification,
110
- command: "" + exports.BaseEndpoints.command,
111
- company: "" + exports.BaseEndpoints.company,
112
- deviceConfig: "" + exports.BaseEndpoints.deviceConfig,
113
- deviceTransferRequest: "" + exports.BaseEndpoints.deviceTransferRequest,
114
- deviceTemplate: "" + exports.BaseEndpoints.deviceTemplate,
115
- deviceType: "" + exports.BaseEndpoints.deviceType,
116
- device: "" + exports.BaseEndpoints.device,
117
- deviceLocationObservation: "" + exports.BaseEndpoints.deviceLocationObservation,
118
- downstreamSystem: "" + exports.BaseEndpoints.downstreamSystem,
119
- discoveredDevice: "" + exports.BaseEndpoints.discoveredDevice,
120
- escrowDevice: "" + exports.BaseEndpoints.escrowDevice,
121
- gatewayCommand: "" + exports.BaseEndpoints.gatewayCommand,
122
- ingestor: "" + exports.BaseEndpoints.ingestor,
123
- integration: "" + exports.BaseEndpoints.integration,
124
- pollableAttribute: "" + exports.BaseEndpoints.pollableAttribute,
125
- region: "" + exports.BaseEndpoints.region,
126
- report: "" + exports.BaseEndpoints.report,
127
- rule: "" + exports.BaseEndpoints.rule,
128
- secret: "" + exports.BaseEndpoints.secret,
129
- softwareUpdate: "" + exports.BaseEndpoints.softwareUpdate,
130
- statsDevicesByHeartbeat: exports.BaseEndpoints.stats + "/devices/count_by_heartbeat_status",
131
- statsDevicesByType: exports.BaseEndpoints.stats + "/devices/count_by_type",
132
- statsCellUsage: exports.BaseEndpoints.stats + "/cumulative_cell_usage",
133
- systemCommand: "" + exports.BaseEndpoints.systemCommand,
134
- systemCommandJob: "" + exports.BaseEndpoints.systemCommandJob,
135
- translator: "" + exports.BaseEndpoints.translator,
136
- userType: "" + exports.BaseEndpoints.userType,
137
- user: "" + exports.BaseEndpoints.user,
138
- };
139
- exports.MethodsActions = {
140
- post: 'creating',
141
- put: 'updating',
142
- delete: 'deleting',
143
- get: 'loading',
144
- };
145
- exports.DefaultPagination = {
146
- page: 1,
147
- itemsPerPage: 12,
148
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultPagination = exports.MethodsActions = exports.Endpoints = exports.BaseEndpoints = exports.getAttachMessage = exports.ErrorParts = exports.ResponseErrorsMessages = exports.ResponseErrorsNames = exports.Errors = exports.defaultBaseUrl = void 0;
4
+ exports.defaultBaseUrl = 'https://api.edgeiq.io/api/v1/platform/';
5
+ exports.Errors = {
6
+ noInstance: 'Use EdgeIQAPI.init() instead',
7
+ instanceInitiated: 'Instantiation failed: EdgeIQAPI has already been initiated.',
8
+ };
9
+ exports.ResponseErrorsNames = {
10
+ disconnected: 'No connection error',
11
+ unauthorized: 'Unauthorization error',
12
+ timeout: 'Timeout error',
13
+ credentials: 'Credentials error',
14
+ issueCommand: 'Issue command error',
15
+ csvUpload: 'CSV upload error',
16
+ fileUpload: 'File upload error',
17
+ duplicatedDevice: 'Duplicated device unique id',
18
+ deviceCharacters: 'Invalid unique id characters',
19
+ duplicateKey: 'Duplicate key error',
20
+ uniqueConstraint: 'Unique constraint error',
21
+ deviceConfig: 'Device config error',
22
+ unEditableIntegration: 'Uneditable Integration type',
23
+ integrationMissinValues: 'Integration missing required values',
24
+ createError: 'Unable to create resource',
25
+ unexpected: 'Unexpected error',
26
+ deviceLocationMissingValues: 'Device location observation missing required values',
27
+ };
28
+ exports.ResponseErrorsMessages = {
29
+ disconnected: 'Please check your internet connection. If your internet appear to be fine, our services may be undergoing maintenance. Please try again in a few minutes.',
30
+ unauthorized: 'You are not authorized to perform this action. Logging you out. Login to refresh your session permissions.',
31
+ timeout: 'Your session has expired. Please login to resume your session.',
32
+ credentials: 'There was a problem checking these credentials. Please try again.',
33
+ noUser: 'That username wasn’t found in the system.',
34
+ invalidPassword: 'Invalid password',
35
+ token: 'Invalid token.',
36
+ notFound: 'not found',
37
+ issueCommand: 'There was an error issuing this command. Please try again.',
38
+ csvUpload: 'There was an error performing this CSV operation. Please try again.',
39
+ fileUpload: 'There was an error uploading files for this software package. Please try again.',
40
+ deviceId: function (unique_id) {
41
+ return "A Device with unique id '" + unique_id + "' already exists";
42
+ },
43
+ deviceCharacters: 'A unique ID can only contain lower case letters, numbers or special characters -, : or _',
44
+ emailUsed: function (email) {
45
+ return "A user with email '" + email + "' already exists";
46
+ },
47
+ uniqueConstraint: function (model) {
48
+ return "A " + model + " with the same key already exists";
49
+ },
50
+ unEditableIntegration: function (type) {
51
+ return "Intregration of type " + type + " cannot be edited";
52
+ },
53
+ integrationMissinValues: function (type, values) {
54
+ return "The " + (values.length === 1 ? 'value' : 'values') + " " + values.join(', ') + " " + (values.length === 1 ? 'is' : 'are') + " required for integration of type: " + type;
55
+ },
56
+ unexpected: 'Unexpected error has ocurred',
57
+ invalidTokenExpiration: 'Invalid session token expiration. Session token expiration must be greater than 0 and less than one week.',
58
+ };
59
+ exports.ErrorParts = {
60
+ deviceExists: 'A Device with unique id',
61
+ uniqueIdError: "\"unique_id\" can only contain lower case letters, numbers or the special charaters \"-\", \":\", or \"_\"",
62
+ duplicateKey: 'duplicate key error collection',
63
+ uniqueConstraint: 'duplicate key value violates unique constraint',
64
+ };
65
+ var getAttachMessage = function (model, action, baseModel) {
66
+ return model + " " + (action === 'attach' ? 'attached to' : 'detached from') + " " + baseModel;
67
+ };
68
+ exports.getAttachMessage = getAttachMessage;
69
+ exports.BaseEndpoints = {
70
+ auth: 'user',
71
+ bulkResponse: 'bulk_responses',
72
+ notification: 'notifications',
73
+ command: 'commands',
74
+ company: 'companies',
75
+ deviceConfig: 'device_configs',
76
+ deviceError: 'device_errors',
77
+ deviceTransferRequest: 'device_transfer_requests',
78
+ deviceTemplate: 'device_templates',
79
+ deviceType: 'device_types',
80
+ device: 'devices',
81
+ deviceLocationObservation: 'device_location_observations',
82
+ discoveredDevice: 'discovered_devices',
83
+ downstreamSystem: 'downstream_systems',
84
+ escrowDevice: 'escrow_devices',
85
+ file: 'files',
86
+ gatewayCommand: 'gateway_commands',
87
+ gatewayCsvUpload: 'gateway_csv_upload',
88
+ ingestor: 'ingestors',
89
+ integration: 'integrations',
90
+ pollableAttribute: 'pollable_attributes',
91
+ region: 'regions',
92
+ report: 'reports',
93
+ rule: 'rules',
94
+ secret: 'secrets',
95
+ softwareUpdate: 'software_updates',
96
+ stats: 'stats',
97
+ systemCommand: 'system_commands',
98
+ systemCommandJob: 'system_command_jobs',
99
+ translator: 'translators',
100
+ userType: 'user_types',
101
+ user: 'users',
102
+ };
103
+ exports.Endpoints = {
104
+ me: 'me',
105
+ login: exports.BaseEndpoints.auth + "/authenticate",
106
+ apiTokenReset: exports.BaseEndpoints.auth + "/api_token_reset",
107
+ passwordResetRequest: exports.BaseEndpoints.auth + "/password_reset_request",
108
+ passwordReset: exports.BaseEndpoints.auth + "/password_reset",
109
+ bulkResponse: "" + exports.BaseEndpoints.bulkResponse,
110
+ notification: "" + exports.BaseEndpoints.notification,
111
+ command: "" + exports.BaseEndpoints.command,
112
+ company: "" + exports.BaseEndpoints.company,
113
+ deviceConfig: "" + exports.BaseEndpoints.deviceConfig,
114
+ deviceError: "" + exports.BaseEndpoints.deviceError,
115
+ deviceTransferRequest: "" + exports.BaseEndpoints.deviceTransferRequest,
116
+ deviceTemplate: "" + exports.BaseEndpoints.deviceTemplate,
117
+ deviceType: "" + exports.BaseEndpoints.deviceType,
118
+ device: "" + exports.BaseEndpoints.device,
119
+ deviceLocationObservation: "" + exports.BaseEndpoints.deviceLocationObservation,
120
+ downstreamSystem: "" + exports.BaseEndpoints.downstreamSystem,
121
+ discoveredDevice: "" + exports.BaseEndpoints.discoveredDevice,
122
+ escrowDevice: "" + exports.BaseEndpoints.escrowDevice,
123
+ gatewayCommand: "" + exports.BaseEndpoints.gatewayCommand,
124
+ ingestor: "" + exports.BaseEndpoints.ingestor,
125
+ integration: "" + exports.BaseEndpoints.integration,
126
+ pollableAttribute: "" + exports.BaseEndpoints.pollableAttribute,
127
+ region: "" + exports.BaseEndpoints.region,
128
+ report: "" + exports.BaseEndpoints.report,
129
+ rule: "" + exports.BaseEndpoints.rule,
130
+ secret: "" + exports.BaseEndpoints.secret,
131
+ softwareUpdate: "" + exports.BaseEndpoints.softwareUpdate,
132
+ statsDevicesByHeartbeat: exports.BaseEndpoints.stats + "/devices/count_by_heartbeat_status",
133
+ statsDiscoveredDevicesByHeartbeat: exports.BaseEndpoints.stats + "/discovered_devices/count_by_heartbeat_status",
134
+ statsDevicesByType: exports.BaseEndpoints.stats + "/devices/count_by_type",
135
+ statsCellUsage: exports.BaseEndpoints.stats + "/cumulative_cell_usage",
136
+ systemCommand: "" + exports.BaseEndpoints.systemCommand,
137
+ systemCommandJob: "" + exports.BaseEndpoints.systemCommandJob,
138
+ translator: "" + exports.BaseEndpoints.translator,
139
+ userType: "" + exports.BaseEndpoints.userType,
140
+ user: "" + exports.BaseEndpoints.user,
141
+ };
142
+ exports.MethodsActions = {
143
+ post: 'creating',
144
+ put: 'updating',
145
+ delete: 'deleting',
146
+ get: 'loading',
147
+ };
148
+ exports.DefaultPagination = {
149
+ page: 1,
150
+ itemsPerPage: 12,
151
+ };
@@ -1,13 +1,13 @@
1
- import { AxiosInstance } from 'axios';
2
- import { PaginationFilter } from '../models';
3
- export interface BaseModelInterface<TClass, TClassInput, TFilters, TPaginatedClass> {
4
- create(item: TClassInput): Promise<TClass>;
5
- list(filters?: TFilters, pagination?: PaginationFilter): Promise<TPaginatedClass>;
6
- getOneById(id: string): Promise<TClass>;
7
- delete(id: string): Promise<string>;
8
- }
9
- export declare abstract class BaseModelClass {
10
- static getAxios(): AxiosInstance;
11
- static logAction(message: string): void;
12
- static logError(error: string): void;
13
- }
1
+ import { AxiosInstance } from 'axios';
2
+ import { PaginationFilter } from '../models';
3
+ export interface BaseModelInterface<TClass, TClassInput, TFilters, TPaginatedClass> {
4
+ create(item: TClassInput): Promise<TClass>;
5
+ list(filters?: TFilters, pagination?: PaginationFilter): Promise<TPaginatedClass>;
6
+ getOneById(id: string): Promise<TClass>;
7
+ delete(id: string): Promise<string>;
8
+ }
9
+ export declare abstract class BaseModelClass {
10
+ static getAxios(): AxiosInstance;
11
+ static logAction(message: string): void;
12
+ static logError(error: string): void;
13
+ }
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseModelClass = void 0;
4
- var _1 = require(".");
5
- var BaseModelClass = (function () {
6
- function BaseModelClass() {
7
- }
8
- BaseModelClass.getAxios = function () {
9
- return _1.EdgeIQAPI.getAxios();
10
- };
11
- BaseModelClass.logAction = function (message) {
12
- _1.EdgeIQAPI.logAction(message);
13
- };
14
- BaseModelClass.logError = function (error) {
15
- _1.EdgeIQAPI.logError(error);
16
- };
17
- return BaseModelClass;
18
- }());
19
- exports.BaseModelClass = BaseModelClass;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseModelClass = void 0;
4
+ var _1 = require(".");
5
+ var BaseModelClass = (function () {
6
+ function BaseModelClass() {
7
+ }
8
+ BaseModelClass.getAxios = function () {
9
+ return _1.EdgeIQAPI.getAxios();
10
+ };
11
+ BaseModelClass.logAction = function (message) {
12
+ _1.EdgeIQAPI.logAction(message);
13
+ };
14
+ BaseModelClass.logError = function (error) {
15
+ _1.EdgeIQAPI.logError(error);
16
+ };
17
+ return BaseModelClass;
18
+ }());
19
+ exports.BaseModelClass = BaseModelClass;
@@ -1,2 +1,2 @@
1
- import { AxiosError } from 'axios';
2
- export declare const handleResponseError: (error: AxiosError) => Promise<string>;
1
+ import { AxiosError } from 'axios';
2
+ export declare const handleResponseError: (error: AxiosError) => Promise<string>;