edge-impulse-api 1.95.10 → 1.95.12

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 (41) hide show
  1. package/build/browser/edge-impulse-api.d.ts +73 -26
  2. package/build/browser/edge-impulse-api.js +185 -15
  3. package/build/browser/edge-impulse-api.js.map +1 -1
  4. package/build/library/sdk/api/deploymentApi.d.ts +1 -1
  5. package/build/library/sdk/api/deploymentApi.js +1 -1
  6. package/build/library/sdk/api/jobsApi.d.ts +1 -1
  7. package/build/library/sdk/api/jobsApi.js +1 -1
  8. package/build/library/sdk/api/learnApi.d.ts +33 -0
  9. package/build/library/sdk/api/learnApi.js +160 -0
  10. package/build/library/sdk/api/learnApi.js.map +1 -1
  11. package/build/library/sdk/api/organizationBlocksApi.d.ts +5 -4
  12. package/build/library/sdk/api/organizationBlocksApi.js +4 -4
  13. package/build/library/sdk/api/organizationBlocksApi.js.map +1 -1
  14. package/build/library/sdk/model/addOrganizationExtensionBlockRequest.d.ts +2 -6
  15. package/build/library/sdk/model/addOrganizationExtensionBlockRequest.js +0 -2
  16. package/build/library/sdk/model/addOrganizationExtensionBlockRequest.js.map +1 -1
  17. package/build/library/sdk/model/extension.d.ts +2 -3
  18. package/build/library/sdk/model/extension.js +0 -2
  19. package/build/library/sdk/model/extension.js.map +1 -1
  20. package/build/library/sdk/model/extensionNavbarLocation.d.ts +5 -0
  21. package/build/library/sdk/model/extensionNavbarLocation.js +6 -0
  22. package/build/library/sdk/model/extensionNavbarLocation.js.map +1 -0
  23. package/build/library/sdk/model/getAllImpulsesResponse.d.ts +4 -0
  24. package/build/library/sdk/model/listLearnBlockFilesResponse.d.ts +15 -0
  25. package/build/library/sdk/model/listLearnBlockFilesResponse.js +4 -0
  26. package/build/library/sdk/model/listLearnBlockFilesResponse.js.map +1 -0
  27. package/build/library/sdk/model/models.d.ts +2 -0
  28. package/build/library/sdk/model/models.js +2 -0
  29. package/build/library/sdk/model/models.js.map +1 -1
  30. package/build/library/sdk/model/oAuthScope.d.ts +1 -1
  31. package/build/library/sdk/model/oAuthScope.js +1 -1
  32. package/build/library/sdk/model/oAuthScope.js.map +1 -1
  33. package/build/library/sdk/model/projectExtension.d.ts +2 -3
  34. package/build/library/sdk/model/projectExtension.js +0 -2
  35. package/build/library/sdk/model/projectExtension.js.map +1 -1
  36. package/build/library/sdk/model/updateOrganizationExtensionBlockRequest.d.ts +2 -6
  37. package/build/library/sdk/model/updateOrganizationExtensionBlockRequest.js +0 -2
  38. package/build/library/sdk/model/updateOrganizationExtensionBlockRequest.js.map +1 -1
  39. package/build/library/sdk/model/updateProjectRequest.d.ts +2 -1
  40. package/build/library/sdk/model/updateProjectRequest.js.map +1 -1
  41. package/package.json +1 -1
