@edgeiq/edgeiq-api-js 1.1.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) 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 -110
  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 -0
  11. package/dist/__tests__/discoveredDevice.test.js +126 -0
  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__/pollableAttributes.test.d.ts +1 -1
  17. package/dist/__tests__/pollableAttributes.test.js +172 -172
  18. package/dist/__tests__/rules.test.d.ts +1 -1
  19. package/dist/__tests__/rules.test.js +172 -172
  20. package/dist/__tests__/translators.test.d.ts +1 -1
  21. package/dist/__tests__/translators.test.js +172 -172
  22. package/dist/__tests__/users.test.d.ts +1 -1
  23. package/dist/__tests__/users.test.js +208 -208
  24. package/dist/auth/index.d.ts +8 -8
  25. package/dist/auth/index.js +158 -147
  26. package/dist/bulkResponses/index.d.ts +8 -8
  27. package/dist/bulkResponses/index.js +124 -124
  28. package/dist/bulkResponses/models.d.ts +43 -43
  29. package/dist/bulkResponses/models.js +2 -2
  30. package/dist/commands/index.d.ts +9 -9
  31. package/dist/commands/index.js +224 -224
  32. package/dist/commands/models.d.ts +28 -28
  33. package/dist/commands/models.js +2 -2
  34. package/dist/companies/index.d.ts +7 -7
  35. package/dist/companies/index.js +198 -198
  36. package/dist/companies/models.d.ts +94 -94
  37. package/dist/companies/models.js +2 -2
  38. package/dist/constants.d.ts +130 -127
  39. package/dist/constants.js +146 -143
  40. package/dist/core/ModelClass.d.ts +13 -13
  41. package/dist/core/ModelClass.js +19 -19
  42. package/dist/core/handleResponseError.d.ts +2 -2
  43. package/dist/core/handleResponseError.js +167 -167
  44. package/dist/core/index.d.ts +19 -19
  45. package/dist/core/index.js +63 -63
  46. package/dist/deviceConfigs/index.d.ts +9 -9
  47. package/dist/deviceConfigs/index.js +224 -224
  48. package/dist/deviceConfigs/models.d.ts +38 -38
  49. package/dist/deviceConfigs/models.js +2 -2
  50. package/dist/deviceLocationObservations/index.d.ts +5 -5
  51. package/dist/deviceLocationObservations/index.js +189 -189
  52. package/dist/deviceLocationObservations/models.d.ts +26 -26
  53. package/dist/deviceLocationObservations/models.js +2 -2
  54. package/dist/deviceTemplates/index.d.ts +9 -9
  55. package/dist/deviceTemplates/index.js +226 -226
  56. package/dist/deviceTemplates/models.d.ts +36 -36
  57. package/dist/deviceTemplates/models.js +2 -2
  58. package/dist/deviceTransferRequests/index.d.ts +7 -7
  59. package/dist/deviceTransferRequests/index.js +198 -198
  60. package/dist/deviceTransferRequests/models.d.ts +26 -26
  61. package/dist/deviceTransferRequests/models.js +2 -2
  62. package/dist/deviceTypes/index.d.ts +19 -19
  63. package/dist/deviceTypes/index.js +440 -440
  64. package/dist/deviceTypes/models.d.ts +104 -104
  65. package/dist/deviceTypes/models.js +2 -2
  66. package/dist/devices/index.d.ts +20 -20
  67. package/dist/devices/index.js +487 -487
  68. package/dist/devices/models.d.ts +114 -114
  69. package/dist/devices/models.js +2 -2
  70. package/dist/discoveredDevices/index.d.ts +14 -0
  71. package/dist/discoveredDevices/index.js +334 -0
  72. package/dist/discoveredDevices/models.d.ts +41 -0
  73. package/dist/discoveredDevices/models.js +2 -0
  74. package/dist/downstreamSystems/index.d.ts +7 -7
  75. package/dist/downstreamSystems/index.js +198 -198
  76. package/dist/downstreamSystems/models.d.ts +17 -17
  77. package/dist/downstreamSystems/models.js +2 -2
  78. package/dist/escrowDevices/index.d.ts +9 -9
  79. package/dist/escrowDevices/index.js +224 -224
  80. package/dist/escrowDevices/models.d.ts +21 -21
  81. package/dist/escrowDevices/models.js +2 -2
  82. package/dist/filtersParser.d.ts +5 -5
  83. package/dist/filtersParser.js +52 -52
  84. package/dist/gatewayCommands/index.d.ts +10 -10
  85. package/dist/gatewayCommands/index.js +261 -261
  86. package/dist/gatewayCommands/models.d.ts +41 -41
  87. package/dist/gatewayCommands/models.js +2 -2
  88. package/dist/helpers.d.ts +3 -3
  89. package/dist/helpers.js +11 -11
  90. package/dist/index.d.ts +56 -54
  91. package/dist/index.js +98 -95
  92. package/dist/ingestors/index.d.ts +9 -9
  93. package/dist/ingestors/index.js +224 -224
  94. package/dist/ingestors/models.d.ts +37 -37
  95. package/dist/ingestors/models.js +2 -2
  96. package/dist/integrations/index.d.ts +9 -9
  97. package/dist/integrations/index.js +306 -306
  98. package/dist/integrations/models.d.ts +61 -61
  99. package/dist/integrations/models.js +2 -2
  100. package/dist/models/index.d.ts +1893 -1893
  101. package/dist/models/index.js +2 -2
  102. package/dist/models.d.ts +67 -67
  103. package/dist/models.js +2 -2
  104. package/dist/pollableAttributes/index.d.ts +7 -7
  105. package/dist/pollableAttributes/index.js +198 -198
  106. package/dist/pollableAttributes/models.d.ts +28 -28
  107. package/dist/pollableAttributes/models.js +2 -2
  108. package/dist/regions/index.d.ts +5 -5
  109. package/dist/regions/index.js +173 -173
  110. package/dist/regions/models.d.ts +17 -17
  111. package/dist/regions/models.js +2 -2
  112. package/dist/reports/index.d.ts +8 -8
  113. package/dist/reports/index.js +199 -199
  114. package/dist/reports/models.d.ts +25 -25
  115. package/dist/reports/models.js +2 -2
  116. package/dist/rules/index.d.ts +9 -9
  117. package/dist/rules/index.js +224 -224
  118. package/dist/rules/models.d.ts +108 -108
  119. package/dist/rules/models.js +2 -2
  120. package/dist/secrets/index.d.ts +5 -5
  121. package/dist/secrets/index.js +173 -173
  122. package/dist/secrets/models.d.ts +16 -16
  123. package/dist/secrets/models.js +2 -2
  124. package/dist/softwareUpdates/index.d.ts +9 -9
  125. package/dist/softwareUpdates/index.js +224 -224
  126. package/dist/softwareUpdates/models.d.ts +22 -22
  127. package/dist/softwareUpdates/models.js +2 -2
  128. package/dist/stats/index.d.ts +8 -8
  129. package/dist/stats/index.js +116 -116
  130. package/dist/stats/models.d.ts +27 -27
  131. package/dist/stats/models.js +2 -2
  132. package/dist/systemCommandJobs/index.d.ts +5 -5
  133. package/dist/systemCommandJobs/index.js +173 -173
  134. package/dist/systemCommandJobs/models.d.ts +32 -32
  135. package/dist/systemCommandJobs/models.js +2 -2
  136. package/dist/systemCommands/index.d.ts +7 -7
  137. package/dist/systemCommands/index.js +198 -198
  138. package/dist/systemCommands/models.d.ts +32 -32
  139. package/dist/systemCommands/models.js +2 -2
  140. package/dist/testConstants.d.ts +44 -42
  141. package/dist/testConstants.js +220 -214
  142. package/dist/translators/index.d.ts +9 -9
  143. package/dist/translators/index.js +224 -224
  144. package/dist/translators/models.d.ts +21 -21
  145. package/dist/translators/models.js +2 -2
  146. package/dist/userTypes/index.d.ts +7 -7
  147. package/dist/userTypes/index.js +198 -198
  148. package/dist/userTypes/models.d.ts +79 -79
  149. package/dist/userTypes/models.js +2 -2
  150. package/dist/users/index.d.ts +10 -10
  151. package/dist/users/index.js +252 -252
  152. package/dist/users/models.d.ts +41 -41
  153. package/dist/users/models.js +2 -2
  154. package/package.json +56 -56
  155. package/dist/__tests__/testConstants.d.ts +0 -7
  156. package/dist/__tests__/testConstants.js +0 -14
  157. package/dist/example/index.d.ts +0 -1
  158. package/dist/example/index.js +0 -5
