edge-impulse-linux 1.4.8 → 1.5.1

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 (522) hide show
  1. package/README.md +10 -0
  2. package/build/cli/init-cli-app.js +4 -1
  3. package/build/cli/init-cli-app.js.map +1 -1
  4. package/build/cli/linux/camera-debug.js +0 -0
  5. package/build/cli/linux/linux.js +0 -0
  6. package/build/cli/linux/runner.js +194 -2
  7. package/build/cli/linux/runner.js.map +1 -1
  8. package/build/cli/linux/webserver/middleware/asyncMiddleware.d.ts +2 -0
  9. package/build/cli/linux/webserver/middleware/asyncMiddleware.js +10 -0
  10. package/build/cli/linux/webserver/middleware/asyncMiddleware.js.map +1 -0
  11. package/build/cli/linux/webserver/public/inference-server.d.ts +0 -0
  12. package/build/cli/linux/webserver/public/inference-server.js +168 -0
  13. package/build/cli/linux/webserver/public/inference-server.js.map +1 -0
  14. package/build/cli/linux/webserver/views/escape-html-template-tag/escape.d.ts +12 -0
  15. package/build/cli/linux/webserver/views/escape-html-template-tag/escape.js +59 -0
  16. package/build/cli/linux/webserver/views/escape-html-template-tag/escape.js.map +1 -0
  17. package/build/cli/linux/webserver/views/escape-html-template-tag/index.d.ts +7 -0
  18. package/build/cli/linux/webserver/views/escape-html-template-tag/index.js +24 -0
  19. package/build/cli/linux/webserver/views/escape-html-template-tag/index.js.map +1 -0
  20. package/build/cli/linux/webserver/views/inference-server-view.d.ts +19 -0
  21. package/build/cli/linux/webserver/views/inference-server-view.js +164 -0
  22. package/build/cli/linux/webserver/views/inference-server-view.js.map +1 -0
  23. package/build/cli/make-image.d.ts +2 -7
  24. package/build/cli/make-image.js +15 -0
  25. package/build/cli/make-image.js.map +1 -1
  26. package/build/library/classifier/image-classifier.d.ts +10 -2
  27. package/build/library/classifier/image-classifier.js +21 -6
  28. package/build/library/classifier/image-classifier.js.map +1 -1
  29. package/build/sdk/studio/sdk/api/adminApi.d.ts +129 -5
  30. package/build/sdk/studio/sdk/api/adminApi.js +956 -236
  31. package/build/sdk/studio/sdk/api/adminApi.js.map +1 -1
  32. package/build/sdk/studio/sdk/api/apis.d.ts +1 -21
  33. package/build/sdk/studio/sdk/api/apis.js +1 -21
  34. package/build/sdk/studio/sdk/api/apis.js.map +1 -1
  35. package/build/sdk/studio/sdk/api/jobsApi.d.ts +2 -3
  36. package/build/sdk/studio/sdk/api/jobsApi.js +2 -8
  37. package/build/sdk/studio/sdk/api/jobsApi.js.map +1 -1
  38. package/build/sdk/studio/sdk/api/optimizationApi.d.ts +36 -7
  39. package/build/sdk/studio/sdk/api/optimizationApi.js +237 -8
  40. package/build/sdk/studio/sdk/api/optimizationApi.js.map +1 -1
  41. package/build/sdk/studio/sdk/api/organizationDataApi.d.ts +2 -2
  42. package/build/sdk/studio/sdk/api/organizationDataApi.js +2 -2
  43. package/build/sdk/studio/sdk/api/organizationsApi.d.ts +177 -6
  44. package/build/sdk/studio/sdk/api/organizationsApi.js +1197 -170
  45. package/build/sdk/studio/sdk/api/organizationsApi.js.map +1 -1
  46. package/build/sdk/studio/sdk/api/projectsApi.d.ts +26 -3
  47. package/build/sdk/studio/sdk/api/projectsApi.js +158 -6
  48. package/build/sdk/studio/sdk/api/projectsApi.js.map +1 -1
  49. package/build/sdk/studio/sdk/api/rawDataApi.d.ts +37 -3
  50. package/build/sdk/studio/sdk/api/rawDataApi.js +234 -3
  51. package/build/sdk/studio/sdk/api/rawDataApi.js.map +1 -1
  52. package/build/sdk/studio/sdk/api/uploadPortalApi.d.ts +1 -1
  53. package/build/sdk/studio/sdk/api/uploadPortalApi.js +1 -1
  54. package/build/sdk/studio/sdk/model/addApiKeyRequest.d.ts +0 -7
  55. package/build/sdk/studio/sdk/model/addApiKeyRequest.js +1 -12
  56. package/build/sdk/studio/sdk/model/addApiKeyRequest.js.map +1 -1
  57. package/build/sdk/studio/sdk/model/addOrganizationApiKeyRequest.js.map +1 -1
  58. package/build/sdk/studio/sdk/model/addOrganizationApiKeyRequestAllOf.d.ts +27 -0
  59. package/build/sdk/studio/sdk/model/addOrganizationApiKeyRequestAllOf.js +33 -0
  60. package/build/sdk/studio/sdk/model/addOrganizationApiKeyRequestAllOf.js.map +1 -0
  61. package/build/sdk/studio/sdk/model/addOrganizationTransferLearningBlockRequest.d.ts +4 -0
  62. package/build/sdk/studio/sdk/model/addOrganizationTransferLearningBlockRequest.js +5 -0
  63. package/build/sdk/studio/sdk/model/addOrganizationTransferLearningBlockRequest.js.map +1 -1
  64. package/build/sdk/studio/sdk/model/addOrganizationTransformationBlockRequest.d.ts +4 -0
  65. package/build/sdk/studio/sdk/model/addOrganizationTransformationBlockRequest.js +5 -0
  66. package/build/sdk/studio/sdk/model/addOrganizationTransformationBlockRequest.js.map +1 -1
  67. package/build/sdk/studio/sdk/model/addProjectApiKeyRequest.d.ts +39 -0
  68. package/build/sdk/studio/sdk/model/addProjectApiKeyRequest.js +48 -0
  69. package/build/sdk/studio/sdk/model/addProjectApiKeyRequest.js.map +1 -0
  70. package/build/sdk/studio/sdk/model/addProjectApiKeyRequestAllOf.d.ts +31 -0
  71. package/build/sdk/studio/sdk/model/addProjectApiKeyRequestAllOf.js +38 -0
  72. package/build/sdk/studio/sdk/model/addProjectApiKeyRequestAllOf.js.map +1 -0
  73. package/build/sdk/studio/sdk/model/adminAddOrganizationApiKeyRequest.d.ts +39 -0
  74. package/build/sdk/studio/sdk/model/adminAddOrganizationApiKeyRequest.js +48 -0
  75. package/build/sdk/studio/sdk/model/adminAddOrganizationApiKeyRequest.js.map +1 -0
  76. package/build/sdk/studio/sdk/model/{getUserResponseAllOfOrganizations.d.ts → adminAddProjectApiKeyRequest.d.ts} +8 -8
  77. package/build/sdk/studio/sdk/model/adminAddProjectApiKeyRequest.js +42 -0
  78. package/build/sdk/studio/sdk/model/adminAddProjectApiKeyRequest.js.map +1 -0
  79. package/build/sdk/studio/sdk/model/adminAddProjectApiKeyRequestAllOf.d.ts +28 -0
  80. package/build/sdk/studio/sdk/model/adminAddProjectApiKeyRequestAllOf.js +32 -0
  81. package/build/sdk/studio/sdk/model/adminAddProjectApiKeyRequestAllOf.js.map +1 -0
  82. package/build/sdk/studio/sdk/model/adminApiOrganization.d.ts +4 -0
  83. package/build/sdk/studio/sdk/model/adminApiOrganization.js +5 -0
  84. package/build/sdk/studio/sdk/model/adminApiOrganization.js.map +1 -1
  85. package/build/sdk/studio/sdk/model/{whitelabelAdminCreateProjectRequest.d.ts → adminCreateProjectRequest.d.ts} +5 -3
  86. package/build/sdk/studio/sdk/model/{whitelabelAdminCreateProjectRequest.js → adminCreateProjectRequest.js} +14 -9
  87. package/build/sdk/studio/sdk/model/adminCreateProjectRequest.js.map +1 -0
  88. package/build/sdk/studio/sdk/model/{getAutoSegmenterResponse.d.ts → adminGetOrganizationComputeTimeUsageResponse.d.ts} +13 -7
  89. package/build/sdk/studio/sdk/model/adminGetOrganizationComputeTimeUsageResponse.js +52 -0
  90. package/build/sdk/studio/sdk/model/adminGetOrganizationComputeTimeUsageResponse.js.map +1 -0
  91. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponse.d.ts +34 -0
  92. package/build/sdk/studio/sdk/model/{saveAutoSegmenterClustersResponse.js → adminGetOrganizationUsageReportResponse.js} +12 -12
  93. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponse.js.map +1 -0
  94. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponseAllOf.d.ts +26 -0
  95. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponseAllOf.js +32 -0
  96. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponseAllOf.js.map +1 -0
  97. package/build/sdk/studio/sdk/model/{adminGetFeatureFlagsResponse.d.ts → adminGetOrganizationUsageReportsResponse.d.ts} +4 -3
  98. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportsResponse.js +47 -0
  99. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportsResponse.js.map +1 -0
  100. package/build/sdk/studio/sdk/model/{adminGetFeatureFlagsResponseAllOf.d.ts → adminGetOrganizationUsageReportsResponseAllOf.d.ts} +4 -3
  101. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportsResponseAllOf.js +37 -0
  102. package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportsResponseAllOf.js.map +1 -0
  103. package/build/sdk/studio/sdk/model/adminOrganizationInfoResponse.d.ts +8 -20
  104. package/build/sdk/studio/sdk/model/adminOrganizationInfoResponse.js +11 -41
  105. package/build/sdk/studio/sdk/model/adminOrganizationInfoResponse.js.map +1 -1
  106. package/build/sdk/studio/sdk/model/adminOrganizationInfoResponseAllOf.d.ts +0 -8
  107. package/build/sdk/studio/sdk/model/adminOrganizationInfoResponseAllOf.js +0 -10
  108. package/build/sdk/studio/sdk/model/adminOrganizationInfoResponseAllOf.js.map +1 -1
  109. package/build/sdk/studio/sdk/model/adminUpdateUserRequest.d.ts +4 -0
  110. package/build/sdk/studio/sdk/model/adminUpdateUserRequest.js +5 -0
  111. package/build/sdk/studio/sdk/model/adminUpdateUserRequest.js.map +1 -1
  112. package/build/sdk/studio/sdk/model/anomalyResult.d.ts +5 -0
  113. package/build/sdk/studio/sdk/model/anomalyResult.js +5 -0
  114. package/build/sdk/studio/sdk/model/anomalyResult.js.map +1 -1
  115. package/build/sdk/studio/sdk/model/applicationBudget.d.ts +32 -0
  116. package/build/sdk/studio/sdk/model/applicationBudget.js +45 -0
  117. package/build/sdk/studio/sdk/model/applicationBudget.js.map +1 -0
  118. package/build/sdk/studio/sdk/model/classifySampleResponseClassification.d.ts +5 -0
  119. package/build/sdk/studio/sdk/model/classifySampleResponseClassification.js +5 -0
  120. package/build/sdk/studio/sdk/model/classifySampleResponseClassification.js.map +1 -1
  121. package/build/sdk/studio/sdk/model/cosineSimilarityData.d.ts +36 -0
  122. package/build/sdk/studio/sdk/model/cosineSimilarityData.js +40 -0
  123. package/build/sdk/studio/sdk/model/cosineSimilarityData.js.map +1 -0
  124. package/build/sdk/studio/sdk/model/cosineSimilarityIssue.d.ts +42 -0
  125. package/build/sdk/studio/sdk/model/cosineSimilarityIssue.js +50 -0
  126. package/build/sdk/studio/sdk/model/cosineSimilarityIssue.js.map +1 -0
  127. package/build/sdk/studio/sdk/model/cosineSimilarityIssueIssues.d.ts +39 -0
  128. package/build/sdk/studio/sdk/model/cosineSimilarityIssueIssues.js +47 -0
  129. package/build/sdk/studio/sdk/model/cosineSimilarityIssueIssues.js.map +1 -0
  130. package/build/sdk/studio/sdk/model/{getJWTTokenResponseAllOf.d.ts → cosineSimilarityIssueWindows.d.ts} +9 -5
  131. package/build/sdk/studio/sdk/model/cosineSimilarityIssueWindows.js +42 -0
  132. package/build/sdk/studio/sdk/model/cosineSimilarityIssueWindows.js.map +1 -0
  133. package/build/sdk/studio/sdk/model/createEnterpriseTrialUserRequest.d.ts +4 -0
  134. package/build/sdk/studio/sdk/model/createEnterpriseTrialUserRequest.js +5 -0
  135. package/build/sdk/studio/sdk/model/createEnterpriseTrialUserRequest.js.map +1 -1
  136. package/build/sdk/studio/sdk/model/createEnterpriseTrialUserRequestAllOf.d.ts +4 -0
  137. package/build/sdk/studio/sdk/model/createEnterpriseTrialUserRequestAllOf.js +5 -0
  138. package/build/sdk/studio/sdk/model/createEnterpriseTrialUserRequestAllOf.js.map +1 -1
  139. package/build/sdk/studio/sdk/model/{getAutoSegmenterResponseAllOfItems.d.ts → createOrganizationUsageReportBody.d.ts} +3 -2
  140. package/build/sdk/studio/sdk/model/createOrganizationUsageReportBody.js +37 -0
  141. package/build/sdk/studio/sdk/model/createOrganizationUsageReportBody.js.map +1 -0
  142. package/build/sdk/studio/sdk/model/createProjectRequest.d.ts +2 -0
  143. package/build/sdk/studio/sdk/model/createProjectRequest.js +5 -0
  144. package/build/sdk/studio/sdk/model/createProjectRequest.js.map +1 -1
  145. package/build/sdk/studio/sdk/model/createUserRequest.d.ts +4 -0
  146. package/build/sdk/studio/sdk/model/createUserRequest.js +5 -0
  147. package/build/sdk/studio/sdk/model/createUserRequest.js.map +1 -1
  148. package/build/sdk/studio/sdk/model/{organizationCreateProjectCreatedByUser.d.ts → createdUpdatedByUser.d.ts} +1 -1
  149. package/build/sdk/studio/sdk/model/{organizationCreateProjectCreatedByUser.js → createdUpdatedByUser.js} +9 -9
  150. package/build/sdk/studio/sdk/model/createdUpdatedByUser.js.map +1 -0
  151. package/build/sdk/studio/sdk/model/{addNoteRequest.d.ts → crossValidationData.d.ts} +6 -9
  152. package/build/sdk/studio/sdk/model/crossValidationData.js +35 -0
  153. package/build/sdk/studio/sdk/model/crossValidationData.js.map +1 -0
  154. package/build/sdk/studio/sdk/model/crossValidationDataScores.d.ts +50 -0
  155. package/build/sdk/studio/sdk/model/crossValidationDataScores.js +62 -0
  156. package/build/sdk/studio/sdk/model/crossValidationDataScores.js.map +1 -0
  157. package/build/sdk/studio/sdk/model/dSPGroupItem.d.ts +6 -0
  158. package/build/sdk/studio/sdk/model/dSPGroupItem.js +7 -1
  159. package/build/sdk/studio/sdk/model/dSPGroupItem.js.map +1 -1
  160. package/build/sdk/studio/sdk/model/dSPInfoFeatures.d.ts +4 -0
  161. package/build/sdk/studio/sdk/model/dSPInfoFeatures.js +5 -0
  162. package/build/sdk/studio/sdk/model/dSPInfoFeatures.js.map +1 -1
  163. package/build/sdk/studio/sdk/model/deployPretrainedModelRequest.d.ts +1 -1
  164. package/build/sdk/studio/sdk/model/deployPretrainedModelRequest.js +1 -1
  165. package/build/sdk/studio/sdk/model/deployPretrainedModelRequest.js.map +1 -1
  166. package/build/sdk/studio/sdk/model/dspRunResponseWithSample.d.ts +4 -0
  167. package/build/sdk/studio/sdk/model/dspRunResponseWithSample.js +5 -0
  168. package/build/sdk/studio/sdk/model/dspRunResponseWithSample.js.map +1 -1
  169. package/build/sdk/studio/sdk/model/dspRunResponseWithSampleAllOf.d.ts +4 -0
  170. package/build/sdk/studio/sdk/model/dspRunResponseWithSampleAllOf.js +5 -0
  171. package/build/sdk/studio/sdk/model/dspRunResponseWithSampleAllOf.js.map +1 -1
  172. package/build/sdk/studio/sdk/model/entitlementLimits.d.ts +16 -0
  173. package/build/sdk/studio/sdk/model/entitlementLimits.js +5 -0
  174. package/build/sdk/studio/sdk/model/entitlementLimits.js.map +1 -1
  175. package/build/sdk/studio/sdk/model/feature.d.ts +1 -1
  176. package/build/sdk/studio/sdk/model/feature.js +1 -1
  177. package/build/sdk/studio/sdk/model/feature.js.map +1 -1
  178. package/build/sdk/studio/sdk/model/getDiversityDataResponseAllOfClusterInfos.d.ts +1 -1
  179. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponse.d.ts +34 -0
  180. package/build/sdk/studio/sdk/model/{getJWTTokenResponse.js → getLabelNoiseDataResponse.js} +12 -17
  181. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponse.js.map +1 -0
  182. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponseAllOf.d.ts +26 -0
  183. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponseAllOf.js +32 -0
  184. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponseAllOf.js.map +1 -0
  185. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponseAllOfData.d.ts +30 -0
  186. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponseAllOfData.js +42 -0
  187. package/build/sdk/studio/sdk/model/getLabelNoiseDataResponseAllOfData.js.map +1 -0
  188. package/build/sdk/studio/sdk/model/getLastDeploymentBuildResponse.d.ts +2 -0
  189. package/build/sdk/studio/sdk/model/getLastDeploymentBuildResponse.js +5 -0
  190. package/build/sdk/studio/sdk/model/getLastDeploymentBuildResponse.js.map +1 -1
  191. package/build/sdk/studio/sdk/model/getLastDeploymentBuildResponseAllOf.d.ts +2 -0
  192. package/build/sdk/studio/sdk/model/getLastDeploymentBuildResponseAllOf.js +5 -0
  193. package/build/sdk/studio/sdk/model/getLastDeploymentBuildResponseAllOf.js.map +1 -1
  194. package/build/sdk/studio/sdk/model/{createNoteResponse.d.ts → getOrganizationUsageReportResponse.d.ts} +3 -5
  195. package/build/sdk/studio/sdk/model/{listOrganizationProjectsResponse.js → getOrganizationUsageReportResponse.js} +12 -12
  196. package/build/sdk/studio/sdk/model/getOrganizationUsageReportResponse.js.map +1 -0
  197. package/build/sdk/studio/sdk/model/{listOrganizationProjectsResponse.d.ts → getTargetConstraintsResponse.d.ts} +3 -3
  198. package/build/sdk/studio/sdk/model/{adminGetFeatureFlagsResponse.js → getTargetConstraintsResponse.js} +12 -12
  199. package/build/sdk/studio/sdk/model/getTargetConstraintsResponse.js.map +1 -0
  200. package/build/sdk/studio/sdk/model/getTargetConstraintsResponseAllOf.d.ts +26 -0
  201. package/build/sdk/studio/sdk/model/getTargetConstraintsResponseAllOf.js +32 -0
  202. package/build/sdk/studio/sdk/model/getTargetConstraintsResponseAllOf.js.map +1 -0
  203. package/build/sdk/studio/sdk/model/job.d.ts +2 -0
  204. package/build/sdk/studio/sdk/model/job.js +5 -0
  205. package/build/sdk/studio/sdk/model/job.js.map +1 -1
  206. package/build/sdk/studio/sdk/model/{developmentBoard.d.ts → jobCreatedByUser.d.ts} +4 -3
  207. package/build/sdk/studio/sdk/model/{developmentBoard.js → jobCreatedByUser.js} +18 -13
  208. package/build/sdk/studio/sdk/model/jobCreatedByUser.js.map +1 -0
  209. package/build/sdk/studio/sdk/model/jobDetails.d.ts +2 -0
  210. package/build/sdk/studio/sdk/model/jobDetails.js +5 -0
  211. package/build/sdk/studio/sdk/model/jobDetails.js.map +1 -1
  212. package/build/sdk/studio/sdk/model/jobParentTypeEnum.d.ts +1 -1
  213. package/build/sdk/studio/sdk/model/jobParentTypeEnum.js +1 -1
  214. package/build/sdk/studio/sdk/model/jobParentTypeEnum.js.map +1 -1
  215. package/build/sdk/studio/sdk/model/jobStatus.d.ts +13 -0
  216. package/build/sdk/studio/sdk/model/jobStatus.js +16 -0
  217. package/build/sdk/studio/sdk/model/jobStatus.js.map +1 -0
  218. package/build/sdk/studio/sdk/model/kerasModelMetadata.d.ts +5 -1
  219. package/build/sdk/studio/sdk/model/kerasModelMetadata.js +6 -1
  220. package/build/sdk/studio/sdk/model/kerasModelMetadata.js.map +1 -1
  221. package/build/sdk/studio/sdk/model/kerasModelMetadataAllOf.d.ts +5 -1
  222. package/build/sdk/studio/sdk/model/kerasModelMetadataAllOf.js +6 -1
  223. package/build/sdk/studio/sdk/model/kerasModelMetadataAllOf.js.map +1 -1
  224. package/build/sdk/studio/sdk/model/kerasResponse.d.ts +6 -0
  225. package/build/sdk/studio/sdk/model/kerasResponse.js +10 -0
  226. package/build/sdk/studio/sdk/model/kerasResponse.js.map +1 -1
  227. package/build/sdk/studio/sdk/model/kerasResponseAllOf.d.ts +6 -0
  228. package/build/sdk/studio/sdk/model/kerasResponseAllOf.js +10 -0
  229. package/build/sdk/studio/sdk/model/kerasResponseAllOf.js.map +1 -1
  230. package/build/sdk/studio/sdk/model/learnBlock.d.ts +4 -0
  231. package/build/sdk/studio/sdk/model/learnBlock.js +5 -0
  232. package/build/sdk/studio/sdk/model/learnBlock.js.map +1 -1
  233. package/build/sdk/studio/sdk/model/listApiKeysResponseAllOfApiKeys.d.ts +1 -1
  234. package/build/sdk/studio/sdk/model/listApiKeysResponseAllOfApiKeys.js +1 -1
  235. package/build/sdk/studio/sdk/model/listApiKeysResponseAllOfApiKeys.js.map +1 -1
  236. package/build/sdk/studio/sdk/model/listOrganizationSecretsResponseAllOfSecrets.d.ts +2 -0
  237. package/build/sdk/studio/sdk/model/listOrganizationSecretsResponseAllOfSecrets.js +5 -0
  238. package/build/sdk/studio/sdk/model/listOrganizationSecretsResponseAllOfSecrets.js.map +1 -1
  239. package/build/sdk/studio/sdk/model/{getJWTTokenResponse.d.ts → listOrganizationUsageReportsResponse.d.ts} +5 -7
  240. package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponse.js +47 -0
  241. package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponse.js.map +1 -0
  242. package/build/sdk/studio/sdk/model/{saveAutoSegmenterClustersResponse.d.ts → listTunerRunsResponse.d.ts} +3 -2
  243. package/build/sdk/studio/sdk/model/{createNoteResponse.js → listTunerRunsResponse.js} +12 -12
  244. package/build/sdk/studio/sdk/model/listTunerRunsResponse.js.map +1 -0
  245. package/build/sdk/studio/sdk/model/{createNoteResponseAllOf.d.ts → listTunerRunsResponseAllOf.d.ts} +3 -5
  246. package/build/sdk/studio/sdk/model/listTunerRunsResponseAllOf.js +32 -0
  247. package/build/sdk/studio/sdk/model/listTunerRunsResponseAllOf.js.map +1 -0
  248. package/build/sdk/studio/sdk/model/{adminGetFeatureFlagsResponseAllOfFlags.d.ts → memorySpec.d.ts} +7 -7
  249. package/build/sdk/studio/sdk/model/memorySpec.js +40 -0
  250. package/build/sdk/studio/sdk/model/memorySpec.js.map +1 -0
  251. package/build/sdk/studio/sdk/model/modelPrediction.d.ts +1 -0
  252. package/build/sdk/studio/sdk/model/modelPrediction.js +5 -0
  253. package/build/sdk/studio/sdk/model/modelPrediction.js.map +1 -1
  254. package/build/sdk/studio/sdk/model/models.d.ts +49 -4
  255. package/build/sdk/studio/sdk/model/models.js +154 -13
  256. package/build/sdk/studio/sdk/model/models.js.map +1 -1
  257. package/build/sdk/studio/sdk/model/{anomalyModelMetadataClusters.d.ts → neighborsData.d.ts} +9 -5
  258. package/build/sdk/studio/sdk/model/neighborsData.js +40 -0
  259. package/build/sdk/studio/sdk/model/neighborsData.js.map +1 -0
  260. package/build/sdk/studio/sdk/model/neighborsScore.d.ts +50 -0
  261. package/build/sdk/studio/sdk/model/neighborsScore.js +60 -0
  262. package/build/sdk/studio/sdk/model/neighborsScore.js.map +1 -0
  263. package/build/sdk/studio/sdk/model/{classifyJobResponseAllOfResult.d.ts → neighborsScoreNeighborWindows.d.ts} +14 -5
  264. package/build/sdk/studio/sdk/model/neighborsScoreNeighborWindows.js +47 -0
  265. package/build/sdk/studio/sdk/model/neighborsScoreNeighborWindows.js.map +1 -0
  266. package/build/sdk/studio/sdk/model/objectDetectionLastLayer.d.ts +1 -1
  267. package/build/sdk/studio/sdk/model/objectDetectionLastLayer.js +1 -1
  268. package/build/sdk/studio/sdk/model/objectDetectionLastLayer.js.map +1 -1
  269. package/build/sdk/studio/sdk/model/optimizeConfig.d.ts +9 -6
  270. package/build/sdk/studio/sdk/model/optimizeConfig.js +7 -2
  271. package/build/sdk/studio/sdk/model/optimizeConfig.js.map +1 -1
  272. package/build/sdk/studio/sdk/model/optimizeConfigResponse.d.ts +9 -6
  273. package/build/sdk/studio/sdk/model/optimizeConfigResponse.js +7 -2
  274. package/build/sdk/studio/sdk/model/optimizeConfigResponse.js.map +1 -1
  275. package/build/sdk/studio/sdk/model/optimizeConfigTargetDevice.d.ts +1 -1
  276. package/build/sdk/studio/sdk/model/optimizeStateResponse.d.ts +14 -2
  277. package/build/sdk/studio/sdk/model/optimizeStateResponse.js +17 -2
  278. package/build/sdk/studio/sdk/model/optimizeStateResponse.js.map +1 -1
  279. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOf.d.ts +14 -2
  280. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOf.js +17 -2
  281. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOf.js.map +1 -1
  282. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOfStatus.d.ts +9 -9
  283. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOfStatus.js +1 -1
  284. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOfStatus.js.map +1 -1
  285. package/build/sdk/studio/sdk/model/optimizeStateResponseAllOfWorkers.d.ts +2 -2
  286. package/build/sdk/studio/sdk/model/optimizeTransferLearningModelsResponse.d.ts +1 -1
  287. package/build/sdk/studio/sdk/model/optimizeTransferLearningModelsResponseAllOf.d.ts +1 -1
  288. package/build/sdk/studio/sdk/model/organization.d.ts +4 -0
  289. package/build/sdk/studio/sdk/model/organization.js +5 -0
  290. package/build/sdk/studio/sdk/model/organization.js.map +1 -1
  291. package/build/sdk/studio/sdk/model/organizationComputeTimeUsage.d.ts +36 -0
  292. package/build/sdk/studio/sdk/model/organizationComputeTimeUsage.js +42 -0
  293. package/build/sdk/studio/sdk/model/organizationComputeTimeUsage.js.map +1 -0
  294. package/build/sdk/studio/sdk/model/organizationCreateProject.d.ts +2 -2
  295. package/build/sdk/studio/sdk/model/organizationCreateProject.js +1 -1
  296. package/build/sdk/studio/sdk/model/organizationCreateProject.js.map +1 -1
  297. package/build/sdk/studio/sdk/model/organizationCreateProjectRequest.d.ts +2 -0
  298. package/build/sdk/studio/sdk/model/organizationCreateProjectRequest.js +5 -0
  299. package/build/sdk/studio/sdk/model/organizationCreateProjectRequest.js.map +1 -1
  300. package/build/sdk/studio/sdk/model/organizationCreateProjectWithFiles.d.ts +2 -2
  301. package/build/sdk/studio/sdk/model/organizationCreateProjectWithFiles.js +1 -1
  302. package/build/sdk/studio/sdk/model/organizationCreateProjectWithFiles.js.map +1 -1
  303. package/build/sdk/studio/sdk/model/organizationDeployBlock.d.ts +4 -0
  304. package/build/sdk/studio/sdk/model/organizationDeployBlock.js +15 -0
  305. package/build/sdk/studio/sdk/model/organizationDeployBlock.js.map +1 -1
  306. package/build/sdk/studio/sdk/model/organizationDspBlock.d.ts +4 -0
  307. package/build/sdk/studio/sdk/model/organizationDspBlock.js +15 -0
  308. package/build/sdk/studio/sdk/model/organizationDspBlock.js.map +1 -1
  309. package/build/sdk/studio/sdk/model/organizationGetCreateProjectsResponseAllOfJobs.d.ts +2 -2
  310. package/build/sdk/studio/sdk/model/organizationGetCreateProjectsResponseAllOfJobs.js +1 -1
  311. package/build/sdk/studio/sdk/model/organizationGetCreateProjectsResponseAllOfJobs.js.map +1 -1
  312. package/build/sdk/studio/sdk/model/organizationMetricsResponseAllOfMetrics.d.ts +2 -2
  313. package/build/sdk/studio/sdk/model/organizationTransferLearningBlock.d.ts +12 -0
  314. package/build/sdk/studio/sdk/model/organizationTransferLearningBlock.js +25 -0
  315. package/build/sdk/studio/sdk/model/organizationTransferLearningBlock.js.map +1 -1
  316. package/build/sdk/studio/sdk/model/organizationTransformationBlock.d.ts +8 -0
  317. package/build/sdk/studio/sdk/model/organizationTransformationBlock.js +20 -0
  318. package/build/sdk/studio/sdk/model/organizationTransformationBlock.js.map +1 -1
  319. package/build/sdk/studio/sdk/model/organizationUsageReport.d.ts +34 -0
  320. package/build/sdk/studio/sdk/model/organizationUsageReport.js +72 -0
  321. package/build/sdk/studio/sdk/model/organizationUsageReport.js.map +1 -0
  322. package/build/sdk/studio/sdk/model/project.d.ts +13 -0
  323. package/build/sdk/studio/sdk/model/project.js +20 -0
  324. package/build/sdk/studio/sdk/model/project.js.map +1 -1
  325. package/build/sdk/studio/sdk/model/projectInfoResponse.d.ts +6 -0
  326. package/build/sdk/studio/sdk/model/projectInfoResponse.js +10 -0
  327. package/build/sdk/studio/sdk/model/projectInfoResponse.js.map +1 -1
  328. package/build/sdk/studio/sdk/model/projectInfoResponseAllOf.d.ts +6 -0
  329. package/build/sdk/studio/sdk/model/projectInfoResponseAllOf.js +10 -0
  330. package/build/sdk/studio/sdk/model/projectInfoResponseAllOf.js.map +1 -1
  331. package/build/sdk/studio/sdk/model/projectVisibility.d.ts +16 -0
  332. package/build/sdk/studio/sdk/model/projectVisibility.js +16 -0
  333. package/build/sdk/studio/sdk/model/projectVisibility.js.map +1 -0
  334. package/build/sdk/studio/sdk/model/resourceRange.d.ts +29 -0
  335. package/build/sdk/studio/sdk/model/resourceRange.js +40 -0
  336. package/build/sdk/studio/sdk/model/resourceRange.js.map +1 -0
  337. package/build/sdk/studio/sdk/model/sample.d.ts +7 -0
  338. package/build/sdk/studio/sdk/model/sample.js +15 -0
  339. package/build/sdk/studio/sdk/model/sample.js.map +1 -1
  340. package/build/sdk/studio/sdk/model/setKerasParameterRequest.d.ts +6 -0
  341. package/build/sdk/studio/sdk/model/setKerasParameterRequest.js +10 -0
  342. package/build/sdk/studio/sdk/model/setKerasParameterRequest.js.map +1 -1
  343. package/build/sdk/studio/sdk/model/setSampleStructuredLabelsRequest.d.ts +26 -0
  344. package/build/sdk/studio/sdk/model/setSampleStructuredLabelsRequest.js +32 -0
  345. package/build/sdk/studio/sdk/model/setSampleStructuredLabelsRequest.js.map +1 -0
  346. package/build/sdk/studio/sdk/model/structuredClassifyResult.d.ts +6 -6
  347. package/build/sdk/studio/sdk/model/{adminCreateUserTrialRequest.d.ts → structuredLabel.d.ts} +10 -7
  348. package/build/sdk/studio/sdk/model/structuredLabel.js +45 -0
  349. package/build/sdk/studio/sdk/model/structuredLabel.js.map +1 -0
  350. package/build/sdk/studio/sdk/model/targetConstraints.d.ts +40 -0
  351. package/build/sdk/studio/sdk/model/targetConstraints.js +43 -0
  352. package/build/sdk/studio/sdk/model/targetConstraints.js.map +1 -0
  353. package/build/sdk/studio/sdk/model/{getJWTTokenRequest.d.ts → targetConstraintsDevice.d.ts} +14 -12
  354. package/build/sdk/studio/sdk/model/targetConstraintsDevice.js +52 -0
  355. package/build/sdk/studio/sdk/model/targetConstraintsDevice.js.map +1 -0
  356. package/build/sdk/studio/sdk/model/targetMemory.d.ts +30 -0
  357. package/build/sdk/studio/sdk/model/{profileTfLiteResponseAllOfMemoryTflite.js → targetMemory.js} +14 -11
  358. package/build/sdk/studio/sdk/model/targetMemory.js.map +1 -0
  359. package/build/sdk/studio/sdk/model/targetProcessor.d.ts +48 -0
  360. package/build/sdk/studio/sdk/model/targetProcessor.js +62 -0
  361. package/build/sdk/studio/sdk/model/targetProcessor.js.map +1 -0
  362. package/build/sdk/studio/sdk/model/{saveAutoSegmenterClustersRequestClusters.d.ts → tunerRun.d.ts} +7 -2
  363. package/build/sdk/studio/sdk/model/tunerRun.js +57 -0
  364. package/build/sdk/studio/sdk/model/tunerRun.js.map +1 -0
  365. package/build/sdk/studio/sdk/model/tunerTrial.d.ts +6 -3
  366. package/build/sdk/studio/sdk/model/tunerTrial.js +4 -3
  367. package/build/sdk/studio/sdk/model/tunerTrial.js.map +1 -1
  368. package/build/sdk/studio/sdk/model/tunerTrialBlocks.d.ts +8 -4
  369. package/build/sdk/studio/sdk/model/tunerTrialBlocks.js +5 -3
  370. package/build/sdk/studio/sdk/model/tunerTrialBlocks.js.map +1 -1
  371. package/build/sdk/studio/sdk/model/{activateUserRequest.d.ts → tunerTrialImpulse.d.ts} +4 -5
  372. package/build/sdk/studio/sdk/model/tunerTrialImpulse.js +42 -0
  373. package/build/sdk/studio/sdk/model/tunerTrialImpulse.js.map +1 -0
  374. package/build/sdk/studio/sdk/model/updateOrganizationCreateEmptyProjectRequest.d.ts +2 -0
  375. package/build/sdk/studio/sdk/model/updateOrganizationCreateEmptyProjectRequest.js +5 -0
  376. package/build/sdk/studio/sdk/model/updateOrganizationCreateEmptyProjectRequest.js.map +1 -1
  377. package/build/sdk/studio/sdk/model/updateOrganizationTransferLearningBlockRequest.d.ts +4 -0
  378. package/build/sdk/studio/sdk/model/updateOrganizationTransferLearningBlockRequest.js +5 -0
  379. package/build/sdk/studio/sdk/model/updateOrganizationTransferLearningBlockRequest.js.map +1 -1
  380. package/build/sdk/studio/sdk/model/updateOrganizationTransformationBlockRequest.d.ts +4 -0
  381. package/build/sdk/studio/sdk/model/updateOrganizationTransformationBlockRequest.js +5 -0
  382. package/build/sdk/studio/sdk/model/updateOrganizationTransformationBlockRequest.js.map +1 -1
  383. package/build/sdk/studio/sdk/model/updateProjectRequest.d.ts +14 -0
  384. package/build/sdk/studio/sdk/model/updateProjectRequest.js +20 -0
  385. package/build/sdk/studio/sdk/model/updateProjectRequest.js.map +1 -1
  386. package/build/sdk/studio/sdk/model/{adminGetUserMetricsResponseAllOf.d.ts → updateTunerRunRequest.d.ts} +2 -2
  387. package/build/sdk/studio/sdk/model/{activateUserRequest.js → updateTunerRunRequest.js} +11 -11
  388. package/build/sdk/studio/sdk/model/updateTunerRunRequest.js.map +1 -0
  389. package/build/sdk/studio/sdk/model/userOrganization.d.ts +2 -0
  390. package/build/sdk/studio/sdk/model/userOrganization.js +5 -0
  391. package/build/sdk/studio/sdk/model/userOrganization.js.map +1 -1
  392. package/build/shared/bounding-box-file-types.d.ts +50 -9
  393. package/build/shared/bounding-box-file-types.js +105 -4
  394. package/build/shared/bounding-box-file-types.js.map +1 -1
  395. package/build/shared/viewmodels/init.d.ts +2 -2
  396. package/build/shared/viewmodels/init.js +1 -0
  397. package/build/shared/viewmodels/init.js.map +1 -1
  398. package/cli/linux/runner.ts +236 -2
  399. package/cli/linux/webserver/middleware/asyncMiddleware.ts +7 -0
  400. package/cli/linux/webserver/public/assets/mobileclient.css +20 -0
  401. package/cli/linux/webserver/public/inference-server.js +185 -0
  402. package/cli/linux/webserver/views/escape-html-template-tag/escape.ts +64 -0
  403. package/cli/linux/webserver/views/escape-html-template-tag/index.ts +2 -0
  404. package/cli/linux/webserver/views/inference-server-view.ts +179 -0
  405. package/package.json +8 -4
  406. package/build/sdk/studio/sdk/api/allowsReadOnlyApi.d.ts +0 -726
  407. package/build/sdk/studio/sdk/api/allowsReadOnlyApi.js +0 -3986
  408. package/build/sdk/studio/sdk/api/allowsReadOnlyApi.js.map +0 -1
  409. package/build/sdk/studio/sdk/api/contentDispositionInlineApi.d.ts +0 -89
  410. package/build/sdk/studio/sdk/api/contentDispositionInlineApi.js +0 -335
  411. package/build/sdk/studio/sdk/api/contentDispositionInlineApi.js.map +0 -1
  412. package/build/sdk/studio/sdk/api/organizationAllowDeveloperProfileApi.d.ts +0 -693
  413. package/build/sdk/studio/sdk/api/organizationAllowDeveloperProfileApi.js +0 -3799
  414. package/build/sdk/studio/sdk/api/organizationAllowDeveloperProfileApi.js.map +0 -1
  415. package/build/sdk/studio/sdk/api/organizationAllowGuestAccessApi.d.ts +0 -180
  416. package/build/sdk/studio/sdk/api/organizationAllowGuestAccessApi.js +0 -847
  417. package/build/sdk/studio/sdk/api/organizationAllowGuestAccessApi.js.map +0 -1
  418. package/build/sdk/studio/sdk/api/organizationRequiresAdminApi.d.ts +0 -640
  419. package/build/sdk/studio/sdk/api/organizationRequiresAdminApi.js +0 -3714
  420. package/build/sdk/studio/sdk/api/organizationRequiresAdminApi.js.map +0 -1
  421. package/build/sdk/studio/sdk/api/organizationRequiresWhitelabelAdminApi.d.ts +0 -471
  422. package/build/sdk/studio/sdk/api/organizationRequiresWhitelabelAdminApi.js +0 -2604
  423. package/build/sdk/studio/sdk/api/organizationRequiresWhitelabelAdminApi.js.map +0 -1
  424. package/build/sdk/studio/sdk/api/projectRequiresAdminApi.d.ts +0 -65
  425. package/build/sdk/studio/sdk/api/projectRequiresAdminApi.js +0 -231
  426. package/build/sdk/studio/sdk/api/projectRequiresAdminApi.js.map +0 -1
  427. package/build/sdk/studio/sdk/api/requiresSudoApi.d.ts +0 -87
  428. package/build/sdk/studio/sdk/api/requiresSudoApi.js +0 -371
  429. package/build/sdk/studio/sdk/api/requiresSudoApi.js.map +0 -1
  430. package/build/sdk/studio/sdk/api/requiresThirdPartyAuthApiKeyApi.d.ts +0 -56
  431. package/build/sdk/studio/sdk/api/requiresThirdPartyAuthApiKeyApi.js +0 -158
  432. package/build/sdk/studio/sdk/api/requiresThirdPartyAuthApiKeyApi.js.map +0 -1
  433. package/build/sdk/studio/sdk/api/supportsRangeApi.d.ts +0 -74
  434. package/build/sdk/studio/sdk/api/supportsRangeApi.js +0 -248
  435. package/build/sdk/studio/sdk/api/supportsRangeApi.js.map +0 -1
  436. package/build/sdk/studio/sdk/model/activateUserRequest.js.map +0 -1
  437. package/build/sdk/studio/sdk/model/addNoteRequest.js +0 -37
  438. package/build/sdk/studio/sdk/model/addNoteRequest.js.map +0 -1
  439. package/build/sdk/studio/sdk/model/adminCreateUserTrialRequest.js +0 -42
  440. package/build/sdk/studio/sdk/model/adminCreateUserTrialRequest.js.map +0 -1
  441. package/build/sdk/studio/sdk/model/adminGetFeatureFlagsResponse.js.map +0 -1
  442. package/build/sdk/studio/sdk/model/adminGetFeatureFlagsResponseAllOf.js +0 -32
  443. package/build/sdk/studio/sdk/model/adminGetFeatureFlagsResponseAllOf.js.map +0 -1
  444. package/build/sdk/studio/sdk/model/adminGetFeatureFlagsResponseAllOfFlags.js +0 -37
  445. package/build/sdk/studio/sdk/model/adminGetFeatureFlagsResponseAllOfFlags.js.map +0 -1
  446. package/build/sdk/studio/sdk/model/adminGetUserMetricsResponseAllOf.js +0 -32
  447. package/build/sdk/studio/sdk/model/adminGetUserMetricsResponseAllOf.js.map +0 -1
  448. package/build/sdk/studio/sdk/model/anomalyModelMetadataClusters.js +0 -37
  449. package/build/sdk/studio/sdk/model/anomalyModelMetadataClusters.js.map +0 -1
  450. package/build/sdk/studio/sdk/model/anomalyModelMetadataResponse.d.ts +0 -57
  451. package/build/sdk/studio/sdk/model/anomalyModelMetadataResponse.js +0 -67
  452. package/build/sdk/studio/sdk/model/anomalyModelMetadataResponse.js.map +0 -1
  453. package/build/sdk/studio/sdk/model/classifyJobResponseAllOfResult.js +0 -42
  454. package/build/sdk/studio/sdk/model/classifyJobResponseAllOfResult.js.map +0 -1
  455. package/build/sdk/studio/sdk/model/createNoteResponse.js.map +0 -1
  456. package/build/sdk/studio/sdk/model/createNoteResponseAllOf.js +0 -32
  457. package/build/sdk/studio/sdk/model/createNoteResponseAllOf.js.map +0 -1
  458. package/build/sdk/studio/sdk/model/deployPretrainedModelInputNone.d.ts +0 -27
  459. package/build/sdk/studio/sdk/model/deployPretrainedModelInputNone.js +0 -33
  460. package/build/sdk/studio/sdk/model/deployPretrainedModelInputNone.js.map +0 -1
  461. package/build/sdk/studio/sdk/model/developmentBoard.js.map +0 -1
  462. package/build/sdk/studio/sdk/model/getAutoSegmenterResponse.js +0 -62
  463. package/build/sdk/studio/sdk/model/getAutoSegmenterResponse.js.map +0 -1
  464. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOf.d.ts +0 -30
  465. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOf.js +0 -52
  466. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOf.js.map +0 -1
  467. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOfClusters.d.ts +0 -27
  468. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOfClusters.js +0 -37
  469. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOfClusters.js.map +0 -1
  470. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOfItems.js +0 -32
  471. package/build/sdk/studio/sdk/model/getAutoSegmenterResponseAllOfItems.js.map +0 -1
  472. package/build/sdk/studio/sdk/model/getJWTTokenRequest.js +0 -53
  473. package/build/sdk/studio/sdk/model/getJWTTokenRequest.js.map +0 -1
  474. package/build/sdk/studio/sdk/model/getJWTTokenResponse.js.map +0 -1
  475. package/build/sdk/studio/sdk/model/getJWTTokenResponseAllOf.js +0 -37
  476. package/build/sdk/studio/sdk/model/getJWTTokenResponseAllOf.js.map +0 -1
  477. package/build/sdk/studio/sdk/model/getOrganizationProjectsDataCountResponseAllOf.d.ts +0 -25
  478. package/build/sdk/studio/sdk/model/getOrganizationProjectsDataCountResponseAllOf.js +0 -32
  479. package/build/sdk/studio/sdk/model/getOrganizationProjectsDataCountResponseAllOf.js.map +0 -1
  480. package/build/sdk/studio/sdk/model/getUserResponseAllOfOrganizations.js +0 -57
  481. package/build/sdk/studio/sdk/model/getUserResponseAllOfOrganizations.js.map +0 -1
  482. package/build/sdk/studio/sdk/model/listOrganizationProjectsResponse.js.map +0 -1
  483. package/build/sdk/studio/sdk/model/listOrganizationProjectsResponseAllOf.d.ts +0 -26
  484. package/build/sdk/studio/sdk/model/listOrganizationProjectsResponseAllOf.js +0 -32
  485. package/build/sdk/studio/sdk/model/listOrganizationProjectsResponseAllOf.js.map +0 -1
  486. package/build/sdk/studio/sdk/model/organizationCreateProjectCreatedByUser.js.map +0 -1
  487. package/build/sdk/studio/sdk/model/organizationCreateProjectFiles.d.ts +0 -32
  488. package/build/sdk/studio/sdk/model/organizationCreateProjectFiles.js +0 -58
  489. package/build/sdk/studio/sdk/model/organizationCreateProjectFiles.js.map +0 -1
  490. package/build/sdk/studio/sdk/model/organizationInfoResponseAllOfEntitlementLimits.d.ts +0 -28
  491. package/build/sdk/studio/sdk/model/organizationInfoResponseAllOfEntitlementLimits.js +0 -47
  492. package/build/sdk/studio/sdk/model/organizationInfoResponseAllOfEntitlementLimits.js.map +0 -1
  493. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOf.d.ts +0 -27
  494. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOf.js +0 -37
  495. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOf.js.map +0 -1
  496. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOfMemory.d.ts +0 -27
  497. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOfMemory.js +0 -37
  498. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOfMemory.js.map +0 -1
  499. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOfMemoryTflite.d.ts +0 -26
  500. package/build/sdk/studio/sdk/model/profileTfLiteResponseAllOfMemoryTflite.js.map +0 -1
  501. package/build/sdk/studio/sdk/model/projectInfoResponseAllOfLatencyDevices.d.ts +0 -32
  502. package/build/sdk/studio/sdk/model/projectInfoResponseAllOfLatencyDevices.js +0 -67
  503. package/build/sdk/studio/sdk/model/projectInfoResponseAllOfLatencyDevices.js.map +0 -1
  504. package/build/sdk/studio/sdk/model/runAutoSegmenterRequest.d.ts +0 -27
  505. package/build/sdk/studio/sdk/model/runAutoSegmenterRequest.js +0 -42
  506. package/build/sdk/studio/sdk/model/runAutoSegmenterRequest.js.map +0 -1
  507. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersRequest.d.ts +0 -26
  508. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersRequest.js +0 -32
  509. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersRequest.js.map +0 -1
  510. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersRequestClusters.js +0 -37
  511. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersRequestClusters.js.map +0 -1
  512. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersResponse.js.map +0 -1
  513. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersResponseAllOf.d.ts +0 -25
  514. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersResponseAllOf.js +0 -32
  515. package/build/sdk/studio/sdk/model/saveAutoSegmenterClustersResponseAllOf.js.map +0 -1
  516. package/build/sdk/studio/sdk/model/updateNoteRequest.d.ts +0 -32
  517. package/build/sdk/studio/sdk/model/updateNoteRequest.js +0 -37
  518. package/build/sdk/studio/sdk/model/updateNoteRequest.js.map +0 -1
  519. package/build/sdk/studio/sdk/model/updateNoteResponse.d.ts +0 -25
  520. package/build/sdk/studio/sdk/model/updateNoteResponse.js +0 -27
  521. package/build/sdk/studio/sdk/model/updateNoteResponse.js.map +0 -1
  522. package/build/sdk/studio/sdk/model/whitelabelAdminCreateProjectRequest.js.map +0 -1
