edge-impulse-api 1.39.0 → 1.40.2

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 (25) hide show
  1. package/build/library/sdk/api/adminApi.d.ts +17 -1
  2. package/build/library/sdk/api/adminApi.js +82 -1
  3. package/build/library/sdk/api/adminApi.js.map +1 -1
  4. package/build/library/sdk/api/optimizationApi.d.ts +1 -7
  5. package/build/library/sdk/api/optimizationApi.js +1 -9
  6. package/build/library/sdk/api/optimizationApi.js.map +1 -1
  7. package/build/library/sdk/api/organizationsApi.d.ts +18 -1
  8. package/build/library/sdk/api/organizationsApi.js +88 -1
  9. package/build/library/sdk/api/organizationsApi.js.map +1 -1
  10. package/build/library/sdk/model/adminApiOrganization.d.ts +4 -0
  11. package/build/library/sdk/model/adminApiOrganization.js +5 -0
  12. package/build/library/sdk/model/adminApiOrganization.js.map +1 -1
  13. package/build/library/sdk/model/getLastDeploymentBuildResponse.d.ts +2 -0
  14. package/build/library/sdk/model/getLastDeploymentBuildResponse.js +5 -0
  15. package/build/library/sdk/model/getLastDeploymentBuildResponse.js.map +1 -1
  16. package/build/library/sdk/model/getLastDeploymentBuildResponseAllOf.d.ts +2 -0
  17. package/build/library/sdk/model/getLastDeploymentBuildResponseAllOf.js +5 -0
  18. package/build/library/sdk/model/getLastDeploymentBuildResponseAllOf.js.map +1 -1
  19. package/build/library/sdk/model/organization.d.ts +4 -0
  20. package/build/library/sdk/model/organization.js +5 -0
  21. package/build/library/sdk/model/organization.js.map +1 -1
  22. package/build/library/sdk/model/updateProjectRequest.d.ts +4 -0
  23. package/build/library/sdk/model/updateProjectRequest.js +5 -0
  24. package/build/library/sdk/model/updateProjectRequest.js.map +1 -1
  25. package/package.json +1 -1
@@ -89,12 +89,16 @@ declare type adminGetOrganizationComputeTimeUsageQueryParams = {
89
89
  startDate: Date;
90
90
  endDate: Date;
91
91
  };
92
+ declare type adminGetOrganizationInfoQueryParams = {
93
+ includeDeleted?: boolean;
94
+ };
92
95
  declare type adminGetOrganizationUsageReportsQueryParams = {
93
96
  limit?: number;
94
97
  offset?: number;
95
98
  };