@@ -116,7 +116,7 @@ export declare class DeploymentApi {
116
116
  setApiKey(key: DeploymentApiApiKeys, value: string | undefined): void;
117
117
  set accessToken(token: string);
118
118
  /**
119
- * Create a deployment job for a _public_ project. You can only create deployments for \"wasm\" and \"wasm-browser-simd\" deployment types. If a deployment already exists, jobId is null. If a deployment did not exist, or a job is created, jobId is set to an integer, and you can get updates via `getPublicDeploymentStatus`. When this step is complete use `downloadHistoricDeployment` to download the artefacts using deploymentVersion. Updates are _NOT_ streamed over the websocket API (for security reasons); but can be obtained via `getPublicDeploymentStatus`.
119
+ * Create a deployment job for a _public_ project. If a deployment already exists, jobId is null. If a deployment did not exist, or a job is created, jobId is set to an integer, and you can get updates via `getPublicDeploymentStatus`. When this step is complete use `downloadHistoricDeployment` to download the artefacts using deploymentVersion. Updates are _NOT_ streamed over the websocket API (for security reasons); but can be obtained via `getPublicDeploymentStatus`.
120
120
  * @summary Build deployment (public)
121
121
  * @param projectId Project ID
122
122
  * @param buildPublicDeploymentJobRequest
@@ -99,7 +99,7 @@ class DeploymentApi {
99
99
  this.authentications.OAuth2.accessToken = token;
100
100
  }
101
101
  /**
102
- * Create a deployment job for a _public_ project. You can only create deployments for \"wasm\" and \"wasm-browser-simd\" deployment types. If a deployment already exists, jobId is null. If a deployment did not exist, or a job is created, jobId is set to an integer, and you can get updates via `getPublicDeploymentStatus`. When this step is complete use `downloadHistoricDeployment` to download the artefacts using deploymentVersion. Updates are _NOT_ streamed over the websocket API (for security reasons); but can be obtained via `getPublicDeploymentStatus`.
102
+ * Create a deployment job for a _public_ project. If a deployment already exists, jobId is null. If a deployment did not exist, or a job is created, jobId is set to an integer, and you can get updates via `getPublicDeploymentStatus`. When this step is complete use `downloadHistoricDeployment` to download the artefacts using deploymentVersion. Updates are _NOT_ streamed over the websocket API (for security reasons); but can be obtained via `getPublicDeploymentStatus`.
103
103
  * @summary Build deployment (public)
104
104
  * @param projectId Project ID
105
105
  * @param buildPublicDeploymentJobRequest
@@ -727,7 +727,7 @@ export declare class JobsApi {
727
727
  }) => void;
728
728
  }): Promise<StartJobResponse>;
729
729
  /**
730
- * Create a new version of the project. This stores all data and configuration offsite. If you have access to the enterprise version of Edge Impulse you can store your data in your own storage buckets (only through JWT token authentication).
730
+ * Create a new version of the project. This stores all data and configuration offsite. If you have access to the enterprise version of Edge Impulse you can store your data in your own storage buckets (only through JWT token authentication). OAuth requests that set makePublic to true also require the projects:versions:public:create scope.
731
731
  * @summary Version project
732
732
  * @param projectId Project ID
733
733
  * @param projectVersionRequest
@@ -3231,7 +3231,7 @@ class JobsApi {
3231
3231
  return resp;
3232
3232
  }
3233
3233
  /**
3234
- * Create a new version of the project. This stores all data and configuration offsite. If you have access to the enterprise version of Edge Impulse you can store your data in your own storage buckets (only through JWT token authentication).
3234
+ * Create a new version of the project. This stores all data and configuration offsite. If you have access to the enterprise version of Edge Impulse you can store your data in your own storage buckets (only through JWT token authentication). OAuth requests that set makePublic to true also require the projects:versions:public:create scope.
3235
3235
  * @summary Version project
3236
3236
  * @param projectId Project ID
3237
3237
  * @param projectVersionRequest
@@ -21,6 +21,7 @@ import { GetDataExplorerFeaturesResponse } from '../model/getDataExplorerFeature
21
21
  import { GetPretrainedModelResponse } from '../model/getPretrainedModelResponse';
22
22
  import { KerasModelMetadataResponse } from '../model/kerasModelMetadataResponse';
23
23
  import { KerasResponse } from '../model/kerasResponse';
24
+ import { ListLearnBlockFilesResponse } from '../model/listLearnBlockFilesResponse';
24
25
  import { SavePretrainedModelRequest } from '../model/savePretrainedModelRequest';
25
26
  import { SetAnomalyParameterRequest } from '../model/setAnomalyParameterRequest';
26
27
  import { SetKerasParameterRequest } from '../model/setKerasParameterRequest';
@@ -59,6 +60,9 @@ type getPretrainedModelInfoQueryParams = {
59
60
  type profilePretrainedModelQueryParams = {
60
61
  impulseId?: number;
61
62
  };
63
+ type readLearnBlockCustomDataFileQueryParams = {
64
+ path: string;
65
+ };
62
66
  type savePretrainedModelParametersQueryParams = {
63
67
  impulseId?: number;
64
68
  };
@@ -353,6 +357,20 @@ export declare class LearnApi {
353
357
  [name: string]: string;
354
358
  }) => void;
355
359
  }): Promise<VlmConfigResponse>;
360
+ /**
361
+ * List all custom files for the learn block as they exist on the file system. You can write extra files to /home/custom_data in your custom learn block (or in expert mode); then pick them up here. This yields all files across all subfolders.
362
+ * @summary List learn block custom data files
363
+ * @param projectId Project ID
364
+ * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
365
+ */
366
+ listLearnBlockCustomDataFiles(projectId: number, learnId: number, options?: {
367
+ headers: {
368
+ [name: string]: string;
369
+ };
370
+ responseHeadersCallback?: (headers: {
371
+ [name: string]: string;
372
+ }) => void;
373
+ }): Promise<ListLearnBlockFilesResponse>;
356
374
  /**
357
375
  * Returns the latency, RAM and ROM used for the pretrained model - upload first via `uploadPretrainedModel`. This is using the project\'s selected latency device. Updates are streamed over the websocket API (or can be retrieved through the /stdout endpoint). Use getProfileTfliteJobResult to get the results when the job is completed.
358
376
  * @summary Profile pretrained model
@@ -367,6 +385,21 @@ export declare class LearnApi {
367
385
  [name: string]: string;
368
386
  }) => void;
369
387
  }): Promise<StartJobResponse>;
388
+ /**
389
+ * Read a file from the learn block as it exists on the file system. You can write extra files to /home/custom_data in your custom learn block (or in expert mode); then pick them up here. Use \"listLearnBlockCustomDataFiles\" to list all available files.
390
+ * @summary Read learn block custom data file
391
+ * @param projectId Project ID
392
+ * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
393
+ * @param path CDN Path
394
+ */
395
+ readLearnBlockCustomDataFile(projectId: number, learnId: number, queryParams: readLearnBlockCustomDataFileQueryParams, options?: {
396
+ headers: {
397
+ [name: string]: string;
398
+ };
399
+ responseHeadersCallback?: (headers: {
400
+ [name: string]: string;
401
+ }) => void;
402
+ }): Promise<Buffer>;
370
403
  /**
371
404
  * Save input / model configuration for a pretrained model. This overrides the current impulse. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
372
405
  * @summary Save parameters for pretrained model
@@ -1439,6 +1439,82 @@ class LearnApi {
1439
1439
  }
1440
1440
  return resp;
1441
1441
  }
1442
+ /**
1443
+ * List all custom files for the learn block as they exist on the file system. You can write extra files to /home/custom_data in your custom learn block (or in expert mode); then pick them up here. This yields all files across all subfolders.
1444
+ * @summary List learn block custom data files
1445
+ * @param projectId Project ID
1446
+ * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
1447
+ */
1448
+ async listLearnBlockCustomDataFiles(projectId, learnId, options = { headers: {} }) {
1449
+ const localVarPath = this.basePath + '/api/{projectId}/learn-data/{learnId}/custom-data/list'
1450
+ .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1451
+ .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
1452
+ let queryParameters = {};
1453
+ let localVarHeaderParams = {
1454
+ 'User-Agent': 'edgeimpulse-api nodejs',
1455
+ 'Content-Type': 'application/json',
1456
+ ...this.defaultHeaders,
1457
+ };
1458
+ const produces = ['application/json'];
1459
+ // give precedence to 'application/json'
1460
+ if (produces.indexOf('application/json') >= 0) {
1461
+ localVarHeaderParams.Accept = 'application/json';
1462
+ }
1463
+ else {
1464
+ localVarHeaderParams.Accept = produces.join(',');
1465
+ }
1466
+ let localVarFormParams;
1467
+ // verify required parameter 'projectId' is not null or undefined
1468
+ if (projectId === null || projectId === undefined) {
1469
+ throw new Error('Required parameter projectId was null or undefined when calling listLearnBlockCustomDataFiles.');
1470
+ }
1471
+ // verify required parameter 'learnId' is not null or undefined
1472
+ if (learnId === null || learnId === undefined) {
1473
+ throw new Error('Required parameter learnId was null or undefined when calling listLearnBlockCustomDataFiles.');
1474
+ }
1475
+ localVarHeaderParams = {
1476
+ ...localVarHeaderParams,
1477
+ ...options.headers,
1478
+ ...this.opts.extraHeaders,
1479
+ };
1480
+ const queryString = Object.entries(queryParameters)
1481
+ .filter(([, value]) => value !== undefined)
1482
+ .map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
1483
+ .join('&');
1484
+ let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
1485
+ let localVarRequestOptions = {
1486
+ method: 'GET',
1487
+ headers: { ...localVarHeaderParams },
1488
+ };
1489
+ let requestOptions = localVarRequestOptions;
1490
+ let url = localVarUrl;
1491
+ const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
1492
+ requestOptions = auth_ApiKeyAuthentication.requestOptions;
1493
+ url = auth_ApiKeyAuthentication.url;
1494
+ const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
1495
+ requestOptions = auth_JWTAuthentication.requestOptions;
1496
+ url = auth_JWTAuthentication.url;
1497
+ const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
1498
+ requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
1499
+ url = auth_JWTHttpHeaderAuthentication.url;
1500
+ const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
1501
+ requestOptions = auth_OAuth2.requestOptions;
1502
+ url = auth_OAuth2.url;
1503
+ const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
1504
+ requestOptions = authDefault.requestOptions;
1505
+ url = authDefault.url;
1506
+ (0, models_1.applyFormParams)(requestOptions, localVarFormParams);
1507
+ const response = await fetch(url, requestOptions);
1508
+ const resp = this.handleResponse(response, 'ListLearnBlockFilesResponse');
1509
+ if (options === null || options === void 0 ? void 0 : options.responseHeadersCallback) {
1510
+ const headerCb = options.responseHeadersCallback;
1511
+ // on next tick, so we have time to handle the response
1512
+ setTimeout(() => {
1513
+ headerCb(Object.fromEntries(response.headers.entries()));
1514
+ }, 0);
1515
+ }
1516
+ return resp;
1517
+ }
1442
1518
  /**
1443
1519
  * Returns the latency, RAM and ROM used for the pretrained model - upload first via `uploadPretrainedModel`. This is using the project\'s selected latency device. Updates are streamed over the websocket API (or can be retrieved through the /stdout endpoint). Use getProfileTfliteJobResult to get the results when the job is completed.
1444
1520
  * @summary Profile pretrained model
@@ -1513,6 +1589,90 @@ class LearnApi {
1513
1589
  }
1514
1590
  return resp;
1515
1591
  }
1592
+ /**
1593
+ * Read a file from the learn block as it exists on the file system. You can write extra files to /home/custom_data in your custom learn block (or in expert mode); then pick them up here. Use \"listLearnBlockCustomDataFiles\" to list all available files.
1594
+ * @summary Read learn block custom data file
1595
+ * @param projectId Project ID
1596
+ * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
1597
+ * @param path CDN Path
1598
+ */
1599
+ async readLearnBlockCustomDataFile(projectId, learnId, queryParams, options = { headers: {} }) {
1600
+ const localVarPath = this.basePath + '/api/{projectId}/learn-data/{learnId}/custom-data/read'
1601
+ .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1602
+ .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
1603
+ let queryParameters = {};
1604
+ let localVarHeaderParams = {
1605
+ 'User-Agent': 'edgeimpulse-api nodejs',
1606
+ 'Content-Type': 'application/json',
1607
+ ...this.defaultHeaders,
1608
+ };
1609
+ const produces = ['application/octet-stream'];
1610
+ // give precedence to 'application/json'
1611
+ if (produces.indexOf('application/json') >= 0) {
1612
+ localVarHeaderParams.Accept = 'application/json';
1613
+ }
1614
+ else {
1615
+ localVarHeaderParams.Accept = produces.join(',');
1616
+ }
1617
+ let localVarFormParams;
1618
+ // verify required parameter 'projectId' is not null or undefined
1619
+ if (projectId === null || projectId === undefined) {
1620
+ throw new Error('Required parameter projectId was null or undefined when calling readLearnBlockCustomDataFile.');
1621
+ }
1622
+ // verify required parameter 'learnId' is not null or undefined
1623
+ if (learnId === null || learnId === undefined) {
1624
+ throw new Error('Required parameter learnId was null or undefined when calling readLearnBlockCustomDataFile.');
1625
+ }
1626
+ // verify required parameter 'path' is not null or undefined
1627
+ if (queryParams.path === null || queryParams.path === undefined) {
1628
+ throw new Error('Required parameter queryParams.path was null or undefined when calling readLearnBlockCustomDataFile.');
1629
+ }
1630
+ if (typeof (queryParams === null || queryParams === void 0 ? void 0 : queryParams.path) !== 'undefined' && (queryParams === null || queryParams === void 0 ? void 0 : queryParams.path) !== null) {
1631
+ queryParameters['path'] = queryParams.path;
1632
+ }
1633
+ localVarHeaderParams = {
1634
+ ...localVarHeaderParams,
1635
+ ...options.headers,
1636
+ ...this.opts.extraHeaders,
1637
+ };
1638
+ const queryString = Object.entries(queryParameters)
1639
+ .filter(([, value]) => value !== undefined)
1640
+ .map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
1641
+ .join('&');
1642
+ let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
1643
+ let localVarRequestOptions = {
1644
+ method: 'GET',
1645
+ headers: { ...localVarHeaderParams },
1646
+ };
1647
+ let requestOptions = localVarRequestOptions;
1648
+ let url = localVarUrl;
1649
+ const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
1650
+ requestOptions = auth_ApiKeyAuthentication.requestOptions;
1651
+ url = auth_ApiKeyAuthentication.url;
1652
+ const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
1653
+ requestOptions = auth_JWTAuthentication.requestOptions;
1654
+ url = auth_JWTAuthentication.url;
1655
+ const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
1656
+ requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
1657
+ url = auth_JWTHttpHeaderAuthentication.url;
1658
+ const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
1659
+ requestOptions = auth_OAuth2.requestOptions;
1660
+ url = auth_OAuth2.url;
1661
+ const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
1662
+ requestOptions = authDefault.requestOptions;
1663
+ url = authDefault.url;
1664
+ (0, models_1.applyFormParams)(requestOptions, localVarFormParams);
1665
+ const response = await fetch(url, requestOptions);
1666
+ const resp = this.handleResponse(response, 'Buffer');
1667
+ if (options === null || options === void 0 ? void 0 : options.responseHeadersCallback) {
1668
+ const headerCb = options.responseHeadersCallback;
1669
+ // on next tick, so we have time to handle the response
1670
+ setTimeout(() => {
1671
+ headerCb(Object.fromEntries(response.headers.entries()));
1672
+ }, 0);
1673
+ }
1674
+ return resp;
1675
+ }
1516
1676
  /**
1517
1677
  * Save input / model configuration for a pretrained model. This overrides the current impulse. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
1518
1678
  * @summary Save parameters for pretrained model