edge-impulse-api 1.71.52 → 1.71.54

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.
@@ -22,6 +22,7 @@ import { ExportWavDataRequest } from '../model/exportWavDataRequest';
22
22
  import { GenerateFeaturesRequest } from '../model/generateFeaturesRequest';
23
23
  import { GenericApiResponse } from '../model/genericApiResponse';
24
24
  import { GetJobResponse } from '../model/getJobResponse';
25
+ import { ImportDataFromAnotherProjectJobRequest } from '../model/importDataFromAnotherProjectJobRequest';
25
26
  import { JobSummaryResponse } from '../model/jobSummaryResponse';
26
27
  import { ListJobsResponse } from '../model/listJobsResponse';
27
28
  import { LogStdoutResponse } from '../model/logStdoutResponse';
@@ -479,6 +480,17 @@ export declare class JobsApi {
479
480
  [name: string]: string;
480
481
  };
481
482
  }): Promise<StartJobResponse>;
483
+ /**
484
+ * Adds all data from an existing project into this project. This function is only available through a JWT token; and you can only add data from projects that you\'re a collaborator on.
485
+ * @summary Import data from another project
486
+ * @param projectId Project ID
487
+ * @param importDataFromAnotherProjectJobRequest
488
+ */
489
+ startImportDataFromProjectJob(projectId: number, importDataFromAnotherProjectJobRequest: ImportDataFromAnotherProjectJobRequest, options?: {
490
+ headers: {
491
+ [name: string]: string;
492
+ };
493
+ }): Promise<StartJobResponse>;
482
494
  /**
483
495
  * Add keywords and noise data to a project (for getting started guide)
484
496
  * @summary Add keywords and noise
@@ -2478,6 +2478,86 @@ class JobsApi {
2478
2478
  });
2479
2479
  });
2480
2480
  }
2481
+ /**
2482
+ * Adds all data from an existing project into this project. This function is only available through a JWT token; and you can only add data from projects that you\'re a collaborator on.
2483
+ * @summary Import data from another project
2484
+ * @param projectId Project ID
2485
+ * @param importDataFromAnotherProjectJobRequest
2486
+ */
2487
+ async startImportDataFromProjectJob(projectId, importDataFromAnotherProjectJobRequest, options = { headers: {} }) {
2488
+ const localVarPath = this.basePath + '/api/{projectId}/jobs/import-data-from-project'
2489
+ .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2490
+ let localVarQueryParameters = {};
2491
+ let localVarHeaderParams = Object.assign({
2492
+ 'User-Agent': 'edgeimpulse-api nodejs'
2493
+ }, this.defaultHeaders);
2494
+ const produces = ['application/json'];
2495
+ // give precedence to 'application/json'
2496
+ if (produces.indexOf('application/json') >= 0) {
2497
+ localVarHeaderParams.Accept = 'application/json';
2498
+ }
2499
+ else {
2500
+ localVarHeaderParams.Accept = produces.join(',');
2501
+ }
2502
+ let localVarFormParams = {};
2503
+ // verify required parameter 'projectId' is not null or undefined
2504
+ if (projectId === null || projectId === undefined) {
2505
+ throw new Error('Required parameter projectId was null or undefined when calling startImportDataFromProjectJob.');
2506
+ }
2507
+ // verify required parameter 'importDataFromAnotherProjectJobRequest' is not null or undefined
2508
+ if (importDataFromAnotherProjectJobRequest === null || importDataFromAnotherProjectJobRequest === undefined) {
2509
+ throw new Error('Required parameter importDataFromAnotherProjectJobRequest was null or undefined when calling startImportDataFromProjectJob.');
2510
+ }
2511
+ Object.assign(localVarHeaderParams, options.headers);
2512
+ Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2513
+ let localVarUseFormData = false;
2514
+ let localVarRequestOptions = {
2515
+ method: 'POST',
2516
+ qs: localVarQueryParameters,
2517
+ headers: localVarHeaderParams,
2518
+ uri: localVarPath,
2519
+ useQuerystring: this._useQuerystring,
2520
+ agentOptions: { keepAlive: false },
2521
+ json: true,
2522
+ body: models_1.ObjectSerializer.serialize(importDataFromAnotherProjectJobRequest, "ImportDataFromAnotherProjectJobRequest")
2523
+ };
2524
+ let authenticationPromise = Promise.resolve();
2525
+ authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2526
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2527
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2528
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2529
+ return authenticationPromise.then(() => {
2530
+ if (Object.keys(localVarFormParams).length) {
2531
+ if (localVarUseFormData) {
2532
+ localVarRequestOptions.formData = localVarFormParams;
2533
+ }
2534
+ else {
2535
+ localVarRequestOptions.form = localVarFormParams;
2536
+ }
2537
+ }
2538
+ return new Promise((resolve, reject) => {
2539
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
2540
+ if (error) {
2541
+ reject(error);
2542
+ }
2543
+ else {
2544
+ body = models_1.ObjectSerializer.deserialize(body, "StartJobResponse");
2545
+ if (typeof body.success === 'boolean' && !body.success) {
2546
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2547
+ reject(new Error(body.error || errString));
2548
+ }
2549
+ else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2550
+ resolve(body);
2551
+ }
2552
+ else {
2553
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2554
+ reject(errString);
2555
+ }
2556
+ }
2557
+ });
2558
+ });
2559
+ });
2560
+ }
2481
2561
  /**
2482
2562
  * Add keywords and noise data to a project (for getting started guide)
2483
2563
  * @summary Add keywords and noise