edge-impulse-api 1.66.34 → 1.67.0

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.
@@ -59,7 +59,9 @@ import { JobLogsResponse } from '../model/jobLogsResponse';
59
59
  import { JobMetricsResponse } from '../model/jobMetricsResponse';
60
60
  import { JobParentTypeEnum } from '../model/jobParentTypeEnum';
61
61
  import { ListJobsResponse } from '../model/listJobsResponse';
62
+ import { ListOrganizationDataResponse } from '../model/listOrganizationDataResponse';
62
63
  import { ListPortalFilesInFolderResponse } from '../model/listPortalFilesInFolderResponse';
64
+ import { ListSamplesResponse } from '../model/listSamplesResponse';
63
65
  import { StartJobResponse } from '../model/startJobResponse';
64
66
  import { UpdateProjectRequest } from '../model/updateProjectRequest';
65
67
  import { UserTierEnum } from '../model/userTierEnum';
@@ -135,6 +137,10 @@ type adminGetOrganizationsQueryParams = {
135
137
  offset?: number;
136
138
  search?: string;
137
139
  };
140
+ type adminGetProjectDataSamplesQueryParams = {
141
+ limit?: number;
142
+ offset?: number;
143
+ };
138
144
  type adminGetProjectJobsQueryParams = {
139
145
  limit?: number;
140
146
  offset?: number;
@@ -176,6 +182,11 @@ type adminGetUsersQueryParams = {
176
182
  offset?: number;
177
183
  search?: string;
178
184
  };
185
+ type adminListOrganizationDataQueryParams = {
186
+ dataset?: string;
187
+ limit?: number;
188
+ offset?: number;
189
+ };
179
190
  type adminListTrashbinOrganizationS3FilesQueryParams = {
180
191
  prefix?: string;
181
192
  sourceBucket: 'ingestion' | 'cdn' | 'user-data';
@@ -747,6 +758,18 @@ export declare class AdminApi {
747
758
  [name: string]: string;
748
759
  };
749
760
  }): Promise<AdminProjectInfoResponse>;
