@edgeiq/edgeiq-api-js 1.9.0 → 1.9.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.
@@ -89,6 +89,7 @@ export declare const BaseEndpoints: {
89
89
  setting: string;
90
90
  settingsApplicationRecord: string;
91
91
  softwareUpdate: string;
92
+ softwareVersion: string;
92
93
  stats: string;
93
94
  systemCommand: string;
94
95
  systemCommandJob: string;
@@ -142,6 +143,7 @@ export declare const Endpoints: {
142
143
  setting: string;
143
144
  settingsApplicationRecord: string;
144
145
  softwareUpdate: string;
146
+ softwareVersion: string;
145
147
  statsDevicesByHeartbeat: string;
146
148
  statsDiscoveredDevicesByHeartbeat: string;
147
149
  statsDevicesByType: string;
package/dist/constants.js CHANGED
@@ -91,6 +91,7 @@ export const BaseEndpoints = {
91
91
  setting: 'settings',
92
92
  settingsApplicationRecord: 'settings_application_record',
93
93
  softwareUpdate: 'software_updates',
94
+ softwareVersion: 'software_versions',
94
95
  stats: 'stats',
95
96
  systemCommand: 'system_commands',
96
97
  systemCommandJob: 'system_command_jobs',
@@ -144,6 +145,7 @@ export const Endpoints = {
144
145
  setting: `${BaseEndpoints.setting}`,
145
146
  settingsApplicationRecord: `${BaseEndpoints.settingsApplicationRecord}`,
146
147
  softwareUpdate: `${BaseEndpoints.softwareUpdate}`,
148
+ softwareVersion: `${BaseEndpoints.softwareVersion}`,
147
149
  statsDevicesByHeartbeat: `${BaseEndpoints.stats}/devices/count_by_heartbeat_status`,
148
150
  statsDiscoveredDevicesByHeartbeat: `${BaseEndpoints.stats}/discovered_devices/count_by_heartbeat_status`,
149
151
  statsDevicesByType: `${BaseEndpoints.stats}/devices/count_by_type`,
@@ -55,6 +55,7 @@ export interface Actions {
55
55
  sms: boolean;
56
56
  sms_at_command_status_request: boolean;
57
57
  software_update: boolean;
58
+ software_version: boolean;
58
59
  status: boolean;
59
60
  tcp: boolean;
60
61
  tcp_modbus: boolean;
@@ -1,6 +1,6 @@
1
1
  import { Base, Filter, Filters, Pagination } from '../models';
2
2
  import { RetryOptions } from '../retryOptions/models';
3
- export declare type GatewayCommandType = 'activate_cloud_native_device' | 'backup' | 'data_restriction' | 'deactivate_cloud_native_device' | 'disable_data_restriction' | 'enable_data_restriction' | 'greengrass_initialize' | 'awsiot_attach_thing_groups' | 'awsiot_detach_thing_groups' | 'cancel_password_change' | 'file_from_device' | 'file_to_device' | 'heartbeat' | 'log_level' | 'log_upload' | 'lwm2m_request' | 'lwm2m_file' | 'restore_backup' | 'reboot' | 'reset' | 'send_config' | 'setting' | 'setting_fetch' | 'software_update' | 'status';
3
+ export declare type GatewayCommandType = 'activate_cloud_native_device' | 'backup' | 'data_restriction' | 'deactivate_cloud_native_device' | 'disable_data_restriction' | 'enable_data_restriction' | 'greengrass_initialize' | 'awsiot_attach_thing_groups' | 'awsiot_detach_thing_groups' | 'cancel_password_change' | 'file_from_device' | 'file_to_device' | 'heartbeat' | 'log_level' | 'log_upload' | 'lwm2m_request' | 'lwm2m_file' | 'restore_backup' | 'reboot' | 'reset' | 'send_config' | 'setting' | 'setting_fetch' | 'software_update' | 'software_version' | 'status';
4
4
  export declare type CommandType = 'download' | 'fileupload' | 'filedownload' | 'execute' | 'observe' | 'observe_stop' | 'read' | 'upload' | 'write';
5
5
  export interface CommandSchedule {
6
6
  start_datetime: string;
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export { Secrets } from './secrets';
29
29
  export { Settings } from './settings';
30
30
  export { SettingApplicationRecords } from './settingsApplicationRecord';
31
31
  export { SoftwareUpdates } from './softwareUpdates';
32
+ export { SoftwareVersions } from './softwareVersions';
32
33
  export { Stats } from './stats';
33
34
  export { SystemCommands } from './systemCommands';
34
35
  export { SystemCommandJobs } from './systemCommandJobs';
@@ -73,6 +74,7 @@ export * from './settings/models';
73
74
  export * from './settingsApplicationRecord/models';
74
75
  export * from './stats/models';
75
76
  export * from './softwareUpdates/models';
77
+ export * from './softwareVersions/models';
76
78
  export * from './systemCommands/models';
77
79
  export * from './systemCommandJobs/models';
78
80
  export * from './translators/models';
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ export { Secrets } from './secrets';
29
29
  export { Settings } from './settings';
30
30
  export { SettingApplicationRecords } from './settingsApplicationRecord';
31
31
  export { SoftwareUpdates } from './softwareUpdates';
32
+ export { SoftwareVersions } from './softwareVersions';
32
33
  export { Stats } from './stats';
33
34
  export { SystemCommands } from './systemCommands';
34
35
  export { SystemCommandJobs } from './systemCommandJobs';
@@ -73,6 +74,7 @@ export * from './settings/models';
73
74
  export * from './settingsApplicationRecord/models';
74
75
  export * from './stats/models';
75
76
  export * from './softwareUpdates/models';
77
+ export * from './softwareVersions/models';
76
78
  export * from './systemCommands/models';
77
79
  export * from './systemCommandJobs/models';
78
80
  export * from './translators/models';
@@ -0,0 +1,6 @@
1
+ import { PaginationFilter } from '..';
2
+ import { PaginatedSoftwareVersions, SoftwareVersionsFilters } from './models';
3
+ declare const SoftwareVersions: {
4
+ list: (filters?: SoftwareVersionsFilters | undefined, pagination?: PaginationFilter | undefined) => Promise<PaginatedSoftwareVersions>;
5
+ };
6
+ export { SoftwareVersions };
@@ -0,0 +1,40 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { EdgeIQAPI } from '..';
11
+ import { Endpoints } from '../constants';
12
+ import { isApiError } from '../helpers';
13
+ import { parseFilters } from '../filtersParser';
14
+ const SoftwareVersions = {
15
+ list: (filters, pagination) => __awaiter(void 0, void 0, void 0, function* () {
16
+ var _a, _b, _c, _d;
17
+ try {
18
+ EdgeIQAPI.logAction(`Getting software versions`);
19
+ const axios = EdgeIQAPI.getAxios();
20
+ const result = yield axios.get(Endpoints.softwareVersion, {
21
+ params: parseFilters(filters, pagination),
22
+ });
23
+ return {
24
+ softwareVersions: (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.resources,
25
+ pagination: {
26
+ page: (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.page,
27
+ itemsPerPage: (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c.per_page,
28
+ total: (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.total,
29
+ },
30
+ };
31
+ }
32
+ catch (error) {
33
+ if (isApiError(error)) {
34
+ throw error;
35
+ }
36
+ throw error;
37
+ }
38
+ }),
39
+ };
40
+ export { SoftwareVersions };
@@ -0,0 +1,26 @@
1
+ import { Base, Filter, Filters, Pagination } from '../models';
2
+ export declare type VersionSourceType = 'apt' | 'snap';
3
+ export interface SoftwareVersion extends Base {
4
+ device_id: string;
5
+ name: string;
6
+ notes?: string;
7
+ source: VersionSourceType;
8
+ publisher?: string;
9
+ version_raw?: string;
10
+ version_major?: number;
11
+ version_minor?: number;
12
+ version_patch?: number;
13
+ version_prerelease?: string;
14
+ version_metadata?: string;
15
+ revision?: number;
16
+ track?: string;
17
+ }
18
+ export interface SoftwareVersionsFilters extends Filters {
19
+ device_id?: Filter;
20
+ name?: Filter;
21
+ source?: Filter;
22
+ }
23
+ export interface PaginatedSoftwareVersions {
24
+ softwareVersions: SoftwareVersion[];
25
+ pagination: Pagination;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",