@edgeiq/edgeiq-api-js 1.2.0 → 1.2.1

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 (164) 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__/companies.test.d.ts +1 -1
  5. package/dist/__tests__/companies.test.js +196 -196
  6. package/dist/__tests__/deviceTypes.test.d.ts +1 -1
  7. package/dist/__tests__/deviceTypes.test.js +172 -172
  8. package/dist/__tests__/devices.test.d.ts +1 -1
  9. package/dist/__tests__/devices.test.js +204 -204
  10. package/dist/__tests__/discoveredDevice.test.d.ts +1 -1
  11. package/dist/__tests__/discoveredDevice.test.js +126 -126
  12. package/dist/__tests__/ingestors.test.d.ts +1 -1
  13. package/dist/__tests__/ingestors.test.js +172 -172
  14. package/dist/__tests__/integrations.test.d.ts +1 -1
  15. package/dist/__tests__/integrations.test.js +192 -192
  16. package/dist/__tests__/notifications.test.d.ts +1 -0
  17. package/dist/__tests__/notifications.test.js +72 -0
  18. package/dist/__tests__/pollableAttributes.test.d.ts +1 -1
  19. package/dist/__tests__/pollableAttributes.test.js +172 -172
  20. package/dist/__tests__/rules.test.d.ts +1 -1
  21. package/dist/__tests__/rules.test.js +172 -172
  22. package/dist/__tests__/testConstants.d.ts +7 -0
  23. package/dist/__tests__/testConstants.js +14 -0
  24. package/dist/__tests__/translators.test.d.ts +1 -1
  25. package/dist/__tests__/translators.test.js +172 -172
  26. package/dist/__tests__/users.test.d.ts +1 -1
  27. package/dist/__tests__/users.test.js +208 -208
  28. package/dist/auth/index.d.ts +8 -8
  29. package/dist/auth/index.js +158 -158
  30. package/dist/bulkResponses/index.d.ts +8 -8
  31. package/dist/bulkResponses/index.js +124 -124
  32. package/dist/bulkResponses/models.d.ts +43 -43
  33. package/dist/bulkResponses/models.js +2 -2
  34. package/dist/commands/index.d.ts +9 -9
  35. package/dist/commands/index.js +224 -224
  36. package/dist/commands/models.d.ts +28 -28
  37. package/dist/commands/models.js +2 -2
  38. package/dist/companies/index.d.ts +7 -7
  39. package/dist/companies/index.js +198 -198
  40. package/dist/companies/models.d.ts +94 -94
  41. package/dist/companies/models.js +2 -2
  42. package/dist/constants.d.ts +132 -130
  43. package/dist/constants.js +148 -146
  44. package/dist/core/ModelClass.d.ts +13 -13
  45. package/dist/core/ModelClass.js +19 -19
  46. package/dist/core/handleResponseError.d.ts +2 -2
  47. package/dist/core/handleResponseError.js +167 -167
  48. package/dist/core/index.d.ts +19 -19
  49. package/dist/core/index.js +63 -63
  50. package/dist/deviceConfigs/index.d.ts +9 -9
  51. package/dist/deviceConfigs/index.js +224 -224
  52. package/dist/deviceConfigs/models.d.ts +38 -38
  53. package/dist/deviceConfigs/models.js +2 -2
  54. package/dist/deviceLocationObservations/index.d.ts +5 -5
  55. package/dist/deviceLocationObservations/index.js +189 -189
  56. package/dist/deviceLocationObservations/models.d.ts +26 -26
  57. package/dist/deviceLocationObservations/models.js +2 -2
  58. package/dist/deviceTemplates/index.d.ts +9 -9
  59. package/dist/deviceTemplates/index.js +226 -226
  60. package/dist/deviceTemplates/models.d.ts +36 -36
  61. package/dist/deviceTemplates/models.js +2 -2
  62. package/dist/deviceTransferRequests/index.d.ts +7 -7
  63. package/dist/deviceTransferRequests/index.js +198 -198
  64. package/dist/deviceTransferRequests/models.d.ts +26 -26
  65. package/dist/deviceTransferRequests/models.js +2 -2
  66. package/dist/deviceTypes/index.d.ts +19 -19
  67. package/dist/deviceTypes/index.js +440 -440
  68. package/dist/deviceTypes/models.d.ts +104 -104
  69. package/dist/deviceTypes/models.js +2 -2
  70. package/dist/devices/index.d.ts +20 -20
  71. package/dist/devices/index.js +487 -487
  72. package/dist/devices/models.d.ts +114 -114
  73. package/dist/devices/models.js +2 -2
  74. package/dist/discoveredDevices/index.d.ts +14 -14
  75. package/dist/discoveredDevices/index.js +334 -334
  76. package/dist/discoveredDevices/models.d.ts +41 -41
  77. package/dist/discoveredDevices/models.js +2 -2
  78. package/dist/downstreamSystems/index.d.ts +7 -7
  79. package/dist/downstreamSystems/index.js +198 -198
  80. package/dist/downstreamSystems/models.d.ts +17 -17
  81. package/dist/downstreamSystems/models.js +2 -2
  82. package/dist/escrowDevices/index.d.ts +9 -9
  83. package/dist/escrowDevices/index.js +224 -224
  84. package/dist/escrowDevices/models.d.ts +21 -21
  85. package/dist/escrowDevices/models.js +2 -2
  86. package/dist/example/index.d.ts +1 -0
  87. package/dist/example/index.js +5 -0
  88. package/dist/filtersParser.d.ts +5 -5
  89. package/dist/filtersParser.js +52 -52
  90. package/dist/gatewayCommands/index.d.ts +10 -10
  91. package/dist/gatewayCommands/index.js +261 -261
  92. package/dist/gatewayCommands/models.d.ts +41 -41
  93. package/dist/gatewayCommands/models.js +2 -2
  94. package/dist/helpers.d.ts +3 -3
  95. package/dist/helpers.js +11 -11
  96. package/dist/index.d.ts +58 -56
  97. package/dist/index.js +101 -98
  98. package/dist/ingestors/index.d.ts +9 -9
  99. package/dist/ingestors/index.js +224 -224
  100. package/dist/ingestors/models.d.ts +37 -37
  101. package/dist/ingestors/models.js +2 -2
  102. package/dist/integrations/index.d.ts +9 -9
  103. package/dist/integrations/index.js +306 -306
  104. package/dist/integrations/models.d.ts +61 -61
  105. package/dist/integrations/models.js +2 -2
  106. package/dist/models/index.d.ts +1893 -1893
  107. package/dist/models/index.js +2 -2
  108. package/dist/models.d.ts +67 -67
  109. package/dist/models.js +2 -2
  110. package/dist/notifications/index.d.ts +8 -0
  111. package/dist/notifications/index.js +124 -0
  112. package/dist/notifications/models.d.ts +19 -0
  113. package/dist/notifications/models.js +2 -0
  114. package/dist/pollableAttributes/index.d.ts +7 -7
  115. package/dist/pollableAttributes/index.js +198 -198
  116. package/dist/pollableAttributes/models.d.ts +28 -28
  117. package/dist/pollableAttributes/models.js +2 -2
  118. package/dist/regions/index.d.ts +5 -5
  119. package/dist/regions/index.js +173 -173
  120. package/dist/regions/models.d.ts +17 -17
  121. package/dist/regions/models.js +2 -2
  122. package/dist/reports/index.d.ts +8 -8
  123. package/dist/reports/index.js +199 -199
  124. package/dist/reports/models.d.ts +25 -25
  125. package/dist/reports/models.js +2 -2
  126. package/dist/rules/index.d.ts +9 -9
  127. package/dist/rules/index.js +224 -224
  128. package/dist/rules/models.d.ts +108 -108
  129. package/dist/rules/models.js +2 -2
  130. package/dist/secrets/index.d.ts +5 -5
  131. package/dist/secrets/index.js +173 -173
  132. package/dist/secrets/models.d.ts +16 -16
  133. package/dist/secrets/models.js +2 -2
  134. package/dist/softwareUpdates/index.d.ts +9 -9
  135. package/dist/softwareUpdates/index.js +224 -224
  136. package/dist/softwareUpdates/models.d.ts +22 -22
  137. package/dist/softwareUpdates/models.js +2 -2
  138. package/dist/stats/index.d.ts +8 -8
  139. package/dist/stats/index.js +116 -116
  140. package/dist/stats/models.d.ts +27 -27
  141. package/dist/stats/models.js +2 -2
  142. package/dist/systemCommandJobs/index.d.ts +5 -5
  143. package/dist/systemCommandJobs/index.js +173 -173
  144. package/dist/systemCommandJobs/models.d.ts +32 -32
  145. package/dist/systemCommandJobs/models.js +2 -2
  146. package/dist/systemCommands/index.d.ts +7 -7
  147. package/dist/systemCommands/index.js +198 -198
  148. package/dist/systemCommands/models.d.ts +32 -32
  149. package/dist/systemCommands/models.js +2 -2
  150. package/dist/testConstants.d.ts +46 -44
  151. package/dist/testConstants.js +221 -220
  152. package/dist/translators/index.d.ts +9 -9
  153. package/dist/translators/index.js +224 -224
  154. package/dist/translators/models.d.ts +21 -21
  155. package/dist/translators/models.js +2 -2
  156. package/dist/userTypes/index.d.ts +7 -7
  157. package/dist/userTypes/index.js +198 -198
  158. package/dist/userTypes/models.d.ts +79 -79
  159. package/dist/userTypes/models.js +2 -2
  160. package/dist/users/index.d.ts +12 -10
  161. package/dist/users/index.js +300 -252
  162. package/dist/users/models.d.ts +41 -41
  163. package/dist/users/models.js +2 -2
  164. package/package.json +56 -56