@@ -1,3986 +0,0 @@
1
- "use strict";
2
- /**
3
- * Edge Impulse API
4
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
- *
6
- * The version of the OpenAPI document: 1.0.0
7
- *
8
- *
9
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
- * https://openapi-generator.tech
11
- * Do not edit the class manually.
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.AllowsReadOnlyApi = exports.AllowsReadOnlyApiApiKeys = void 0;
15
- // tslint:disable-next-line: variable-name, no-var-requires
16
- const PATH = require('path');
17
- // tslint:disable-next-line: no-unsafe-any
18
- module.paths.push(PATH.join(process.cwd(), 'node_modules'));
19
- const localVarRequest = require("request");
20
- const models_1 = require("../model/models");
21
- const models_2 = require("../model/models");
22
- let defaultBasePath = 'https://studio.edgeimpulse.com/v1';
23
- // ===============================================
24
- // This file is autogenerated - Please do not edit
25
- // ===============================================
26
- var AllowsReadOnlyApiApiKeys;
27
- (function (AllowsReadOnlyApiApiKeys) {
28
- AllowsReadOnlyApiApiKeys[AllowsReadOnlyApiApiKeys["ApiKeyAuthentication"] = 0] = "ApiKeyAuthentication";
29
- AllowsReadOnlyApiApiKeys[AllowsReadOnlyApiApiKeys["JWTAuthentication"] = 1] = "JWTAuthentication";
30
- AllowsReadOnlyApiApiKeys[AllowsReadOnlyApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
31
- })(AllowsReadOnlyApiApiKeys = exports.AllowsReadOnlyApiApiKeys || (exports.AllowsReadOnlyApiApiKeys = {}));
32
- class AllowsReadOnlyApi {
33
- constructor(basePathOrUsername, opts, password, basePath) {
34
- this._basePath = defaultBasePath;
35
- this.defaultHeaders = {};
36
- this._useQuerystring = false;
37
- this._opts = {};
38
- this.authentications = {
39
- 'default': new models_1.VoidAuth(),
40
- 'ApiKeyAuthentication': new models_2.ApiKeyAuth('header', 'x-api-key'),
41
- 'JWTAuthentication': new models_2.ApiKeyAuth('cookie', 'jwt'),
42
- 'JWTHttpHeaderAuthentication': new models_2.ApiKeyAuth('header', 'x-jwt-token'),
43
- };
44
- if (password) {
45
- if (basePath) {
46
- this.basePath = basePath;
47
- }
48
- }
49
- else {
50
- if (basePathOrUsername) {
51
- this.basePath = basePathOrUsername;
52
- }
53
- }
54
- this.opts = opts !== null && opts !== void 0 ? opts : {};
55
- }
56
- set useQuerystring(value) {
57
- this._useQuerystring = value;
58
- }
59
- set basePath(basePath) {
60
- this._basePath = basePath;
61
- }
62
- get basePath() {
63
- return this._basePath;
64
- }
65
- set opts(opts) {
66
- this._opts = opts;
67
- }
68
- get opts() {
69
- return this._opts;
70
- }
71
- setDefaultAuthentication(auth) {
72
- this.authentications.default = auth;
73
- }
74
- setApiKey(key, value) {
75
- this.authentications[AllowsReadOnlyApiApiKeys[key]].apiKey = value;
76
- }
77
- /**
78
- * Get a sample of trained features, this extracts a number of samples and their features.
79
- * @summary Trained features
80
- * @param projectId Project ID
81
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
82
- * @param featureAx1 Feature axis 1
83
- * @param featureAx2 Feature axis 2
84
- */
85
- async anomalyTrainedFeatures(projectId, learnId, queryParams, options = { headers: {} }) {
86
- const localVarPath = this.basePath + '/api/{projectId}/training/anomaly/{learnId}/features/get-graph'
87
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
88
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
89
- let localVarQueryParameters = {};
90
- let localVarHeaderParams = Object.assign({
91
- 'User-Agent': 'edgeimpulse-api nodejs'
92
- }, this.defaultHeaders);
93
- const produces = ['application/json'];
94
- // give precedence to 'application/json'
95
- if (produces.indexOf('application/json') >= 0) {
96
- localVarHeaderParams.Accept = 'application/json';
97
- }
98
- else {
99
- localVarHeaderParams.Accept = produces.join(',');
100
- }
101
- let localVarFormParams = {};
102
- // verify required parameter 'projectId' is not null or undefined
103
- if (projectId === null || projectId === undefined) {
104
- throw new Error('Required parameter projectId was null or undefined when calling anomalyTrainedFeatures.');
105
- }
106
- // verify required parameter 'learnId' is not null or undefined
107
- if (learnId === null || learnId === undefined) {
108
- throw new Error('Required parameter learnId was null or undefined when calling anomalyTrainedFeatures.');
109
- }
110
- // verify required parameter 'featureAx1' is not null or undefined
111
- if (queryParams.featureAx1 === null || queryParams.featureAx1 === undefined) {
112
- throw new Error('Required parameter queryParams.featureAx1 was null or undefined when calling anomalyTrainedFeatures.');
113
- }
114
- // verify required parameter 'featureAx2' is not null or undefined
115
- if (queryParams.featureAx2 === null || queryParams.featureAx2 === undefined) {
116
- throw new Error('Required parameter queryParams.featureAx2 was null or undefined when calling anomalyTrainedFeatures.');
117
- }
118
- if (queryParams.featureAx1 !== undefined) {
119
- localVarQueryParameters['featureAx1'] = models_1.ObjectSerializer.serialize(queryParams.featureAx1, "number");
120
- }
121
- if (queryParams.featureAx2 !== undefined) {
122
- localVarQueryParameters['featureAx2'] = models_1.ObjectSerializer.serialize(queryParams.featureAx2, "number");
123
- }
124
- Object.assign(localVarHeaderParams, options.headers);
125
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
126
- let localVarUseFormData = false;
127
- let localVarRequestOptions = {
128
- method: 'GET',
129
- qs: localVarQueryParameters,
130
- headers: localVarHeaderParams,
131
- uri: localVarPath,
132
- useQuerystring: this._useQuerystring,
133
- agentOptions: { keepAlive: false },
134
- json: true,
135
- };
136
- let authenticationPromise = Promise.resolve();
137
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
138
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
139
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
140
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
141
- return authenticationPromise.then(() => {
142
- if (Object.keys(localVarFormParams).length) {
143
- if (localVarUseFormData) {
144
- localVarRequestOptions.formData = localVarFormParams;
145
- }
146
- else {
147
- localVarRequestOptions.form = localVarFormParams;
148
- }
149
- }
150
- return new Promise((resolve, reject) => {
151
- localVarRequest(localVarRequestOptions, (error, response, body) => {
152
- if (error) {
153
- reject(error);
154
- }
155
- else {
156
- body = models_1.ObjectSerializer.deserialize(body, "AnomalyTrainedFeaturesResponse");
157
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
158
- if (typeof body.success === 'boolean' && !body.success) {
159
- reject(new Error(body.error || errString));
160
- }
161
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
162
- resolve(body);
163
- }
164
- else {
165
- reject(errString);
166
- }
167
- }
168
- });
169
- });
170
- });
171
- }
172
- /**
173
- * Get trained features for a single sample. This runs both the DSP prerequisites and the anomaly classifier.
174
- * @summary Trained features for sample
175
- * @param projectId Project ID
176
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
177
- * @param sampleId Sample ID
178
- */
179
- async anomalyTrainedFeaturesPerSample(projectId, learnId, sampleId, options = { headers: {} }) {
180
- const localVarPath = this.basePath + '/api/{projectId}/training/anomaly/{learnId}/features/get-graph/classification/{sampleId}'
181
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
182
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)))
183
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
184
- let localVarQueryParameters = {};
185
- let localVarHeaderParams = Object.assign({
186
- 'User-Agent': 'edgeimpulse-api nodejs'
187
- }, this.defaultHeaders);
188
- const produces = ['application/json'];
189
- // give precedence to 'application/json'
190
- if (produces.indexOf('application/json') >= 0) {
191
- localVarHeaderParams.Accept = 'application/json';
192
- }
193
- else {
194
- localVarHeaderParams.Accept = produces.join(',');
195
- }
196
- let localVarFormParams = {};
197
- // verify required parameter 'projectId' is not null or undefined
198
- if (projectId === null || projectId === undefined) {
199
- throw new Error('Required parameter projectId was null or undefined when calling anomalyTrainedFeaturesPerSample.');
200
- }
201
- // verify required parameter 'learnId' is not null or undefined
202
- if (learnId === null || learnId === undefined) {
203
- throw new Error('Required parameter learnId was null or undefined when calling anomalyTrainedFeaturesPerSample.');
204
- }
205
- // verify required parameter 'sampleId' is not null or undefined
206
- if (sampleId === null || sampleId === undefined) {
207
- throw new Error('Required parameter sampleId was null or undefined when calling anomalyTrainedFeaturesPerSample.');
208
- }
209
- Object.assign(localVarHeaderParams, options.headers);
210
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
211
- let localVarUseFormData = false;
212
- let localVarRequestOptions = {
213
- method: 'GET',
214
- qs: localVarQueryParameters,
215
- headers: localVarHeaderParams,
216
- uri: localVarPath,
217
- useQuerystring: this._useQuerystring,
218
- agentOptions: { keepAlive: false },
219
- json: true,
220
- };
221
- let authenticationPromise = Promise.resolve();
222
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
223
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
224
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
225
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
226
- return authenticationPromise.then(() => {
227
- if (Object.keys(localVarFormParams).length) {
228
- if (localVarUseFormData) {
229
- localVarRequestOptions.formData = localVarFormParams;
230
- }
231
- else {
232
- localVarRequestOptions.form = localVarFormParams;
233
- }
234
- }
235
- return new Promise((resolve, reject) => {
236
- localVarRequest(localVarRequestOptions, (error, response, body) => {
237
- if (error) {
238
- reject(error);
239
- }
240
- else {
241
- body = models_1.ObjectSerializer.deserialize(body, "AnomalyTrainedFeaturesResponse");
242
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
243
- if (typeof body.success === 'boolean' && !body.success) {
244
- reject(new Error(body.error || errString));
245
- }
246
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
247
- resolve(body);
248
- }
249
- else {
250
- reject(errString);
251
- }
252
- }
253
- });
254
- });
255
- });
256
- }
257
- /**
258
- * This API is deprecated, use classifySampleV2 instead (`/v1/api/{projectId}/classify/v2/{sampleId}`). Classify a complete file against the current impulse. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and classify for every window that is extracted.
259
- * @summary Classify sample (deprecated)
260
- * @param projectId Project ID
261
- * @param sampleId Sample ID
262
- * @param includeDebugInfo Whether to return the debug information from FOMO classification.
263
- */
264
- async classifySample(projectId, sampleId, queryParams, options = { headers: {} }) {
265
- const localVarPath = this.basePath + '/api/{projectId}/classify/{sampleId}'
266
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
267
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
268
- let localVarQueryParameters = {};
269
- let localVarHeaderParams = Object.assign({
270
- 'User-Agent': 'edgeimpulse-api nodejs'
271
- }, this.defaultHeaders);
272
- const produces = ['application/json'];
273
- // give precedence to 'application/json'
274
- if (produces.indexOf('application/json') >= 0) {
275
- localVarHeaderParams.Accept = 'application/json';
276
- }
277
- else {
278
- localVarHeaderParams.Accept = produces.join(',');
279
- }
280
- let localVarFormParams = {};
281
- // verify required parameter 'projectId' is not null or undefined
282
- if (projectId === null || projectId === undefined) {
283
- throw new Error('Required parameter projectId was null or undefined when calling classifySample.');
284
- }
285
- // verify required parameter 'sampleId' is not null or undefined
286
- if (sampleId === null || sampleId === undefined) {
287
- throw new Error('Required parameter sampleId was null or undefined when calling classifySample.');
288
- }
289
- if (queryParams.includeDebugInfo !== undefined) {
290
- localVarQueryParameters['includeDebugInfo'] = models_1.ObjectSerializer.serialize(queryParams.includeDebugInfo, "boolean");
291
- }
292
- Object.assign(localVarHeaderParams, options.headers);
293
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
294
- let localVarUseFormData = false;
295
- let localVarRequestOptions = {
296
- method: 'GET',
297
- qs: localVarQueryParameters,
298
- headers: localVarHeaderParams,
299
- uri: localVarPath,
300
- useQuerystring: this._useQuerystring,
301
- agentOptions: { keepAlive: false },
302
- json: true,
303
- };
304
- let authenticationPromise = Promise.resolve();
305
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
306
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
307
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
308
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
309
- return authenticationPromise.then(() => {
310
- if (Object.keys(localVarFormParams).length) {
311
- if (localVarUseFormData) {
312
- localVarRequestOptions.formData = localVarFormParams;
313
- }
314
- else {
315
- localVarRequestOptions.form = localVarFormParams;
316
- }
317
- }
318
- return new Promise((resolve, reject) => {
319
- localVarRequest(localVarRequestOptions, (error, response, body) => {
320
- if (error) {
321
- reject(error);
322
- }
323
- else {
324
- body = models_1.ObjectSerializer.deserialize(body, "ClassifySampleResponse");
325
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
326
- if (typeof body.success === 'boolean' && !body.success) {
327
- reject(new Error(body.error || errString));
328
- }
329
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
330
- resolve(body);
331
- }
332
- else {
333
- reject(errString);
334
- }
335
- }
336
- });
337
- });
338
- });
339
- }
340
- /**
341
- * This API is deprecated, use classifySampleByLearnBlockV2 (`/v1/api/{projectId}/classify/anomaly-gmm/v2/{blockId}/{sampleId}`) instead. Classify a complete file against the specified learn block. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and classify for every window that is extracted.
342
- * @summary Classify sample by learn block
343
- * @param projectId Project ID
344
- * @param sampleId Sample ID
345
- * @param blockId Block ID
346
- */
347
- async classifySampleByLearnBlock(projectId, sampleId, blockId, options = { headers: {} }) {
348
- const localVarPath = this.basePath + '/api/{projectId}/classify/anomaly-gmm/{blockId}/{sampleId}'
349
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
350
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)))
351
- .replace('{' + 'blockId' + '}', encodeURIComponent(String(blockId)));
352
- let localVarQueryParameters = {};
353
- let localVarHeaderParams = Object.assign({
354
- 'User-Agent': 'edgeimpulse-api nodejs'
355
- }, this.defaultHeaders);
356
- const produces = ['application/json'];
357
- // give precedence to 'application/json'
358
- if (produces.indexOf('application/json') >= 0) {
359
- localVarHeaderParams.Accept = 'application/json';
360
- }
361
- else {
362
- localVarHeaderParams.Accept = produces.join(',');
363
- }
364
- let localVarFormParams = {};
365
- // verify required parameter 'projectId' is not null or undefined
366
- if (projectId === null || projectId === undefined) {
367
- throw new Error('Required parameter projectId was null or undefined when calling classifySampleByLearnBlock.');
368
- }
369
- // verify required parameter 'sampleId' is not null or undefined
370
- if (sampleId === null || sampleId === undefined) {
371
- throw new Error('Required parameter sampleId was null or undefined when calling classifySampleByLearnBlock.');
372
- }
373
- // verify required parameter 'blockId' is not null or undefined
374
- if (blockId === null || blockId === undefined) {
375
- throw new Error('Required parameter blockId was null or undefined when calling classifySampleByLearnBlock.');
376
- }
377
- Object.assign(localVarHeaderParams, options.headers);
378
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
379
- let localVarUseFormData = false;
380
- let localVarRequestOptions = {
381
- method: 'GET',
382
- qs: localVarQueryParameters,
383
- headers: localVarHeaderParams,
384
- uri: localVarPath,
385
- useQuerystring: this._useQuerystring,
386
- agentOptions: { keepAlive: false },
387
- json: true,
388
- };
389
- let authenticationPromise = Promise.resolve();
390
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
391
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
392
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
393
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
394
- return authenticationPromise.then(() => {
395
- if (Object.keys(localVarFormParams).length) {
396
- if (localVarUseFormData) {
397
- localVarRequestOptions.formData = localVarFormParams;
398
- }
399
- else {
400
- localVarRequestOptions.form = localVarFormParams;
401
- }
402
- }
403
- return new Promise((resolve, reject) => {
404
- localVarRequest(localVarRequestOptions, (error, response, body) => {
405
- if (error) {
406
- reject(error);
407
- }
408
- else {
409
- body = models_1.ObjectSerializer.deserialize(body, "ClassifySampleResponse");
410
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
411
- if (typeof body.success === 'boolean' && !body.success) {
412
- reject(new Error(body.error || errString));
413
- }
414
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
415
- resolve(body);
416
- }
417
- else {
418
- reject(errString);
419
- }
420
- }
421
- });
422
- });
423
- });
424
- }
425
- /**
426
- * Classify a complete file against the specified learn block. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and classify for every window that is extracted. Depending on the size of your file, whether your sample is resampled, and whether the result is cached you\'ll get either the result or a job back. If you receive a job, then wait for the completion of the job, and then call this function again to receive the results. The unoptimized (float32) model is used by default, and classification with an optimized (int8) model can be slower.
427
- * @summary Classify sample by learn block
428
- * @param projectId Project ID
429
- * @param sampleId Sample ID
430
- * @param blockId Block ID
431
- * @param variant Keras model variant
432
- */
433
- async classifySampleByLearnBlockV2(projectId, sampleId, blockId, queryParams, options = { headers: {} }) {
434
- const localVarPath = this.basePath + '/api/{projectId}/classify/anomaly-gmm/v2/{blockId}/{sampleId}'
435
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
436
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)))
437
- .replace('{' + 'blockId' + '}', encodeURIComponent(String(blockId)));
438
- let localVarQueryParameters = {};
439
- let localVarHeaderParams = Object.assign({
440
- 'User-Agent': 'edgeimpulse-api nodejs'
441
- }, this.defaultHeaders);
442
- const produces = ['application/json'];
443
- // give precedence to 'application/json'
444
- if (produces.indexOf('application/json') >= 0) {
445
- localVarHeaderParams.Accept = 'application/json';
446
- }
447
- else {
448
- localVarHeaderParams.Accept = produces.join(',');
449
- }
450
- let localVarFormParams = {};
451
- // verify required parameter 'projectId' is not null or undefined
452
- if (projectId === null || projectId === undefined) {
453
- throw new Error('Required parameter projectId was null or undefined when calling classifySampleByLearnBlockV2.');
454
- }
455
- // verify required parameter 'sampleId' is not null or undefined
456
- if (sampleId === null || sampleId === undefined) {
457
- throw new Error('Required parameter sampleId was null or undefined when calling classifySampleByLearnBlockV2.');
458
- }
459
- // verify required parameter 'blockId' is not null or undefined
460
- if (blockId === null || blockId === undefined) {
461
- throw new Error('Required parameter blockId was null or undefined when calling classifySampleByLearnBlockV2.');
462
- }
463
- if (queryParams.variant !== undefined) {
464
- localVarQueryParameters['variant'] = models_1.ObjectSerializer.serialize(queryParams.variant, "KerasModelVariantEnum");
465
- }
466
- Object.assign(localVarHeaderParams, options.headers);
467
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
468
- let localVarUseFormData = false;
469
- let localVarRequestOptions = {
470
- method: 'POST',
471
- qs: localVarQueryParameters,
472
- headers: localVarHeaderParams,
473
- uri: localVarPath,
474
- useQuerystring: this._useQuerystring,
475
- agentOptions: { keepAlive: false },
476
- json: true,
477
- };
478
- let authenticationPromise = Promise.resolve();
479
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
480
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
481
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
482
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
483
- return authenticationPromise.then(() => {
484
- if (Object.keys(localVarFormParams).length) {
485
- if (localVarUseFormData) {
486
- localVarRequestOptions.formData = localVarFormParams;
487
- }
488
- else {
489
- localVarRequestOptions.form = localVarFormParams;
490
- }
491
- }
492
- return new Promise((resolve, reject) => {
493
- localVarRequest(localVarRequestOptions, (error, response, body) => {
494
- if (error) {
495
- reject(error);
496
- }
497
- else {
498
- body = models_1.ObjectSerializer.deserialize(body, "ClassifySampleResponse | StartJobResponse");
499
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
500
- if (typeof body.success === 'boolean' && !body.success) {
501
- reject(new Error(body.error || errString));
502
- }
503
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
504
- resolve(body);
505
- }
506
- else {
507
- reject(errString);
508
- }
509
- }
510
- });
511
- });
512
- });
513
- }
514
- /**
515
- * Classify a complete file against the current impulse. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and classify for every window that is extracted. Depending on the size of your file, whether your sample is resampled, and whether the result is cached you\'ll get either the result or a job back. If you receive a job, then wait for the completion of the job, and then call this function again to receive the results. The unoptimized (float32) model is used by default, and classification with an optimized (int8) model can be slower.
516
- * @summary Classify sample
517
- * @param projectId Project ID
518
- * @param sampleId Sample ID
519
- * @param includeDebugInfo Whether to return the debug information from FOMO classification.
520
- * @param variant Keras model variant
521
- */
522
- async classifySampleV2(projectId, sampleId, queryParams, options = { headers: {} }) {
523
- const localVarPath = this.basePath + '/api/{projectId}/classify/v2/{sampleId}'
524
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
525
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
526
- let localVarQueryParameters = {};
527
- let localVarHeaderParams = Object.assign({
528
- 'User-Agent': 'edgeimpulse-api nodejs'
529
- }, this.defaultHeaders);
530
- const produces = ['application/json'];
531
- // give precedence to 'application/json'
532
- if (produces.indexOf('application/json') >= 0) {
533
- localVarHeaderParams.Accept = 'application/json';
534
- }
535
- else {
536
- localVarHeaderParams.Accept = produces.join(',');
537
- }
538
- let localVarFormParams = {};
539
- // verify required parameter 'projectId' is not null or undefined
540
- if (projectId === null || projectId === undefined) {
541
- throw new Error('Required parameter projectId was null or undefined when calling classifySampleV2.');
542
- }
543
- // verify required parameter 'sampleId' is not null or undefined
544
- if (sampleId === null || sampleId === undefined) {
545
- throw new Error('Required parameter sampleId was null or undefined when calling classifySampleV2.');
546
- }
547
- if (queryParams.includeDebugInfo !== undefined) {
548
- localVarQueryParameters['includeDebugInfo'] = models_1.ObjectSerializer.serialize(queryParams.includeDebugInfo, "boolean");
549
- }
550
- if (queryParams.variant !== undefined) {
551
- localVarQueryParameters['variant'] = models_1.ObjectSerializer.serialize(queryParams.variant, "KerasModelVariantEnum");
552
- }
553
- Object.assign(localVarHeaderParams, options.headers);
554
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
555
- let localVarUseFormData = false;
556
- let localVarRequestOptions = {
557
- method: 'POST',
558
- qs: localVarQueryParameters,
559
- headers: localVarHeaderParams,
560
- uri: localVarPath,
561
- useQuerystring: this._useQuerystring,
562
- agentOptions: { keepAlive: false },
563
- json: true,
564
- };
565
- let authenticationPromise = Promise.resolve();
566
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
567
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
568
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
569
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
570
- return authenticationPromise.then(() => {
571
- if (Object.keys(localVarFormParams).length) {
572
- if (localVarUseFormData) {
573
- localVarRequestOptions.formData = localVarFormParams;
574
- }
575
- else {
576
- localVarRequestOptions.form = localVarFormParams;
577
- }
578
- }
579
- return new Promise((resolve, reject) => {
580
- localVarRequest(localVarRequestOptions, (error, response, body) => {
581
- if (error) {
582
- reject(error);
583
- }
584
- else {
585
- body = models_1.ObjectSerializer.deserialize(body, "ClassifySampleResponse | StartJobResponse");
586
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
587
- if (typeof body.success === 'boolean' && !body.success) {
588
- reject(new Error(body.error || errString));
589
- }
590
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
591
- resolve(body);
592
- }
593
- else {
594
- reject(errString);
595
- }
596
- }
597
- });
598
- });
599
- });
600
- }
601
- /**
602
- * Count all raw data by category.
603
- * @summary Count samples
604
- * @param projectId Project ID
605
- * @param category Which of the three acquisition categories to retrieve data from
606
- * @param labels Only include samples with a label within the given list of labels, given as a JSON string
607
- * @param filename Only include samples whose filename includes the given filename
608
- * @param maxLength Only include samples shorter than the given length, in milliseconds
609
- * @param minLength Only include samples longer than the given length, in milliseconds
610
- * @param minFrequency Only include samples with higher frequency than given frequency, in hertz
611
- * @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
612
- * @param signatureValidity Include samples with either valid or invalid signatures
613
- * @param includeDisabled Include only enabled or disabled samples (or both)
614
- */
615
- async countSamples(projectId, queryParams, options = { headers: {} }) {
616
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/count'
617
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
618
- let localVarQueryParameters = {};
619
- let localVarHeaderParams = Object.assign({
620
- 'User-Agent': 'edgeimpulse-api nodejs'
621
- }, this.defaultHeaders);
622
- const produces = ['application/json'];
623
- // give precedence to 'application/json'
624
- if (produces.indexOf('application/json') >= 0) {
625
- localVarHeaderParams.Accept = 'application/json';
626
- }
627
- else {
628
- localVarHeaderParams.Accept = produces.join(',');
629
- }
630
- let localVarFormParams = {};
631
- // verify required parameter 'projectId' is not null or undefined
632
- if (projectId === null || projectId === undefined) {
633
- throw new Error('Required parameter projectId was null or undefined when calling countSamples.');
634
- }
635
- // verify required parameter 'category' is not null or undefined
636
- if (queryParams.category === null || queryParams.category === undefined) {
637
- throw new Error('Required parameter queryParams.category was null or undefined when calling countSamples.');
638
- }
639
- if (queryParams.category !== undefined) {
640
- localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "'training' | 'testing' | 'anomaly'");
641
- }
642
- if (queryParams.labels !== undefined) {
643
- localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
644
- }
645
- if (queryParams.filename !== undefined) {
646
- localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
647
- }
648
- if (queryParams.maxLength !== undefined) {
649
- localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
650
- }
651
- if (queryParams.minLength !== undefined) {
652
- localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
653
- }
654
- if (queryParams.minFrequency !== undefined) {
655
- localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
656
- }
657
- if (queryParams.maxFrequency !== undefined) {
658
- localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
659
- }
660
- if (queryParams.signatureValidity !== undefined) {
661
- localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
662
- }
663
- if (queryParams.includeDisabled !== undefined) {
664
- localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
665
- }
666
- Object.assign(localVarHeaderParams, options.headers);
667
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
668
- let localVarUseFormData = false;
669
- let localVarRequestOptions = {
670
- method: 'GET',
671
- qs: localVarQueryParameters,
672
- headers: localVarHeaderParams,
673
- uri: localVarPath,
674
- useQuerystring: this._useQuerystring,
675
- agentOptions: { keepAlive: false },
676
- json: true,
677
- };
678
- let authenticationPromise = Promise.resolve();
679
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
680
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
681
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
682
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
683
- return authenticationPromise.then(() => {
684
- if (Object.keys(localVarFormParams).length) {
685
- if (localVarUseFormData) {
686
- localVarRequestOptions.formData = localVarFormParams;
687
- }
688
- else {
689
- localVarRequestOptions.form = localVarFormParams;
690
- }
691
- }
692
- return new Promise((resolve, reject) => {
693
- localVarRequest(localVarRequestOptions, (error, response, body) => {
694
- if (error) {
695
- reject(error);
696
- }
697
- else {
698
- body = models_1.ObjectSerializer.deserialize(body, "CountSamplesResponse");
699
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
700
- if (typeof body.success === 'boolean' && !body.success) {
701
- reject(new Error(body.error || errString));
702
- }
703
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
704
- resolve(body);
705
- }
706
- else {
707
- reject(errString);
708
- }
709
- }
710
- });
711
- });
712
- });
713
- }
714
- /**
715
- * Download the build artefacts for a project
716
- * @summary Download
717
- * @param projectId Project ID
718
- * @param type The name of the built target. You can find this by listing all deployment targets through &#x60;listDeploymentTargetsForProject&#x60; (via &#x60;GET /v1/api/{projectId}/deployment/targets&#x60;) and see the &#x60;format&#x60; type.
719
- * @param modelType Optional model type of the build (if not, it uses the settings in the Keras block)
720
- * @param engine Optional engine for the build (if not, it uses the default engine for the deployment target)
721
- */
722
- async downloadBuild(projectId, queryParams, options = { headers: {} }) {
723
- const localVarPath = this.basePath + '/api/{projectId}/deployment/download'
724
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
725
- let localVarQueryParameters = {};
726
- let localVarHeaderParams = Object.assign({
727
- 'User-Agent': 'edgeimpulse-api nodejs'
728
- }, this.defaultHeaders);
729
- const produces = ['application/zip'];
730
- // give precedence to 'application/json'
731
- if (produces.indexOf('application/json') >= 0) {
732
- localVarHeaderParams.Accept = 'application/json';
733
- }
734
- else {
735
- localVarHeaderParams.Accept = produces.join(',');
736
- }
737
- let localVarFormParams = {};
738
- // verify required parameter 'projectId' is not null or undefined
739
- if (projectId === null || projectId === undefined) {
740
- throw new Error('Required parameter projectId was null or undefined when calling downloadBuild.');
741
- }
742
- // verify required parameter 'type' is not null or undefined
743
- if (queryParams.type === null || queryParams.type === undefined) {
744
- throw new Error('Required parameter queryParams.type was null or undefined when calling downloadBuild.');
745
- }
746
- if (queryParams.type !== undefined) {
747
- localVarQueryParameters['type'] = models_1.ObjectSerializer.serialize(queryParams.type, "string");
748
- }
749
- if (queryParams.modelType !== undefined) {
750
- localVarQueryParameters['modelType'] = models_1.ObjectSerializer.serialize(queryParams.modelType, "KerasModelTypeEnum");
751
- }
752
- if (queryParams.engine !== undefined) {
753
- localVarQueryParameters['engine'] = models_1.ObjectSerializer.serialize(queryParams.engine, "DeploymentTargetEngine");
754
- }
755
- Object.assign(localVarHeaderParams, options.headers);
756
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
757
- let localVarUseFormData = false;
758
- let localVarRequestOptions = {
759
- method: 'GET',
760
- qs: localVarQueryParameters,
761
- headers: localVarHeaderParams,
762
- uri: localVarPath,
763
- useQuerystring: this._useQuerystring,
764
- agentOptions: { keepAlive: false },
765
- encoding: null,
766
- };
767
- let authenticationPromise = Promise.resolve();
768
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
769
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
770
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
771
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
772
- return authenticationPromise.then(() => {
773
- if (Object.keys(localVarFormParams).length) {
774
- if (localVarUseFormData) {
775
- localVarRequestOptions.formData = localVarFormParams;
776
- }
777
- else {
778
- localVarRequestOptions.form = localVarFormParams;
779
- }
780
- }
781
- return new Promise((resolve, reject) => {
782
- localVarRequest(localVarRequestOptions, (error, response, body) => {
783
- if (error) {
784
- reject(error);
785
- }
786
- else {
787
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
788
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
789
- if (typeof body.success === 'boolean' && !body.success) {
790
- reject(new Error(body.error || errString));
791
- }
792
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
793
- resolve(body);
794
- }
795
- else {
796
- reject(errString);
797
- }
798
- }
799
- });
800
- });
801
- });
802
- }
803
- /**
804
- * Download output from a DSP block over all data in the training set, already sliced in windows. In Numpy binary format.
805
- * @summary Download DSP data
806
- * @param projectId Project ID
807
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
808
- * @param category Which of the three acquisition categories to download data from
809
- * @param raw Whether to download raw data or processed data. Processed data is the default.
810
- */
811
- async downloadDspData(projectId, dspId, category, queryParams, options = { headers: {} }) {
812
- const localVarPath = this.basePath + '/api/{projectId}/dsp-data/{dspId}/x/{category}'
813
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
814
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
815
- .replace('{' + 'category' + '}', encodeURIComponent(String(category)));
816
- let localVarQueryParameters = {};
817
- let localVarHeaderParams = Object.assign({
818
- 'User-Agent': 'edgeimpulse-api nodejs'
819
- }, this.defaultHeaders);
820
- const produces = ['application/octet-stream'];
821
- // give precedence to 'application/json'
822
- if (produces.indexOf('application/json') >= 0) {
823
- localVarHeaderParams.Accept = 'application/json';
824
- }
825
- else {
826
- localVarHeaderParams.Accept = produces.join(',');
827
- }
828
- let localVarFormParams = {};
829
- // verify required parameter 'projectId' is not null or undefined
830
- if (projectId === null || projectId === undefined) {
831
- throw new Error('Required parameter projectId was null or undefined when calling downloadDspData.');
832
- }
833
- // verify required parameter 'dspId' is not null or undefined
834
- if (dspId === null || dspId === undefined) {
835
- throw new Error('Required parameter dspId was null or undefined when calling downloadDspData.');
836
- }
837
- // verify required parameter 'category' is not null or undefined
838
- if (category === null || category === undefined) {
839
- throw new Error('Required parameter category was null or undefined when calling downloadDspData.');
840
- }
841
- if (queryParams.raw !== undefined) {
842
- localVarQueryParameters['raw'] = models_1.ObjectSerializer.serialize(queryParams.raw, "boolean");
843
- }
844
- Object.assign(localVarHeaderParams, options.headers);
845
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
846
- let localVarUseFormData = false;
847
- let localVarRequestOptions = {
848
- method: 'GET',
849
- qs: localVarQueryParameters,
850
- headers: localVarHeaderParams,
851
- uri: localVarPath,
852
- useQuerystring: this._useQuerystring,
853
- agentOptions: { keepAlive: false },
854
- encoding: null,
855
- };
856
- let authenticationPromise = Promise.resolve();
857
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
858
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
859
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
860
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
861
- return authenticationPromise.then(() => {
862
- if (Object.keys(localVarFormParams).length) {
863
- if (localVarUseFormData) {
864
- localVarRequestOptions.formData = localVarFormParams;
865
- }
866
- else {
867
- localVarRequestOptions.form = localVarFormParams;
868
- }
869
- }
870
- return new Promise((resolve, reject) => {
871
- localVarRequest(localVarRequestOptions, (error, response, body) => {
872
- if (error) {
873
- reject(error);
874
- }
875
- else {
876
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
877
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
878
- if (typeof body.success === 'boolean' && !body.success) {
879
- reject(new Error(body.error || errString));
880
- }
881
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
882
- resolve(body);
883
- }
884
- else {
885
- reject(errString);
886
- }
887
- }
888
- });
889
- });
890
- });
891
- }
892
- /**
893
- * Download labels for a DSP block over all data in the training set, already sliced in windows.
894
- * @summary Download DSP labels
895
- * @param projectId Project ID
896
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
897
- * @param category Which of the three acquisition categories to download data from
898
- */
899
- async downloadDspLabels(projectId, dspId, category, options = { headers: {} }) {
900
- const localVarPath = this.basePath + '/api/{projectId}/dsp-data/{dspId}/y/{category}'
901
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
902
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
903
- .replace('{' + 'category' + '}', encodeURIComponent(String(category)));
904
- let localVarQueryParameters = {};
905
- let localVarHeaderParams = Object.assign({
906
- 'User-Agent': 'edgeimpulse-api nodejs'
907
- }, this.defaultHeaders);
908
- const produces = ['application/octet-stream'];
909
- // give precedence to 'application/json'
910
- if (produces.indexOf('application/json') >= 0) {
911
- localVarHeaderParams.Accept = 'application/json';
912
- }
913
- else {
914
- localVarHeaderParams.Accept = produces.join(',');
915
- }
916
- let localVarFormParams = {};
917
- // verify required parameter 'projectId' is not null or undefined
918
- if (projectId === null || projectId === undefined) {
919
- throw new Error('Required parameter projectId was null or undefined when calling downloadDspLabels.');
920
- }
921
- // verify required parameter 'dspId' is not null or undefined
922
- if (dspId === null || dspId === undefined) {
923
- throw new Error('Required parameter dspId was null or undefined when calling downloadDspLabels.');
924
- }
925
- // verify required parameter 'category' is not null or undefined
926
- if (category === null || category === undefined) {
927
- throw new Error('Required parameter category was null or undefined when calling downloadDspLabels.');
928
- }
929
- Object.assign(localVarHeaderParams, options.headers);
930
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
931
- let localVarUseFormData = false;
932
- let localVarRequestOptions = {
933
- method: 'GET',
934
- qs: localVarQueryParameters,
935
- headers: localVarHeaderParams,
936
- uri: localVarPath,
937
- useQuerystring: this._useQuerystring,
938
- agentOptions: { keepAlive: false },
939
- encoding: null,
940
- };
941
- let authenticationPromise = Promise.resolve();
942
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
943
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
944
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
945
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
946
- return authenticationPromise.then(() => {
947
- if (Object.keys(localVarFormParams).length) {
948
- if (localVarUseFormData) {
949
- localVarRequestOptions.formData = localVarFormParams;
950
- }
951
- else {
952
- localVarRequestOptions.form = localVarFormParams;
953
- }
954
- }
955
- return new Promise((resolve, reject) => {
956
- localVarRequest(localVarRequestOptions, (error, response, body) => {
957
- if (error) {
958
- reject(error);
959
- }
960
- else {
961
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
962
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
963
- if (typeof body.success === 'boolean' && !body.success) {
964
- reject(new Error(body.error || errString));
965
- }
966
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
967
- resolve(body);
968
- }
969
- else {
970
- reject(errString);
971
- }
972
- }
973
- });
974
- });
975
- });
976
- }
977
- /**
978
- * Download a trained model for a learning block. Depending on the block this can be a TensorFlow model, or the cluster centroids.
979
- * @summary Download trained model
980
- * @param projectId Project ID
981
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
982
- * @param modelDownloadId Model download ID, which can be obtained from the project information
983
- */
984
- async downloadLearnModel(projectId, learnId, modelDownloadId, options = { headers: {} }) {
985
- const localVarPath = this.basePath + '/api/{projectId}/learn-data/{learnId}/model/{modelDownloadId}'
986
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
987
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)))
988
- .replace('{' + 'modelDownloadId' + '}', encodeURIComponent(String(modelDownloadId)));
989
- let localVarQueryParameters = {};
990
- let localVarHeaderParams = Object.assign({
991
- 'User-Agent': 'edgeimpulse-api nodejs'
992
- }, this.defaultHeaders);
993
- const produces = ['application/octet-stream'];
994
- // give precedence to 'application/json'
995
- if (produces.indexOf('application/json') >= 0) {
996
- localVarHeaderParams.Accept = 'application/json';
997
- }
998
- else {
999
- localVarHeaderParams.Accept = produces.join(',');
1000
- }
1001
- let localVarFormParams = {};
1002
- // verify required parameter 'projectId' is not null or undefined
1003
- if (projectId === null || projectId === undefined) {
1004
- throw new Error('Required parameter projectId was null or undefined when calling downloadLearnModel.');
1005
- }
1006
- // verify required parameter 'learnId' is not null or undefined
1007
- if (learnId === null || learnId === undefined) {
1008
- throw new Error('Required parameter learnId was null or undefined when calling downloadLearnModel.');
1009
- }
1010
- // verify required parameter 'modelDownloadId' is not null or undefined
1011
- if (modelDownloadId === null || modelDownloadId === undefined) {
1012
- throw new Error('Required parameter modelDownloadId was null or undefined when calling downloadLearnModel.');
1013
- }
1014
- Object.assign(localVarHeaderParams, options.headers);
1015
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1016
- let localVarUseFormData = false;
1017
- let localVarRequestOptions = {
1018
- method: 'GET',
1019
- qs: localVarQueryParameters,
1020
- headers: localVarHeaderParams,
1021
- uri: localVarPath,
1022
- useQuerystring: this._useQuerystring,
1023
- agentOptions: { keepAlive: false },
1024
- encoding: null,
1025
- };
1026
- let authenticationPromise = Promise.resolve();
1027
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1028
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1029
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1030
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1031
- return authenticationPromise.then(() => {
1032
- if (Object.keys(localVarFormParams).length) {
1033
- if (localVarUseFormData) {
1034
- localVarRequestOptions.formData = localVarFormParams;
1035
- }
1036
- else {
1037
- localVarRequestOptions.form = localVarFormParams;
1038
- }
1039
- }
1040
- return new Promise((resolve, reject) => {
1041
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1042
- if (error) {
1043
- reject(error);
1044
- }
1045
- else {
1046
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
1047
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1048
- if (typeof body.success === 'boolean' && !body.success) {
1049
- reject(new Error(body.error || errString));
1050
- }
1051
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1052
- resolve(body);
1053
- }
1054
- else {
1055
- reject(errString);
1056
- }
1057
- }
1058
- });
1059
- });
1060
- });
1061
- }
1062
- /**
1063
- * Runs the DSP block against a sample. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and run the DSP function for every window that is extracted.
1064
- * @summary Features for sample
1065
- * @param projectId Project ID
1066
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
1067
- * @param sampleId Sample ID
1068
- */
1069
- async dspGetFeaturesForSample(projectId, dspId, sampleId, options = { headers: {} }) {
1070
- const localVarPath = this.basePath + '/api/{projectId}/dsp/{dspId}/features/get-graph/classification/{sampleId}'
1071
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1072
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
1073
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
1074
- let localVarQueryParameters = {};
1075
- let localVarHeaderParams = Object.assign({
1076
- 'User-Agent': 'edgeimpulse-api nodejs'
1077
- }, this.defaultHeaders);
1078
- const produces = ['application/json'];
1079
- // give precedence to 'application/json'
1080
- if (produces.indexOf('application/json') >= 0) {
1081
- localVarHeaderParams.Accept = 'application/json';
1082
- }
1083
- else {
1084
- localVarHeaderParams.Accept = produces.join(',');
1085
- }
1086
- let localVarFormParams = {};
1087
- // verify required parameter 'projectId' is not null or undefined
1088
- if (projectId === null || projectId === undefined) {
1089
- throw new Error('Required parameter projectId was null or undefined when calling dspGetFeaturesForSample.');
1090
- }
1091
- // verify required parameter 'dspId' is not null or undefined
1092
- if (dspId === null || dspId === undefined) {
1093
- throw new Error('Required parameter dspId was null or undefined when calling dspGetFeaturesForSample.');
1094
- }
1095
- // verify required parameter 'sampleId' is not null or undefined
1096
- if (sampleId === null || sampleId === undefined) {
1097
- throw new Error('Required parameter sampleId was null or undefined when calling dspGetFeaturesForSample.');
1098
- }
1099
- Object.assign(localVarHeaderParams, options.headers);
1100
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1101
- let localVarUseFormData = false;
1102
- let localVarRequestOptions = {
1103
- method: 'GET',
1104
- qs: localVarQueryParameters,
1105
- headers: localVarHeaderParams,
1106
- uri: localVarPath,
1107
- useQuerystring: this._useQuerystring,
1108
- agentOptions: { keepAlive: false },
1109
- json: true,
1110
- };
1111
- let authenticationPromise = Promise.resolve();
1112
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1113
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1114
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1115
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1116
- return authenticationPromise.then(() => {
1117
- if (Object.keys(localVarFormParams).length) {
1118
- if (localVarUseFormData) {
1119
- localVarRequestOptions.formData = localVarFormParams;
1120
- }
1121
- else {
1122
- localVarRequestOptions.form = localVarFormParams;
1123
- }
1124
- }
1125
- return new Promise((resolve, reject) => {
1126
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1127
- if (error) {
1128
- reject(error);
1129
- }
1130
- else {
1131
- body = models_1.ObjectSerializer.deserialize(body, "DspSampleFeaturesResponse");
1132
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1133
- if (typeof body.success === 'boolean' && !body.success) {
1134
- reject(new Error(body.error || errString));
1135
- }
1136
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1137
- resolve(body);
1138
- }
1139
- else {
1140
- reject(errString);
1141
- }
1142
- }
1143
- });
1144
- });
1145
- });
1146
- }
1147
- /**
1148
- * Get a sample of trained features, this extracts a number of samples and their labels. Used to visualize the current training set.
1149
- * @summary Sample of trained features
1150
- * @param projectId Project ID
1151
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
1152
- * @param featureAx1 Feature axis 1
1153
- * @param featureAx2 Feature axis 2
1154
- * @param featureAx3 Feature axis 3
1155
- * @param category Which of the three acquisition categories to download data from
1156
- */
1157
- async dspSampleTrainedFeatures(projectId, dspId, category, queryParams, options = { headers: {} }) {
1158
- const localVarPath = this.basePath + '/api/{projectId}/dsp/{dspId}/features/get-graph/{category}'
1159
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1160
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
1161
- .replace('{' + 'category' + '}', encodeURIComponent(String(category)));
1162
- let localVarQueryParameters = {};
1163
- let localVarHeaderParams = Object.assign({
1164
- 'User-Agent': 'edgeimpulse-api nodejs'
1165
- }, this.defaultHeaders);
1166
- const produces = ['application/json'];
1167
- // give precedence to 'application/json'
1168
- if (produces.indexOf('application/json') >= 0) {
1169
- localVarHeaderParams.Accept = 'application/json';
1170
- }
1171
- else {
1172
- localVarHeaderParams.Accept = produces.join(',');
1173
- }
1174
- let localVarFormParams = {};
1175
- // verify required parameter 'projectId' is not null or undefined
1176
- if (projectId === null || projectId === undefined) {
1177
- throw new Error('Required parameter projectId was null or undefined when calling dspSampleTrainedFeatures.');
1178
- }
1179
- // verify required parameter 'dspId' is not null or undefined
1180
- if (dspId === null || dspId === undefined) {
1181
- throw new Error('Required parameter dspId was null or undefined when calling dspSampleTrainedFeatures.');
1182
- }
1183
- // verify required parameter 'featureAx1' is not null or undefined
1184
- if (queryParams.featureAx1 === null || queryParams.featureAx1 === undefined) {
1185
- throw new Error('Required parameter queryParams.featureAx1 was null or undefined when calling dspSampleTrainedFeatures.');
1186
- }
1187
- // verify required parameter 'featureAx2' is not null or undefined
1188
- if (queryParams.featureAx2 === null || queryParams.featureAx2 === undefined) {
1189
- throw new Error('Required parameter queryParams.featureAx2 was null or undefined when calling dspSampleTrainedFeatures.');
1190
- }
1191
- // verify required parameter 'featureAx3' is not null or undefined
1192
- if (queryParams.featureAx3 === null || queryParams.featureAx3 === undefined) {
1193
- throw new Error('Required parameter queryParams.featureAx3 was null or undefined when calling dspSampleTrainedFeatures.');
1194
- }
1195
- // verify required parameter 'category' is not null or undefined
1196
- if (category === null || category === undefined) {
1197
- throw new Error('Required parameter category was null or undefined when calling dspSampleTrainedFeatures.');
1198
- }
1199
- if (queryParams.featureAx1 !== undefined) {
1200
- localVarQueryParameters['featureAx1'] = models_1.ObjectSerializer.serialize(queryParams.featureAx1, "number");
1201
- }
1202
- if (queryParams.featureAx2 !== undefined) {
1203
- localVarQueryParameters['featureAx2'] = models_1.ObjectSerializer.serialize(queryParams.featureAx2, "number");
1204
- }
1205
- if (queryParams.featureAx3 !== undefined) {
1206
- localVarQueryParameters['featureAx3'] = models_1.ObjectSerializer.serialize(queryParams.featureAx3, "number");
1207
- }
1208
- Object.assign(localVarHeaderParams, options.headers);
1209
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1210
- let localVarUseFormData = false;
1211
- let localVarRequestOptions = {
1212
- method: 'GET',
1213
- qs: localVarQueryParameters,
1214
- headers: localVarHeaderParams,
1215
- uri: localVarPath,
1216
- useQuerystring: this._useQuerystring,
1217
- agentOptions: { keepAlive: false },
1218
- json: true,
1219
- };
1220
- let authenticationPromise = Promise.resolve();
1221
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1222
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1223
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1224
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1225
- return authenticationPromise.then(() => {
1226
- if (Object.keys(localVarFormParams).length) {
1227
- if (localVarUseFormData) {
1228
- localVarRequestOptions.formData = localVarFormParams;
1229
- }
1230
- else {
1231
- localVarRequestOptions.form = localVarFormParams;
1232
- }
1233
- }
1234
- return new Promise((resolve, reject) => {
1235
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1236
- if (error) {
1237
- reject(error);
1238
- }
1239
- else {
1240
- body = models_1.ObjectSerializer.deserialize(body, "DspTrainedFeaturesResponse");
1241
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1242
- if (typeof body.success === 'boolean' && !body.success) {
1243
- reject(new Error(body.error || errString));
1244
- }
1245
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1246
- resolve(body);
1247
- }
1248
- else {
1249
- reject(errString);
1250
- }
1251
- }
1252
- });
1253
- });
1254
- });
1255
- }
1256
- /**
1257
- * Get metadata about a trained anomaly block. Use the impulse blocks to find the learnId.
1258
- * @summary Anomaly metadata
1259
- * @param projectId Project ID
1260
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
1261
- */
1262
- async getAnomalyMetadata(projectId, learnId, options = { headers: {} }) {
1263
- const localVarPath = this.basePath + '/api/{projectId}/training/anomaly/{learnId}/metadata'
1264
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1265
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
1266
- let localVarQueryParameters = {};
1267
- let localVarHeaderParams = Object.assign({
1268
- 'User-Agent': 'edgeimpulse-api nodejs'
1269
- }, this.defaultHeaders);
1270
- const produces = ['application/json'];
1271
- // give precedence to 'application/json'
1272
- if (produces.indexOf('application/json') >= 0) {
1273
- localVarHeaderParams.Accept = 'application/json';
1274
- }
1275
- else {
1276
- localVarHeaderParams.Accept = produces.join(',');
1277
- }
1278
- let localVarFormParams = {};
1279
- // verify required parameter 'projectId' is not null or undefined
1280
- if (projectId === null || projectId === undefined) {
1281
- throw new Error('Required parameter projectId was null or undefined when calling getAnomalyMetadata.');
1282
- }
1283
- // verify required parameter 'learnId' is not null or undefined
1284
- if (learnId === null || learnId === undefined) {
1285
- throw new Error('Required parameter learnId was null or undefined when calling getAnomalyMetadata.');
1286
- }
1287
- Object.assign(localVarHeaderParams, options.headers);
1288
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1289
- let localVarUseFormData = false;
1290
- let localVarRequestOptions = {
1291
- method: 'GET',
1292
- qs: localVarQueryParameters,
1293
- headers: localVarHeaderParams,
1294
- uri: localVarPath,
1295
- useQuerystring: this._useQuerystring,
1296
- agentOptions: { keepAlive: false },
1297
- json: true,
1298
- };
1299
- let authenticationPromise = Promise.resolve();
1300
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1301
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1302
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1303
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1304
- return authenticationPromise.then(() => {
1305
- if (Object.keys(localVarFormParams).length) {
1306
- if (localVarUseFormData) {
1307
- localVarRequestOptions.formData = localVarFormParams;
1308
- }
1309
- else {
1310
- localVarRequestOptions.form = localVarFormParams;
1311
- }
1312
- }
1313
- return new Promise((resolve, reject) => {
1314
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1315
- if (error) {
1316
- reject(error);
1317
- }
1318
- else {
1319
- body = models_1.ObjectSerializer.deserialize(body, "AnomalyModelMetadata");
1320
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1321
- if (typeof body.success === 'boolean' && !body.success) {
1322
- reject(new Error(body.error || errString));
1323
- }
1324
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1325
- resolve(body);
1326
- }
1327
- else {
1328
- reject(errString);
1329
- }
1330
- }
1331
- });
1332
- });
1333
- });
1334
- }
1335
- /**
1336
- * Get classify job result, containing the result for the complete testing dataset.
1337
- * @summary Classify job result
1338
- * @param projectId Project ID
1339
- * @param featureExplorerOnly Whether to get only the classification results relevant to the feature explorer.
1340
- */
1341
- async getClassifyJobResult(projectId, queryParams, options = { headers: {} }) {
1342
- const localVarPath = this.basePath + '/api/{projectId}/classify/all/result'
1343
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
1344
- let localVarQueryParameters = {};
1345
- let localVarHeaderParams = Object.assign({
1346
- 'User-Agent': 'edgeimpulse-api nodejs'
1347
- }, this.defaultHeaders);
1348
- const produces = ['application/json'];
1349
- // give precedence to 'application/json'
1350
- if (produces.indexOf('application/json') >= 0) {
1351
- localVarHeaderParams.Accept = 'application/json';
1352
- }
1353
- else {
1354
- localVarHeaderParams.Accept = produces.join(',');
1355
- }
1356
- let localVarFormParams = {};
1357
- // verify required parameter 'projectId' is not null or undefined
1358
- if (projectId === null || projectId === undefined) {
1359
- throw new Error('Required parameter projectId was null or undefined when calling getClassifyJobResult.');
1360
- }
1361
- if (queryParams.featureExplorerOnly !== undefined) {
1362
- localVarQueryParameters['featureExplorerOnly'] = models_1.ObjectSerializer.serialize(queryParams.featureExplorerOnly, "boolean");
1363
- }
1364
- Object.assign(localVarHeaderParams, options.headers);
1365
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1366
- let localVarUseFormData = false;
1367
- let localVarRequestOptions = {
1368
- method: 'GET',
1369
- qs: localVarQueryParameters,
1370
- headers: localVarHeaderParams,
1371
- uri: localVarPath,
1372
- useQuerystring: this._useQuerystring,
1373
- agentOptions: { keepAlive: false },
1374
- json: true,
1375
- };
1376
- let authenticationPromise = Promise.resolve();
1377
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1378
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1379
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1380
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1381
- return authenticationPromise.then(() => {
1382
- if (Object.keys(localVarFormParams).length) {
1383
- if (localVarUseFormData) {
1384
- localVarRequestOptions.formData = localVarFormParams;
1385
- }
1386
- else {
1387
- localVarRequestOptions.form = localVarFormParams;
1388
- }
1389
- }
1390
- return new Promise((resolve, reject) => {
1391
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1392
- if (error) {
1393
- reject(error);
1394
- }
1395
- else {
1396
- body = models_1.ObjectSerializer.deserialize(body, "ClassifyJobResponse");
1397
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1398
- if (typeof body.success === 'boolean' && !body.success) {
1399
- reject(new Error(body.error || errString));
1400
- }
1401
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1402
- resolve(body);
1403
- }
1404
- else {
1405
- reject(errString);
1406
- }
1407
- }
1408
- });
1409
- });
1410
- });
1411
- }
1412
- /**
1413
- * Get classify job result, containing the predictions for a given page.
1414
- * @summary Single page of a classify job result
1415
- * @param projectId Project ID
1416
- * @param limit Maximum number of results
1417
- * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
1418
- */
1419
- async getClassifyJobResultPage(projectId, queryParams, options = { headers: {} }) {
1420
- const localVarPath = this.basePath + '/api/{projectId}/classify/all/result/page'
1421
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
1422
- let localVarQueryParameters = {};
1423
- let localVarHeaderParams = Object.assign({
1424
- 'User-Agent': 'edgeimpulse-api nodejs'
1425
- }, this.defaultHeaders);
1426
- const produces = ['application/json'];
1427
- // give precedence to 'application/json'
1428
- if (produces.indexOf('application/json') >= 0) {
1429
- localVarHeaderParams.Accept = 'application/json';
1430
- }
1431
- else {
1432
- localVarHeaderParams.Accept = produces.join(',');
1433
- }
1434
- let localVarFormParams = {};
1435
- // verify required parameter 'projectId' is not null or undefined
1436
- if (projectId === null || projectId === undefined) {
1437
- throw new Error('Required parameter projectId was null or undefined when calling getClassifyJobResultPage.');
1438
- }
1439
- if (queryParams.limit !== undefined) {
1440
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
1441
- }
1442
- if (queryParams.offset !== undefined) {
1443
- localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
1444
- }
1445
- Object.assign(localVarHeaderParams, options.headers);
1446
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1447
- let localVarUseFormData = false;
1448
- let localVarRequestOptions = {
1449
- method: 'GET',
1450
- qs: localVarQueryParameters,
1451
- headers: localVarHeaderParams,
1452
- uri: localVarPath,
1453
- useQuerystring: this._useQuerystring,
1454
- agentOptions: { keepAlive: false },
1455
- json: true,
1456
- };
1457
- let authenticationPromise = Promise.resolve();
1458
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1459
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1460
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1461
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1462
- return authenticationPromise.then(() => {
1463
- if (Object.keys(localVarFormParams).length) {
1464
- if (localVarUseFormData) {
1465
- localVarRequestOptions.formData = localVarFormParams;
1466
- }
1467
- else {
1468
- localVarRequestOptions.form = localVarFormParams;
1469
- }
1470
- }
1471
- return new Promise((resolve, reject) => {
1472
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1473
- if (error) {
1474
- reject(error);
1475
- }
1476
- else {
1477
- body = models_1.ObjectSerializer.deserialize(body, "ClassifyJobResponsePage");
1478
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1479
- if (typeof body.success === 'boolean' && !body.success) {
1480
- reject(new Error(body.error || errString));
1481
- }
1482
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1483
- resolve(body);
1484
- }
1485
- else {
1486
- reject(errString);
1487
- }
1488
- }
1489
- });
1490
- });
1491
- });
1492
- }
1493
- /**
1494
- * t-SNE2 output of the raw dataset
1495
- * @summary Get data explorer features
1496
- * @param projectId Project ID
1497
- */
1498
- async getDataExplorerFeatures(projectId, options = { headers: {} }) {
1499
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/data-explorer/features'
1500
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
1501
- let localVarQueryParameters = {};
1502
- let localVarHeaderParams = Object.assign({
1503
- 'User-Agent': 'edgeimpulse-api nodejs'
1504
- }, this.defaultHeaders);
1505
- const produces = ['application/json'];
1506
- // give precedence to 'application/json'
1507
- if (produces.indexOf('application/json') >= 0) {
1508
- localVarHeaderParams.Accept = 'application/json';
1509
- }
1510
- else {
1511
- localVarHeaderParams.Accept = produces.join(',');
1512
- }
1513
- let localVarFormParams = {};
1514
- // verify required parameter 'projectId' is not null or undefined
1515
- if (projectId === null || projectId === undefined) {
1516
- throw new Error('Required parameter projectId was null or undefined when calling getDataExplorerFeatures.');
1517
- }
1518
- Object.assign(localVarHeaderParams, options.headers);
1519
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1520
- let localVarUseFormData = false;
1521
- let localVarRequestOptions = {
1522
- method: 'GET',
1523
- qs: localVarQueryParameters,
1524
- headers: localVarHeaderParams,
1525
- uri: localVarPath,
1526
- useQuerystring: this._useQuerystring,
1527
- agentOptions: { keepAlive: false },
1528
- json: true,
1529
- };
1530
- let authenticationPromise = Promise.resolve();
1531
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1532
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1533
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1534
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1535
- return authenticationPromise.then(() => {
1536
- if (Object.keys(localVarFormParams).length) {
1537
- if (localVarUseFormData) {
1538
- localVarRequestOptions.formData = localVarFormParams;
1539
- }
1540
- else {
1541
- localVarRequestOptions.form = localVarFormParams;
1542
- }
1543
- }
1544
- return new Promise((resolve, reject) => {
1545
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1546
- if (error) {
1547
- reject(error);
1548
- }
1549
- else {
1550
- body = models_1.ObjectSerializer.deserialize(body, "GetDataExplorerFeaturesResponse");
1551
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1552
- if (typeof body.success === 'boolean' && !body.success) {
1553
- reject(new Error(body.error || errString));
1554
- }
1555
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1556
- resolve(body);
1557
- }
1558
- else {
1559
- reject(errString);
1560
- }
1561
- }
1562
- });
1563
- });
1564
- });
1565
- }
1566
- /**
1567
- * Predictions for every data explorer point (only available when using current impulse to populate data explorer)
1568
- * @summary Get data explorer predictions
1569
- * @param projectId Project ID
1570
- */
1571
- async getDataExplorerPredictions(projectId, options = { headers: {} }) {
1572
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/data-explorer/predictions'
1573
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
1574
- let localVarQueryParameters = {};
1575
- let localVarHeaderParams = Object.assign({
1576
- 'User-Agent': 'edgeimpulse-api nodejs'
1577
- }, this.defaultHeaders);
1578
- const produces = ['application/json'];
1579
- // give precedence to 'application/json'
1580
- if (produces.indexOf('application/json') >= 0) {
1581
- localVarHeaderParams.Accept = 'application/json';
1582
- }
1583
- else {
1584
- localVarHeaderParams.Accept = produces.join(',');
1585
- }
1586
- let localVarFormParams = {};
1587
- // verify required parameter 'projectId' is not null or undefined
1588
- if (projectId === null || projectId === undefined) {
1589
- throw new Error('Required parameter projectId was null or undefined when calling getDataExplorerPredictions.');
1590
- }
1591
- Object.assign(localVarHeaderParams, options.headers);
1592
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1593
- let localVarUseFormData = false;
1594
- let localVarRequestOptions = {
1595
- method: 'GET',
1596
- qs: localVarQueryParameters,
1597
- headers: localVarHeaderParams,
1598
- uri: localVarPath,
1599
- useQuerystring: this._useQuerystring,
1600
- agentOptions: { keepAlive: false },
1601
- json: true,
1602
- };
1603
- let authenticationPromise = Promise.resolve();
1604
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1605
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1606
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1607
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1608
- return authenticationPromise.then(() => {
1609
- if (Object.keys(localVarFormParams).length) {
1610
- if (localVarUseFormData) {
1611
- localVarRequestOptions.formData = localVarFormParams;
1612
- }
1613
- else {
1614
- localVarRequestOptions.form = localVarFormParams;
1615
- }
1616
- }
1617
- return new Promise((resolve, reject) => {
1618
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1619
- if (error) {
1620
- reject(error);
1621
- }
1622
- else {
1623
- body = models_1.ObjectSerializer.deserialize(body, "DataExplorerPredictionsResponse");
1624
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1625
- if (typeof body.success === 'boolean' && !body.success) {
1626
- reject(new Error(body.error || errString));
1627
- }
1628
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1629
- resolve(body);
1630
- }
1631
- else {
1632
- reject(errString);
1633
- }
1634
- }
1635
- });
1636
- });
1637
- });
1638
- }
1639
- /**
1640
- * Structure describing the similarity and diversity of a dataset
1641
- * @summary Get diversity visualization data
1642
- * @param projectId Project ID
1643
- */
1644
- async getDiversityData(projectId, options = { headers: {} }) {
1645
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/data-quality/diversity'
1646
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
1647
- let localVarQueryParameters = {};
1648
- let localVarHeaderParams = Object.assign({
1649
- 'User-Agent': 'edgeimpulse-api nodejs'
1650
- }, this.defaultHeaders);
1651
- const produces = ['application/json'];
1652
- // give precedence to 'application/json'
1653
- if (produces.indexOf('application/json') >= 0) {
1654
- localVarHeaderParams.Accept = 'application/json';
1655
- }
1656
- else {
1657
- localVarHeaderParams.Accept = produces.join(',');
1658
- }
1659
- let localVarFormParams = {};
1660
- // verify required parameter 'projectId' is not null or undefined
1661
- if (projectId === null || projectId === undefined) {
1662
- throw new Error('Required parameter projectId was null or undefined when calling getDiversityData.');
1663
- }
1664
- Object.assign(localVarHeaderParams, options.headers);
1665
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1666
- let localVarUseFormData = false;
1667
- let localVarRequestOptions = {
1668
- method: 'GET',
1669
- qs: localVarQueryParameters,
1670
- headers: localVarHeaderParams,
1671
- uri: localVarPath,
1672
- useQuerystring: this._useQuerystring,
1673
- agentOptions: { keepAlive: false },
1674
- json: true,
1675
- };
1676
- let authenticationPromise = Promise.resolve();
1677
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1678
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1679
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1680
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1681
- return authenticationPromise.then(() => {
1682
- if (Object.keys(localVarFormParams).length) {
1683
- if (localVarUseFormData) {
1684
- localVarRequestOptions.formData = localVarFormParams;
1685
- }
1686
- else {
1687
- localVarRequestOptions.form = localVarFormParams;
1688
- }
1689
- }
1690
- return new Promise((resolve, reject) => {
1691
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1692
- if (error) {
1693
- reject(error);
1694
- }
1695
- else {
1696
- body = models_1.ObjectSerializer.deserialize(body, "GetDiversityDataResponse");
1697
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1698
- if (typeof body.success === 'boolean' && !body.success) {
1699
- reject(new Error(body.error || errString));
1700
- }
1701
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1702
- resolve(body);
1703
- }
1704
- else {
1705
- reject(errString);
1706
- }
1707
- }
1708
- });
1709
- });
1710
- });
1711
- }
1712
- /**
1713
- * Retrieve the metadata from a generated DSP block.
1714
- * @summary Get metadata
1715
- * @param projectId Project ID
1716
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
1717
- * @param excludeIncludedSamples Whether to exclude \&#39;includedSamples\&#39; in the response (as these can slow down requests significantly).
1718
- */
1719
- async getDspMetadata(projectId, dspId, queryParams, options = { headers: {} }) {
1720
- const localVarPath = this.basePath + '/api/{projectId}/dsp/{dspId}/metadata'
1721
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1722
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
1723
- let localVarQueryParameters = {};
1724
- let localVarHeaderParams = Object.assign({
1725
- 'User-Agent': 'edgeimpulse-api nodejs'
1726
- }, this.defaultHeaders);
1727
- const produces = ['application/json'];
1728
- // give precedence to 'application/json'
1729
- if (produces.indexOf('application/json') >= 0) {
1730
- localVarHeaderParams.Accept = 'application/json';
1731
- }
1732
- else {
1733
- localVarHeaderParams.Accept = produces.join(',');
1734
- }
1735
- let localVarFormParams = {};
1736
- // verify required parameter 'projectId' is not null or undefined
1737
- if (projectId === null || projectId === undefined) {
1738
- throw new Error('Required parameter projectId was null or undefined when calling getDspMetadata.');
1739
- }
1740
- // verify required parameter 'dspId' is not null or undefined
1741
- if (dspId === null || dspId === undefined) {
1742
- throw new Error('Required parameter dspId was null or undefined when calling getDspMetadata.');
1743
- }
1744
- if (queryParams.excludeIncludedSamples !== undefined) {
1745
- localVarQueryParameters['excludeIncludedSamples'] = models_1.ObjectSerializer.serialize(queryParams.excludeIncludedSamples, "boolean");
1746
- }
1747
- Object.assign(localVarHeaderParams, options.headers);
1748
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1749
- let localVarUseFormData = false;
1750
- let localVarRequestOptions = {
1751
- method: 'GET',
1752
- qs: localVarQueryParameters,
1753
- headers: localVarHeaderParams,
1754
- uri: localVarPath,
1755
- useQuerystring: this._useQuerystring,
1756
- agentOptions: { keepAlive: false },
1757
- json: true,
1758
- };
1759
- let authenticationPromise = Promise.resolve();
1760
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1761
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1762
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1763
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1764
- return authenticationPromise.then(() => {
1765
- if (Object.keys(localVarFormParams).length) {
1766
- if (localVarUseFormData) {
1767
- localVarRequestOptions.formData = localVarFormParams;
1768
- }
1769
- else {
1770
- localVarRequestOptions.form = localVarFormParams;
1771
- }
1772
- }
1773
- return new Promise((resolve, reject) => {
1774
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1775
- if (error) {
1776
- reject(error);
1777
- }
1778
- else {
1779
- body = models_1.ObjectSerializer.deserialize(body, "DSPMetadataResponse");
1780
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1781
- if (typeof body.success === 'boolean' && !body.success) {
1782
- reject(new Error(body.error || errString));
1783
- }
1784
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1785
- resolve(body);
1786
- }
1787
- else {
1788
- reject(errString);
1789
- }
1790
- }
1791
- });
1792
- });
1793
- });
1794
- }
1795
- /**
1796
- * Get raw sample data, but with only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out. If you pass dspId = 0 this will return a raw graph without any processing.
1797
- * @summary Get raw sample
1798
- * @param projectId Project ID
1799
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
1800
- * @param sampleId Sample ID
1801
- * @param limitPayloadValues Limit the number of payload values in the response
1802
- */
1803
- async getDspRawSample(projectId, dspId, sampleId, queryParams, options = { headers: {} }) {
1804
- const localVarPath = this.basePath + '/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}'
1805
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1806
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
1807
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
1808
- let localVarQueryParameters = {};
1809
- let localVarHeaderParams = Object.assign({
1810
- 'User-Agent': 'edgeimpulse-api nodejs'
1811
- }, this.defaultHeaders);
1812
- const produces = ['application/json'];
1813
- // give precedence to 'application/json'
1814
- if (produces.indexOf('application/json') >= 0) {
1815
- localVarHeaderParams.Accept = 'application/json';
1816
- }
1817
- else {
1818
- localVarHeaderParams.Accept = produces.join(',');
1819
- }
1820
- let localVarFormParams = {};
1821
- // verify required parameter 'projectId' is not null or undefined
1822
- if (projectId === null || projectId === undefined) {
1823
- throw new Error('Required parameter projectId was null or undefined when calling getDspRawSample.');
1824
- }
1825
- // verify required parameter 'dspId' is not null or undefined
1826
- if (dspId === null || dspId === undefined) {
1827
- throw new Error('Required parameter dspId was null or undefined when calling getDspRawSample.');
1828
- }
1829
- // verify required parameter 'sampleId' is not null or undefined
1830
- if (sampleId === null || sampleId === undefined) {
1831
- throw new Error('Required parameter sampleId was null or undefined when calling getDspRawSample.');
1832
- }
1833
- if (queryParams.limitPayloadValues !== undefined) {
1834
- localVarQueryParameters['limitPayloadValues'] = models_1.ObjectSerializer.serialize(queryParams.limitPayloadValues, "number");
1835
- }
1836
- Object.assign(localVarHeaderParams, options.headers);
1837
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1838
- let localVarUseFormData = false;
1839
- let localVarRequestOptions = {
1840
- method: 'GET',
1841
- qs: localVarQueryParameters,
1842
- headers: localVarHeaderParams,
1843
- uri: localVarPath,
1844
- useQuerystring: this._useQuerystring,
1845
- agentOptions: { keepAlive: false },
1846
- json: true,
1847
- };
1848
- let authenticationPromise = Promise.resolve();
1849
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1850
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1851
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1852
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1853
- return authenticationPromise.then(() => {
1854
- if (Object.keys(localVarFormParams).length) {
1855
- if (localVarUseFormData) {
1856
- localVarRequestOptions.formData = localVarFormParams;
1857
- }
1858
- else {
1859
- localVarRequestOptions.form = localVarFormParams;
1860
- }
1861
- }
1862
- return new Promise((resolve, reject) => {
1863
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1864
- if (error) {
1865
- reject(error);
1866
- }
1867
- else {
1868
- body = models_1.ObjectSerializer.deserialize(body, "GetSampleResponse");
1869
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1870
- if (typeof body.success === 'boolean' && !body.success) {
1871
- reject(new Error(body.error || errString));
1872
- }
1873
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1874
- resolve(body);
1875
- }
1876
- else {
1877
- reject(errString);
1878
- }
1879
- }
1880
- });
1881
- });
1882
- });
1883
- }
1884
- /**
1885
- * Get slice of raw sample data, but with only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.
1886
- * @summary Get raw sample (slice)
1887
- * @param projectId Project ID
1888
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
1889
- * @param sampleId Sample ID
1890
- * @param sliceStart Begin index of the slice
1891
- * @param sliceEnd End index of the slice
1892
- */
1893
- async getDspSampleSlice(projectId, dspId, sampleId, queryParams, options = { headers: {} }) {
1894
- const localVarPath = this.basePath + '/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice'
1895
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1896
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
1897
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
1898
- let localVarQueryParameters = {};
1899
- let localVarHeaderParams = Object.assign({
1900
- 'User-Agent': 'edgeimpulse-api nodejs'
1901
- }, this.defaultHeaders);
1902
- const produces = ['application/json'];
1903
- // give precedence to 'application/json'
1904
- if (produces.indexOf('application/json') >= 0) {
1905
- localVarHeaderParams.Accept = 'application/json';
1906
- }
1907
- else {
1908
- localVarHeaderParams.Accept = produces.join(',');
1909
- }
1910
- let localVarFormParams = {};
1911
- // verify required parameter 'projectId' is not null or undefined
1912
- if (projectId === null || projectId === undefined) {
1913
- throw new Error('Required parameter projectId was null or undefined when calling getDspSampleSlice.');
1914
- }
1915
- // verify required parameter 'dspId' is not null or undefined
1916
- if (dspId === null || dspId === undefined) {
1917
- throw new Error('Required parameter dspId was null or undefined when calling getDspSampleSlice.');
1918
- }
1919
- // verify required parameter 'sampleId' is not null or undefined
1920
- if (sampleId === null || sampleId === undefined) {
1921
- throw new Error('Required parameter sampleId was null or undefined when calling getDspSampleSlice.');
1922
- }
1923
- // verify required parameter 'sliceStart' is not null or undefined
1924
- if (queryParams.sliceStart === null || queryParams.sliceStart === undefined) {
1925
- throw new Error('Required parameter queryParams.sliceStart was null or undefined when calling getDspSampleSlice.');
1926
- }
1927
- // verify required parameter 'sliceEnd' is not null or undefined
1928
- if (queryParams.sliceEnd === null || queryParams.sliceEnd === undefined) {
1929
- throw new Error('Required parameter queryParams.sliceEnd was null or undefined when calling getDspSampleSlice.');
1930
- }
1931
- if (queryParams.sliceStart !== undefined) {
1932
- localVarQueryParameters['sliceStart'] = models_1.ObjectSerializer.serialize(queryParams.sliceStart, "number");
1933
- }
1934
- if (queryParams.sliceEnd !== undefined) {
1935
- localVarQueryParameters['sliceEnd'] = models_1.ObjectSerializer.serialize(queryParams.sliceEnd, "number");
1936
- }
1937
- Object.assign(localVarHeaderParams, options.headers);
1938
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
1939
- let localVarUseFormData = false;
1940
- let localVarRequestOptions = {
1941
- method: 'GET',
1942
- qs: localVarQueryParameters,
1943
- headers: localVarHeaderParams,
1944
- uri: localVarPath,
1945
- useQuerystring: this._useQuerystring,
1946
- agentOptions: { keepAlive: false },
1947
- json: true,
1948
- };
1949
- let authenticationPromise = Promise.resolve();
1950
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1951
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1952
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1953
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1954
- return authenticationPromise.then(() => {
1955
- if (Object.keys(localVarFormParams).length) {
1956
- if (localVarUseFormData) {
1957
- localVarRequestOptions.formData = localVarFormParams;
1958
- }
1959
- else {
1960
- localVarRequestOptions.form = localVarFormParams;
1961
- }
1962
- }
1963
- return new Promise((resolve, reject) => {
1964
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1965
- if (error) {
1966
- reject(error);
1967
- }
1968
- else {
1969
- body = models_1.ObjectSerializer.deserialize(body, "GetSampleResponse");
1970
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
1971
- if (typeof body.success === 'boolean' && !body.success) {
1972
- reject(new Error(body.error || errString));
1973
- }
1974
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1975
- resolve(body);
1976
- }
1977
- else {
1978
- reject(errString);
1979
- }
1980
- }
1981
- });
1982
- });
1983
- });
1984
- }
1985
- /**
1986
- * Get raw model metadata of the Gaussian mixture model (GMM) for a trained anomaly block. Use the impulse blocks to find the learnId.
1987
- * @summary Anomaly GMM metadata
1988
- * @param projectId Project ID
1989
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
1990
- */
1991
- async getGmmMetadata(projectId, learnId, options = { headers: {} }) {
1992
- const localVarPath = this.basePath + '/api/{projectId}/training/anomaly/{learnId}/gmm/metadata'
1993
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1994
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
1995
- let localVarQueryParameters = {};
1996
- let localVarHeaderParams = Object.assign({
1997
- 'User-Agent': 'edgeimpulse-api nodejs'
1998
- }, this.defaultHeaders);
1999
- const produces = ['application/json'];
2000
- // give precedence to 'application/json'
2001
- if (produces.indexOf('application/json') >= 0) {
2002
- localVarHeaderParams.Accept = 'application/json';
2003
- }
2004
- else {
2005
- localVarHeaderParams.Accept = produces.join(',');
2006
- }
2007
- let localVarFormParams = {};
2008
- // verify required parameter 'projectId' is not null or undefined
2009
- if (projectId === null || projectId === undefined) {
2010
- throw new Error('Required parameter projectId was null or undefined when calling getGmmMetadata.');
2011
- }
2012
- // verify required parameter 'learnId' is not null or undefined
2013
- if (learnId === null || learnId === undefined) {
2014
- throw new Error('Required parameter learnId was null or undefined when calling getGmmMetadata.');
2015
- }
2016
- Object.assign(localVarHeaderParams, options.headers);
2017
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2018
- let localVarUseFormData = false;
2019
- let localVarRequestOptions = {
2020
- method: 'GET',
2021
- qs: localVarQueryParameters,
2022
- headers: localVarHeaderParams,
2023
- uri: localVarPath,
2024
- useQuerystring: this._useQuerystring,
2025
- agentOptions: { keepAlive: false },
2026
- json: true,
2027
- };
2028
- let authenticationPromise = Promise.resolve();
2029
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2030
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2031
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2032
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2033
- return authenticationPromise.then(() => {
2034
- if (Object.keys(localVarFormParams).length) {
2035
- if (localVarUseFormData) {
2036
- localVarRequestOptions.formData = localVarFormParams;
2037
- }
2038
- else {
2039
- localVarRequestOptions.form = localVarFormParams;
2040
- }
2041
- }
2042
- return new Promise((resolve, reject) => {
2043
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2044
- if (error) {
2045
- reject(error);
2046
- }
2047
- else {
2048
- body = models_1.ObjectSerializer.deserialize(body, "AnomalyGmmMetadata");
2049
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2050
- if (typeof body.success === 'boolean' && !body.success) {
2051
- reject(new Error(body.error || errString));
2052
- }
2053
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2054
- resolve(body);
2055
- }
2056
- else {
2057
- reject(errString);
2058
- }
2059
- }
2060
- });
2061
- });
2062
- });
2063
- }
2064
- /**
2065
- * t-SNE2 output of the raw dataset using embeddings from this Keras block
2066
- * @summary Get data explorer features
2067
- * @param projectId Project ID
2068
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
2069
- */
2070
- async getKerasDataExplorerFeatures(projectId, learnId, options = { headers: {} }) {
2071
- const localVarPath = this.basePath + '/api/{projectId}/training/keras/{learnId}/data-explorer/features'
2072
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
2073
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
2074
- let localVarQueryParameters = {};
2075
- let localVarHeaderParams = Object.assign({
2076
- 'User-Agent': 'edgeimpulse-api nodejs'
2077
- }, this.defaultHeaders);
2078
- const produces = ['application/json'];
2079
- // give precedence to 'application/json'
2080
- if (produces.indexOf('application/json') >= 0) {
2081
- localVarHeaderParams.Accept = 'application/json';
2082
- }
2083
- else {
2084
- localVarHeaderParams.Accept = produces.join(',');
2085
- }
2086
- let localVarFormParams = {};
2087
- // verify required parameter 'projectId' is not null or undefined
2088
- if (projectId === null || projectId === undefined) {
2089
- throw new Error('Required parameter projectId was null or undefined when calling getKerasDataExplorerFeatures.');
2090
- }
2091
- // verify required parameter 'learnId' is not null or undefined
2092
- if (learnId === null || learnId === undefined) {
2093
- throw new Error('Required parameter learnId was null or undefined when calling getKerasDataExplorerFeatures.');
2094
- }
2095
- Object.assign(localVarHeaderParams, options.headers);
2096
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2097
- let localVarUseFormData = false;
2098
- let localVarRequestOptions = {
2099
- method: 'GET',
2100
- qs: localVarQueryParameters,
2101
- headers: localVarHeaderParams,
2102
- uri: localVarPath,
2103
- useQuerystring: this._useQuerystring,
2104
- agentOptions: { keepAlive: false },
2105
- json: true,
2106
- };
2107
- let authenticationPromise = Promise.resolve();
2108
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2109
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2110
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2111
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2112
- return authenticationPromise.then(() => {
2113
- if (Object.keys(localVarFormParams).length) {
2114
- if (localVarUseFormData) {
2115
- localVarRequestOptions.formData = localVarFormParams;
2116
- }
2117
- else {
2118
- localVarRequestOptions.form = localVarFormParams;
2119
- }
2120
- }
2121
- return new Promise((resolve, reject) => {
2122
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2123
- if (error) {
2124
- reject(error);
2125
- }
2126
- else {
2127
- body = models_1.ObjectSerializer.deserialize(body, "GetDataExplorerFeaturesResponse");
2128
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2129
- if (typeof body.success === 'boolean' && !body.success) {
2130
- reject(new Error(body.error || errString));
2131
- }
2132
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2133
- resolve(body);
2134
- }
2135
- else {
2136
- reject(errString);
2137
- }
2138
- }
2139
- });
2140
- });
2141
- });
2142
- }
2143
- /**
2144
- * Get metadata about a trained Keras block. Use the impulse blocks to find the learnId.
2145
- * @summary Keras metadata
2146
- * @param projectId Project ID
2147
- * @param learnId Learn Block ID, use the impulse functions to retrieve the ID
2148
- */
2149
- async getKerasMetadata(projectId, learnId, options = { headers: {} }) {
2150
- const localVarPath = this.basePath + '/api/{projectId}/training/keras/{learnId}/metadata'
2151
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
2152
- .replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
2153
- let localVarQueryParameters = {};
2154
- let localVarHeaderParams = Object.assign({
2155
- 'User-Agent': 'edgeimpulse-api nodejs'
2156
- }, this.defaultHeaders);
2157
- const produces = ['application/json'];
2158
- // give precedence to 'application/json'
2159
- if (produces.indexOf('application/json') >= 0) {
2160
- localVarHeaderParams.Accept = 'application/json';
2161
- }
2162
- else {
2163
- localVarHeaderParams.Accept = produces.join(',');
2164
- }
2165
- let localVarFormParams = {};
2166
- // verify required parameter 'projectId' is not null or undefined
2167
- if (projectId === null || projectId === undefined) {
2168
- throw new Error('Required parameter projectId was null or undefined when calling getKerasMetadata.');
2169
- }
2170
- // verify required parameter 'learnId' is not null or undefined
2171
- if (learnId === null || learnId === undefined) {
2172
- throw new Error('Required parameter learnId was null or undefined when calling getKerasMetadata.');
2173
- }
2174
- Object.assign(localVarHeaderParams, options.headers);
2175
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2176
- let localVarUseFormData = false;
2177
- let localVarRequestOptions = {
2178
- method: 'GET',
2179
- qs: localVarQueryParameters,
2180
- headers: localVarHeaderParams,
2181
- uri: localVarPath,
2182
- useQuerystring: this._useQuerystring,
2183
- agentOptions: { keepAlive: false },
2184
- json: true,
2185
- };
2186
- let authenticationPromise = Promise.resolve();
2187
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2188
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2189
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2190
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2191
- return authenticationPromise.then(() => {
2192
- if (Object.keys(localVarFormParams).length) {
2193
- if (localVarUseFormData) {
2194
- localVarRequestOptions.formData = localVarFormParams;
2195
- }
2196
- else {
2197
- localVarRequestOptions.form = localVarFormParams;
2198
- }
2199
- }
2200
- return new Promise((resolve, reject) => {
2201
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2202
- if (error) {
2203
- reject(error);
2204
- }
2205
- else {
2206
- body = models_1.ObjectSerializer.deserialize(body, "KerasModelMetadata");
2207
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2208
- if (typeof body.success === 'boolean' && !body.success) {
2209
- reject(new Error(body.error || errString));
2210
- }
2211
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2212
- resolve(body);
2213
- }
2214
- else {
2215
- reject(errString);
2216
- }
2217
- }
2218
- });
2219
- });
2220
- });
2221
- }
2222
- /**
2223
- * Get all notes in project.
2224
- * @summary Get notes
2225
- * @param projectId Project ID
2226
- */
2227
- async getNotes(projectId, options = { headers: {} }) {
2228
- const localVarPath = this.basePath + '/api/{projectId}/notes'
2229
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2230
- let localVarQueryParameters = {};
2231
- let localVarHeaderParams = Object.assign({
2232
- 'User-Agent': 'edgeimpulse-api nodejs'
2233
- }, this.defaultHeaders);
2234
- const produces = ['application/json'];
2235
- // give precedence to 'application/json'
2236
- if (produces.indexOf('application/json') >= 0) {
2237
- localVarHeaderParams.Accept = 'application/json';
2238
- }
2239
- else {
2240
- localVarHeaderParams.Accept = produces.join(',');
2241
- }
2242
- let localVarFormParams = {};
2243
- // verify required parameter 'projectId' is not null or undefined
2244
- if (projectId === null || projectId === undefined) {
2245
- throw new Error('Required parameter projectId was null or undefined when calling getNotes.');
2246
- }
2247
- Object.assign(localVarHeaderParams, options.headers);
2248
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2249
- let localVarUseFormData = false;
2250
- let localVarRequestOptions = {
2251
- method: 'GET',
2252
- qs: localVarQueryParameters,
2253
- headers: localVarHeaderParams,
2254
- uri: localVarPath,
2255
- useQuerystring: this._useQuerystring,
2256
- agentOptions: { keepAlive: false },
2257
- json: true,
2258
- };
2259
- let authenticationPromise = Promise.resolve();
2260
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2261
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2262
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2263
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2264
- return authenticationPromise.then(() => {
2265
- if (Object.keys(localVarFormParams).length) {
2266
- if (localVarUseFormData) {
2267
- localVarRequestOptions.formData = localVarFormParams;
2268
- }
2269
- else {
2270
- localVarRequestOptions.form = localVarFormParams;
2271
- }
2272
- }
2273
- return new Promise((resolve, reject) => {
2274
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2275
- if (error) {
2276
- reject(error);
2277
- }
2278
- else {
2279
- body = models_1.ObjectSerializer.deserialize(body, "GetNotesResponse");
2280
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2281
- if (typeof body.success === 'boolean' && !body.success) {
2282
- reject(new Error(body.error || errString));
2283
- }
2284
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2285
- resolve(body);
2286
- }
2287
- else {
2288
- reject(errString);
2289
- }
2290
- }
2291
- });
2292
- });
2293
- });
2294
- }
2295
- /**
2296
- * Get performance calibration ground truth data
2297
- * @summary Get ground truth
2298
- * @param projectId Project ID
2299
- */
2300
- async getPerformanceCalibrationGroundTruth(projectId, options = { headers: {} }) {
2301
- const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/ground-truth'
2302
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2303
- let localVarQueryParameters = {};
2304
- let localVarHeaderParams = Object.assign({
2305
- 'User-Agent': 'edgeimpulse-api nodejs'
2306
- }, this.defaultHeaders);
2307
- const produces = ['application/json'];
2308
- // give precedence to 'application/json'
2309
- if (produces.indexOf('application/json') >= 0) {
2310
- localVarHeaderParams.Accept = 'application/json';
2311
- }
2312
- else {
2313
- localVarHeaderParams.Accept = produces.join(',');
2314
- }
2315
- let localVarFormParams = {};
2316
- // verify required parameter 'projectId' is not null or undefined
2317
- if (projectId === null || projectId === undefined) {
2318
- throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationGroundTruth.');
2319
- }
2320
- Object.assign(localVarHeaderParams, options.headers);
2321
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2322
- let localVarUseFormData = false;
2323
- let localVarRequestOptions = {
2324
- method: 'GET',
2325
- qs: localVarQueryParameters,
2326
- headers: localVarHeaderParams,
2327
- uri: localVarPath,
2328
- useQuerystring: this._useQuerystring,
2329
- agentOptions: { keepAlive: false },
2330
- json: true,
2331
- };
2332
- let authenticationPromise = Promise.resolve();
2333
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2334
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2335
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2336
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2337
- return authenticationPromise.then(() => {
2338
- if (Object.keys(localVarFormParams).length) {
2339
- if (localVarUseFormData) {
2340
- localVarRequestOptions.formData = localVarFormParams;
2341
- }
2342
- else {
2343
- localVarRequestOptions.form = localVarFormParams;
2344
- }
2345
- }
2346
- return new Promise((resolve, reject) => {
2347
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2348
- if (error) {
2349
- reject(error);
2350
- }
2351
- else {
2352
- body = models_1.ObjectSerializer.deserialize(body, "GetPerformanceCalibrationGroundTruthResponse");
2353
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2354
- if (typeof body.success === 'boolean' && !body.success) {
2355
- reject(new Error(body.error || errString));
2356
- }
2357
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2358
- resolve(body);
2359
- }
2360
- else {
2361
- reject(errString);
2362
- }
2363
- }
2364
- });
2365
- });
2366
- });
2367
- }
2368
- /**
2369
- * Get performance calibration parameter sets
2370
- * @summary Get parameter sets
2371
- * @param projectId Project ID
2372
- */
2373
- async getPerformanceCalibrationParameterSets(projectId, options = { headers: {} }) {
2374
- const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/parameter-sets'
2375
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2376
- let localVarQueryParameters = {};
2377
- let localVarHeaderParams = Object.assign({
2378
- 'User-Agent': 'edgeimpulse-api nodejs'
2379
- }, this.defaultHeaders);
2380
- const produces = ['application/json'];
2381
- // give precedence to 'application/json'
2382
- if (produces.indexOf('application/json') >= 0) {
2383
- localVarHeaderParams.Accept = 'application/json';
2384
- }
2385
- else {
2386
- localVarHeaderParams.Accept = produces.join(',');
2387
- }
2388
- let localVarFormParams = {};
2389
- // verify required parameter 'projectId' is not null or undefined
2390
- if (projectId === null || projectId === undefined) {
2391
- throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationParameterSets.');
2392
- }
2393
- Object.assign(localVarHeaderParams, options.headers);
2394
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2395
- let localVarUseFormData = false;
2396
- let localVarRequestOptions = {
2397
- method: 'GET',
2398
- qs: localVarQueryParameters,
2399
- headers: localVarHeaderParams,
2400
- uri: localVarPath,
2401
- useQuerystring: this._useQuerystring,
2402
- agentOptions: { keepAlive: false },
2403
- json: true,
2404
- };
2405
- let authenticationPromise = Promise.resolve();
2406
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2407
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2408
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2409
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2410
- return authenticationPromise.then(() => {
2411
- if (Object.keys(localVarFormParams).length) {
2412
- if (localVarUseFormData) {
2413
- localVarRequestOptions.formData = localVarFormParams;
2414
- }
2415
- else {
2416
- localVarRequestOptions.form = localVarFormParams;
2417
- }
2418
- }
2419
- return new Promise((resolve, reject) => {
2420
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2421
- if (error) {
2422
- reject(error);
2423
- }
2424
- else {
2425
- body = models_1.ObjectSerializer.deserialize(body, "GetPerformanceCalibrationParameterSetsResponse");
2426
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2427
- if (typeof body.success === 'boolean' && !body.success) {
2428
- reject(new Error(body.error || errString));
2429
- }
2430
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2431
- resolve(body);
2432
- }
2433
- else {
2434
- reject(errString);
2435
- }
2436
- }
2437
- });
2438
- });
2439
- });
2440
- }
2441
- /**
2442
- * Get performance calibration raw result
2443
- * @summary Get raw result
2444
- * @param projectId Project ID
2445
- */
2446
- async getPerformanceCalibrationRawResult(projectId, options = { headers: {} }) {
2447
- const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/raw-result'
2448
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2449
- let localVarQueryParameters = {};
2450
- let localVarHeaderParams = Object.assign({
2451
- 'User-Agent': 'edgeimpulse-api nodejs'
2452
- }, this.defaultHeaders);
2453
- const produces = ['application/json'];
2454
- // give precedence to 'application/json'
2455
- if (produces.indexOf('application/json') >= 0) {
2456
- localVarHeaderParams.Accept = 'application/json';
2457
- }
2458
- else {
2459
- localVarHeaderParams.Accept = produces.join(',');
2460
- }
2461
- let localVarFormParams = {};
2462
- // verify required parameter 'projectId' is not null or undefined
2463
- if (projectId === null || projectId === undefined) {
2464
- throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationRawResult.');
2465
- }
2466
- Object.assign(localVarHeaderParams, options.headers);
2467
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2468
- let localVarUseFormData = false;
2469
- let localVarRequestOptions = {
2470
- method: 'GET',
2471
- qs: localVarQueryParameters,
2472
- headers: localVarHeaderParams,
2473
- uri: localVarPath,
2474
- useQuerystring: this._useQuerystring,
2475
- agentOptions: { keepAlive: false },
2476
- json: true,
2477
- };
2478
- let authenticationPromise = Promise.resolve();
2479
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2480
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2481
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2482
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2483
- return authenticationPromise.then(() => {
2484
- if (Object.keys(localVarFormParams).length) {
2485
- if (localVarUseFormData) {
2486
- localVarRequestOptions.formData = localVarFormParams;
2487
- }
2488
- else {
2489
- localVarRequestOptions.form = localVarFormParams;
2490
- }
2491
- }
2492
- return new Promise((resolve, reject) => {
2493
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2494
- if (error) {
2495
- reject(error);
2496
- }
2497
- else {
2498
- body = models_1.ObjectSerializer.deserialize(body, "GetPerformanceCalibrationRawResultResponse");
2499
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2500
- if (typeof body.success === 'boolean' && !body.success) {
2501
- reject(new Error(body.error || errString));
2502
- }
2503
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2504
- resolve(body);
2505
- }
2506
- else {
2507
- reject(errString);
2508
- }
2509
- }
2510
- });
2511
- });
2512
- });
2513
- }
2514
- /**
2515
- * Get performance calibration stored parameters
2516
- * @summary Get parameters
2517
- * @param projectId Project ID
2518
- */
2519
- async getPerformanceCalibrationSavedParameters(projectId, options = { headers: {} }) {
2520
- const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/parameters'
2521
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2522
- let localVarQueryParameters = {};
2523
- let localVarHeaderParams = Object.assign({
2524
- 'User-Agent': 'edgeimpulse-api nodejs'
2525
- }, this.defaultHeaders);
2526
- const produces = ['application/json'];
2527
- // give precedence to 'application/json'
2528
- if (produces.indexOf('application/json') >= 0) {
2529
- localVarHeaderParams.Accept = 'application/json';
2530
- }
2531
- else {
2532
- localVarHeaderParams.Accept = produces.join(',');
2533
- }
2534
- let localVarFormParams = {};
2535
- // verify required parameter 'projectId' is not null or undefined
2536
- if (projectId === null || projectId === undefined) {
2537
- throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationSavedParameters.');
2538
- }
2539
- Object.assign(localVarHeaderParams, options.headers);
2540
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2541
- let localVarUseFormData = false;
2542
- let localVarRequestOptions = {
2543
- method: 'GET',
2544
- qs: localVarQueryParameters,
2545
- headers: localVarHeaderParams,
2546
- uri: localVarPath,
2547
- useQuerystring: this._useQuerystring,
2548
- agentOptions: { keepAlive: false },
2549
- json: true,
2550
- };
2551
- let authenticationPromise = Promise.resolve();
2552
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2553
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2554
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2555
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2556
- return authenticationPromise.then(() => {
2557
- if (Object.keys(localVarFormParams).length) {
2558
- if (localVarUseFormData) {
2559
- localVarRequestOptions.formData = localVarFormParams;
2560
- }
2561
- else {
2562
- localVarRequestOptions.form = localVarFormParams;
2563
- }
2564
- }
2565
- return new Promise((resolve, reject) => {
2566
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2567
- if (error) {
2568
- reject(error);
2569
- }
2570
- else {
2571
- body = models_1.ObjectSerializer.deserialize(body, "GetPerformanceCalibrationParametersResponse");
2572
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2573
- if (typeof body.success === 'boolean' && !body.success) {
2574
- reject(new Error(body.error || errString));
2575
- }
2576
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2577
- resolve(body);
2578
- }
2579
- else {
2580
- reject(errString);
2581
- }
2582
- }
2583
- });
2584
- });
2585
- });
2586
- }
2587
- /**
2588
- * Get performance calibration status
2589
- * @summary Get status
2590
- * @param projectId Project ID
2591
- */
2592
- async getPerformanceCalibrationStatus(projectId, options = { headers: {} }) {
2593
- const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/status'
2594
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2595
- let localVarQueryParameters = {};
2596
- let localVarHeaderParams = Object.assign({
2597
- 'User-Agent': 'edgeimpulse-api nodejs'
2598
- }, this.defaultHeaders);
2599
- const produces = ['application/json'];
2600
- // give precedence to 'application/json'
2601
- if (produces.indexOf('application/json') >= 0) {
2602
- localVarHeaderParams.Accept = 'application/json';
2603
- }
2604
- else {
2605
- localVarHeaderParams.Accept = produces.join(',');
2606
- }
2607
- let localVarFormParams = {};
2608
- // verify required parameter 'projectId' is not null or undefined
2609
- if (projectId === null || projectId === undefined) {
2610
- throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationStatus.');
2611
- }
2612
- Object.assign(localVarHeaderParams, options.headers);
2613
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2614
- let localVarUseFormData = false;
2615
- let localVarRequestOptions = {
2616
- method: 'GET',
2617
- qs: localVarQueryParameters,
2618
- headers: localVarHeaderParams,
2619
- uri: localVarPath,
2620
- useQuerystring: this._useQuerystring,
2621
- agentOptions: { keepAlive: false },
2622
- json: true,
2623
- };
2624
- let authenticationPromise = Promise.resolve();
2625
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2626
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2627
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2628
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2629
- return authenticationPromise.then(() => {
2630
- if (Object.keys(localVarFormParams).length) {
2631
- if (localVarUseFormData) {
2632
- localVarRequestOptions.formData = localVarFormParams;
2633
- }
2634
- else {
2635
- localVarRequestOptions.form = localVarFormParams;
2636
- }
2637
- }
2638
- return new Promise((resolve, reject) => {
2639
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2640
- if (error) {
2641
- reject(error);
2642
- }
2643
- else {
2644
- body = models_1.ObjectSerializer.deserialize(body, "GetPerformanceCalibrationStatusResponse");
2645
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2646
- if (typeof body.success === 'boolean' && !body.success) {
2647
- reject(new Error(body.error || errString));
2648
- }
2649
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2650
- resolve(body);
2651
- }
2652
- else {
2653
- reject(errString);
2654
- }
2655
- }
2656
- });
2657
- });
2658
- });
2659
- }
2660
- /**
2661
- * List a summary about this project - available for public projects.
2662
- * @summary Public project information
2663
- * @param projectId Project ID
2664
- */
2665
- async getProjectInfoSummary(projectId, options = { headers: {} }) {
2666
- const localVarPath = this.basePath + '/api/{projectId}/public-info'
2667
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
2668
- let localVarQueryParameters = {};
2669
- let localVarHeaderParams = Object.assign({
2670
- 'User-Agent': 'edgeimpulse-api nodejs'
2671
- }, this.defaultHeaders);
2672
- const produces = ['application/json'];
2673
- // give precedence to 'application/json'
2674
- if (produces.indexOf('application/json') >= 0) {
2675
- localVarHeaderParams.Accept = 'application/json';
2676
- }
2677
- else {
2678
- localVarHeaderParams.Accept = produces.join(',');
2679
- }
2680
- let localVarFormParams = {};
2681
- // verify required parameter 'projectId' is not null or undefined
2682
- if (projectId === null || projectId === undefined) {
2683
- throw new Error('Required parameter projectId was null or undefined when calling getProjectInfoSummary.');
2684
- }
2685
- Object.assign(localVarHeaderParams, options.headers);
2686
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2687
- let localVarUseFormData = false;
2688
- let localVarRequestOptions = {
2689
- method: 'GET',
2690
- qs: localVarQueryParameters,
2691
- headers: localVarHeaderParams,
2692
- uri: localVarPath,
2693
- useQuerystring: this._useQuerystring,
2694
- agentOptions: { keepAlive: false },
2695
- json: true,
2696
- };
2697
- let authenticationPromise = Promise.resolve();
2698
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2699
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2700
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2701
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2702
- return authenticationPromise.then(() => {
2703
- if (Object.keys(localVarFormParams).length) {
2704
- if (localVarUseFormData) {
2705
- localVarRequestOptions.formData = localVarFormParams;
2706
- }
2707
- else {
2708
- localVarRequestOptions.form = localVarFormParams;
2709
- }
2710
- }
2711
- return new Promise((resolve, reject) => {
2712
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2713
- if (error) {
2714
- reject(error);
2715
- }
2716
- else {
2717
- body = models_1.ObjectSerializer.deserialize(body, "ProjectInfoSummaryResponse");
2718
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2719
- if (typeof body.success === 'boolean' && !body.success) {
2720
- reject(new Error(body.error || errString));
2721
- }
2722
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2723
- resolve(body);
2724
- }
2725
- else {
2726
- reject(errString);
2727
- }
2728
- }
2729
- });
2730
- });
2731
- });
2732
- }
2733
- /**
2734
- * Get a sample.
2735
- * @summary Get sample
2736
- * @param projectId Project ID
2737
- * @param sampleId Sample ID
2738
- * @param limitPayloadValues Limit the number of payload values in the response
2739
- */
2740
- async getSample(projectId, sampleId, queryParams, options = { headers: {} }) {
2741
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}'
2742
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
2743
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
2744
- let localVarQueryParameters = {};
2745
- let localVarHeaderParams = Object.assign({
2746
- 'User-Agent': 'edgeimpulse-api nodejs'
2747
- }, this.defaultHeaders);
2748
- const produces = ['application/json'];
2749
- // give precedence to 'application/json'
2750
- if (produces.indexOf('application/json') >= 0) {
2751
- localVarHeaderParams.Accept = 'application/json';
2752
- }
2753
- else {
2754
- localVarHeaderParams.Accept = produces.join(',');
2755
- }
2756
- let localVarFormParams = {};
2757
- // verify required parameter 'projectId' is not null or undefined
2758
- if (projectId === null || projectId === undefined) {
2759
- throw new Error('Required parameter projectId was null or undefined when calling getSample.');
2760
- }
2761
- // verify required parameter 'sampleId' is not null or undefined
2762
- if (sampleId === null || sampleId === undefined) {
2763
- throw new Error('Required parameter sampleId was null or undefined when calling getSample.');
2764
- }
2765
- if (queryParams.limitPayloadValues !== undefined) {
2766
- localVarQueryParameters['limitPayloadValues'] = models_1.ObjectSerializer.serialize(queryParams.limitPayloadValues, "number");
2767
- }
2768
- Object.assign(localVarHeaderParams, options.headers);
2769
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2770
- let localVarUseFormData = false;
2771
- let localVarRequestOptions = {
2772
- method: 'GET',
2773
- qs: localVarQueryParameters,
2774
- headers: localVarHeaderParams,
2775
- uri: localVarPath,
2776
- useQuerystring: this._useQuerystring,
2777
- agentOptions: { keepAlive: false },
2778
- json: true,
2779
- };
2780
- let authenticationPromise = Promise.resolve();
2781
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2782
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2783
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2784
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2785
- return authenticationPromise.then(() => {
2786
- if (Object.keys(localVarFormParams).length) {
2787
- if (localVarUseFormData) {
2788
- localVarRequestOptions.formData = localVarFormParams;
2789
- }
2790
- else {
2791
- localVarRequestOptions.form = localVarFormParams;
2792
- }
2793
- }
2794
- return new Promise((resolve, reject) => {
2795
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2796
- if (error) {
2797
- reject(error);
2798
- }
2799
- else {
2800
- body = models_1.ObjectSerializer.deserialize(body, "GetSampleResponse");
2801
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2802
- if (typeof body.success === 'boolean' && !body.success) {
2803
- reject(new Error(body.error || errString));
2804
- }
2805
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2806
- resolve(body);
2807
- }
2808
- else {
2809
- reject(errString);
2810
- }
2811
- }
2812
- });
2813
- });
2814
- });
2815
- }
2816
- /**
2817
- * Get a sample as a WAV file. This only applies to samples with an audio axis.
2818
- * @summary Get WAV file
2819
- * @param projectId Project ID
2820
- * @param sampleId Sample ID
2821
- * @param axisIx Axis index
2822
- * @param sliceStart Begin index of the slice
2823
- * @param sliceEnd End index of the slice
2824
- */
2825
- async getSampleAsAudio(projectId, sampleId, queryParams, options = { headers: {} }) {
2826
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/wav'
2827
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
2828
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
2829
- let localVarQueryParameters = {};
2830
- let localVarHeaderParams = Object.assign({
2831
- 'User-Agent': 'edgeimpulse-api nodejs'
2832
- }, this.defaultHeaders);
2833
- const produces = ['audio/wav'];
2834
- // give precedence to 'application/json'
2835
- if (produces.indexOf('application/json') >= 0) {
2836
- localVarHeaderParams.Accept = 'application/json';
2837
- }
2838
- else {
2839
- localVarHeaderParams.Accept = produces.join(',');
2840
- }
2841
- let localVarFormParams = {};
2842
- // verify required parameter 'projectId' is not null or undefined
2843
- if (projectId === null || projectId === undefined) {
2844
- throw new Error('Required parameter projectId was null or undefined when calling getSampleAsAudio.');
2845
- }
2846
- // verify required parameter 'sampleId' is not null or undefined
2847
- if (sampleId === null || sampleId === undefined) {
2848
- throw new Error('Required parameter sampleId was null or undefined when calling getSampleAsAudio.');
2849
- }
2850
- // verify required parameter 'axisIx' is not null or undefined
2851
- if (queryParams.axisIx === null || queryParams.axisIx === undefined) {
2852
- throw new Error('Required parameter queryParams.axisIx was null or undefined when calling getSampleAsAudio.');
2853
- }
2854
- if (queryParams.axisIx !== undefined) {
2855
- localVarQueryParameters['axisIx'] = models_1.ObjectSerializer.serialize(queryParams.axisIx, "number");
2856
- }
2857
- if (queryParams.sliceStart !== undefined) {
2858
- localVarQueryParameters['sliceStart'] = models_1.ObjectSerializer.serialize(queryParams.sliceStart, "number");
2859
- }
2860
- if (queryParams.sliceEnd !== undefined) {
2861
- localVarQueryParameters['sliceEnd'] = models_1.ObjectSerializer.serialize(queryParams.sliceEnd, "number");
2862
- }
2863
- Object.assign(localVarHeaderParams, options.headers);
2864
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2865
- let localVarUseFormData = false;
2866
- let localVarRequestOptions = {
2867
- method: 'GET',
2868
- qs: localVarQueryParameters,
2869
- headers: localVarHeaderParams,
2870
- uri: localVarPath,
2871
- useQuerystring: this._useQuerystring,
2872
- agentOptions: { keepAlive: false },
2873
- encoding: null,
2874
- };
2875
- let authenticationPromise = Promise.resolve();
2876
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2877
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2878
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2879
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2880
- return authenticationPromise.then(() => {
2881
- if (Object.keys(localVarFormParams).length) {
2882
- if (localVarUseFormData) {
2883
- localVarRequestOptions.formData = localVarFormParams;
2884
- }
2885
- else {
2886
- localVarRequestOptions.form = localVarFormParams;
2887
- }
2888
- }
2889
- return new Promise((resolve, reject) => {
2890
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2891
- if (error) {
2892
- reject(error);
2893
- }
2894
- else {
2895
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
2896
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2897
- if (typeof body.success === 'boolean' && !body.success) {
2898
- reject(new Error(body.error || errString));
2899
- }
2900
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2901
- resolve(body);
2902
- }
2903
- else {
2904
- reject(errString);
2905
- }
2906
- }
2907
- });
2908
- });
2909
- });
2910
- }
2911
- /**
2912
- * Get a sample as an image file. This only applies to samples with RGBA data.
2913
- * @summary Get image file
2914
- * @param projectId Project ID
2915
- * @param sampleId Sample ID
2916
- * @param afterInputBlock Whether to process the image through the input block first
2917
- */
2918
- async getSampleAsImage(projectId, sampleId, queryParams, options = { headers: {} }) {
2919
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/image'
2920
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
2921
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
2922
- let localVarQueryParameters = {};
2923
- let localVarHeaderParams = Object.assign({
2924
- 'User-Agent': 'edgeimpulse-api nodejs'
2925
- }, this.defaultHeaders);
2926
- const produces = ['image/jpeg'];
2927
- // give precedence to 'application/json'
2928
- if (produces.indexOf('application/json') >= 0) {
2929
- localVarHeaderParams.Accept = 'application/json';
2930
- }
2931
- else {
2932
- localVarHeaderParams.Accept = produces.join(',');
2933
- }
2934
- let localVarFormParams = {};
2935
- // verify required parameter 'projectId' is not null or undefined
2936
- if (projectId === null || projectId === undefined) {
2937
- throw new Error('Required parameter projectId was null or undefined when calling getSampleAsImage.');
2938
- }
2939
- // verify required parameter 'sampleId' is not null or undefined
2940
- if (sampleId === null || sampleId === undefined) {
2941
- throw new Error('Required parameter sampleId was null or undefined when calling getSampleAsImage.');
2942
- }
2943
- if (queryParams.afterInputBlock !== undefined) {
2944
- localVarQueryParameters['afterInputBlock'] = models_1.ObjectSerializer.serialize(queryParams.afterInputBlock, "boolean");
2945
- }
2946
- Object.assign(localVarHeaderParams, options.headers);
2947
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
2948
- let localVarUseFormData = false;
2949
- let localVarRequestOptions = {
2950
- method: 'GET',
2951
- qs: localVarQueryParameters,
2952
- headers: localVarHeaderParams,
2953
- uri: localVarPath,
2954
- useQuerystring: this._useQuerystring,
2955
- agentOptions: { keepAlive: false },
2956
- encoding: null,
2957
- };
2958
- let authenticationPromise = Promise.resolve();
2959
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
2960
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
2961
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
2962
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2963
- return authenticationPromise.then(() => {
2964
- if (Object.keys(localVarFormParams).length) {
2965
- if (localVarUseFormData) {
2966
- localVarRequestOptions.formData = localVarFormParams;
2967
- }
2968
- else {
2969
- localVarRequestOptions.form = localVarFormParams;
2970
- }
2971
- }
2972
- return new Promise((resolve, reject) => {
2973
- localVarRequest(localVarRequestOptions, (error, response, body) => {
2974
- if (error) {
2975
- reject(error);
2976
- }
2977
- else {
2978
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
2979
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
2980
- if (typeof body.success === 'boolean' && !body.success) {
2981
- reject(new Error(body.error || errString));
2982
- }
2983
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
2984
- resolve(body);
2985
- }
2986
- else {
2987
- reject(errString);
2988
- }
2989
- }
2990
- });
2991
- });
2992
- });
2993
- }
2994
- /**
2995
- * Download a sample in it\'s original format as uploaded to the ingestion service.
2996
- * @summary Download file
2997
- * @param projectId Project ID
2998
- * @param sampleId Sample ID
2999
- */
3000
- async getSampleAsRaw(projectId, sampleId, options = { headers: {} }) {
3001
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/raw'
3002
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
3003
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
3004
- let localVarQueryParameters = {};
3005
- let localVarHeaderParams = Object.assign({
3006
- 'User-Agent': 'edgeimpulse-api nodejs'
3007
- }, this.defaultHeaders);
3008
- const produces = ['application/octet-stream'];
3009
- // give precedence to 'application/json'
3010
- if (produces.indexOf('application/json') >= 0) {
3011
- localVarHeaderParams.Accept = 'application/json';
3012
- }
3013
- else {
3014
- localVarHeaderParams.Accept = produces.join(',');
3015
- }
3016
- let localVarFormParams = {};
3017
- // verify required parameter 'projectId' is not null or undefined
3018
- if (projectId === null || projectId === undefined) {
3019
- throw new Error('Required parameter projectId was null or undefined when calling getSampleAsRaw.');
3020
- }
3021
- // verify required parameter 'sampleId' is not null or undefined
3022
- if (sampleId === null || sampleId === undefined) {
3023
- throw new Error('Required parameter sampleId was null or undefined when calling getSampleAsRaw.');
3024
- }
3025
- Object.assign(localVarHeaderParams, options.headers);
3026
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3027
- let localVarUseFormData = false;
3028
- let localVarRequestOptions = {
3029
- method: 'GET',
3030
- qs: localVarQueryParameters,
3031
- headers: localVarHeaderParams,
3032
- uri: localVarPath,
3033
- useQuerystring: this._useQuerystring,
3034
- agentOptions: { keepAlive: false },
3035
- encoding: null,
3036
- };
3037
- let authenticationPromise = Promise.resolve();
3038
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3039
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3040
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3041
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3042
- return authenticationPromise.then(() => {
3043
- if (Object.keys(localVarFormParams).length) {
3044
- if (localVarUseFormData) {
3045
- localVarRequestOptions.formData = localVarFormParams;
3046
- }
3047
- else {
3048
- localVarRequestOptions.form = localVarFormParams;
3049
- }
3050
- }
3051
- return new Promise((resolve, reject) => {
3052
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3053
- if (error) {
3054
- reject(error);
3055
- }
3056
- else {
3057
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
3058
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3059
- if (typeof body.success === 'boolean' && !body.success) {
3060
- reject(new Error(body.error || errString));
3061
- }
3062
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3063
- resolve(body);
3064
- }
3065
- else {
3066
- reject(errString);
3067
- }
3068
- }
3069
- });
3070
- });
3071
- });
3072
- }
3073
- /**
3074
- * Get a sample as an video file. This only applies to samples with video data.
3075
- * @summary Get video file
3076
- * @param projectId Project ID
3077
- * @param sampleId Sample ID
3078
- * @param afterInputBlock Whether to process the image through the input block first
3079
- */
3080
- async getSampleAsVideo(projectId, sampleId, queryParams, options = { headers: {} }) {
3081
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/video'
3082
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
3083
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
3084
- let localVarQueryParameters = {};
3085
- let localVarHeaderParams = Object.assign({
3086
- 'User-Agent': 'edgeimpulse-api nodejs'
3087
- }, this.defaultHeaders);
3088
- const produces = ['video/mp4'];
3089
- // give precedence to 'application/json'
3090
- if (produces.indexOf('application/json') >= 0) {
3091
- localVarHeaderParams.Accept = 'application/json';
3092
- }
3093
- else {
3094
- localVarHeaderParams.Accept = produces.join(',');
3095
- }
3096
- let localVarFormParams = {};
3097
- // verify required parameter 'projectId' is not null or undefined
3098
- if (projectId === null || projectId === undefined) {
3099
- throw new Error('Required parameter projectId was null or undefined when calling getSampleAsVideo.');
3100
- }
3101
- // verify required parameter 'sampleId' is not null or undefined
3102
- if (sampleId === null || sampleId === undefined) {
3103
- throw new Error('Required parameter sampleId was null or undefined when calling getSampleAsVideo.');
3104
- }
3105
- if (queryParams.afterInputBlock !== undefined) {
3106
- localVarQueryParameters['afterInputBlock'] = models_1.ObjectSerializer.serialize(queryParams.afterInputBlock, "boolean");
3107
- }
3108
- Object.assign(localVarHeaderParams, options.headers);
3109
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3110
- let localVarUseFormData = false;
3111
- let localVarRequestOptions = {
3112
- method: 'GET',
3113
- qs: localVarQueryParameters,
3114
- headers: localVarHeaderParams,
3115
- uri: localVarPath,
3116
- useQuerystring: this._useQuerystring,
3117
- agentOptions: { keepAlive: false },
3118
- encoding: null,
3119
- };
3120
- let authenticationPromise = Promise.resolve();
3121
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3122
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3123
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3124
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3125
- return authenticationPromise.then(() => {
3126
- if (Object.keys(localVarFormParams).length) {
3127
- if (localVarUseFormData) {
3128
- localVarRequestOptions.formData = localVarFormParams;
3129
- }
3130
- else {
3131
- localVarRequestOptions.form = localVarFormParams;
3132
- }
3133
- }
3134
- return new Promise((resolve, reject) => {
3135
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3136
- if (error) {
3137
- reject(error);
3138
- }
3139
- else {
3140
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
3141
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3142
- if (typeof body.success === 'boolean' && !body.success) {
3143
- reject(new Error(body.error || errString));
3144
- }
3145
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3146
- resolve(body);
3147
- }
3148
- else {
3149
- reject(errString);
3150
- }
3151
- }
3152
- });
3153
- });
3154
- });
3155
- }
3156
- /**
3157
- * Get a slice of a sample.
3158
- * @summary Get sample slice
3159
- * @param projectId Project ID
3160
- * @param sampleId Sample ID
3161
- * @param sliceStart Begin index of the slice
3162
- * @param sliceEnd End index of the slice
3163
- */
3164
- async getSampleSlice(projectId, sampleId, queryParams, options = { headers: {} }) {
3165
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/slice'
3166
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
3167
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
3168
- let localVarQueryParameters = {};
3169
- let localVarHeaderParams = Object.assign({
3170
- 'User-Agent': 'edgeimpulse-api nodejs'
3171
- }, this.defaultHeaders);
3172
- const produces = ['application/json'];
3173
- // give precedence to 'application/json'
3174
- if (produces.indexOf('application/json') >= 0) {
3175
- localVarHeaderParams.Accept = 'application/json';
3176
- }
3177
- else {
3178
- localVarHeaderParams.Accept = produces.join(',');
3179
- }
3180
- let localVarFormParams = {};
3181
- // verify required parameter 'projectId' is not null or undefined
3182
- if (projectId === null || projectId === undefined) {
3183
- throw new Error('Required parameter projectId was null or undefined when calling getSampleSlice.');
3184
- }
3185
- // verify required parameter 'sampleId' is not null or undefined
3186
- if (sampleId === null || sampleId === undefined) {
3187
- throw new Error('Required parameter sampleId was null or undefined when calling getSampleSlice.');
3188
- }
3189
- // verify required parameter 'sliceStart' is not null or undefined
3190
- if (queryParams.sliceStart === null || queryParams.sliceStart === undefined) {
3191
- throw new Error('Required parameter queryParams.sliceStart was null or undefined when calling getSampleSlice.');
3192
- }
3193
- // verify required parameter 'sliceEnd' is not null or undefined
3194
- if (queryParams.sliceEnd === null || queryParams.sliceEnd === undefined) {
3195
- throw new Error('Required parameter queryParams.sliceEnd was null or undefined when calling getSampleSlice.');
3196
- }
3197
- if (queryParams.sliceStart !== undefined) {
3198
- localVarQueryParameters['sliceStart'] = models_1.ObjectSerializer.serialize(queryParams.sliceStart, "number");
3199
- }
3200
- if (queryParams.sliceEnd !== undefined) {
3201
- localVarQueryParameters['sliceEnd'] = models_1.ObjectSerializer.serialize(queryParams.sliceEnd, "number");
3202
- }
3203
- Object.assign(localVarHeaderParams, options.headers);
3204
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3205
- let localVarUseFormData = false;
3206
- let localVarRequestOptions = {
3207
- method: 'GET',
3208
- qs: localVarQueryParameters,
3209
- headers: localVarHeaderParams,
3210
- uri: localVarPath,
3211
- useQuerystring: this._useQuerystring,
3212
- agentOptions: { keepAlive: false },
3213
- json: true,
3214
- };
3215
- let authenticationPromise = Promise.resolve();
3216
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3217
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3218
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3219
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3220
- return authenticationPromise.then(() => {
3221
- if (Object.keys(localVarFormParams).length) {
3222
- if (localVarUseFormData) {
3223
- localVarRequestOptions.formData = localVarFormParams;
3224
- }
3225
- else {
3226
- localVarRequestOptions.form = localVarFormParams;
3227
- }
3228
- }
3229
- return new Promise((resolve, reject) => {
3230
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3231
- if (error) {
3232
- reject(error);
3233
- }
3234
- else {
3235
- body = models_1.ObjectSerializer.deserialize(body, "GetSampleResponse");
3236
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3237
- if (typeof body.success === 'boolean' && !body.success) {
3238
- reject(new Error(body.error || errString));
3239
- }
3240
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3241
- resolve(body);
3242
- }
3243
- else {
3244
- reject(errString);
3245
- }
3246
- }
3247
- });
3248
- });
3249
- });
3250
- }
3251
- /**
3252
- * Get the synthetic sample as a WAV file
3253
- * @summary Get WAV file
3254
- * @param projectId Project ID
3255
- */
3256
- async getWavFile(projectId, options = { headers: {} }) {
3257
- const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/wav'
3258
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3259
- let localVarQueryParameters = {};
3260
- let localVarHeaderParams = Object.assign({
3261
- 'User-Agent': 'edgeimpulse-api nodejs'
3262
- }, this.defaultHeaders);
3263
- const produces = ['audio/wav'];
3264
- // give precedence to 'application/json'
3265
- if (produces.indexOf('application/json') >= 0) {
3266
- localVarHeaderParams.Accept = 'application/json';
3267
- }
3268
- else {
3269
- localVarHeaderParams.Accept = produces.join(',');
3270
- }
3271
- let localVarFormParams = {};
3272
- // verify required parameter 'projectId' is not null or undefined
3273
- if (projectId === null || projectId === undefined) {
3274
- throw new Error('Required parameter projectId was null or undefined when calling getWavFile.');
3275
- }
3276
- Object.assign(localVarHeaderParams, options.headers);
3277
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3278
- let localVarUseFormData = false;
3279
- let localVarRequestOptions = {
3280
- method: 'GET',
3281
- qs: localVarQueryParameters,
3282
- headers: localVarHeaderParams,
3283
- uri: localVarPath,
3284
- useQuerystring: this._useQuerystring,
3285
- agentOptions: { keepAlive: false },
3286
- encoding: null,
3287
- };
3288
- let authenticationPromise = Promise.resolve();
3289
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3290
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3291
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3292
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3293
- return authenticationPromise.then(() => {
3294
- if (Object.keys(localVarFormParams).length) {
3295
- if (localVarUseFormData) {
3296
- localVarRequestOptions.formData = localVarFormParams;
3297
- }
3298
- else {
3299
- localVarRequestOptions.form = localVarFormParams;
3300
- }
3301
- }
3302
- return new Promise((resolve, reject) => {
3303
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3304
- if (error) {
3305
- reject(error);
3306
- }
3307
- else {
3308
- body = models_1.ObjectSerializer.deserialize(body, "Buffer");
3309
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3310
- if (typeof body.success === 'boolean' && !body.success) {
3311
- reject(new Error(body.error || errString));
3312
- }
3313
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3314
- resolve(body);
3315
- }
3316
- else {
3317
- reject(errString);
3318
- }
3319
- }
3320
- });
3321
- });
3322
- });
3323
- }
3324
- /**
3325
- * t-SNE2 output of the raw dataset
3326
- * @summary Check data explorer features
3327
- * @param projectId Project ID
3328
- */
3329
- async hasDataExplorerFeatures(projectId, options = { headers: {} }) {
3330
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/data-explorer/has-features'
3331
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3332
- let localVarQueryParameters = {};
3333
- let localVarHeaderParams = Object.assign({
3334
- 'User-Agent': 'edgeimpulse-api nodejs'
3335
- }, this.defaultHeaders);
3336
- const produces = ['application/json'];
3337
- // give precedence to 'application/json'
3338
- if (produces.indexOf('application/json') >= 0) {
3339
- localVarHeaderParams.Accept = 'application/json';
3340
- }
3341
- else {
3342
- localVarHeaderParams.Accept = produces.join(',');
3343
- }
3344
- let localVarFormParams = {};
3345
- // verify required parameter 'projectId' is not null or undefined
3346
- if (projectId === null || projectId === undefined) {
3347
- throw new Error('Required parameter projectId was null or undefined when calling hasDataExplorerFeatures.');
3348
- }
3349
- Object.assign(localVarHeaderParams, options.headers);
3350
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3351
- let localVarUseFormData = false;
3352
- let localVarRequestOptions = {
3353
- method: 'GET',
3354
- qs: localVarQueryParameters,
3355
- headers: localVarHeaderParams,
3356
- uri: localVarPath,
3357
- useQuerystring: this._useQuerystring,
3358
- agentOptions: { keepAlive: false },
3359
- json: true,
3360
- };
3361
- let authenticationPromise = Promise.resolve();
3362
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3363
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3364
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3365
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3366
- return authenticationPromise.then(() => {
3367
- if (Object.keys(localVarFormParams).length) {
3368
- if (localVarUseFormData) {
3369
- localVarRequestOptions.formData = localVarFormParams;
3370
- }
3371
- else {
3372
- localVarRequestOptions.form = localVarFormParams;
3373
- }
3374
- }
3375
- return new Promise((resolve, reject) => {
3376
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3377
- if (error) {
3378
- reject(error);
3379
- }
3380
- else {
3381
- body = models_1.ObjectSerializer.deserialize(body, "HasDataExplorerFeaturesResponse");
3382
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3383
- if (typeof body.success === 'boolean' && !body.success) {
3384
- reject(new Error(body.error || errString));
3385
- }
3386
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3387
- resolve(body);
3388
- }
3389
- else {
3390
- reject(errString);
3391
- }
3392
- }
3393
- });
3394
- });
3395
- });
3396
- }
3397
- /**
3398
- * Determine if data diversity metrics have been calculated
3399
- * @summary Check if data diversity metrics exist
3400
- * @param projectId Project ID
3401
- */
3402
- async hasDiversityData(projectId, options = { headers: {} }) {
3403
- const localVarPath = this.basePath + '/api/{projectId}/raw-data/data-quality/diversity/exists'
3404
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3405
- let localVarQueryParameters = {};
3406
- let localVarHeaderParams = Object.assign({
3407
- 'User-Agent': 'edgeimpulse-api nodejs'
3408
- }, this.defaultHeaders);
3409
- const produces = ['application/json'];
3410
- // give precedence to 'application/json'
3411
- if (produces.indexOf('application/json') >= 0) {
3412
- localVarHeaderParams.Accept = 'application/json';
3413
- }
3414
- else {
3415
- localVarHeaderParams.Accept = produces.join(',');
3416
- }
3417
- let localVarFormParams = {};
3418
- // verify required parameter 'projectId' is not null or undefined
3419
- if (projectId === null || projectId === undefined) {
3420
- throw new Error('Required parameter projectId was null or undefined when calling hasDiversityData.');
3421
- }
3422
- Object.assign(localVarHeaderParams, options.headers);
3423
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3424
- let localVarUseFormData = false;
3425
- let localVarRequestOptions = {
3426
- method: 'GET',
3427
- qs: localVarQueryParameters,
3428
- headers: localVarHeaderParams,
3429
- uri: localVarPath,
3430
- useQuerystring: this._useQuerystring,
3431
- agentOptions: { keepAlive: false },
3432
- json: true,
3433
- };
3434
- let authenticationPromise = Promise.resolve();
3435
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3436
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3437
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3438
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3439
- return authenticationPromise.then(() => {
3440
- if (Object.keys(localVarFormParams).length) {
3441
- if (localVarUseFormData) {
3442
- localVarRequestOptions.formData = localVarFormParams;
3443
- }
3444
- else {
3445
- localVarRequestOptions.form = localVarFormParams;
3446
- }
3447
- }
3448
- return new Promise((resolve, reject) => {
3449
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3450
- if (error) {
3451
- reject(error);
3452
- }
3453
- else {
3454
- body = models_1.ObjectSerializer.deserialize(body, "HasDataExplorerFeaturesResponse");
3455
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3456
- if (typeof body.success === 'boolean' && !body.success) {
3457
- reject(new Error(body.error || errString));
3458
- }
3459
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3460
- resolve(body);
3461
- }
3462
- else {
3463
- reject(errString);
3464
- }
3465
- }
3466
- });
3467
- });
3468
- });
3469
- }
3470
- /**
3471
- * List all deployment targets
3472
- * @summary Deployment targets
3473
- */
3474
- async listAllDeploymentTargets(options = { headers: {} }) {
3475
- const localVarPath = this.basePath + '/api/deployment/targets';
3476
- let localVarQueryParameters = {};
3477
- let localVarHeaderParams = Object.assign({
3478
- 'User-Agent': 'edgeimpulse-api nodejs'
3479
- }, this.defaultHeaders);
3480
- const produces = ['application/json'];
3481
- // give precedence to 'application/json'
3482
- if (produces.indexOf('application/json') >= 0) {
3483
- localVarHeaderParams.Accept = 'application/json';
3484
- }
3485
- else {
3486
- localVarHeaderParams.Accept = produces.join(',');
3487
- }
3488
- let localVarFormParams = {};
3489
- Object.assign(localVarHeaderParams, options.headers);
3490
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3491
- let localVarUseFormData = false;
3492
- let localVarRequestOptions = {
3493
- method: 'GET',
3494
- qs: localVarQueryParameters,
3495
- headers: localVarHeaderParams,
3496
- uri: localVarPath,
3497
- useQuerystring: this._useQuerystring,
3498
- agentOptions: { keepAlive: false },
3499
- json: true,
3500
- };
3501
- let authenticationPromise = Promise.resolve();
3502
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3503
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3504
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3505
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3506
- return authenticationPromise.then(() => {
3507
- if (Object.keys(localVarFormParams).length) {
3508
- if (localVarUseFormData) {
3509
- localVarRequestOptions.formData = localVarFormParams;
3510
- }
3511
- else {
3512
- localVarRequestOptions.form = localVarFormParams;
3513
- }
3514
- }
3515
- return new Promise((resolve, reject) => {
3516
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3517
- if (error) {
3518
- reject(error);
3519
- }
3520
- else {
3521
- body = models_1.ObjectSerializer.deserialize(body, "DeploymentTargetsResponse");
3522
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3523
- if (typeof body.success === 'boolean' && !body.success) {
3524
- reject(new Error(body.error || errString));
3525
- }
3526
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3527
- resolve(body);
3528
- }
3529
- else {
3530
- reject(errString);
3531
- }
3532
- }
3533
- });
3534
- });
3535
- });
3536
- }
3537
- /**
3538
- * List deployment targets for a project
3539
- * @summary Deployment targets
3540
- * @param projectId Project ID
3541
- */
3542
- async listDeploymentTargetsForProject(projectId, options = { headers: {} }) {
3543
- const localVarPath = this.basePath + '/api/{projectId}/deployment/targets'
3544
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3545
- let localVarQueryParameters = {};
3546
- let localVarHeaderParams = Object.assign({
3547
- 'User-Agent': 'edgeimpulse-api nodejs'
3548
- }, this.defaultHeaders);
3549
- const produces = ['application/json'];
3550
- // give precedence to 'application/json'
3551
- if (produces.indexOf('application/json') >= 0) {
3552
- localVarHeaderParams.Accept = 'application/json';
3553
- }
3554
- else {
3555
- localVarHeaderParams.Accept = produces.join(',');
3556
- }
3557
- let localVarFormParams = {};
3558
- // verify required parameter 'projectId' is not null or undefined
3559
- if (projectId === null || projectId === undefined) {
3560
- throw new Error('Required parameter projectId was null or undefined when calling listDeploymentTargetsForProject.');
3561
- }
3562
- Object.assign(localVarHeaderParams, options.headers);
3563
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3564
- let localVarUseFormData = false;
3565
- let localVarRequestOptions = {
3566
- method: 'GET',
3567
- qs: localVarQueryParameters,
3568
- headers: localVarHeaderParams,
3569
- uri: localVarPath,
3570
- useQuerystring: this._useQuerystring,
3571
- agentOptions: { keepAlive: false },
3572
- json: true,
3573
- };
3574
- let authenticationPromise = Promise.resolve();
3575
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3576
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3577
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3578
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3579
- return authenticationPromise.then(() => {
3580
- if (Object.keys(localVarFormParams).length) {
3581
- if (localVarUseFormData) {
3582
- localVarRequestOptions.formData = localVarFormParams;
3583
- }
3584
- else {
3585
- localVarRequestOptions.form = localVarFormParams;
3586
- }
3587
- }
3588
- return new Promise((resolve, reject) => {
3589
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3590
- if (error) {
3591
- reject(error);
3592
- }
3593
- else {
3594
- body = models_1.ObjectSerializer.deserialize(body, "ProjectDeploymentTargetsResponse");
3595
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3596
- if (typeof body.success === 'boolean' && !body.success) {
3597
- reject(new Error(body.error || errString));
3598
- }
3599
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3600
- resolve(body);
3601
- }
3602
- else {
3603
- reject(errString);
3604
- }
3605
- }
3606
- });
3607
- });
3608
- });
3609
- }
3610
- /**
3611
- * List deployment targets for a project from data sources page (it shows some things like all Linux deploys, and hides \'fake\' deploy targets like mobile phone / computer)
3612
- * @summary Deployment targets (data sources)
3613
- * @param projectId Project ID
3614
- */
3615
- async listDeploymentTargetsForProjectDataSources(projectId, options = { headers: {} }) {
3616
- const localVarPath = this.basePath + '/api/{projectId}/deployment/targets/data-sources'
3617
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3618
- let localVarQueryParameters = {};
3619
- let localVarHeaderParams = Object.assign({
3620
- 'User-Agent': 'edgeimpulse-api nodejs'
3621
- }, this.defaultHeaders);
3622
- const produces = ['application/json'];
3623
- // give precedence to 'application/json'
3624
- if (produces.indexOf('application/json') >= 0) {
3625
- localVarHeaderParams.Accept = 'application/json';
3626
- }
3627
- else {
3628
- localVarHeaderParams.Accept = produces.join(',');
3629
- }
3630
- let localVarFormParams = {};
3631
- // verify required parameter 'projectId' is not null or undefined
3632
- if (projectId === null || projectId === undefined) {
3633
- throw new Error('Required parameter projectId was null or undefined when calling listDeploymentTargetsForProjectDataSources.');
3634
- }
3635
- Object.assign(localVarHeaderParams, options.headers);
3636
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3637
- let localVarUseFormData = false;
3638
- let localVarRequestOptions = {
3639
- method: 'GET',
3640
- qs: localVarQueryParameters,
3641
- headers: localVarHeaderParams,
3642
- uri: localVarPath,
3643
- useQuerystring: this._useQuerystring,
3644
- agentOptions: { keepAlive: false },
3645
- json: true,
3646
- };
3647
- let authenticationPromise = Promise.resolve();
3648
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3649
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3650
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3651
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3652
- return authenticationPromise.then(() => {
3653
- if (Object.keys(localVarFormParams).length) {
3654
- if (localVarUseFormData) {
3655
- localVarRequestOptions.formData = localVarFormParams;
3656
- }
3657
- else {
3658
- localVarRequestOptions.form = localVarFormParams;
3659
- }
3660
- }
3661
- return new Promise((resolve, reject) => {
3662
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3663
- if (error) {
3664
- reject(error);
3665
- }
3666
- else {
3667
- body = models_1.ObjectSerializer.deserialize(body, "DeploymentTargetsResponse");
3668
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3669
- if (typeof body.success === 'boolean' && !body.success) {
3670
- reject(new Error(body.error || errString));
3671
- }
3672
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3673
- resolve(body);
3674
- }
3675
- else {
3676
- reject(errString);
3677
- }
3678
- }
3679
- });
3680
- });
3681
- });
3682
- }
3683
- /**
3684
- * Retrieve all raw data by category.
3685
- * @summary List samples
3686
- * @param projectId Project ID
3687
- * @param category Which of the three acquisition categories to retrieve data from
3688
- * @param limit Maximum number of results
3689
- * @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
3690
- * @param excludeSensors Whether to exclude sensors in the response (as these can slow down requests when you have large pages).
3691
- * @param labels Only include samples with a label within the given list of labels, given as a JSON string
3692
- * @param filename Only include samples whose filename includes the given filename
3693
- * @param maxLength Only include samples shorter than the given length, in milliseconds
3694
- * @param minLength Only include samples longer than the given length, in milliseconds
3695
- * @param minFrequency Only include samples with higher frequency than given frequency, in hertz
3696
- * @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
3697
- * @param signatureValidity Include samples with either valid or invalid signatures
3698
- * @param includeDisabled Include only enabled or disabled samples (or both)
3699
- */
3700
- async listSamples(projectId, queryParams, options = { headers: {} }) {
3701
- const localVarPath = this.basePath + '/api/{projectId}/raw-data'
3702
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3703
- let localVarQueryParameters = {};
3704
- let localVarHeaderParams = Object.assign({
3705
- 'User-Agent': 'edgeimpulse-api nodejs'
3706
- }, this.defaultHeaders);
3707
- const produces = ['application/json'];
3708
- // give precedence to 'application/json'
3709
- if (produces.indexOf('application/json') >= 0) {
3710
- localVarHeaderParams.Accept = 'application/json';
3711
- }
3712
- else {
3713
- localVarHeaderParams.Accept = produces.join(',');
3714
- }
3715
- let localVarFormParams = {};
3716
- // verify required parameter 'projectId' is not null or undefined
3717
- if (projectId === null || projectId === undefined) {
3718
- throw new Error('Required parameter projectId was null or undefined when calling listSamples.');
3719
- }
3720
- // verify required parameter 'category' is not null or undefined
3721
- if (queryParams.category === null || queryParams.category === undefined) {
3722
- throw new Error('Required parameter queryParams.category was null or undefined when calling listSamples.');
3723
- }
3724
- if (queryParams.category !== undefined) {
3725
- localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "'training' | 'testing' | 'anomaly'");
3726
- }
3727
- if (queryParams.limit !== undefined) {
3728
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
3729
- }
3730
- if (queryParams.offset !== undefined) {
3731
- localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
3732
- }
3733
- if (queryParams.excludeSensors !== undefined) {
3734
- localVarQueryParameters['excludeSensors'] = models_1.ObjectSerializer.serialize(queryParams.excludeSensors, "boolean");
3735
- }
3736
- if (queryParams.labels !== undefined) {
3737
- localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
3738
- }
3739
- if (queryParams.filename !== undefined) {
3740
- localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
3741
- }
3742
- if (queryParams.maxLength !== undefined) {
3743
- localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
3744
- }
3745
- if (queryParams.minLength !== undefined) {
3746
- localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
3747
- }
3748
- if (queryParams.minFrequency !== undefined) {
3749
- localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
3750
- }
3751
- if (queryParams.maxFrequency !== undefined) {
3752
- localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
3753
- }
3754
- if (queryParams.signatureValidity !== undefined) {
3755
- localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
3756
- }
3757
- if (queryParams.includeDisabled !== undefined) {
3758
- localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
3759
- }
3760
- Object.assign(localVarHeaderParams, options.headers);
3761
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3762
- let localVarUseFormData = false;
3763
- let localVarRequestOptions = {
3764
- method: 'GET',
3765
- qs: localVarQueryParameters,
3766
- headers: localVarHeaderParams,
3767
- uri: localVarPath,
3768
- useQuerystring: this._useQuerystring,
3769
- agentOptions: { keepAlive: false },
3770
- json: true,
3771
- };
3772
- let authenticationPromise = Promise.resolve();
3773
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3774
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3775
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3776
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3777
- return authenticationPromise.then(() => {
3778
- if (Object.keys(localVarFormParams).length) {
3779
- if (localVarUseFormData) {
3780
- localVarRequestOptions.formData = localVarFormParams;
3781
- }
3782
- else {
3783
- localVarRequestOptions.form = localVarFormParams;
3784
- }
3785
- }
3786
- return new Promise((resolve, reject) => {
3787
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3788
- if (error) {
3789
- reject(error);
3790
- }
3791
- else {
3792
- body = models_1.ObjectSerializer.deserialize(body, "ListSamplesResponse");
3793
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3794
- if (typeof body.success === 'boolean' && !body.success) {
3795
- reject(new Error(body.error || errString));
3796
- }
3797
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3798
- resolve(body);
3799
- }
3800
- else {
3801
- reject(errString);
3802
- }
3803
- }
3804
- });
3805
- });
3806
- });
3807
- }
3808
- /**
3809
- * Get slice of sample data, and run it through the DSP block. This only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.
3810
- * @summary Get processed sample (slice)
3811
- * @param projectId Project ID
3812
- * @param dspId DSP Block ID, use the impulse functions to retrieve the ID
3813
- * @param sampleId Sample ID
3814
- * @param sliceStart Begin index of the slice
3815
- * @param sliceEnd End index of the slice
3816
- */
3817
- async runDspSampleSliceReadOnly(projectId, dspId, sampleId, queryParams, options = { headers: {} }) {
3818
- const localVarPath = this.basePath + '/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run/readonly'
3819
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
3820
- .replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
3821
- .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
3822
- let localVarQueryParameters = {};
3823
- let localVarHeaderParams = Object.assign({
3824
- 'User-Agent': 'edgeimpulse-api nodejs'
3825
- }, this.defaultHeaders);
3826
- const produces = ['application/json'];
3827
- // give precedence to 'application/json'
3828
- if (produces.indexOf('application/json') >= 0) {
3829
- localVarHeaderParams.Accept = 'application/json';
3830
- }
3831
- else {
3832
- localVarHeaderParams.Accept = produces.join(',');
3833
- }
3834
- let localVarFormParams = {};
3835
- // verify required parameter 'projectId' is not null or undefined
3836
- if (projectId === null || projectId === undefined) {
3837
- throw new Error('Required parameter projectId was null or undefined when calling runDspSampleSliceReadOnly.');
3838
- }
3839
- // verify required parameter 'dspId' is not null or undefined
3840
- if (dspId === null || dspId === undefined) {
3841
- throw new Error('Required parameter dspId was null or undefined when calling runDspSampleSliceReadOnly.');
3842
- }
3843
- // verify required parameter 'sampleId' is not null or undefined
3844
- if (sampleId === null || sampleId === undefined) {
3845
- throw new Error('Required parameter sampleId was null or undefined when calling runDspSampleSliceReadOnly.');
3846
- }
3847
- // verify required parameter 'sliceStart' is not null or undefined
3848
- if (queryParams.sliceStart === null || queryParams.sliceStart === undefined) {
3849
- throw new Error('Required parameter queryParams.sliceStart was null or undefined when calling runDspSampleSliceReadOnly.');
3850
- }
3851
- // verify required parameter 'sliceEnd' is not null or undefined
3852
- if (queryParams.sliceEnd === null || queryParams.sliceEnd === undefined) {
3853
- throw new Error('Required parameter queryParams.sliceEnd was null or undefined when calling runDspSampleSliceReadOnly.');
3854
- }
3855
- if (queryParams.sliceStart !== undefined) {
3856
- localVarQueryParameters['sliceStart'] = models_1.ObjectSerializer.serialize(queryParams.sliceStart, "number");
3857
- }
3858
- if (queryParams.sliceEnd !== undefined) {
3859
- localVarQueryParameters['sliceEnd'] = models_1.ObjectSerializer.serialize(queryParams.sliceEnd, "number");
3860
- }
3861
- Object.assign(localVarHeaderParams, options.headers);
3862
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3863
- let localVarUseFormData = false;
3864
- let localVarRequestOptions = {
3865
- method: 'GET',
3866
- qs: localVarQueryParameters,
3867
- headers: localVarHeaderParams,
3868
- uri: localVarPath,
3869
- useQuerystring: this._useQuerystring,
3870
- agentOptions: { keepAlive: false },
3871
- json: true,
3872
- };
3873
- let authenticationPromise = Promise.resolve();
3874
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3875
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3876
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3877
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3878
- return authenticationPromise.then(() => {
3879
- if (Object.keys(localVarFormParams).length) {
3880
- if (localVarUseFormData) {
3881
- localVarRequestOptions.formData = localVarFormParams;
3882
- }
3883
- else {
3884
- localVarRequestOptions.form = localVarFormParams;
3885
- }
3886
- }
3887
- return new Promise((resolve, reject) => {
3888
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3889
- if (error) {
3890
- reject(error);
3891
- }
3892
- else {
3893
- body = models_1.ObjectSerializer.deserialize(body, "DspRunResponseWithSample");
3894
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3895
- if (typeof body.success === 'boolean' && !body.success) {
3896
- reject(new Error(body.error || errString));
3897
- }
3898
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3899
- resolve(body);
3900
- }
3901
- else {
3902
- reject(errString);
3903
- }
3904
- }
3905
- });
3906
- });
3907
- });
3908
- }
3909
- /**
3910
- * Test out a pretrained model (using raw features) - upload first via `uploadPretrainedModel`. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
3911
- * @summary Test pretrained model
3912
- * @param projectId Project ID
3913
- * @param testPretrainedModelRequest
3914
- */
3915
- async testPretrainedModel(projectId, testPretrainedModelRequest, options = { headers: {} }) {
3916
- const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/test'
3917
- .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
3918
- let localVarQueryParameters = {};
3919
- let localVarHeaderParams = Object.assign({
3920
- 'User-Agent': 'edgeimpulse-api nodejs'
3921
- }, this.defaultHeaders);
3922
- const produces = ['application/json'];
3923
- // give precedence to 'application/json'
3924
- if (produces.indexOf('application/json') >= 0) {
3925
- localVarHeaderParams.Accept = 'application/json';
3926
- }
3927
- else {
3928
- localVarHeaderParams.Accept = produces.join(',');
3929
- }
3930
- let localVarFormParams = {};
3931
- // verify required parameter 'projectId' is not null or undefined
3932
- if (projectId === null || projectId === undefined) {
3933
- throw new Error('Required parameter projectId was null or undefined when calling testPretrainedModel.');
3934
- }
3935
- Object.assign(localVarHeaderParams, options.headers);
3936
- Object.assign(localVarHeaderParams, this.opts.extraHeaders);
3937
- let localVarUseFormData = false;
3938
- let localVarRequestOptions = {
3939
- method: 'POST',
3940
- qs: localVarQueryParameters,
3941
- headers: localVarHeaderParams,
3942
- uri: localVarPath,
3943
- useQuerystring: this._useQuerystring,
3944
- agentOptions: { keepAlive: false },
3945
- json: true,
3946
- body: models_1.ObjectSerializer.serialize(testPretrainedModelRequest, "TestPretrainedModelRequest")
3947
- };
3948
- let authenticationPromise = Promise.resolve();
3949
- authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
3950
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
3951
- authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
3952
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
3953
- return authenticationPromise.then(() => {
3954
- if (Object.keys(localVarFormParams).length) {
3955
- if (localVarUseFormData) {
3956
- localVarRequestOptions.formData = localVarFormParams;
3957
- }
3958
- else {
3959
- localVarRequestOptions.form = localVarFormParams;
3960
- }
3961
- }
3962
- return new Promise((resolve, reject) => {
3963
- localVarRequest(localVarRequestOptions, (error, response, body) => {
3964
- if (error) {
3965
- reject(error);
3966
- }
3967
- else {
3968
- body = models_1.ObjectSerializer.deserialize(body, "TestPretrainedModelResponse");
3969
- const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
3970
- if (typeof body.success === 'boolean' && !body.success) {
3971
- reject(new Error(body.error || errString));
3972
- }
3973
- else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
3974
- resolve(body);
3975
- }
3976
- else {
3977
- reject(errString);
3978
- }
3979
- }
3980
- });
3981
- });
3982
- });
3983
- }
3984
- }
3985
- exports.AllowsReadOnlyApi = AllowsReadOnlyApi;
3986
- //# sourceMappingURL=allowsReadOnlyApi.js.map