edge-impulse-api 1.95.11 → 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.
- package/build/browser/edge-impulse-api.d.ts +51 -1
- package/build/browser/edge-impulse-api.js +168 -0
- package/build/browser/edge-impulse-api.js.map +1 -1
- package/build/library/sdk/api/learnApi.d.ts +33 -0
- package/build/library/sdk/api/learnApi.js +160 -0
- package/build/library/sdk/api/learnApi.js.map +1 -1
- package/build/library/sdk/model/listLearnBlockFilesResponse.d.ts +15 -0
- package/build/library/sdk/model/listLearnBlockFilesResponse.js +4 -0
- package/build/library/sdk/model/listLearnBlockFilesResponse.js.map +1 -0
- package/build/library/sdk/model/models.d.ts +1 -0
- package/build/library/sdk/model/models.js +1 -0
- package/build/library/sdk/model/models.js.map +1 -1
- package/build/library/sdk/model/updateProjectRequest.d.ts +2 -1
- package/build/library/sdk/model/updateProjectRequest.js.map +1 -1
- package/package.json +1 -1
|
@@ -4797,6 +4797,9 @@ type getPretrainedModelInfoQueryParams = {
|
|
|
4797
4797
|
type profilePretrainedModelQueryParams = {
|
|
4798
4798
|
impulseId?: number;
|
|
4799
4799
|
};
|
|
4800
|
+
type readLearnBlockCustomDataFileQueryParams = {
|
|
4801
|
+
path: string;
|
|
4802
|
+
};
|
|
4800
4803
|
type savePretrainedModelParametersQueryParams = {
|
|
4801
4804
|
impulseId?: number;
|
|
4802
4805
|
};
|
|
@@ -5091,6 +5094,20 @@ export class LearnApi {
|
|
|
5091
5094
|
[name: string]: string;
|
|
5092
5095
|
}) => void;
|
|
5093
5096
|
}): Promise<VlmConfigResponse>;
|
|
5097
|
+
/**
|
|
5098
|
+
* 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.
|
|
5099
|
+
* @summary List learn block custom data files
|
|
5100
|
+
* @param projectId Project ID
|
|
5101
|
+
* @param learnId Learn Block ID, use the impulse functions to retrieve the ID
|
|
5102
|
+
*/
|
|
5103
|
+
listLearnBlockCustomDataFiles(projectId: number, learnId: number, options?: {
|
|
5104
|
+
headers: {
|
|
5105
|
+
[name: string]: string;
|
|
5106
|
+
};
|
|
5107
|
+
responseHeadersCallback?: (headers: {
|
|
5108
|
+
[name: string]: string;
|
|
5109
|
+
}) => void;
|
|
5110
|
+
}): Promise<ListLearnBlockFilesResponse>;
|
|
5094
5111
|
/**
|
|
5095
5112
|
* 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.
|
|
5096
5113
|
* @summary Profile pretrained model
|
|
@@ -5105,6 +5122,21 @@ export class LearnApi {
|
|
|
5105
5122
|
[name: string]: string;
|
|
5106
5123
|
}) => void;
|
|
5107
5124
|
}): Promise<StartJobResponse>;
|
|
5125
|
+
/**
|
|
5126
|
+
* 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.
|
|
5127
|
+
* @summary Read learn block custom data file
|
|
5128
|
+
* @param projectId Project ID
|
|
5129
|
+
* @param learnId Learn Block ID, use the impulse functions to retrieve the ID
|
|
5130
|
+
* @param path CDN Path
|
|
5131
|
+
*/
|
|
5132
|
+
readLearnBlockCustomDataFile(projectId: number, learnId: number, queryParams: readLearnBlockCustomDataFileQueryParams, options?: {
|
|
5133
|
+
headers: {
|
|
5134
|
+
[name: string]: string;
|
|
5135
|
+
};
|
|
5136
|
+
responseHeadersCallback?: (headers: {
|
|
5137
|
+
[name: string]: string;
|
|
5138
|
+
}) => void;
|
|
5139
|
+
}): Promise<ArrayBuffer>;
|
|
5108
5140
|
/**
|
|
5109
5141
|
* 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`.
|
|
5110
5142
|
* @summary Save parameters for pretrained model
|
|
@@ -23285,6 +23317,23 @@ export type ListJobsResponse = {
|
|
|
23285
23317
|
};
|
|
23286
23318
|
|
|
23287
23319
|
|
|
23320
|
+
export type ListLearnBlockFilesResponse = {
|
|
23321
|
+
/**
|
|
23322
|
+
* Whether the operation succeeded
|
|
23323
|
+
*/
|
|
23324
|
+
success: boolean;
|
|
23325
|
+
/**
|
|
23326
|
+
* Optional error description (set if 'success' was false)
|
|
23327
|
+
*/
|
|
23328
|
+
error?: string;
|
|
23329
|
+
files: {
|
|
23330
|
+
path: string;
|
|
23331
|
+
mimeType: string;
|
|
23332
|
+
size: number;
|
|
23333
|
+
}[];
|
|
23334
|
+
};
|
|
23335
|
+
|
|
23336
|
+
|
|
23288
23337
|
export type ListModelsResponse = {
|
|
23289
23338
|
/**
|
|
23290
23339
|
* Whether the operation succeeded
|
|
@@ -30341,7 +30390,8 @@ export type UpdateOrganizationTransformationBlockRequest = {
|
|
|
30341
30390
|
|
|
30342
30391
|
|
|
30343
30392
|
/**
|
|
30344
|
-
* Only fields set in this object will be updated.
|
|
30393
|
+
* Only fields set in this object will be updated. "projectVisibility" can only be changed when authenticating with JWT
|
|
30394
|
+
* token authentication.
|
|
30345
30395
|
*/
|
|
30346
30396
|
export type UpdateProjectRequest = {
|
|
30347
30397
|
/**
|
|
@@ -23150,6 +23150,82 @@ class LearnApi {
|
|
|
23150
23150
|
}
|
|
23151
23151
|
return resp;
|
|
23152
23152
|
}
|
|
23153
|
+
/**
|
|
23154
|
+
* 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.
|
|
23155
|
+
* @summary List learn block custom data files
|
|
23156
|
+
* @param projectId Project ID
|
|
23157
|
+
* @param learnId Learn Block ID, use the impulse functions to retrieve the ID
|
|
23158
|
+
*/
|
|
23159
|
+
async listLearnBlockCustomDataFiles(projectId, learnId, options = { headers: {} }) {
|
|
23160
|
+
const localVarPath = this.basePath + '/api/{projectId}/learn-data/{learnId}/custom-data/list'
|
|
23161
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
23162
|
+
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
23163
|
+
let queryParameters = {};
|
|
23164
|
+
let localVarHeaderParams = {
|
|
23165
|
+
...(typeof window === "undefined" ? { "User-Agent": "edgeimpulse-api nodejs" } : {}),
|
|
23166
|
+
'Content-Type': 'application/json',
|
|
23167
|
+
...this.defaultHeaders,
|
|
23168
|
+
};
|
|
23169
|
+
const produces = ['application/json'];
|
|
23170
|
+
// give precedence to 'application/json'
|
|
23171
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
23172
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
23173
|
+
}
|
|
23174
|
+
else {
|
|
23175
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
23176
|
+
}
|
|
23177
|
+
let localVarFormParams;
|
|
23178
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
23179
|
+
if (projectId === null || projectId === undefined) {
|
|
23180
|
+
throw new Error('Required parameter projectId was null or undefined when calling listLearnBlockCustomDataFiles.');
|
|
23181
|
+
}
|
|
23182
|
+
// verify required parameter 'learnId' is not null or undefined
|
|
23183
|
+
if (learnId === null || learnId === undefined) {
|
|
23184
|
+
throw new Error('Required parameter learnId was null or undefined when calling listLearnBlockCustomDataFiles.');
|
|
23185
|
+
}
|
|
23186
|
+
localVarHeaderParams = {
|
|
23187
|
+
...localVarHeaderParams,
|
|
23188
|
+
...options.headers,
|
|
23189
|
+
...this.opts.extraHeaders,
|
|
23190
|
+
};
|
|
23191
|
+
const queryString = Object.entries(queryParameters)
|
|
23192
|
+
.filter(([, value]) => value !== undefined)
|
|
23193
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
23194
|
+
.join('&');
|
|
23195
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
23196
|
+
let localVarRequestOptions = {
|
|
23197
|
+
method: 'GET',
|
|
23198
|
+
headers: { ...localVarHeaderParams },
|
|
23199
|
+
};
|
|
23200
|
+
let requestOptions = localVarRequestOptions;
|
|
23201
|
+
let url = localVarUrl;
|
|
23202
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
23203
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
23204
|
+
url = auth_ApiKeyAuthentication.url;
|
|
23205
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
23206
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
23207
|
+
url = auth_JWTAuthentication.url;
|
|
23208
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
23209
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
23210
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
23211
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
23212
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
23213
|
+
url = auth_OAuth2.url;
|
|
23214
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
23215
|
+
requestOptions = authDefault.requestOptions;
|
|
23216
|
+
url = authDefault.url;
|
|
23217
|
+
(0, models_1.applyFormParams)(requestOptions, localVarFormParams);
|
|
23218
|
+
const response = await fetch(url, requestOptions);
|
|
23219
|
+
const resp = this.handleResponse(response, 'ListLearnBlockFilesResponse');
|
|
23220
|
+
if (options === null || options === void 0 ? void 0 : options.responseHeadersCallback) {
|
|
23221
|
+
const headerCb = options.responseHeadersCallback;
|
|
23222
|
+
// on next tick, so we have time to handle the response
|
|
23223
|
+
setTimeout(() => {
|
|
23224
|
+
headerCb(Object.fromEntries(response.headers.entries()));
|
|
23225
|
+
}, 0);
|
|
23226
|
+
}
|
|
23227
|
+
return resp;
|
|
23228
|
+
}
|
|
23153
23229
|
/**
|
|
23154
23230
|
* 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.
|
|
23155
23231
|
* @summary Profile pretrained model
|
|
@@ -23224,6 +23300,90 @@ class LearnApi {
|
|
|
23224
23300
|
}
|
|
23225
23301
|
return resp;
|
|
23226
23302
|
}
|
|
23303
|
+
/**
|
|
23304
|
+
* 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.
|
|
23305
|
+
* @summary Read learn block custom data file
|
|
23306
|
+
* @param projectId Project ID
|
|
23307
|
+
* @param learnId Learn Block ID, use the impulse functions to retrieve the ID
|
|
23308
|
+
* @param path CDN Path
|
|
23309
|
+
*/
|
|
23310
|
+
async readLearnBlockCustomDataFile(projectId, learnId, queryParams, options = { headers: {} }) {
|
|
23311
|
+
const localVarPath = this.basePath + '/api/{projectId}/learn-data/{learnId}/custom-data/read'
|
|
23312
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
23313
|
+
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
23314
|
+
let queryParameters = {};
|
|
23315
|
+
let localVarHeaderParams = {
|
|
23316
|
+
...(typeof window === "undefined" ? { "User-Agent": "edgeimpulse-api nodejs" } : {}),
|
|
23317
|
+
'Content-Type': 'application/json',
|
|
23318
|
+
...this.defaultHeaders,
|
|
23319
|
+
};
|
|
23320
|
+
const produces = ['application/octet-stream'];
|
|
23321
|
+
// give precedence to 'application/json'
|
|
23322
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
23323
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
23324
|
+
}
|
|
23325
|
+
else {
|
|
23326
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
23327
|
+
}
|
|
23328
|
+
let localVarFormParams;
|
|
23329
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
23330
|
+
if (projectId === null || projectId === undefined) {
|
|
23331
|
+
throw new Error('Required parameter projectId was null or undefined when calling readLearnBlockCustomDataFile.');
|
|
23332
|
+
}
|
|
23333
|
+
// verify required parameter 'learnId' is not null or undefined
|
|
23334
|
+
if (learnId === null || learnId === undefined) {
|
|
23335
|
+
throw new Error('Required parameter learnId was null or undefined when calling readLearnBlockCustomDataFile.');
|
|
23336
|
+
}
|
|
23337
|
+
// verify required parameter 'path' is not null or undefined
|
|
23338
|
+
if (queryParams.path === null || queryParams.path === undefined) {
|
|
23339
|
+
throw new Error('Required parameter queryParams.path was null or undefined when calling readLearnBlockCustomDataFile.');
|
|
23340
|
+
}
|
|
23341
|
+
if (typeof (queryParams === null || queryParams === void 0 ? void 0 : queryParams.path) !== 'undefined' && (queryParams === null || queryParams === void 0 ? void 0 : queryParams.path) !== null) {
|
|
23342
|
+
queryParameters['path'] = queryParams.path;
|
|
23343
|
+
}
|
|
23344
|
+
localVarHeaderParams = {
|
|
23345
|
+
...localVarHeaderParams,
|
|
23346
|
+
...options.headers,
|
|
23347
|
+
...this.opts.extraHeaders,
|
|
23348
|
+
};
|
|
23349
|
+
const queryString = Object.entries(queryParameters)
|
|
23350
|
+
.filter(([, value]) => value !== undefined)
|
|
23351
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
23352
|
+
.join('&');
|
|
23353
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
23354
|
+
let localVarRequestOptions = {
|
|
23355
|
+
method: 'GET',
|
|
23356
|
+
headers: { ...localVarHeaderParams },
|
|
23357
|
+
};
|
|
23358
|
+
let requestOptions = localVarRequestOptions;
|
|
23359
|
+
let url = localVarUrl;
|
|
23360
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
23361
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
23362
|
+
url = auth_ApiKeyAuthentication.url;
|
|
23363
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
23364
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
23365
|
+
url = auth_JWTAuthentication.url;
|
|
23366
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
23367
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
23368
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
23369
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
23370
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
23371
|
+
url = auth_OAuth2.url;
|
|
23372
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
23373
|
+
requestOptions = authDefault.requestOptions;
|
|
23374
|
+
url = authDefault.url;
|
|
23375
|
+
(0, models_1.applyFormParams)(requestOptions, localVarFormParams);
|
|
23376
|
+
const response = await fetch(url, requestOptions);
|
|
23377
|
+
const resp = this.handleResponse(response, 'Buffer');
|
|
23378
|
+
if (options === null || options === void 0 ? void 0 : options.responseHeadersCallback) {
|
|
23379
|
+
const headerCb = options.responseHeadersCallback;
|
|
23380
|
+
// on next tick, so we have time to handle the response
|
|
23381
|
+
setTimeout(() => {
|
|
23382
|
+
headerCb(Object.fromEntries(response.headers.entries()));
|
|
23383
|
+
}, 0);
|
|
23384
|
+
}
|
|
23385
|
+
return resp;
|
|
23386
|
+
}
|
|
23227
23387
|
/**
|
|
23228
23388
|
* 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`.
|
|
23229
23389
|
* @summary Save parameters for pretrained model
|
|
@@ -68296,6 +68456,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
68296
68456
|
});
|
|
68297
68457
|
|
|
68298
68458
|
|
|
68459
|
+
define("library/sdk/model/listLearnBlockFilesResponse", ["require", "exports"], function (require, exports) {
|
|
68460
|
+
"use strict";
|
|
68461
|
+
// Generated by studio/openapi/generate-models/convert.ts
|
|
68462
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68463
|
+
});
|
|
68464
|
+
|
|
68465
|
+
|
|
68299
68466
|
define("library/sdk/model/listModelsResponse", ["require", "exports"], function (require, exports) {
|
|
68300
68467
|
"use strict";
|
|
68301
68468
|
// Generated by studio/openapi/generate-models/convert.ts
|
|
@@ -69129,6 +69296,7 @@ __exportStar(require("./listEnterpriseTrialsResponse"), exports);
|
|
|
69129
69296
|
__exportStar(require("./listEventSubscriptionsResponse"), exports);
|
|
69130
69297
|
__exportStar(require("./listHmacKeysResponse"), exports);
|
|
69131
69298
|
__exportStar(require("./listJobsResponse"), exports);
|
|
69299
|
+
__exportStar(require("./listLearnBlockFilesResponse"), exports);
|
|
69132
69300
|
__exportStar(require("./listModelsResponse"), exports);
|
|
69133
69301
|
__exportStar(require("./listMonitoringEventsResponse"), exports);
|
|
69134
69302
|
__exportStar(require("./listOrganizationApiKeysResponse"), exports);
|