761
+ /**
762
+ * Admin-only API to get the list of all data samples for a project. The response is paginated and returns up to 1000 samples per request. To retrieve additional pages: 1. Use the `limit` parameter to specify how many samples to return (max 1000) 2. Use the `offset` parameter to skip a number of samples 3. Make subsequent requests with increasing offset values to retrieve all samples For example: - First request: limit=1000, offset=0 (samples 1-1000) - Second request: limit=1000, offset=1000 (samples 1001-2000) - And so on
763
+ * @summary Get project data samples
764
+ * @param projectId Project ID
765
+ * @param limit Maximum number of results
766
+ * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
767
+ */
768
+ adminGetProjectDataSamples(projectId: number, queryParams?: adminGetProjectDataSamplesQueryParams, options?: {
769
+ headers: {
770
+ [name: string]: string;
771
+ };
772
+ }): Promise<ListSamplesResponse>;
750
773
  /**
751
774
  * Admin-only API to get the list of all jobs for a project.
752
775
  * @summary Get project jobs
@@ -890,6 +913,19 @@ export declare class AdminApi {
890
913
  [name: string]: string;
891
914
  };
892
915
  }): Promise<AdminGetUsersResponse>;
916
+ /**
917
+ * Admin-only API to list all data items from an organization. The response is paginated and returns up to 1000 samples per request. To retrieve additional pages: 1. Use the `limit` parameter to specify how many samples to return (max 1000) 2. Use the `offset` parameter to skip a number of samples 3. Make subsequent requests with increasing offset values to retrieve all samples For example: - First request: limit=1000, offset=0 (samples 1-1000) - Second request: limit=1000, offset=1000 (samples 1001-2000) - And so on
918
+ * @summary List organization data
919
+ * @param organizationId Organization ID
920
+ * @param dataset Selected dataset
921
+ * @param limit Maximum number of results
922
+ * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
923
+ */
924
+ adminListOrganizationData(organizationId: number, queryParams?: adminListOrganizationDataQueryParams, options?: {
925
+ headers: {
926
+ [name: string]: string;
927
+ };
928
+ }): Promise<ListOrganizationDataResponse>;
893
929
  /**
894
930
  * List files in the trashbin FSx for a given organization.
895
931
  * @summary List organization FSx files in the trash bin
@@ -3930,6 +3930,88 @@ class AdminApi {
3930
3930
  });
3931
3931
  });
3932
3932
  }
3933
+ /**
3934
+ * Admin-only API to get the list of all data samples for a project. The response is paginated and returns up to 1000 samples per request. To retrieve additional pages: 1. Use the `limit` parameter to specify how many samples to return (max 1000) 2. Use the `offset` parameter to skip a number of samples 3. Make subsequent requests with increasing offset values to retrieve all samples For example: - First request: limit=1000, offset=0 (samples 1-1000) - Second request: limit=1000, offset=1000 (samples 1001-2000) - And so on
3935
+ * @summary Get project data samples
3936
+ * @param projectId Project ID
3937
+ * @param limit Maximum number of results
3938
+ * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
3939
+ */
3940
+ async adminGetProjectDataSamples(projectId, queryParams, options = { headers: {} }) {
3941
+ const localVarPath = this.basePath + '/api/admin/projects/{projectId}/data'
3942
+ .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3943
+ let localVarQueryParameters = {};
3944
+ let localVarHeaderParams = Object.assign({
3945
+ 'User-Agent': 'edgeimpulse-api nodejs'
3946
+ }, this.defaultHeaders);
3947
+ const produces = ['application/json'];
3948
+ // give precedence to 'application/json'
3949
+ if (produces.indexOf('application/json') >= 0) {
3950
+ localVarHeaderParams.Accept = 'application/json';
3951
+ }
3952
+ else {
3953
+ localVarHeaderParams.Accept = produces.join(',');
3954
+ }
3955
+ let localVarFormParams = {};
3956
+ // verify required parameter 'projectId' is not null or undefined
3957
+ if (projectId === null || projectId === undefined) {
3958
+ throw new Error('Required parameter projectId was null or undefined when calling adminGetProjectDataSamples.');
3959
+ }
3960
+ if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.limit) !== undefined) {
3961
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
3962
+ }
3963
+ if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.offset) !== undefined) {
3964
+ localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
3965
+ }
3966
+ Object.assign(localVarHeaderParams, options.headers);
3967
+ Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3968
+ let localVarUseFormData = false;
3969
+ let localVarRequestOptions = {
3970
+ method: 'GET',
3971
+ qs: localVarQueryParameters,
3972
+ headers: localVarHeaderParams,
3973
+ uri: localVarPath,
3974
+ useQuerystring: this._useQuerystring,
3975
+ agentOptions: { keepAlive: false },
3976
+ json: true,
3977
+ };
3978
+ let authenticationPromise = Promise.resolve();
3979
+ authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3980
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3981
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3982
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3983
+ return authenticationPromise.then(() => {
3984
+ if (Object.keys(localVarFormParams).length) {
3985
+ if (localVarUseFormData) {
3986
+ localVarRequestOptions.formData = localVarFormParams;
3987
+ }
3988
+ else {
3989
+ localVarRequestOptions.form = localVarFormParams;
3990
+ }
3991
+ }
3992
+ return new Promise((resolve, reject) => {
3993
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
3994
+ if (error) {
3995
+ reject(error);
3996
+ }
3997
+ else {
3998
+ body = models_1.ObjectSerializer.deserialize(body, "ListSamplesResponse");
3999
+ if (typeof body.success === 'boolean' && !body.success) {
4000
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
4001
+ reject(new Error(body.error || errString));
4002
+ }
4003
+ else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
4004
+ resolve(body);
4005
+ }
4006
+ else {
4007
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
4008
+ reject(errString);
4009
+ }
4010
+ }
4011
+ });
4012
+ });
4013
+ });
4014
+ }
3933
4015
  /**
3934
4016
  * Admin-only API to get the list of all jobs for a project.
3935
4017
  * @summary Get project jobs
@@ -4898,6 +4980,92 @@ class AdminApi {
4898
4980
  });
4899
4981
  });
4900
4982
  }
4983
+ /**
4984
+ * Admin-only API to list all data items from an organization. The response is paginated and returns up to 1000 samples per request. To retrieve additional pages: 1. Use the `limit` parameter to specify how many samples to return (max 1000) 2. Use the `offset` parameter to skip a number of samples 3. Make subsequent requests with increasing offset values to retrieve all samples For example: - First request: limit=1000, offset=0 (samples 1-1000) - Second request: limit=1000, offset=1000 (samples 1001-2000) - And so on
4985
+ * @summary List organization data
4986
+ * @param organizationId Organization ID
4987
+ * @param dataset Selected dataset
4988
+ * @param limit Maximum number of results
4989
+ * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
4990
+ */
4991
+ async adminListOrganizationData(organizationId, queryParams, options = { headers: {} }) {
4992
+ const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/data'
4993
+ .replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
4994
+ let localVarQueryParameters = {};
4995
+ let localVarHeaderParams = Object.assign({
4996
+ 'User-Agent': 'edgeimpulse-api nodejs'
4997
+ }, this.defaultHeaders);
4998
+ const produces = ['application/json'];
4999
+ // give precedence to 'application/json'
5000
+ if (produces.indexOf('application/json') >= 0) {
5001
+ localVarHeaderParams.Accept = 'application/json';
5002
+ }
5003
+ else {
5004
+ localVarHeaderParams.Accept = produces.join(',');
5005
+ }
5006
+ let localVarFormParams = {};
5007
+ // verify required parameter 'organizationId' is not null or undefined
5008
+ if (organizationId === null || organizationId === undefined) {
5009
+ throw new Error('Required parameter organizationId was null or undefined when calling adminListOrganizationData.');
5010
+ }
5011
+ if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.dataset) !== undefined) {
5012
+ localVarQueryParameters['dataset'] = models_1.ObjectSerializer.serialize(queryParams.dataset, "string");
5013
+ }
5014
+ if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.limit) !== undefined) {
5015
+ localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
5016
+ }
5017
+ if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.offset) !== undefined) {
5018
+ localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
5019
+ }
5020
+ Object.assign(localVarHeaderParams, options.headers);
5021
+ Object.assign(localVarHeaderParams, this.opts.extraHeaders);
5022
+ let localVarUseFormData = false;
5023
+ let localVarRequestOptions = {
5024
+ method: 'GET',
5025
+ qs: localVarQueryParameters,
5026
+ headers: localVarHeaderParams,
5027
+ uri: localVarPath,
5028
+ useQuerystring: this._useQuerystring,
5029
+ agentOptions: { keepAlive: false },
5030
+ json: true,
5031
+ };
5032
+ let authenticationPromise = Promise.resolve();
5033
+ authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
5034
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
5035
+ authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
5036
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
5037
+ return authenticationPromise.then(() => {
5038
+ if (Object.keys(localVarFormParams).length) {
5039
+ if (localVarUseFormData) {
5040
+ localVarRequestOptions.formData = localVarFormParams;
5041
+ }
5042
+ else {
5043
+ localVarRequestOptions.form = localVarFormParams;
5044
+ }
5045
+ }
5046
+ return new Promise((resolve, reject) => {
5047
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
5048
+ if (error) {
5049
+ reject(error);
5050
+ }
5051
+ else {
5052
+ body = models_1.ObjectSerializer.deserialize(body, "ListOrganizationDataResponse");
5053
+ if (typeof body.success === 'boolean' && !body.success) {
5054
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
5055
+ reject(new Error(body.error || errString));
5056
+ }
5057
+ else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
5058
+ resolve(body);
5059
+ }
5060
+ else {
5061
+ const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
5062
+ reject(errString);
5063
+ }
5064
+ }
5065
+ });
5066
+ });
5067
+ });
5068
+ }
4901
5069
  /**
4902
5070
  * List files in the trashbin FSx for a given organization.
4903
5071
  * @summary List organization FSx files in the trash bin