96
99
  declare type adminGetOrganizationsQueryParams = {
97
100
  active?: number;
101
+ includeDeleted?: boolean;
98
102
  sort?: string;
99
103
  limit?: number;
100
104
  offset?: number;
@@ -488,8 +492,9 @@ export declare class AdminApi {
488
492
  * Admin-only API to list all information about this organization.
489
493
  * @summary Organization information
490
494
  * @param organizationId Organization ID
495
+ * @param includeDeleted Whether to include deleted entities (users, projects, orgs)
491
496
  */
492
- adminGetOrganizationInfo(organizationId: number, options?: {
497
+ adminGetOrganizationInfo(organizationId: number, queryParams: adminGetOrganizationInfoQueryParams, options?: {
493
498
  headers: {
494
499
  [name: string]: string;
495
500
  };
@@ -521,6 +526,7 @@ export declare class AdminApi {
521
526
  * Admin-only API to get the list of all organizations.
522
527
  * @summary Get all organizations
523
528
  * @param active Whether to search for entities (users, orgs) active in the last X days
529
+ * @param includeDeleted Whether to include deleted entities (users, projects, orgs)
524
530
  * @param sort Fields and order to sort query by
525
531
  * @param limit Maximum number of results
526
532
  * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
@@ -653,6 +659,16 @@ export declare class AdminApi {
653
659
  [name: string]: string;
654
660
  };
655
661
  }): Promise<GenericApiResponse>;
662
+ /**
663
+ * Admin-only API to restore a soft deleted organization. All organization projects sharing the same deletion date as that of the organization will also be restored. If this is a trial organization that was never upgraded to a paid plan then the organization will be restored to its original trial state.
664
+ * @summary Restore an organization
665
+ * @param organizationId Organization ID
666
+ */
667
+ adminRestoreOrganization(organizationId: number, options?: {
668
+ headers: {
669
+ [name: string]: string;
670
+ };
671
+ }): Promise<GenericApiResponse>;
656
672
  /**
657
673
  * Admin-only API to run or pause a data migration.
658
674
  * @summary Run or pause a data migration
@@ -2568,8 +2568,9 @@ class AdminApi {
2568
2568
  * Admin-only API to list all information about this organization.
2569
2569
  * @summary Organization information
2570
2570
  * @param organizationId Organization ID
2571
+ * @param includeDeleted Whether to include deleted entities (users, projects, orgs)
2571
2572
  */
2572
- async adminGetOrganizationInfo(organizationId, options = { headers: {} }) {
2573
+ async adminGetOrganizationInfo(organizationId, queryParams, options = { headers: {} }) {
2573
2574
  const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}'
2574
2575
  .replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
2575
2576
  let localVarQueryParameters = {};
@@ -2589,6 +2590,9 @@ class AdminApi {
2589
2590
  if (organizationId === null || organizationId === undefined) {
2590
2591
  throw new Error('Required parameter organizationId was null or undefined when calling adminGetOrganizationInfo.');
2591
2592
  }
2593
+ if (queryParams.includeDeleted !== undefined) {
2594
+ localVarQueryParameters['includeDeleted'] = models_1.ObjectSerializer.serialize(queryParams.includeDeleted, "boolean");
2595
+ }
2592
2596
  Object.assign(localVarHeaderParams, options.headers);
2593
2597
  Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2594
2598
  let localVarUseFormData = false;
@@ -2801,6 +2805,7 @@ class AdminApi {
2801
2805
  * Admin-only API to get the list of all organizations.
2802
2806
  * @summary Get all organizations
2803
2807
  * @param active Whether to search for entities (users, orgs) active in the last X days
2808
+ * @param includeDeleted Whether to include deleted entities (users, projects, orgs)
2804
2809
  * @param sort Fields and order to sort query by
2805
2810
  * @param limit Maximum number of results
2806
2811
  * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
@@ -2824,6 +2829,9 @@ class AdminApi {
2824
2829
  if (queryParams.active !== undefined) {
2825
2830
  localVarQueryParameters['active'] = models_1.ObjectSerializer.serialize(queryParams.active, "number");
2826
2831
  }
2832
+ if (queryParams.includeDeleted !== undefined) {
2833
+ localVarQueryParameters['includeDeleted'] = models_1.ObjectSerializer.serialize(queryParams.includeDeleted, "boolean");
2834
+ }
2827
2835
  if (queryParams.sort !== undefined) {
2828
2836
  localVarQueryParameters['sort'] = models_1.ObjectSerializer.serialize(queryParams.sort, "string");
2829
2837
  }
@@ -3735,6 +3743,79 @@ class AdminApi {
3735
3743
  });
3736
3744
  });
3737
3745
  }
3746
+ /**
3747
+ * Admin-only API to restore a soft deleted organization. All organization projects sharing the same deletion date as that of the organization will also be restored. If this is a trial organization that was never upgraded to a paid plan then the organization will be restored to its original trial state.
3748
+ * @summary Restore an organization
3749
+ * @param organizationId Organization ID
3750
+ */
3751
+ async adminRestoreOrganization(organizationId, options = { headers: {} }) {
3752
+ const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/restore'
3753
+ .replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
3754
+ let localVarQueryParameters = {};
3755
+ let localVarHeaderParams = Object.assign({
3756
+ 'User-Agent': 'edgeimpulse-api nodejs'
3757
+ }, this.defaultHeaders);
3758
+ const produces = ['application/json'];
3759
+ // give precedence to 'application/json'
3760
+ if (produces.indexOf('application/json') >= 0) {
3761
+ localVarHeaderParams.Accept = 'application/json';
3762
+ }
3763
+ else {
3764
+ localVarHeaderParams.Accept = produces.join(',');
3765
+ }
3766
+ let localVarFormParams = {};
3767
+ // verify required parameter 'organizationId' is not null or undefined
3768
+ if (organizationId === null || organizationId === undefined) {
3769
+ throw new Error('Required parameter organizationId was null or undefined when calling adminRestoreOrganization.');
3770
+ }
3771
+ Object.assign(localVarHeaderParams, options.headers);
3772
+ Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3773
+ let localVarUseFormData = false;
3774
+ let localVarRequestOptions = {
3775
+ method: 'POST',
3776
+ qs: localVarQueryParameters,
3777
+ headers: localVarHeaderParams,
3778
+ uri: localVarPath,
3779
+ useQuerystring: this._useQuerystring,
3780
+ agentOptions: { keepAlive: false },
3781
+ json: true,
3782
+ };
3783
+ let authenticationPromise = Promise.resolve();
3784
+ authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3785
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3786
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3787
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3788
+ return authenticationPromise.then(() => {
3789
+ if (Object.keys(localVarFormParams).length) {
3790
+ if (localVarUseFormData) {
3791
+ localVarRequestOptions.formData = localVarFormParams;
3792
+ }
3793
+ else {
3794
+ localVarRequestOptions.form = localVarFormParams;
3795
+ }
3796
+ }
3797
+ return new Promise((resolve, reject) => {
3798
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
3799
+ if (error) {
3800
+ reject(error);
3801
+ }
3802
+ else {
3803
+ body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
3804
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3805
+ if (typeof body.success === 'boolean' && !body.success) {
3806
+ reject(new Error(body.error || errString));
3807
+ }
3808
+ else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3809
+ resolve(body);
3810
+ }
3811
+ else {
3812
+ reject(errString);
3813
+ }
3814
+ }
3815
+ });
3816
+ });
3817
+ });
3818
+ }
3738
3819
  /**
3739
3820
  * Admin-only API to run or pause a data migration.
3740
3821
  * @summary Run or pause a data migration