motion-master-client 0.0.281 → 0.0.283

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-master-client",
3
- "version": "0.0.281",
3
+ "version": "0.0.283",
4
4
  "type": "commonjs",
5
5
  "description": "A library and CLI program used for communicating with Motion Master.",
6
6
  "dependencies": {
@@ -1,57 +1,101 @@
1
1
  import { OblacDrivesRelease } from './oblac-drives-release';
2
+ import { PartConfigurationTable, FirmwareProductSupportedOptions } from './types';
3
+ /**
4
+ * The brand ID for OBLAC Drives.
5
+ */
2
6
  export declare const oblacDrivesBrandId = "a7e925fa-57b7-4741-9126-0840a63cdb71";
7
+ /**
8
+ * The hostname of the current environment.
9
+ * Defaults to 'localhost' if running outside a browser (e.g., Node.js).
10
+ */
3
11
  export declare const hostname: string;
12
+ /**
13
+ * AWS API Gateway endpoint for OBLAC Drives services.
14
+ * S3 URI: s3://synapticon/oblac-drives/
15
+ */
4
16
  export declare const oblacDrivesApiGatewayOrigin = "https://pc27e3jixd.execute-api.us-east-1.amazonaws.com";
17
+ /**
18
+ * Base URL for the CDN hosting OBLAC Drives assets.
19
+ */
5
20
  export declare const cdnBasePath = "https://d9k1r8ajdoczx.cloudfront.net";
21
+ /**
22
+ * Hostname and port for the local cache server (OBLAC Drives Update Service).
23
+ */
6
24
  export declare const cacheHostname: string;
25
+ /**
26
+ * Base origin URL for the local cache server.
27
+ */
7
28
  export declare const cacheOrigin: string;
29
+ /**
30
+ * Base path for accessing cached S3 resources via the local cache server.
31
+ */
8
32
  export declare const cacheS3BasePath: string;
33
+ /**
34
+ * Base path for the local cache API.
35
+ */
9
36
  export declare const cacheApiBasePath: string;
10
37
  /**
11
- * Cache the specified object (file) to the box or the native app.
38
+ * Caches the specified object (file) locally, either on the box or within the native Electron app.
12
39
  *
13
- * @param path - The path to the object (file) in the box.
14
- * @param body - The object (file) to cache.
15
- * @returns A promise that resolves when the object is cached.
40
+ * @param path - The destination path where the object should be cached.
41
+ * @param body - The object (file) data to cache, provided as a Blob.
42
+ * @returns A promise that resolves when caching completes (only resolves in Electron;
43
+ * for other environments, caching is attempted but not awaited).
16
44
  */
17
45
  export declare function cacheOnBox(path: string, body: Blob): Promise<void>;
18
46
  /**
19
- * Compare OBLAC Drives releases by date in descending order.
47
+ * Compares two OBLAC Drives bundle filenames by their embedded version strings,
48
+ * sorting them in descending order based on version.
49
+ *
50
+ * The version is extracted from the filename suffix matching the pattern `_<version>.odbx`.
51
+ *
52
+ * @param a - The first bundle filename to compare.
53
+ * @param b - The second bundle filename to compare.
54
+ * @returns A negative number if `b` has a newer version than `a`, positive if `a` is newer,
55
+ * or 0 if they are equal or the version cannot be determined.
20
56
  */
21
57
  export declare function compareBundlesByVersionDesc(a: string, b: string): number;
22
58
  /**
23
- * Make a CDN URL from the specified path.
59
+ * Constructs a full CDN URL by appending the given path to the base CDN URL.
24
60
  *
25
- * @param path - The path to the object (file) in the CDN.
26
- * @returns The CDN URL.
61
+ * @param path - The relative path to the object (file) on the CDN.
62
+ * @returns The complete URL pointing to the resource on the CDN.
27
63
  */
28
64
  export declare function makeCdnUrl(path: string): string;
29
65
  /**
30
- * Fetch the previously cached object (file) from the box.
66
+ * Retrieves a previously cached object (file) from the OBLAC box or native app cache.
31
67
  *
32
- * @param path - The path to the object (file) in the box.
33
- * @param resolveTo
34
- * @returns The object resolved to the specified type.
68
+ * When running in an Electron app, it uses the native API to get the cached file,
69
+ * otherwise it fetches from a local cache HTTP path.
70
+ *
71
+ * @param path - The path to the cached object within the box or app cache.
72
+ * @param resolveTo - The format to resolve the fetched object to: `'blob'`, `'json'`, or `'text'`.
73
+ * @returns A promise that resolves to the cached object in the specified format,
74
+ * or `undefined` if the file could not be retrieved.
35
75
  */
36
76
  export declare function fetchFromBox(path: string, resolveTo: 'blob' | 'json' | 'text'): Promise<any>;
37
77
  /**
38
- * Fetch object (file) from S3, resolve it to JSON, text, or binary and optionally cache it to the box.
78
+ * Fetches an object (file) from S3, resolves it to the specified format (JSON, text, or binary),
79
+ * and optionally caches it locally (on the box or within the native app).
80
+ *
81
+ * **Note:** Cached data is stored under the `/synapticon/oblac-drives/` prefix to align with the bundle's cache location.
39
82
  *
40
- * **NOTE**: Caching is stored under the /synapticon/oblac-drives/ prefix path because the bundle file includes the cache at that location.
83
+ * If offline or if the fetch fails (including HTTP errors), the function falls back to retrieving the cached version.
41
84
  *
42
- * @param path - The path to the object (file) in S3.
43
- * @param resolveTo - The type to resolve the object to: 'blob', 'json', or 'text'.
44
- * @param cache - Flag to indicate if the object should be cached to the box.
45
- * @returns The object resolved to the specified type.
85
+ * @param path - The S3 path to the object.
86
+ * @param resolveTo - The desired response format: `'blob'`, `'json'`, or `'text'`.
87
+ * @param cache - Whether to cache the fetched object locally. Defaults to false if not specified.
88
+ * @returns A promise that resolves to the fetched object in the specified format.
46
89
  */
47
90
  export declare function fetchAndResolve(path: string, resolveTo: 'blob' | 'json' | 'text', cache: boolean): Promise<any>;
48
91
  /**
49
- * Fetch brand JSON file, parse it and then fetch logo and Bootstrap theme and add it to that object.
92
+ * Fetches the brand JSON data, then retrieves and adds the logo and Bootstrap theme URLs to the object.
50
93
  *
51
- * @param brandJsonUrl - The URL of the brand JSON file.
52
- * @param themeVersion - The version of the Bootstrap theme.
53
- * @param cache - Flag to indicate if the object should be cached to the box.
54
- * @returns The brand object with the logo and Bootstrap theme URLs.
94
+ * @param brandJsonUrl - The URL of the brand JSON file. Defaults to `'brand.json'`.
95
+ * @param themeVersion - The version number of the Bootstrap theme to fetch. Defaults to `1`.
96
+ * @param cache - If `true`, caches the fetched resources locally. Defaults to `true`.
97
+ * @returns A promise that resolves to the brand object extended with `logo` and `bootstrap` CSS content,
98
+ * or `undefined` if fetching or parsing fails.
55
99
  */
56
100
  export declare function fetchBrandData(brandJsonUrl?: string, themeVersion?: number, cache?: boolean): Promise<{
57
101
  bootstrap: string;
@@ -60,60 +104,101 @@ export declare function fetchBrandData(brandJsonUrl?: string, themeVersion?: num
60
104
  name: string;
61
105
  } | undefined>;
62
106
  /**
63
- * Fetch ESI file for the specified brand and version.
107
+ * Fetches the ESI file for a specified brand and firmware version.
64
108
  *
65
- * @param brandId - The ID of the brand.
66
- * @param version - The firmware version.
67
- * @param cache - Flag to indicate if the object should be cached to the box.
68
- * @returns The ESI file as an array of strings.
109
+ * @param brandId - The unique identifier of the brand.
110
+ * @param version - The firmware version to fetch the ESI file for.
111
+ * @param cache - If `true`, caches the fetched ESI file locally. Defaults to `true`.
112
+ * @returns A promise that resolves to the ESI file content as a string.
69
113
  */
70
114
  export declare function fetchEsi(brandId: string, version: string, cache?: boolean): Promise<string>;
71
115
  /**
72
- * Fetch firmware package content as Blob.
116
+ * Fetches the content of a firmware package as a Blob.
73
117
  *
74
- * @param brandId - The ID of the brand.
75
- * @param filename - The name of the package file.
76
- * @param cache - Flag to indicate if the object should be cached to the box.
77
- * @returns The package content as Blob.
118
+ * @param brandId - The unique identifier of the brand.
119
+ * @param filename - The name of the firmware package file.
120
+ * @param cache - If `true`, caches the fetched package locally. Defaults to `true`.
121
+ * @returns A promise that resolves to the firmware package content as a Blob.
78
122
  */
79
123
  export declare function fetchFirmwarePackage(brandId: string, filename: string, cache?: boolean): Promise<Blob>;
80
124
  /**
81
- * Fetch product image (SVG) by id e.g. '9501-01' and optionally by brand id.
125
+ * Fetches the SVG product image by product ID for the specified brand.
82
126
  *
83
- * @param brandId - The ID of the brand.
84
- * @param productId - The ID of the product.
85
- * @param cache - Flag to indicate if the object should be cached to the box.
86
- * @returns The product image as SVG.
127
+ * @param brandId - The unique identifier of the brand.
128
+ * @param productId - The ID of the product (number or string).
129
+ * @param cache - If `true`, caches the fetched image locally. Defaults to `true`.
130
+ * @returns A promise that resolves to the product image as an SVG string.
87
131
  */
88
132
  export declare function fetchProductImage(brandId: string, productId: number | string, cache?: boolean): Promise<string>;
89
133
  /**
90
- * Fetch firmware changelog in Markdown format for the given minor version.
134
+ * Fetches the firmware changelog in Markdown format for a specified minor version.
91
135
  *
92
- * @param brandId - The ID of the brand.
93
- * @param minorVersion - The minor version of the firmware.
94
- * @param cache - Flag to indicate if the object should be cached to the box.
95
- * @returns The firmware changelog in Markdown format.
136
+ * @param brandId - The unique identifier of the brand.
137
+ * @param minorVersion - The minor firmware version to fetch the changelog for.
138
+ * @param cache - If `true`, caches the fetched changelog locally. Defaults to `true`.
139
+ * @returns A promise that resolves to the changelog content as a Markdown string.
140
+ * Rejects if the fetched content is invalid or not found.
96
141
  */
97
142
  export declare function fetchFirmwareChangelog(brandId: string, minorVersion: string, cache?: boolean): Promise<string>;
98
143
  /**
99
- * Fetch production and development OBLAC Drives releases.
144
+ * Fetches both production and development OBLAC Drives releases.
100
145
  *
101
- * @param cache - Flag to indicate if the object should be cached to the box.
102
- * @returns An array of OBLAC Drives releases.
146
+ * @param cache - If `true`, caches the fetched data locally. Defaults to `true`.
147
+ * @returns A promise that resolves to a tuple containing two arrays:
148
+ * - The first array holds production releases (`OblacDrivesRelease[]`).
149
+ * - The second array holds development releases (`OblacDrivesRelease[]`).
103
150
  */
104
151
  export declare function fetchOblacDrivesReleases(cache?: boolean): Promise<[OblacDrivesRelease[], OblacDrivesRelease[]]>;
105
152
  /**
106
- * List firmware packages for the specified brand.
153
+ * Lists firmware package filenames for a given brand.
107
154
  *
108
- * @param brandId - The ID of the brand.
109
- * @param latestMinorVersionsOnly - Flag to indicate if only the latest minor versions should be listed.
110
- * @param cache - Flag to indicate if the object should be cached to the box.
111
- * @returns An array of firmware package filenames.
155
+ * @param brandId - The unique identifier of the brand.
156
+ * @param latestMinorVersionsOnly - If `true`, only includes the latest minor versions; otherwise includes all versions. Defaults to `false`.
157
+ * @param cache - If `true`, caches the fetched data locally. Defaults to `true`.
158
+ * @returns A promise that resolves to an array of firmware package filenames.
112
159
  */
113
160
  export declare function listFirmwarePackages(brandId: string, latestMinorVersionsOnly?: boolean, cache?: boolean): Promise<string[]>;
114
161
  /**
115
- * List OBLAC Drives Update Service versions.
162
+ * Retrieves a list of available Oblac Drives Update Service versions.
163
+ *
164
+ * Waits for the online state to initialize, then fetches the version list
165
+ * either from the live API or a local cache depending on connectivity.
116
166
  *
117
- * @returns An array of OBLAC Drives Update Service versions.
167
+ * @returns A promise that resolves to an array of version strings.
118
168
  */
119
169
  export declare function listOblacDrivesUpdateServiceVersions(): Promise<string[]>;
170
+ /**
171
+ * Retrieves the list of supported encoder configuration types from a JSON resource hosted on AWS S3.
172
+ *
173
+ * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object
174
+ * containing the supported encoder configuration types.
175
+ */
176
+ export declare function fetchSupportedEncoderConfigurationTypes(): Promise<FirmwareProductSupportedOptions>;
177
+ /**
178
+ * Retrieves the list of supported analog inputs from a JSON resource hosted on AWS S3.
179
+ *
180
+ * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object
181
+ * containing the supported analog inputs.
182
+ */
183
+ export declare function fetchSupportedAis(): Promise<FirmwareProductSupportedOptions>;
184
+ /**
185
+ * Retrieves the list of supported digital input/output from a JSON resource hosted on AWS S3.
186
+ *
187
+ * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object
188
+ * containing the supported digital input/output.
189
+ */
190
+ export declare function fetchSupportedDios(): Promise<FirmwareProductSupportedOptions>;
191
+ /**
192
+ * Retrieves the motor configuration data from a JSON resource hosted on AWS S3.
193
+ *
194
+ * @returns A promise that resolves to a `PartConfigurationTable` object
195
+ * containing available motor configurations.
196
+ */
197
+ export declare function fetchMotorConfigurations(): Promise<PartConfigurationTable>;
198
+ /**
199
+ * Retrieves the encoder configuration data from a JSON resource hosted on AWS S3.
200
+ *
201
+ * @returns A promise that resolves to a `PartConfigurationTable` object
202
+ * containing available encoder configurations.
203
+ */
204
+ export declare function fetchEncoderConfigurations(firmwareMajorVersion: number): Promise<PartConfigurationTable>;
package/src/lib/fetch.js CHANGED
@@ -1,29 +1,54 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listOblacDrivesUpdateServiceVersions = exports.listFirmwarePackages = exports.fetchOblacDrivesReleases = exports.fetchFirmwareChangelog = exports.fetchProductImage = exports.fetchFirmwarePackage = exports.fetchEsi = exports.fetchBrandData = exports.fetchAndResolve = exports.fetchFromBox = exports.makeCdnUrl = exports.compareBundlesByVersionDesc = exports.cacheOnBox = exports.cacheApiBasePath = exports.cacheS3BasePath = exports.cacheOrigin = exports.cacheHostname = exports.cdnBasePath = exports.oblacDrivesApiGatewayOrigin = exports.hostname = exports.oblacDrivesBrandId = void 0;
3
+ exports.fetchEncoderConfigurations = exports.fetchMotorConfigurations = exports.fetchSupportedDios = exports.fetchSupportedAis = exports.fetchSupportedEncoderConfigurationTypes = exports.listOblacDrivesUpdateServiceVersions = exports.listFirmwarePackages = exports.fetchOblacDrivesReleases = exports.fetchFirmwareChangelog = exports.fetchProductImage = exports.fetchFirmwarePackage = exports.fetchEsi = exports.fetchBrandData = exports.fetchAndResolve = exports.fetchFromBox = exports.makeCdnUrl = exports.compareBundlesByVersionDesc = exports.cacheOnBox = exports.cacheApiBasePath = exports.cacheS3BasePath = exports.cacheOrigin = exports.cacheHostname = exports.cdnBasePath = exports.oblacDrivesApiGatewayOrigin = exports.hostname = exports.oblacDrivesBrandId = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const rxjs_1 = require("rxjs");
6
6
  const online_1 = require("./online");
7
7
  const util_1 = require("./util");
8
8
  const semver_1 = require("semver");
9
9
  /* eslint-disable max-len */
10
+ /**
11
+ * The brand ID for OBLAC Drives.
12
+ */
10
13
  exports.oblacDrivesBrandId = 'a7e925fa-57b7-4741-9126-0840a63cdb71';
14
+ /**
15
+ * The hostname of the current environment.
16
+ * Defaults to 'localhost' if running outside a browser (e.g., Node.js).
17
+ */
11
18
  // @ts-ignore
12
19
  exports.hostname = typeof window === 'undefined' ? 'localhost' : window.location.hostname;
13
- // AWS API Gateway and CloudFront paths
20
+ /**
21
+ * AWS API Gateway endpoint for OBLAC Drives services.
22
+ * S3 URI: s3://synapticon/oblac-drives/
23
+ */
14
24
  exports.oblacDrivesApiGatewayOrigin = 'https://pc27e3jixd.execute-api.us-east-1.amazonaws.com';
25
+ /**
26
+ * Base URL for the CDN hosting OBLAC Drives assets.
27
+ */
15
28
  exports.cdnBasePath = 'https://d9k1r8ajdoczx.cloudfront.net';
16
- // Local cache paths
29
+ /**
30
+ * Hostname and port for the local cache server (OBLAC Drives Update Service).
31
+ */
17
32
  exports.cacheHostname = `${exports.hostname}:64000`;
33
+ /**
34
+ * Base origin URL for the local cache server.
35
+ */
18
36
  exports.cacheOrigin = `http://${exports.cacheHostname}`;
37
+ /**
38
+ * Base path for accessing cached S3 resources via the local cache server.
39
+ */
19
40
  exports.cacheS3BasePath = `${exports.cacheOrigin}/s3`;
41
+ /**
42
+ * Base path for the local cache API.
43
+ */
20
44
  exports.cacheApiBasePath = `${exports.cacheOrigin}/api`;
21
45
  /**
22
- * Cache the specified object (file) to the box or the native app.
46
+ * Caches the specified object (file) locally, either on the box or within the native Electron app.
23
47
  *
24
- * @param path - The path to the object (file) in the box.
25
- * @param body - The object (file) to cache.
26
- * @returns A promise that resolves when the object is cached.
48
+ * @param path - The destination path where the object should be cached.
49
+ * @param body - The object (file) data to cache, provided as a Blob.
50
+ * @returns A promise that resolves when caching completes (only resolves in Electron;
51
+ * for other environments, caching is attempted but not awaited).
27
52
  */
28
53
  function cacheOnBox(path, body) {
29
54
  var _a;
@@ -43,7 +68,15 @@ function cacheOnBox(path, body) {
43
68
  }
44
69
  exports.cacheOnBox = cacheOnBox;
45
70
  /**
46
- * Compare OBLAC Drives releases by date in descending order.
71
+ * Compares two OBLAC Drives bundle filenames by their embedded version strings,
72
+ * sorting them in descending order based on version.
73
+ *
74
+ * The version is extracted from the filename suffix matching the pattern `_<version>.odbx`.
75
+ *
76
+ * @param a - The first bundle filename to compare.
77
+ * @param b - The second bundle filename to compare.
78
+ * @returns A negative number if `b` has a newer version than `a`, positive if `a` is newer,
79
+ * or 0 if they are equal or the version cannot be determined.
47
80
  */
48
81
  function compareBundlesByVersionDesc(a, b) {
49
82
  const re = /_(.*).odbx$/;
@@ -55,17 +88,20 @@ function compareBundlesByVersionDesc(a, b) {
55
88
  return 0;
56
89
  }
57
90
  exports.compareBundlesByVersionDesc = compareBundlesByVersionDesc;
91
+ /**
92
+ * Maps resolution types to their corresponding MIME types used for data conversion.
93
+ */
58
94
  const resolveToMimeType = {
59
95
  blob: 'application/octet-stream',
60
96
  json: 'application/json',
61
97
  text: 'text/plain',
62
98
  };
63
99
  /**
64
- * Convert base64 string to Blob, JSON, or text.
100
+ * Converts a base64-encoded string into the specified data type: Blob, JSON, or text.
65
101
  *
66
- * @param base64 - The base64 string to convert.
67
- * @param resolveTo - The type to resolve the object to: 'blob', 'json', or 'text'.
68
- * @returns - The object resolved to the specified type.
102
+ * @param base64 - The base64-encoded string to convert.
103
+ * @param resolveTo - The desired output format: `'blob'`, `'json'`, or `'text'`.
104
+ * @returns A promise that resolves to the decoded data in the specified format.
69
105
  */
70
106
  function base64ToData(base64, resolveTo) {
71
107
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -73,21 +109,25 @@ function base64ToData(base64, resolveTo) {
73
109
  });
74
110
  }
75
111
  /**
76
- * Make a CDN URL from the specified path.
112
+ * Constructs a full CDN URL by appending the given path to the base CDN URL.
77
113
  *
78
- * @param path - The path to the object (file) in the CDN.
79
- * @returns The CDN URL.
114
+ * @param path - The relative path to the object (file) on the CDN.
115
+ * @returns The complete URL pointing to the resource on the CDN.
80
116
  */
81
117
  function makeCdnUrl(path) {
82
118
  return `${exports.cdnBasePath}${path}`;
83
119
  }
84
120
  exports.makeCdnUrl = makeCdnUrl;
85
121
  /**
86
- * Fetch the previously cached object (file) from the box.
122
+ * Retrieves a previously cached object (file) from the OBLAC box or native app cache.
123
+ *
124
+ * When running in an Electron app, it uses the native API to get the cached file,
125
+ * otherwise it fetches from a local cache HTTP path.
87
126
  *
88
- * @param path - The path to the object (file) in the box.
89
- * @param resolveTo
90
- * @returns The object resolved to the specified type.
127
+ * @param path - The path to the cached object within the box or app cache.
128
+ * @param resolveTo - The format to resolve the fetched object to: `'blob'`, `'json'`, or `'text'`.
129
+ * @returns A promise that resolves to the cached object in the specified format,
130
+ * or `undefined` if the file could not be retrieved.
91
131
  */
92
132
  function fetchFromBox(path, resolveTo) {
93
133
  var _a;
@@ -107,14 +147,17 @@ function fetchFromBox(path, resolveTo) {
107
147
  }
108
148
  exports.fetchFromBox = fetchFromBox;
109
149
  /**
110
- * Fetch object (file) from S3, resolve it to JSON, text, or binary and optionally cache it to the box.
150
+ * Fetches an object (file) from S3, resolves it to the specified format (JSON, text, or binary),
151
+ * and optionally caches it locally (on the box or within the native app).
111
152
  *
112
- * **NOTE**: Caching is stored under the /synapticon/oblac-drives/ prefix path because the bundle file includes the cache at that location.
153
+ * **Note:** Cached data is stored under the `/synapticon/oblac-drives/` prefix to align with the bundle's cache location.
113
154
  *
114
- * @param path - The path to the object (file) in S3.
115
- * @param resolveTo - The type to resolve the object to: 'blob', 'json', or 'text'.
116
- * @param cache - Flag to indicate if the object should be cached to the box.
117
- * @returns The object resolved to the specified type.
155
+ * If offline or if the fetch fails (including HTTP errors), the function falls back to retrieving the cached version.
156
+ *
157
+ * @param path - The S3 path to the object.
158
+ * @param resolveTo - The desired response format: `'blob'`, `'json'`, or `'text'`.
159
+ * @param cache - Whether to cache the fetched object locally. Defaults to false if not specified.
160
+ * @returns A promise that resolves to the fetched object in the specified format.
118
161
  */
119
162
  function fetchAndResolve(path, resolveTo, cache) {
120
163
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -144,12 +187,13 @@ function fetchAndResolve(path, resolveTo, cache) {
144
187
  }
145
188
  exports.fetchAndResolve = fetchAndResolve;
146
189
  /**
147
- * Fetch brand JSON file, parse it and then fetch logo and Bootstrap theme and add it to that object.
190
+ * Fetches the brand JSON data, then retrieves and adds the logo and Bootstrap theme URLs to the object.
148
191
  *
149
- * @param brandJsonUrl - The URL of the brand JSON file.
150
- * @param themeVersion - The version of the Bootstrap theme.
151
- * @param cache - Flag to indicate if the object should be cached to the box.
152
- * @returns The brand object with the logo and Bootstrap theme URLs.
192
+ * @param brandJsonUrl - The URL of the brand JSON file. Defaults to `'brand.json'`.
193
+ * @param themeVersion - The version number of the Bootstrap theme to fetch. Defaults to `1`.
194
+ * @param cache - If `true`, caches the fetched resources locally. Defaults to `true`.
195
+ * @returns A promise that resolves to the brand object extended with `logo` and `bootstrap` CSS content,
196
+ * or `undefined` if fetching or parsing fails.
153
197
  */
154
198
  function fetchBrandData(brandJsonUrl = 'brand.json', themeVersion = 1, cache = true) {
155
199
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -170,12 +214,12 @@ function fetchBrandData(brandJsonUrl = 'brand.json', themeVersion = 1, cache = t
170
214
  }
171
215
  exports.fetchBrandData = fetchBrandData;
172
216
  /**
173
- * Fetch ESI file for the specified brand and version.
217
+ * Fetches the ESI file for a specified brand and firmware version.
174
218
  *
175
- * @param brandId - The ID of the brand.
176
- * @param version - The firmware version.
177
- * @param cache - Flag to indicate if the object should be cached to the box.
178
- * @returns The ESI file as an array of strings.
219
+ * @param brandId - The unique identifier of the brand.
220
+ * @param version - The firmware version to fetch the ESI file for.
221
+ * @param cache - If `true`, caches the fetched ESI file locally. Defaults to `true`.
222
+ * @returns A promise that resolves to the ESI file content as a string.
179
223
  */
180
224
  function fetchEsi(brandId, version, cache = true) {
181
225
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -186,12 +230,12 @@ function fetchEsi(brandId, version, cache = true) {
186
230
  }
187
231
  exports.fetchEsi = fetchEsi;
188
232
  /**
189
- * Fetch firmware package content as Blob.
233
+ * Fetches the content of a firmware package as a Blob.
190
234
  *
191
- * @param brandId - The ID of the brand.
192
- * @param filename - The name of the package file.
193
- * @param cache - Flag to indicate if the object should be cached to the box.
194
- * @returns The package content as Blob.
235
+ * @param brandId - The unique identifier of the brand.
236
+ * @param filename - The name of the firmware package file.
237
+ * @param cache - If `true`, caches the fetched package locally. Defaults to `true`.
238
+ * @returns A promise that resolves to the firmware package content as a Blob.
195
239
  */
196
240
  function fetchFirmwarePackage(brandId, filename, cache = true) {
197
241
  filename = encodeURIComponent(filename);
@@ -200,12 +244,12 @@ function fetchFirmwarePackage(brandId, filename, cache = true) {
200
244
  }
201
245
  exports.fetchFirmwarePackage = fetchFirmwarePackage;
202
246
  /**
203
- * Fetch product image (SVG) by id e.g. '9501-01' and optionally by brand id.
247
+ * Fetches the SVG product image by product ID for the specified brand.
204
248
  *
205
- * @param brandId - The ID of the brand.
206
- * @param productId - The ID of the product.
207
- * @param cache - Flag to indicate if the object should be cached to the box.
208
- * @returns The product image as SVG.
249
+ * @param brandId - The unique identifier of the brand.
250
+ * @param productId - The ID of the product (number or string).
251
+ * @param cache - If `true`, caches the fetched image locally. Defaults to `true`.
252
+ * @returns A promise that resolves to the product image as an SVG string.
209
253
  */
210
254
  function fetchProductImage(brandId, productId, cache = true) {
211
255
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -216,12 +260,13 @@ function fetchProductImage(brandId, productId, cache = true) {
216
260
  }
217
261
  exports.fetchProductImage = fetchProductImage;
218
262
  /**
219
- * Fetch firmware changelog in Markdown format for the given minor version.
263
+ * Fetches the firmware changelog in Markdown format for a specified minor version.
220
264
  *
221
- * @param brandId - The ID of the brand.
222
- * @param minorVersion - The minor version of the firmware.
223
- * @param cache - Flag to indicate if the object should be cached to the box.
224
- * @returns The firmware changelog in Markdown format.
265
+ * @param brandId - The unique identifier of the brand.
266
+ * @param minorVersion - The minor firmware version to fetch the changelog for.
267
+ * @param cache - If `true`, caches the fetched changelog locally. Defaults to `true`.
268
+ * @returns A promise that resolves to the changelog content as a Markdown string.
269
+ * Rejects if the fetched content is invalid or not found.
225
270
  */
226
271
  function fetchFirmwareChangelog(brandId, minorVersion, cache = true) {
227
272
  const path = `/brands/${brandId}/changelogs/v${encodeURIComponent(minorVersion)}.md`;
@@ -239,10 +284,12 @@ function fetchFirmwareChangelog(brandId, minorVersion, cache = true) {
239
284
  }
240
285
  exports.fetchFirmwareChangelog = fetchFirmwareChangelog;
241
286
  /**
242
- * Fetch production and development OBLAC Drives releases.
287
+ * Fetches both production and development OBLAC Drives releases.
243
288
  *
244
- * @param cache - Flag to indicate if the object should be cached to the box.
245
- * @returns An array of OBLAC Drives releases.
289
+ * @param cache - If `true`, caches the fetched data locally. Defaults to `true`.
290
+ * @returns A promise that resolves to a tuple containing two arrays:
291
+ * - The first array holds production releases (`OblacDrivesRelease[]`).
292
+ * - The second array holds development releases (`OblacDrivesRelease[]`).
246
293
  */
247
294
  function fetchOblacDrivesReleases(cache = true) {
248
295
  return Promise.all([
@@ -252,12 +299,12 @@ function fetchOblacDrivesReleases(cache = true) {
252
299
  }
253
300
  exports.fetchOblacDrivesReleases = fetchOblacDrivesReleases;
254
301
  /**
255
- * List firmware packages for the specified brand.
302
+ * Lists firmware package filenames for a given brand.
256
303
  *
257
- * @param brandId - The ID of the brand.
258
- * @param latestMinorVersionsOnly - Flag to indicate if only the latest minor versions should be listed.
259
- * @param cache - Flag to indicate if the object should be cached to the box.
260
- * @returns An array of firmware package filenames.
304
+ * @param brandId - The unique identifier of the brand.
305
+ * @param latestMinorVersionsOnly - If `true`, only includes the latest minor versions; otherwise includes all versions. Defaults to `false`.
306
+ * @param cache - If `true`, caches the fetched data locally. Defaults to `true`.
307
+ * @returns A promise that resolves to an array of firmware package filenames.
261
308
  */
262
309
  function listFirmwarePackages(brandId, latestMinorVersionsOnly = false, cache = true) {
263
310
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -267,9 +314,12 @@ function listFirmwarePackages(brandId, latestMinorVersionsOnly = false, cache =
267
314
  }
268
315
  exports.listFirmwarePackages = listFirmwarePackages;
269
316
  /**
270
- * List OBLAC Drives Update Service versions.
317
+ * Retrieves a list of available Oblac Drives Update Service versions.
318
+ *
319
+ * Waits for the online state to initialize, then fetches the version list
320
+ * either from the live API or a local cache depending on connectivity.
271
321
  *
272
- * @returns An array of OBLAC Drives Update Service versions.
322
+ * @returns A promise that resolves to an array of version strings.
273
323
  */
274
324
  function listOblacDrivesUpdateServiceVersions() {
275
325
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -282,4 +332,69 @@ function listOblacDrivesUpdateServiceVersions() {
282
332
  });
283
333
  }
284
334
  exports.listOblacDrivesUpdateServiceVersions = listOblacDrivesUpdateServiceVersions;
335
+ /**
336
+ * Retrieves the list of supported encoder configuration types from a JSON resource hosted on AWS S3.
337
+ *
338
+ * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object
339
+ * containing the supported encoder configuration types.
340
+ */
341
+ function fetchSupportedEncoderConfigurationTypes() {
342
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
343
+ const path = `/supported-encoder-configuration-types.json`;
344
+ return yield fetchAndResolve(path, 'json', true);
345
+ });
346
+ }
347
+ exports.fetchSupportedEncoderConfigurationTypes = fetchSupportedEncoderConfigurationTypes;
348
+ /**
349
+ * Retrieves the list of supported analog inputs from a JSON resource hosted on AWS S3.
350
+ *
351
+ * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object
352
+ * containing the supported analog inputs.
353
+ */
354
+ function fetchSupportedAis() {
355
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
356
+ const path = '/supported-ais.json';
357
+ return yield fetchAndResolve(path, 'json', true);
358
+ });
359
+ }
360
+ exports.fetchSupportedAis = fetchSupportedAis;
361
+ /**
362
+ * Retrieves the list of supported digital input/output from a JSON resource hosted on AWS S3.
363
+ *
364
+ * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object
365
+ * containing the supported digital input/output.
366
+ */
367
+ function fetchSupportedDios() {
368
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
369
+ const path = '/supported-dios.json';
370
+ return yield fetchAndResolve(path, 'json', true);
371
+ });
372
+ }
373
+ exports.fetchSupportedDios = fetchSupportedDios;
374
+ /**
375
+ * Retrieves the motor configuration data from a JSON resource hosted on AWS S3.
376
+ *
377
+ * @returns A promise that resolves to a `PartConfigurationTable` object
378
+ * containing available motor configurations.
379
+ */
380
+ function fetchMotorConfigurations() {
381
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
382
+ const path = '/motor-configurations.json';
383
+ return fetchAndResolve(path, 'json', true);
384
+ });
385
+ }
386
+ exports.fetchMotorConfigurations = fetchMotorConfigurations;
387
+ /**
388
+ * Retrieves the encoder configuration data from a JSON resource hosted on AWS S3.
389
+ *
390
+ * @returns A promise that resolves to a `PartConfigurationTable` object
391
+ * containing available encoder configurations.
392
+ */
393
+ function fetchEncoderConfigurations(firmwareMajorVersion) {
394
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
395
+ const path = `/encoder-configurations-v${firmwareMajorVersion}.json`;
396
+ return fetchAndResolve(path, 'json', true);
397
+ });
398
+ }
399
+ exports.fetchEncoderConfigurations = fetchEncoderConfigurations;
285
400
  //# sourceMappingURL=fetch.js.map