@@ -1,127 +1,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
- };
45
- export declare const ErrorParts: {
46
- deviceExists: string;
47
- uniqueIdError: string;
48
- duplicateKey: string;
49
- uniqueConstraint: string;
50
- };
51
- export declare const getAttachMessage: (model: string, action: string, baseModel: string) => string;
52
- export declare const BaseEndpoints: {
53
- auth: string;
54
- bulkResponse: string;
55
- command: string;
56
- company: string;
57
- deviceConfig: string;
58
- deviceTransferRequest: string;
59
- deviceTemplate: string;
60
- deviceType: string;
61
- device: string;
62
- deviceLocationObservation: string;
63
- downstreamSystem: string;
64
- escrowDevice: string;
65
- file: string;
66
- gatewayCommand: string;
67
- gatewayCsvUpload: string;
68
- ingestor: string;
69
- integration: string;
70
- pollableAttribute: string;
71
- region: string;
72
- report: string;
73
- rule: string;
74
- secret: string;
75
- softwareUpdate: string;
76
- stats: string;
77
- systemCommand: string;
78
- systemCommandJob: string;
79
- translator: string;
80
- userType: string;
81
- user: string;
82
- };
83
- export declare const Endpoints: {
84
- me: string;
85
- login: string;
86
- apiTokenReset: string;
87
- passwordResetRequest: string;
88
- passwordReset: string;
89
- bulkResponse: string;
90
- command: string;
91
- company: string;
92
- deviceConfig: string;
93
- deviceTransferRequest: string;
94
- deviceTemplate: string;
95
- deviceType: string;
96
- device: string;
97
- deviceLocationObservation: string;
98
- downstreamSystem: string;
99
- escrowDevice: string;
100
- gatewayCommand: string;
101
- ingestor: string;
102
- integration: string;
103
- pollableAttribute: string;
104
- region: string;
105
- report: string;
106
- rule: string;
107
- secret: string;
108
- softwareUpdate: string;
109
- statsDevicesByHeartbeat: string;
110
- statsDevicesByType: string;
111
- statsCellUsage: string;
112
- systemCommand: string;
113
- systemCommandJob: string;
114
- translator: string;
115
- userType: string;
116
- user: string;
117
- };
118
- export declare const MethodsActions: {
119
- post: string;
120
- put: string;
121
- delete: string;
122
- get: string;
123
- };
124
- export declare const DefaultPagination: {
125
- page: number;
126
- itemsPerPage: number;
127
- };
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
+ };
package/dist/constants.js CHANGED
@@ -1,143 +1,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
- };
58
- exports.ErrorParts = {
59
- deviceExists: 'A Device with unique id',
60
- uniqueIdError: "\"unique_id\" can only contain lower case letters, numbers or the special charaters \"-\", \":\", or \"_\"",
61
- duplicateKey: 'duplicate key error collection',
62
- uniqueConstraint: 'duplicate key value violates unique constraint',
63
- };
64
- var getAttachMessage = function (model, action, baseModel) {
65
- return model + " " + (action === 'attach' ? 'attached to' : 'detached from') + " " + baseModel;
66
- };
67
- exports.getAttachMessage = getAttachMessage;
68
- exports.BaseEndpoints = {
69
- auth: 'user',
70
- bulkResponse: 'bulk_responses',
71
- command: 'commands',
72
- company: 'companies',
73
- deviceConfig: 'device_configs',
74
- deviceTransferRequest: 'device_transfer_requests',
75
- deviceTemplate: 'device_templates',
76
- deviceType: 'device_types',
77
- device: 'devices',
78
- deviceLocationObservation: 'device_location_observations',
79
- downstreamSystem: 'downstream_systems',
80
- escrowDevice: 'escrow_devices',
81
- file: 'files',
82
- gatewayCommand: 'gateway_commands',
83
- gatewayCsvUpload: 'gateway_csv_upload',
84
- ingestor: 'ingestors',
85
- integration: 'integrations',
86
- pollableAttribute: 'pollable_attributes',
87
- region: 'regions',
88
- report: 'reports',
89
- rule: 'rules',
90
- secret: 'secrets',
91
- softwareUpdate: 'software_updates',
92
- stats: 'stats',
93
- systemCommand: 'system_commands',
94
- systemCommandJob: 'system_command_jobs',
95
- translator: 'translators',
96
- userType: 'user_types',
97
- user: 'users',
98
- };
99
- exports.Endpoints = {
100
- me: 'me',
101
- login: exports.BaseEndpoints.auth + "/authenticate",
102
- apiTokenReset: exports.BaseEndpoints.auth + "/api_token_reset",
103
- passwordResetRequest: exports.BaseEndpoints.auth + "/password_reset_request",
104
- passwordReset: exports.BaseEndpoints.auth + "/password_reset",
105
- bulkResponse: "" + exports.BaseEndpoints.bulkResponse,
106
- command: "" + exports.BaseEndpoints.command,
107
- company: "" + exports.BaseEndpoints.company,
108
- deviceConfig: "" + exports.BaseEndpoints.deviceConfig,
109
- deviceTransferRequest: "" + exports.BaseEndpoints.deviceTransferRequest,
110
- deviceTemplate: "" + exports.BaseEndpoints.deviceTemplate,
111
- deviceType: "" + exports.BaseEndpoints.deviceType,
112
- device: "" + exports.BaseEndpoints.device,
113
- deviceLocationObservation: "" + exports.BaseEndpoints.deviceLocationObservation,
114
- downstreamSystem: "" + exports.BaseEndpoints.downstreamSystem,
115
- escrowDevice: "" + exports.BaseEndpoints.escrowDevice,
116
- gatewayCommand: "" + exports.BaseEndpoints.gatewayCommand,
117
- ingestor: "" + exports.BaseEndpoints.ingestor,
118
- integration: "" + exports.BaseEndpoints.integration,
119
- pollableAttribute: "" + exports.BaseEndpoints.pollableAttribute,
120
- region: "" + exports.BaseEndpoints.region,
121
- report: "" + exports.BaseEndpoints.report,
122
- rule: "" + exports.BaseEndpoints.rule,
123
- secret: "" + exports.BaseEndpoints.secret,
124
- softwareUpdate: "" + exports.BaseEndpoints.softwareUpdate,
125
- statsDevicesByHeartbeat: exports.BaseEndpoints.stats + "/devices/count_by_heartbeat_status",
126
- statsDevicesByType: exports.BaseEndpoints.stats + "/devices/count_by_type",
127
- statsCellUsage: exports.BaseEndpoints.stats + "/cumulative_cell_usage",
128
- systemCommand: "" + exports.BaseEndpoints.systemCommand,
129
- systemCommandJob: "" + exports.BaseEndpoints.systemCommandJob,
130
- translator: "" + exports.BaseEndpoints.translator,
131
- userType: "" + exports.BaseEndpoints.userType,
132
- user: "" + exports.BaseEndpoints.user,
133
- };
134
- exports.MethodsActions = {
135
- post: 'creating',
136
- put: 'updating',
137
- delete: 'deleting',
138
- get: 'loading',
139
- };
140
- exports.DefaultPagination = {
141
- page: 1,
142
- itemsPerPage: 12,
143
- };
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,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>;