@@ -1,130 +1,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
- command: string;
57
- company: string;
58
- deviceConfig: string;
59
- deviceTransferRequest: string;
60
- deviceTemplate: string;
61
- deviceType: string;
62
- device: string;
63
- deviceLocationObservation: string;
64
- discoveredDevice: string;
65
- downstreamSystem: string;
66
- escrowDevice: string;
67
- file: string;
68
- gatewayCommand: string;
69
- gatewayCsvUpload: string;
70
- ingestor: string;
71
- integration: string;
72
- pollableAttribute: string;
73
- region: string;
74
- report: string;
75
- rule: string;
76
- secret: string;
77
- softwareUpdate: string;
78
- stats: string;
79
- systemCommand: string;
80
- systemCommandJob: string;
81
- translator: string;
82
- userType: string;
83
- user: string;
84
- };
85
- export declare const Endpoints: {
86
- me: string;
87
- login: string;
88
- apiTokenReset: string;
89
- passwordResetRequest: string;
90
- passwordReset: string;
91
- bulkResponse: string;
92
- command: string;
93
- company: string;
94
- deviceConfig: string;
95
- deviceTransferRequest: string;
96
- deviceTemplate: string;
97
- deviceType: string;
98
- device: string;
99
- deviceLocationObservation: string;
100
- downstreamSystem: string;
101
- discoveredDevice: string;
102
- escrowDevice: string;
103
- gatewayCommand: string;
104
- ingestor: string;
105
- integration: string;
106
- pollableAttribute: string;
107
- region: string;
108
- report: string;
109
- rule: string;
110
- secret: string;
111
- softwareUpdate: string;
112
- statsDevicesByHeartbeat: string;
113
- statsDevicesByType: string;
114
- statsCellUsage: string;
115
- systemCommand: string;
116
- systemCommandJob: string;
117
- translator: string;
118
- userType: string;
119
- user: string;
120
- };
121
- export declare const MethodsActions: {
122
- post: string;
123
- put: string;
124
- delete: string;
125
- get: string;
126
- };
127
- export declare const DefaultPagination: {
128
- page: number;
129
- itemsPerPage: number;
130
- };
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
+ };
package/dist/constants.js CHANGED
@@ -1,146 +1,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
- command: 'commands',
73
- company: 'companies',
74
- deviceConfig: 'device_configs',
75
- deviceTransferRequest: 'device_transfer_requests',
76
- deviceTemplate: 'device_templates',
77
- deviceType: 'device_types',
78
- device: 'devices',
79
- deviceLocationObservation: 'device_location_observations',
80
- discoveredDevice: 'discovered_devices',
81
- downstreamSystem: 'downstream_systems',
82
- escrowDevice: 'escrow_devices',
83
- file: 'files',
84
- gatewayCommand: 'gateway_commands',
85
- gatewayCsvUpload: 'gateway_csv_upload',
86
- ingestor: 'ingestors',
87
- integration: 'integrations',
88
- pollableAttribute: 'pollable_attributes',
89
- region: 'regions',
90
- report: 'reports',
91
- rule: 'rules',
92
- secret: 'secrets',
93
- softwareUpdate: 'software_updates',
94
- stats: 'stats',
95
- systemCommand: 'system_commands',
96
- systemCommandJob: 'system_command_jobs',
97
- translator: 'translators',
98
- userType: 'user_types',
99
- user: 'users',
100
- };
101
- exports.Endpoints = {
102
- me: 'me',
103
- login: exports.BaseEndpoints.auth + "/authenticate",
104
- apiTokenReset: exports.BaseEndpoints.auth + "/api_token_reset",
105
- passwordResetRequest: exports.BaseEndpoints.auth + "/password_reset_request",
106
- passwordReset: exports.BaseEndpoints.auth + "/password_reset",
107
- bulkResponse: "" + exports.BaseEndpoints.bulkResponse,
108
- command: "" + exports.BaseEndpoints.command,
109
- company: "" + exports.BaseEndpoints.company,
110
- deviceConfig: "" + exports.BaseEndpoints.deviceConfig,
111
- deviceTransferRequest: "" + exports.BaseEndpoints.deviceTransferRequest,
112
- deviceTemplate: "" + exports.BaseEndpoints.deviceTemplate,
113
- deviceType: "" + exports.BaseEndpoints.deviceType,
114
- device: "" + exports.BaseEndpoints.device,
115
- deviceLocationObservation: "" + exports.BaseEndpoints.deviceLocationObservation,
116
- downstreamSystem: "" + exports.BaseEndpoints.downstreamSystem,
117
- discoveredDevice: "" + exports.BaseEndpoints.discoveredDevice,
118
- escrowDevice: "" + exports.BaseEndpoints.escrowDevice,
119
- gatewayCommand: "" + exports.BaseEndpoints.gatewayCommand,
120
- ingestor: "" + exports.BaseEndpoints.ingestor,
121
- integration: "" + exports.BaseEndpoints.integration,
122
- pollableAttribute: "" + exports.BaseEndpoints.pollableAttribute,
123
- region: "" + exports.BaseEndpoints.region,
124
- report: "" + exports.BaseEndpoints.report,
125
- rule: "" + exports.BaseEndpoints.rule,
126
- secret: "" + exports.BaseEndpoints.secret,
127
- softwareUpdate: "" + exports.BaseEndpoints.softwareUpdate,
128
- statsDevicesByHeartbeat: exports.BaseEndpoints.stats + "/devices/count_by_heartbeat_status",
129
- statsDevicesByType: exports.BaseEndpoints.stats + "/devices/count_by_type",
130
- statsCellUsage: exports.BaseEndpoints.stats + "/cumulative_cell_usage",
131
- systemCommand: "" + exports.BaseEndpoints.systemCommand,
132
- systemCommandJob: "" + exports.BaseEndpoints.systemCommandJob,
133
- translator: "" + exports.BaseEndpoints.translator,
134
- userType: "" + exports.BaseEndpoints.userType,
135
- user: "" + exports.BaseEndpoints.user,
136
- };
137
- exports.MethodsActions = {
138
- post: 'creating',
139
- put: 'updating',
140
- delete: 'deleting',
141
- get: 'loading',
142
- };
143
- exports.DefaultPagination = {
144
- page: 1,
145
- itemsPerPage: 12,
146
- };
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,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>;