@lucidtech/las-sdk-core
Advanced tools
Comparing version 7.0.0 to 7.1.0
/// <reference types="node" /> | ||
import { Buffer } from 'buffer'; | ||
import { TrainingList } from '.'; | ||
import { Credentials } from './credentials'; | ||
import { AppClient, AppClientList, Asset, AssetList, ContentType, CreateAppClientOptions, CreateDataBundleOptions, CreateDatasetOptions, CreateDocumentOptions, CreateModelOptions, CreatePredictionsOptions, CreateSecretOptions, CreateTransitionOptions, CreateUserOptions, CreateWorkflowOptions, DataBundle, DataBundleList, Dataset, DatasetList, DeleteDocumentOptions, FieldConfig, LasDocument, LasDocumentList, LasDocumentWithoutContent, ListAppClientsOptions, ListAssetsOptions, ListDataBundleOptions, ListDatasetsOptions, ListDocumentsOptions, ListModelsOptions, ListPredictionsOptions, ListSecretsOptions, ListTransitionOptions, ListUsersOptions, ListWorkflowExecutionsOptions, ListWorkflowOptions, Log, Model, ModelList, Organization, PredictionList, PredictionResponse, Secret, SecretList, Transition, TransitionExecution, TransitionExecutionList, TransitionExecutionListOptions, TransitionList, TransitionType, UpdateAppClientOptions, UpdateAssetOptions, UpdateDataBundleOptions, UpdateDatasetOptions, UpdateDocumentOptions, UpdateModelOptions, UpdateOrganizationOptions, UpdateSecretOptions, UpdateTransitionExecution, UpdateTransitionOptions, UpdateUserOptions, UpdateWorkflowExecutionOptions, UpdateWorkflowOptions, User, UserList, Workflow, WorkflowExecution, WorkflowExecutionList, WorkflowList, WorkflowSpecification } from './types'; | ||
import type { AppClient, AppClientList, Asset, AssetList, ContentType, CreateAppClientOptions, CreateAssetOptions, CreateDataBundleOptions, CreateDatasetOptions, CreateDocumentOptions, CreateModelOptions, CreatePredictionsOptions, CreateSecretOptions, CreateTrainingOption, CreateTransitionOptions, CreateUserOptions, CreateWorkflowOptions, DataBundle, DataBundleList, Dataset, DatasetList, DeleteAppClientOptions, DeleteAssetOptions, DeleteDataBundleOptions, DeleteDatasetOptions, DeleteDocumentOptions, DeleteDocumentsOptions, DeleteModelOptions, DeleteTransitionOptions, DeleteUserOptions, DeleteWorkflowExecution, DeleteWorkflowOptions, ExecuteTransitionOptions, ExecuteWorkflowOptions, FieldConfig, GetAssetOptions, GetDatasetOptions, GetDocumentOptions, GetLogOptions, GetModelOptions, GetOrganizationOptions, GetTransitionExecutionOptions, GetTransitionOptions, GetUserOptions, GetWorkflowExecutionOptions, GetWorkflowOptions, LasDocument, LasDocumentList, LasDocumentWithoutContent, ListAppClientsOptions, ListAssetsOptions, ListDataBundleOptions, ListDatasetsOptions, ListDocumentsOptions, ListModelsOptions, ListPlansOptions, ListPredictionsOptions, ListSecretsOptions, ListTrainingsOptions, ListTransitionOptions, ListUsersOptions, ListWorkflowExecutionsOptions, ListWorkflowOptions, Log, Model, ModelList, Organization, Plan, PlanList, PostHeartbeatOptions, PredictionList, PredictionResponse, Secret, SecretList, Training, Transition, TransitionExecution, TransitionExecutionList, TransitionExecutionListOptions, TransitionList, TransitionType, UpdateAppClientOptions, UpdateAssetOptions, UpdateDataBundleOptions, UpdateDatasetOptions, UpdateDocumentOptions, UpdateModelOptions, UpdateOrganizationOptions, UpdateSecretOptions, UpdateTrainingOptions, UpdateTransitionExecution, UpdateTransitionOptions, UpdateUserOptions, UpdateWorkflowExecutionOptions, UpdateWorkflowOptions, User, UserList, Workflow, WorkflowExecution, WorkflowExecutionList, WorkflowList, WorkflowSpecification } from './types'; | ||
/** | ||
@@ -25,3 +27,3 @@ * A high-level http client for communicating with the Lucidtech REST API | ||
*/ | ||
getOrganization(organizationId: string): Promise<Organization>; | ||
getOrganization(organizationId: string, options?: GetOrganizationOptions): Promise<Organization>; | ||
/** | ||
@@ -61,3 +63,3 @@ * Creates an app client, calls the POST /appClients endpoint. | ||
*/ | ||
deleteAppClient(appClientId: string): Promise<AppClient>; | ||
deleteAppClient(appClientId: string, options?: DeleteAppClientOptions): Promise<AppClient>; | ||
/** | ||
@@ -79,3 +81,3 @@ * Creates a document, calls the POST /documents endpoint. | ||
*/ | ||
getDocument(documentId: string): Promise<LasDocument>; | ||
getDocument(documentId: string, options?: GetDocumentOptions): Promise<LasDocument>; | ||
/** | ||
@@ -107,3 +109,3 @@ * List documents available for inference, calls the GET /documents endpoint. | ||
*/ | ||
deleteDocuments(options?: DeleteDocumentOptions): Promise<LasDocumentList>; | ||
deleteDocuments(options?: DeleteDocumentsOptions): Promise<LasDocumentList>; | ||
/** | ||
@@ -115,3 +117,3 @@ * Delete an document, calls the DELETE /documents/{documentId} endpoint. | ||
*/ | ||
deleteDocument(documentId: string): Promise<LasDocument>; | ||
deleteDocument(documentId: string, options?: DeleteDocumentOptions): Promise<LasDocument>; | ||
/** | ||
@@ -135,3 +137,3 @@ * Creates a transition, calls the POST /transitions endpoint. | ||
*/ | ||
getTransition(transitionId: string): Promise<Transition>; | ||
getTransition(transitionId: string, options?: GetTransitionOptions): Promise<Transition>; | ||
/** | ||
@@ -161,3 +163,3 @@ * List transitions, calls the GET /transitions endpoint. | ||
*/ | ||
deleteTransition(transitionId: string): Promise<Transition>; | ||
deleteTransition(transitionId: string, options?: DeleteTransitionOptions): Promise<Transition>; | ||
/** | ||
@@ -169,3 +171,3 @@ * Start executing a manual transition, calls the POST /transitions/{transitionId}/executions endpoint. | ||
*/ | ||
executeTransition(transitionId: string): Promise<TransitionExecution>; | ||
executeTransition(transitionId: string, options?: ExecuteTransitionOptions): Promise<TransitionExecution>; | ||
/** | ||
@@ -178,3 +180,3 @@ * Get an execution of a transition, calls the GET /transitions/{transitionId}/executions/{executionId} endpoint | ||
*/ | ||
getTransitionExecution(transitionId: string, transitionExecutionId: string): Promise<TransitionExecution>; | ||
getTransitionExecution(transitionId: string, transitionExecutionId: string, options?: GetTransitionExecutionOptions): Promise<TransitionExecution>; | ||
/** | ||
@@ -213,3 +215,3 @@ * Ends the processing of the transition execution, calls the | ||
*/ | ||
sendHeartbeat(transitionId: string, transitionExecutionId: string): Promise<unknown>; | ||
sendHeartbeat(transitionId: string, transitionExecutionId: string, options?: PostHeartbeatOptions): Promise<unknown>; | ||
/** | ||
@@ -231,3 +233,3 @@ * Creates a new workflow, calls the POST /workflows endpoint. | ||
*/ | ||
getWorkflow(workflowId: string): Promise<Workflow>; | ||
getWorkflow(workflowId: string, options?: GetWorkflowOptions): Promise<Workflow>; | ||
/** | ||
@@ -247,3 +249,3 @@ * List workflows, calls the GET /workflows endpoint. | ||
*/ | ||
deleteWorkflow(workflowId: string): Promise<Workflow>; | ||
deleteWorkflow(workflowId: string, options?: DeleteWorkflowOptions): Promise<Workflow>; | ||
/** | ||
@@ -263,3 +265,3 @@ * Updates a workflow, calls the PATCH /workflows/{workflowId} endpoint. | ||
*/ | ||
executeWorkflow(workflowId: string, input: object): Promise<WorkflowExecution>; | ||
executeWorkflow(workflowId: string, input: object, options?: ExecuteWorkflowOptions): Promise<WorkflowExecution>; | ||
/** | ||
@@ -284,3 +286,3 @@ * List executions in a workflow, calls the GET /workflows/{workflowId}/executions endpoint. | ||
*/ | ||
getWorkflowExecution(workflowId: string, executionId: string): Promise<WorkflowExecution>; | ||
getWorkflowExecution(workflowId: string, executionId: string, options?: GetWorkflowExecutionOptions): Promise<WorkflowExecution>; | ||
/** | ||
@@ -305,3 +307,3 @@ * Retry or end the processing of a workflow execution, | ||
*/ | ||
deleteWorkflowExecution(workflowId: string, executionId: string): Promise<WorkflowExecution>; | ||
deleteWorkflowExecution(workflowId: string, executionId: string, options?: DeleteWorkflowExecution): Promise<WorkflowExecution>; | ||
/** | ||
@@ -327,3 +329,3 @@ * Create a prediction on a document using specified model, calls the POST /predictions endpoint. | ||
*/ | ||
createAsset(content: string): Promise<Asset>; | ||
createAsset(content: string, options?: CreateAssetOptions): Promise<Asset>; | ||
/** | ||
@@ -335,3 +337,3 @@ * Delete an asset, calls the DELETE /assets/{assetId} endpoint. | ||
*/ | ||
deleteAsset(assetId: string): Promise<Asset>; | ||
deleteAsset(assetId: string, options?: DeleteAssetOptions): Promise<Asset>; | ||
/** | ||
@@ -351,3 +353,3 @@ * List assets available, calls the GET /assets endpoint. | ||
*/ | ||
getAsset(assetId: string): Promise<Asset>; | ||
getAsset(assetId: string, options?: GetAssetOptions): Promise<Asset>; | ||
/** | ||
@@ -367,3 +369,3 @@ * Updates an asset, calls the PATCH /assets/{assetId} endpoint. | ||
*/ | ||
getDataset(datasetId: string): Promise<Dataset>; | ||
getDataset(datasetId: string, options?: GetDatasetOptions): Promise<Dataset>; | ||
/** | ||
@@ -402,3 +404,3 @@ * Creates a dataset, calls the POST /datasets endpoint. | ||
*/ | ||
deleteDataset(datasetId: string, deleteDocuments?: boolean): Promise<Dataset>; | ||
deleteDataset(datasetId: string, deleteDocuments?: boolean, options?: DeleteDatasetOptions): Promise<Dataset>; | ||
/** | ||
@@ -421,3 +423,3 @@ * Creates a dataBundle, calls the POST /models/{modelId}/dataBundles endpoint. | ||
*/ | ||
deleteDataBundle(modelId: string, dataBundleId: string): Promise<DataBundle>; | ||
deleteDataBundle(modelId: string, dataBundleId: string, options?: DeleteDataBundleOptions): Promise<DataBundle>; | ||
/** | ||
@@ -467,3 +469,3 @@ * List dataBundles available, calls the GET /dataBundles endpoint. | ||
*/ | ||
getUser(userId: string): Promise<User>; | ||
getUser(userId: string, options?: GetUserOptions): Promise<User>; | ||
/** | ||
@@ -484,3 +486,3 @@ * Updates a user, calls the PATCH /users/{userId} endpoint. | ||
*/ | ||
deleteUser(userId: string): Promise<User>; | ||
deleteUser(userId: string, options?: DeleteUserOptions): Promise<User>; | ||
/** | ||
@@ -520,3 +522,3 @@ * Creates a secret, calls the POST /secrets endpoint. | ||
*/ | ||
getModel(modelId: string): Promise<Model>; | ||
getModel(modelId: string, options?: GetModelOptions): Promise<Model>; | ||
/** | ||
@@ -539,6 +541,6 @@ * Updates a model, calls the PATCH /models/{modelId} endpoint. | ||
* | ||
* @param modelId of the app client | ||
* @param modelId Id of the model | ||
* @returns Model response from REST API | ||
*/ | ||
deleteModel(modelId: string): Promise<Model>; | ||
deleteModel(modelId: string, options?: DeleteModelOptions): Promise<Model>; | ||
/** | ||
@@ -553,2 +555,50 @@ * List models available, calls the GET /models endpoint. | ||
/** | ||
* List trainings available, calls the GET /models/{modelId}/trainings endpoint. | ||
* | ||
* @param modelId Id of the model | ||
* @param options.maxResults Maximum number of results to be returned | ||
* @param options.nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
* @param options.status List Trainings with the specified TrainingStatus, or array of TrainingStatus | ||
* @returns Trainings response from the REST API | ||
*/ | ||
listTrainings(modelId: string, options?: ListTrainingsOptions): Promise<TrainingList>; | ||
/** | ||
* Requests a training, calls the POST /models/{modelId}/trainings endpoint. | ||
* | ||
* @param modelId Id of the model | ||
* @param options.dataBundleIds DataBundle ids that will be used for training | ||
* @param options.instanceType The type of instance that will be used for training | ||
* @param options.name Name of the training | ||
* @param options.description Description of the training | ||
* @returns Training response from the REST API | ||
*/ | ||
createTraining(modelId: string, options: CreateTrainingOption): Promise<Training>; | ||
/** | ||
* Update a training, calls the PATCH /models/{modelId}/trainings/{trainingId} endpoint. | ||
* | ||
* @param modelId Id of the model | ||
* @param trainingId Id of the training | ||
* @param options.name New name of the training | ||
* @param options.description New description of the training | ||
* @param options.status Cancel the training with status = 'cancelled' | ||
* @returns | ||
*/ | ||
updateTraining(modelId: string, trainingId: string, options: UpdateTrainingOptions): Promise<Training>; | ||
/** | ||
* List plans available, calls the GET /plans endpoint. | ||
* | ||
* @param options.owner Organizations to retrieve plans from | ||
* @param options.maxResults Maximum number of results to be returned | ||
* @param options.nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
* @returns Plans response from the REST API | ||
*/ | ||
listPlans(options?: ListPlansOptions): Promise<PlanList>; | ||
/** | ||
* Get information about a specific plan, calls the GET /plans/{plan_id} endpoint. | ||
* | ||
* @param planId Id of the plan | ||
* @returns Plan response from the REST API | ||
*/ | ||
getPlan(planId: string): Promise<Plan>; | ||
/** | ||
* Get log, calls the GET /logs/{logId} endpoint. | ||
@@ -559,3 +609,3 @@ * | ||
*/ | ||
getLog(logId: string): Promise<Log>; | ||
getLog(logId: string, options?: GetLogOptions): Promise<Log>; | ||
/** | ||
@@ -570,9 +620,10 @@ * Updates a secret, calls the PATCH /secrets/{secretId} endpoint. | ||
updateSecret(secretId: string, data: UpdateSecretOptions): Promise<Secret>; | ||
makeGetRequest<T>(path: string, query?: any): Promise<T>; | ||
makeDeleteRequest<T>(path: string, query?: any): Promise<T>; | ||
makePostRequest<T>(path: string, body: any): Promise<T>; | ||
makePatchRequest<T>(path: string, body: any): Promise<T>; | ||
makeGetRequest<T>(path: string, options?: any): Promise<T>; | ||
makeDeleteRequest<T>(path: string, options?: any): Promise<T>; | ||
makePostRequest<T>(path: string, options: any): Promise<T>; | ||
makePatchRequest<T>(path: string, options: any): Promise<T>; | ||
private makeAuthorizedRequest; | ||
private makeAuthorizedBodyRequest; | ||
private getAuthorizationHeaders; | ||
} | ||
export default Client; |
1043
lib/client.js
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -22,42 +11,23 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Client = void 0; | ||
var axios_1 = __importDefault(require("axios")); | ||
var buffer_1 = require("buffer"); | ||
var utils_1 = require("./utils"); | ||
const axios_1 = require("axios"); | ||
const buffer_1 = require("buffer"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
* A high-level http client for communicating with the Lucidtech REST API | ||
*/ | ||
var Client = /** @class */ (function () { | ||
function Client(credentials) { | ||
class Client { | ||
constructor(credentials) { | ||
this.credentials = credentials; | ||
@@ -73,9 +43,7 @@ } | ||
*/ | ||
Client.prototype.updateOrganization = function (organizationId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/organizations/" + organizationId, options)]; | ||
}); | ||
updateOrganization(organizationId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/organizations/${organizationId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -87,9 +55,7 @@ * Get organization from the REST API, calls the GET /organizations/{organizationId} endpoint. | ||
*/ | ||
Client.prototype.getOrganization = function (organizationId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/organizations/" + organizationId)]; | ||
}); | ||
getOrganization(organizationId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/organizations/${organizationId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -105,9 +71,7 @@ * Creates an app client, calls the POST /appClients endpoint. | ||
*/ | ||
Client.prototype.createAppClient = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostRequest('/appClients', options)]; | ||
}); | ||
createAppClient(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePostRequest('/appClients', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -121,9 +85,7 @@ * Updates an appClient, calls the PATCH /appClients/{appClientId} endpoint. | ||
*/ | ||
Client.prototype.updateAppClient = function (appClientId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/appClients/" + appClientId, options)]; | ||
}); | ||
updateAppClient(appClientId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/appClients/${appClientId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -136,9 +98,7 @@ * List app clients, calls the GET /appClients endpoint. | ||
*/ | ||
Client.prototype.listAppClients = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/appClients', options)]; | ||
}); | ||
listAppClients(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/appClients', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -150,9 +110,7 @@ * Delete the app client, calls the DELETE /appClients/{appClientId} endpoint. | ||
*/ | ||
Client.prototype.deleteAppClient = function (appClientId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/appClients/" + appClientId)]; | ||
}); | ||
deleteAppClient(appClientId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/appClients/${appClientId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -167,18 +125,15 @@ * Creates a document, calls the POST /documents endpoint. | ||
*/ | ||
Client.prototype.createDocument = function (content, contentType, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var encodedContent, body; | ||
return __generator(this, function (_a) { | ||
encodedContent = typeof content === 'string' ? content : buffer_1.Buffer.from(content).toString('base64'); | ||
body = { | ||
content: encodedContent, | ||
contentType: contentType, | ||
}; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/documents', body)]; | ||
}); | ||
createDocument(content, contentType, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const encodedContent = typeof content === 'string' ? content : buffer_1.Buffer.from(content).toString('base64'); | ||
let body = { | ||
content: encodedContent, | ||
contentType, | ||
}; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest('/documents', body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -190,9 +145,7 @@ * Get document from the REST API, calls the GET /documents/{documentId} endpoint. | ||
*/ | ||
Client.prototype.getDocument = function (documentId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/documents/" + documentId)]; | ||
}); | ||
getDocument(documentId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/documents/${documentId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -206,9 +159,7 @@ * List documents available for inference, calls the GET /documents endpoint. | ||
*/ | ||
Client.prototype.listDocuments = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/documents', options)]; | ||
}); | ||
listDocuments(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/documents', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -223,9 +174,7 @@ * Post ground truth to the REST API, calls the PATCH /documents/{documentId} endpoint. | ||
*/ | ||
Client.prototype.updateDocument = function (documentId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/documents/" + documentId, data)]; | ||
}); | ||
updateDocument(documentId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/documents/${documentId}`, data); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -238,9 +187,7 @@ * Delete documents with the provided consentId, calls the DELETE /documents endpoint. | ||
*/ | ||
Client.prototype.deleteDocuments = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest('/documents', options)]; | ||
}); | ||
deleteDocuments(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest('/documents', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -252,9 +199,7 @@ * Delete an document, calls the DELETE /documents/{documentId} endpoint. | ||
*/ | ||
Client.prototype.deleteDocument = function (documentId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/documents/" + documentId)]; | ||
}); | ||
deleteDocument(documentId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/documents/${documentId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -271,16 +216,13 @@ * Creates a transition, calls the POST /transitions endpoint. | ||
*/ | ||
Client.prototype.createTransition = function (transitionType, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { | ||
transitionType: transitionType, | ||
}; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/transitions', body)]; | ||
}); | ||
createTransition(transitionType, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { | ||
transitionType, | ||
}; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest('/transitions', body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -292,9 +234,7 @@ * Get the transition with the provided transitionId, calls the GET /transitions/{transitionId} endpoint. | ||
*/ | ||
Client.prototype.getTransition = function (transitionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/transitions/" + transitionId)]; | ||
}); | ||
getTransition(transitionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/transitions/${transitionId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -308,9 +248,7 @@ * List transitions, calls the GET /transitions endpoint. | ||
*/ | ||
Client.prototype.listTransitions = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/transitions', options)]; | ||
}); | ||
listTransitions(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/transitions', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -323,9 +261,7 @@ * Updates a transition, calls the PATCH /transitions/{transitionId} endpoint. | ||
*/ | ||
Client.prototype.updateTransition = function (transitionId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/transitions/" + transitionId, data)]; | ||
}); | ||
updateTransition(transitionId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/transitions/${transitionId}`, data); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -338,9 +274,7 @@ * Delete the transition with the provided transitionId, calls the DELETE /transitions/{transitionId} endpoint. | ||
*/ | ||
Client.prototype.deleteTransition = function (transitionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/transitions/" + transitionId)]; | ||
}); | ||
deleteTransition(transitionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/transitions/${transitionId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -352,9 +286,7 @@ * Start executing a manual transition, calls the POST /transitions/{transitionId}/executions endpoint. | ||
*/ | ||
Client.prototype.executeTransition = function (transitionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostRequest("/transitions/" + transitionId + "/executions", {})]; | ||
}); | ||
executeTransition(transitionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePostRequest(`/transitions/${transitionId}/executions`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -367,9 +299,7 @@ * Get an execution of a transition, calls the GET /transitions/{transitionId}/executions/{executionId} endpoint | ||
*/ | ||
Client.prototype.getTransitionExecution = function (transitionId, transitionExecutionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/transitions/" + transitionId + "/executions/" + transitionExecutionId)]; | ||
}); | ||
getTransitionExecution(transitionId, transitionExecutionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/transitions/${transitionId}/executions/${transitionExecutionId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -387,9 +317,7 @@ * Ends the processing of the transition execution, calls the | ||
*/ | ||
Client.prototype.updateTransitionExecution = function (transitionId, executionId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/transitions/" + transitionId + "/executions/" + executionId, data)]; | ||
}); | ||
updateTransitionExecution(transitionId, executionId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/transitions/${transitionId}/executions/${executionId}`, data); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -405,9 +333,7 @@ * List executions in a transition, calls the GET /transitions/{transitionId}/executions endpoint. | ||
*/ | ||
Client.prototype.listTransitionExecutions = function (transitionId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/transitions/" + transitionId + "/executions", options)]; | ||
}); | ||
listTransitionExecutions(transitionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/transitions/${transitionId}/executions`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -422,9 +348,7 @@ * Send heartbeat for a manual execution to signal that we are still working on it. | ||
*/ | ||
Client.prototype.sendHeartbeat = function (transitionId, transitionExecutionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostRequest("/transitions/" + transitionId + "/executions/" + transitionExecutionId + "/heartbeats", {})]; | ||
}); | ||
sendHeartbeat(transitionId, transitionExecutionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePostRequest(`/transitions/${transitionId}/executions/${transitionExecutionId}/heartbeats`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -439,17 +363,14 @@ * Creates a new workflow, calls the POST /workflows endpoint. | ||
*/ | ||
Client.prototype.createWorkflow = function (name, specification, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { | ||
name: name, | ||
specification: specification, | ||
}; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/workflows', body)]; | ||
}); | ||
createWorkflow(name, specification, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { | ||
name, | ||
specification, | ||
}; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest('/workflows', body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -461,9 +382,7 @@ * Get the workflow with the provided workflowId, calls the GET /workflows/{workflowId} endpoint. | ||
*/ | ||
Client.prototype.getWorkflow = function (workflowId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/workflows/" + workflowId)]; | ||
}); | ||
getWorkflow(workflowId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/workflows/${workflowId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -476,9 +395,7 @@ * List workflows, calls the GET /workflows endpoint. | ||
*/ | ||
Client.prototype.listWorkflows = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/workflows', options)]; | ||
}); | ||
listWorkflows(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/workflows', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -490,9 +407,7 @@ * Delete the workflow with the provided workflowId, calls the DELETE /workflows/{workflowId} endpoint. | ||
*/ | ||
Client.prototype.deleteWorkflow = function (workflowId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/workflows/" + workflowId)]; | ||
}); | ||
deleteWorkflow(workflowId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/workflows/${workflowId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -504,9 +419,7 @@ * Updates a workflow, calls the PATCH /workflows/{workflowId} endpoint. | ||
*/ | ||
Client.prototype.updateWorkflow = function (workflowId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/workflows/" + workflowId, data)]; | ||
}); | ||
updateWorkflow(workflowId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/workflows/${workflowId}`, data); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -519,13 +432,8 @@ * Start a workflow execution, calls the POST /workflows/{workflowId}/executions endpoint. | ||
*/ | ||
Client.prototype.executeWorkflow = function (workflowId, input) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { | ||
input: input, | ||
}; | ||
return [2 /*return*/, this.makePostRequest("/workflows/" + workflowId + "/executions", body)]; | ||
}); | ||
executeWorkflow(workflowId, input, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const body = Object.assign({ input }, options); | ||
return this.makePostRequest(`/workflows/${workflowId}/executions`, body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -542,9 +450,7 @@ * List executions in a workflow, calls the GET /workflows/{workflowId}/executions endpoint. | ||
*/ | ||
Client.prototype.listWorkflowExecutions = function (workflowId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/workflows/" + workflowId + "/executions", options)]; | ||
}); | ||
listWorkflowExecutions(workflowId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/workflows/${workflowId}/executions`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -557,9 +463,7 @@ * Get a workflow execution, calls the GET /workflows/{workflowId}/executions/{executionId} endpoint. | ||
*/ | ||
Client.prototype.getWorkflowExecution = function (workflowId, executionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/workflows/" + workflowId + "/executions/" + executionId)]; | ||
}); | ||
getWorkflowExecution(workflowId, executionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/workflows/${workflowId}/executions/${executionId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -575,9 +479,7 @@ * Retry or end the processing of a workflow execution, | ||
*/ | ||
Client.prototype.updateWorkflowExecution = function (workflowId, executionId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/workflows/" + workflowId + "/executions/" + executionId, data)]; | ||
}); | ||
updateWorkflowExecution(workflowId, executionId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/workflows/${workflowId}/executions/${executionId}`, data); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -591,9 +493,7 @@ * Deletes the execution with the provided executionId from workflowId, | ||
*/ | ||
Client.prototype.deleteWorkflowExecution = function (workflowId, executionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/workflows/" + workflowId + "/executions/" + executionId)]; | ||
}); | ||
deleteWorkflowExecution(workflowId, executionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/workflows/${workflowId}/executions/${executionId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -611,24 +511,19 @@ * Create a prediction on a document using specified model, calls the POST /predictions endpoint. | ||
*/ | ||
Client.prototype.createPrediction = function (documentId, modelId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { | ||
documentId: documentId, | ||
modelId: modelId, | ||
}; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/predictions', body)]; | ||
}); | ||
createPrediction(documentId, modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { | ||
documentId, | ||
modelId, | ||
}; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest('/predictions', body); | ||
}); | ||
}; | ||
Client.prototype.listPredictions = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/predictions', options)]; | ||
}); | ||
} | ||
listPredictions(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/predictions', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -640,11 +535,8 @@ * Creates an asset, calls the POST /assets endpoint. | ||
*/ | ||
Client.prototype.createAsset = function (content) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var encodedContent; | ||
return __generator(this, function (_a) { | ||
encodedContent = typeof content === 'string' ? content : buffer_1.Buffer.from(content).toString('base64'); | ||
return [2 /*return*/, this.makePostRequest('/assets', { content: encodedContent })]; | ||
}); | ||
createAsset(content, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const encodedContent = typeof content === 'string' ? content : buffer_1.Buffer.from(content).toString('base64'); | ||
return this.makePostRequest('/assets', Object.assign({ content: encodedContent }, options)); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -656,9 +548,7 @@ * Delete an asset, calls the DELETE /assets/{assetId} endpoint. | ||
*/ | ||
Client.prototype.deleteAsset = function (assetId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/assets/" + assetId)]; | ||
}); | ||
deleteAsset(assetId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/assets/${assetId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -671,9 +561,7 @@ * List assets available, calls the GET /assets endpoint. | ||
*/ | ||
Client.prototype.listAssets = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/assets', options)]; | ||
}); | ||
listAssets(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/assets', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -685,9 +573,7 @@ * Get asset from the REST API, calls the GET /assets/{assetId} endpoint. | ||
*/ | ||
Client.prototype.getAsset = function (assetId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/assets/" + assetId)]; | ||
}); | ||
getAsset(assetId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/assets/${assetId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -700,17 +586,15 @@ * Updates an asset, calls the PATCH /assets/{assetId} endpoint. | ||
*/ | ||
Client.prototype.updateAsset = function (assetId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body, encodedContent; | ||
return __generator(this, function (_a) { | ||
if (data) { | ||
body = __assign({}, data); | ||
if (data.content) { | ||
encodedContent = typeof data.content === 'string' ? data.content : buffer_1.Buffer.from(data.content).toString('base64'); | ||
body = __assign(__assign({}, body), { content: encodedContent }); | ||
} | ||
updateAsset(assetId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body; | ||
if (data) { | ||
body = Object.assign({}, data); | ||
if (data.content) { | ||
const encodedContent = typeof data.content === 'string' ? data.content : buffer_1.Buffer.from(data.content).toString('base64'); | ||
body = Object.assign(Object.assign({}, body), { content: encodedContent }); | ||
} | ||
return [2 /*return*/, this.makePatchRequest("/assets/" + assetId, body)]; | ||
}); | ||
} | ||
return this.makePatchRequest(`/assets/${assetId}`, body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -722,9 +606,7 @@ * Get dataset from the REST API, calls the GET /datasets/{datasetId} endpoint. | ||
*/ | ||
Client.prototype.getDataset = function (datasetId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/datasets/" + datasetId)]; | ||
}); | ||
getDataset(datasetId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/datasets/${datasetId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -738,9 +620,7 @@ * Creates a dataset, calls the POST /datasets endpoint. | ||
*/ | ||
Client.prototype.createDataset = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostRequest('/datasets', options)]; | ||
}); | ||
createDataset(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePostRequest('/datasets', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -754,9 +634,7 @@ * Updates a dataset, calls the PATCH /datasets/{datasetId} endpoint. | ||
*/ | ||
Client.prototype.updateDataset = function (datasetId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/datasets/" + datasetId, options)]; | ||
}); | ||
updateDataset(datasetId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/datasets/${datasetId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -769,9 +647,7 @@ * List datasets, calls the GET /datasets endpoint. | ||
*/ | ||
Client.prototype.listDatasets = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/datasets', options)]; | ||
}); | ||
listDatasets(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/datasets', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -784,54 +660,30 @@ * Deletes a dataset, calls the DELETE /datasets/{datasetId} endpoint. | ||
*/ | ||
Client.prototype.deleteDataset = function (datasetId, deleteDocuments) { | ||
if (deleteDocuments === void 0) { deleteDocuments = false; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var response, WAIT_MS, TOTAL_WAIT, MAX_WAIT_MS, datasetResponse; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!deleteDocuments) return [3 /*break*/, 11]; | ||
return [4 /*yield*/, this.deleteDocuments({ datasetId: datasetId })]; | ||
case 1: | ||
response = _a.sent(); | ||
_a.label = 2; | ||
case 2: | ||
if (!response.nextToken) return [3 /*break*/, 4]; | ||
return [4 /*yield*/, this.deleteDocuments({ datasetId: datasetId, nextToken: response.nextToken })]; | ||
case 3: | ||
response = _a.sent(); | ||
return [3 /*break*/, 2]; | ||
case 4: | ||
WAIT_MS = 1000; | ||
TOTAL_WAIT = WAIT_MS; | ||
MAX_WAIT_MS = 10000; | ||
return [4 /*yield*/, utils_1.wait(WAIT_MS)]; | ||
case 5: | ||
_a.sent(); | ||
return [4 /*yield*/, this.getDataset(datasetId)]; | ||
case 6: | ||
datasetResponse = _a.sent(); | ||
_a.label = 7; | ||
case 7: | ||
if (!(datasetResponse.numberOfDocuments > 0 && TOTAL_WAIT < MAX_WAIT_MS)) return [3 /*break*/, 10]; | ||
// exponentially back off | ||
WAIT_MS *= 1.25; | ||
TOTAL_WAIT += WAIT_MS; | ||
return [4 /*yield*/, utils_1.wait(WAIT_MS)]; | ||
case 8: | ||
_a.sent(); | ||
return [4 /*yield*/, this.getDataset(datasetId)]; | ||
case 9: | ||
datasetResponse = _a.sent(); | ||
return [3 /*break*/, 7]; | ||
case 10: | ||
// if the numberOfDocuments has not yet been updated, throw an error | ||
if (datasetResponse.numberOfDocuments > 0) { | ||
throw Error('Dataset numberOfDocuments not updated in time'); | ||
} | ||
_a.label = 11; | ||
case 11: return [2 /*return*/, this.makeDeleteRequest("/datasets/" + datasetId)]; | ||
deleteDataset(datasetId, deleteDocuments = false, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (deleteDocuments) { | ||
let response = yield this.deleteDocuments({ datasetId }); | ||
while (response.nextToken) { | ||
response = yield this.deleteDocuments({ datasetId, nextToken: response.nextToken }); | ||
} | ||
}); | ||
let WAIT_MS = 1000; | ||
let TOTAL_WAIT = WAIT_MS; | ||
const MAX_WAIT_MS = 10000; | ||
yield (0, utils_1.wait)(WAIT_MS); | ||
let datasetResponse = yield this.getDataset(datasetId); | ||
// wait until we get the updated numberOfDocuments, OR we time out | ||
while (datasetResponse.numberOfDocuments > 0 && TOTAL_WAIT < MAX_WAIT_MS) { | ||
// exponentially back off | ||
WAIT_MS *= 1.25; | ||
TOTAL_WAIT += WAIT_MS; | ||
yield (0, utils_1.wait)(WAIT_MS); | ||
datasetResponse = yield this.getDataset(datasetId); | ||
} | ||
// if the numberOfDocuments has not yet been updated, throw an error | ||
if (datasetResponse.numberOfDocuments > 0) { | ||
throw Error('Dataset numberOfDocuments not updated in time'); | ||
} | ||
} | ||
return this.makeDeleteRequest(`/datasets/${datasetId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -846,14 +698,11 @@ * Creates a dataBundle, calls the POST /models/{modelId}/dataBundles endpoint. | ||
*/ | ||
Client.prototype.createDataBundle = function (modelId, datasetIds, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { datasetIds: datasetIds }; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest("/models/" + modelId + "/dataBundles", body)]; | ||
}); | ||
createDataBundle(modelId, datasetIds, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { datasetIds }; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest(`/models/${modelId}/dataBundles`, body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -866,9 +715,7 @@ * Delete a dataBundle, calls the DELETE /dataBundles/{dataBundleId} endpoint. | ||
*/ | ||
Client.prototype.deleteDataBundle = function (modelId, dataBundleId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/models/" + modelId + "/dataBundles/" + dataBundleId)]; | ||
}); | ||
deleteDataBundle(modelId, dataBundleId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/models/${modelId}/dataBundles/${dataBundleId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -882,9 +729,7 @@ * List dataBundles available, calls the GET /dataBundles endpoint. | ||
*/ | ||
Client.prototype.listDataBundles = function (modelId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/models/" + modelId + "/dataBundles", options)]; | ||
}); | ||
listDataBundles(modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/models/${modelId}/dataBundles`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -899,9 +744,7 @@ * Updates a dataBundle, calls the PATCH /dataBundles/{dataBundleId} endpoint. | ||
*/ | ||
Client.prototype.updateDataBundle = function (modelId, dataBundleId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/models/" + modelId + "/dataBundles/" + dataBundleId, options)]; | ||
}); | ||
updateDataBundle(modelId, dataBundleId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/models/${modelId}/dataBundles/${dataBundleId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -917,14 +760,11 @@ * Creates a new user, calls the POST /users endpoint. | ||
*/ | ||
Client.prototype.createUser = function (email, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { email: email }; | ||
if (data) { | ||
body = __assign(__assign({}, body), data); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/users', body)]; | ||
}); | ||
createUser(email, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { email }; | ||
if (data) { | ||
body = Object.assign(Object.assign({}, body), data); | ||
} | ||
return this.makePostRequest('/users', body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -937,9 +777,7 @@ * List users, calls the GET /users endpoint. | ||
*/ | ||
Client.prototype.listUsers = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/users', options)]; | ||
}); | ||
listUsers(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/users', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -951,9 +789,7 @@ * Get information about a specific user, calls the GET /users/{userId} endpoint. | ||
*/ | ||
Client.prototype.getUser = function (userId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/users/" + userId)]; | ||
}); | ||
getUser(userId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/users/${userId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -967,9 +803,7 @@ * Updates a user, calls the PATCH /users/{userId} endpoint. | ||
*/ | ||
Client.prototype.updateUser = function (userId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/users/" + userId, data)]; | ||
}); | ||
updateUser(userId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/users/${userId}`, data); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -981,9 +815,7 @@ * Delete a user, calls the DELETE /users/{userId} endpoint. | ||
*/ | ||
Client.prototype.deleteUser = function (userId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/users/" + userId)]; | ||
}); | ||
deleteUser(userId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/users/${userId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -996,14 +828,11 @@ * Creates a secret, calls the POST /secrets endpoint. | ||
*/ | ||
Client.prototype.createSecret = function (data, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { data: data }; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/secrets', body)]; | ||
}); | ||
createSecret(data, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { data }; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest('/secrets', body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -1016,9 +845,7 @@ * List secrets available, calls the GET /secrets endpoint. | ||
*/ | ||
Client.prototype.listSecrets = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/secrets', options)]; | ||
}); | ||
listSecrets(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/secrets', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -1035,14 +862,11 @@ * Creates a model, calls the POST /models endpoint. | ||
*/ | ||
Client.prototype.createModel = function (fieldConfig, width, height, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var body; | ||
return __generator(this, function (_a) { | ||
body = { fieldConfig: fieldConfig, width: width, height: height }; | ||
if (options) { | ||
body = __assign(__assign({}, body), options); | ||
} | ||
return [2 /*return*/, this.makePostRequest('/models', body)]; | ||
}); | ||
createModel(fieldConfig, width, height, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let body = { fieldConfig, width, height }; | ||
if (options) { | ||
body = Object.assign(Object.assign({}, body), options); | ||
} | ||
return this.makePostRequest('/models', body); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -1054,9 +878,7 @@ * Get model from the REST API, calls the GET /models/{modelId} endpoint. | ||
*/ | ||
Client.prototype.getModel = function (modelId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/models/" + modelId)]; | ||
}); | ||
getModel(modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/models/${modelId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -1075,22 +897,18 @@ * Updates a model, calls the PATCH /models/{modelId} endpoint. | ||
*/ | ||
Client.prototype.updateModel = function (modelId, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/models/" + modelId, options)]; | ||
}); | ||
updateModel(modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/models/${modelId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
* Delete an model, calls the DELETE /models/{modelId} endpoint. | ||
* | ||
* @param modelId of the app client | ||
* @param modelId Id of the model | ||
* @returns Model response from REST API | ||
*/ | ||
Client.prototype.deleteModel = function (modelId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeDeleteRequest("/models/" + modelId)]; | ||
}); | ||
deleteModel(modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeDeleteRequest(`/models/${modelId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -1103,10 +921,76 @@ * List models available, calls the GET /models endpoint. | ||
*/ | ||
Client.prototype.listModels = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest('/models', options)]; | ||
}); | ||
listModels(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/models', options); | ||
}); | ||
}; | ||
} | ||
/** | ||
* List trainings available, calls the GET /models/{modelId}/trainings endpoint. | ||
* | ||
* @param modelId Id of the model | ||
* @param options.maxResults Maximum number of results to be returned | ||
* @param options.nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
* @param options.status List Trainings with the specified TrainingStatus, or array of TrainingStatus | ||
* @returns Trainings response from the REST API | ||
*/ | ||
listTrainings(modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/models/${modelId}/trainings`, options); | ||
}); | ||
} | ||
/** | ||
* Requests a training, calls the POST /models/{modelId}/trainings endpoint. | ||
* | ||
* @param modelId Id of the model | ||
* @param options.dataBundleIds DataBundle ids that will be used for training | ||
* @param options.instanceType The type of instance that will be used for training | ||
* @param options.name Name of the training | ||
* @param options.description Description of the training | ||
* @returns Training response from the REST API | ||
*/ | ||
createTraining(modelId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePostRequest(`/models/${modelId}/trainings`, options); | ||
}); | ||
} | ||
/** | ||
* Update a training, calls the PATCH /models/{modelId}/trainings/{trainingId} endpoint. | ||
* | ||
* @param modelId Id of the model | ||
* @param trainingId Id of the training | ||
* @param options.name New name of the training | ||
* @param options.description New description of the training | ||
* @param options.status Cancel the training with status = 'cancelled' | ||
* @returns | ||
*/ | ||
updateTraining(modelId, trainingId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/models/${modelId}/trainings/${trainingId}`, options); | ||
}); | ||
} | ||
/** | ||
* List plans available, calls the GET /plans endpoint. | ||
* | ||
* @param options.owner Organizations to retrieve plans from | ||
* @param options.maxResults Maximum number of results to be returned | ||
* @param options.nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
* @returns Plans response from the REST API | ||
*/ | ||
listPlans(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest('/plans', options); | ||
}); | ||
} | ||
/** | ||
* Get information about a specific plan, calls the GET /plans/{plan_id} endpoint. | ||
* | ||
* @param planId Id of the plan | ||
* @returns Plan response from the REST API | ||
*/ | ||
getPlan(planId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/plans/${planId}`); | ||
}); | ||
} | ||
/** | ||
* Get log, calls the GET /logs/{logId} endpoint. | ||
@@ -1117,9 +1001,7 @@ * | ||
*/ | ||
Client.prototype.getLog = function (logId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeGetRequest("/logs/" + logId)]; | ||
}); | ||
getLog(logId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeGetRequest(`/logs/${logId}`, options); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -1133,77 +1015,66 @@ * Updates a secret, calls the PATCH /secrets/{secretId} endpoint. | ||
*/ | ||
Client.prototype.updateSecret = function (secretId, data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePatchRequest("/secrets/" + secretId, data)]; | ||
}); | ||
updateSecret(secretId, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makePatchRequest(`/secrets/${secretId}`, data); | ||
}); | ||
}; | ||
} | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
Client.prototype.makeGetRequest = function (path, query) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeAuthorizedRequest(axios_1.default.get, utils_1.buildURL(path, query))]; | ||
}); | ||
makeGetRequest(path, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { requestConfig } = options, query = __rest(options, ["requestConfig"]); | ||
return this.makeAuthorizedRequest(axios_1.default.get, (0, utils_1.buildURL)(path, query), requestConfig); | ||
}); | ||
}; | ||
Client.prototype.makeDeleteRequest = function (path, query) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeAuthorizedRequest(axios_1.default.delete, utils_1.buildURL(path, query))]; | ||
}); | ||
} | ||
makeDeleteRequest(path, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { requestConfig } = options, query = __rest(options, ["requestConfig"]); | ||
return this.makeAuthorizedRequest(axios_1.default.delete, (0, utils_1.buildURL)(path, query), requestConfig); | ||
}); | ||
}; | ||
Client.prototype.makePostRequest = function (path, body) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeAuthorizedRequest(axios_1.default.post, path, body)]; | ||
}); | ||
} | ||
makePostRequest(path, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeAuthorizedBodyRequest(axios_1.default.post, path, options); | ||
}); | ||
}; | ||
Client.prototype.makePatchRequest = function (path, body) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeAuthorizedRequest(axios_1.default.patch, path, body)]; | ||
}); | ||
} | ||
makePatchRequest(path, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.makeAuthorizedBodyRequest(axios_1.default.patch, path, options); | ||
}); | ||
}; | ||
Client.prototype.makeAuthorizedRequest = function (axiosFn, path, body) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var endpoint, headers, config, handle; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
endpoint = "" + this.credentials.apiEndpoint + path; | ||
return [4 /*yield*/, this.getAuthorizationHeaders()]; | ||
case 1: | ||
headers = _a.sent(); | ||
config = { headers: headers }; | ||
handle = body | ||
? function () { return axiosFn(endpoint, body, config); } | ||
: function () { return axiosFn(endpoint, config); }; | ||
return [4 /*yield*/, handle()]; | ||
case 2: return [2 /*return*/, (_a.sent()).data]; | ||
} | ||
}); | ||
} | ||
makeAuthorizedRequest(axiosFn, path, requestConfig = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const endpoint = `${this.credentials.apiEndpoint}${path}`; | ||
const headers = yield this.getAuthorizationHeaders(); | ||
let config = { headers }; | ||
if (requestConfig) { | ||
config = Object.assign(Object.assign({}, config), requestConfig); | ||
} | ||
const result = yield axiosFn(endpoint, config); | ||
return result.data; | ||
}); | ||
}; | ||
} | ||
makeAuthorizedBodyRequest(axiosFn, path, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const endpoint = `${this.credentials.apiEndpoint}${path}`; | ||
const headers = yield this.getAuthorizationHeaders(); | ||
const { requestConfig } = options, body = __rest(options, ["requestConfig"]); | ||
let config = { headers }; | ||
if (requestConfig) { | ||
config = Object.assign(Object.assign({}, config), requestConfig); | ||
} | ||
const result = yield axiosFn(endpoint, body, config); | ||
return result.data; | ||
}); | ||
} | ||
/* eslint-enable */ | ||
Client.prototype.getAuthorizationHeaders = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var accessToken; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.credentials.getAccessToken()]; | ||
case 1: | ||
accessToken = _a.sent(); | ||
return [2 /*return*/, { | ||
Authorization: "Bearer " + accessToken, | ||
}]; | ||
} | ||
}); | ||
getAuthorizationHeaders() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const accessToken = yield this.credentials.getAccessToken(); | ||
return { | ||
Authorization: `Bearer ${accessToken}`, | ||
}; | ||
}); | ||
}; | ||
return Client; | ||
}()); | ||
} | ||
} | ||
exports.Client = Client; | ||
exports.default = Client; |
@@ -7,3 +7,3 @@ "use strict"; | ||
*/ | ||
var Token = /** @class */ (function () { | ||
class Token { | ||
/** | ||
@@ -14,3 +14,3 @@ * @param {string} accessToken | ||
*/ | ||
function Token(accessToken, expiration, refreshToken) { | ||
constructor(accessToken, expiration, refreshToken) { | ||
this.accessToken = accessToken; | ||
@@ -23,7 +23,6 @@ this.expiration = expiration; | ||
*/ | ||
Token.prototype.isValid = function () { | ||
isValid() { | ||
return Date.now() < this.expiration; | ||
}; | ||
return Token; | ||
}()); | ||
} | ||
} | ||
exports.Token = Token; | ||
@@ -33,4 +32,4 @@ /** | ||
*/ | ||
var Credentials = /** @class */ (function () { | ||
function Credentials(apiEndpoint, storage) { | ||
class Credentials { | ||
constructor(apiEndpoint, storage) { | ||
this.apiEndpoint = apiEndpoint; | ||
@@ -45,7 +44,6 @@ this.storage = storage; | ||
*/ | ||
Credentials.prototype.getAccessToken = function () { | ||
var _this = this; | ||
var storage = this.storage; | ||
return new Promise(function (resolve, reject) { | ||
var token = _this.token || null; | ||
getAccessToken() { | ||
const { storage } = this; | ||
return new Promise((resolve, reject) => { | ||
let token = this.token || null; | ||
if (!(token && token.isValid()) && storage) { | ||
@@ -55,7 +53,8 @@ token = storage.getPersistentToken(); | ||
if (token && token.isValid()) { | ||
_this.token = token; | ||
this.token = token; | ||
return resolve(token.accessToken); | ||
} | ||
_this.getToken().then(function (newToken) { | ||
_this.token = newToken; | ||
this.getToken() | ||
.then((newToken) => { | ||
this.token = newToken; | ||
if (storage) { | ||
@@ -65,9 +64,9 @@ storage.setPersistentToken(newToken); | ||
resolve(newToken.accessToken); | ||
}).catch(function (error) { | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
}; | ||
return Credentials; | ||
}()); | ||
} | ||
} | ||
exports.Credentials = Credentials; |
@@ -10,3 +10,4 @@ import { Credentials, Token } from './credentials'; | ||
} | ||
export declare const uuidWithoutDashes: () => string; | ||
export declare function sleep(seconds: number): Promise<unknown>; | ||
export declare function getTestClient(): Client; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTestClient = exports.sleep = exports.TestCredentials = void 0; | ||
var credentials_1 = require("./credentials"); | ||
var client_1 = require("./client"); | ||
var endpoint = 'http://localhost:4010'; | ||
var TestCredentials = /** @class */ (function (_super) { | ||
__extends(TestCredentials, _super); | ||
function TestCredentials(testEndpoint, testAccessToken, testExpiresInSeconds, testRefreshToken) { | ||
var _this = _super.call(this, testEndpoint) || this; | ||
_this.testAccessToken = testAccessToken; | ||
_this.testExpiration = Date.now() + 1000 * testExpiresInSeconds; | ||
_this.testRefreshToken = testRefreshToken; | ||
return _this; | ||
exports.getTestClient = exports.sleep = exports.uuidWithoutDashes = exports.TestCredentials = void 0; | ||
const uuid_1 = require("uuid"); | ||
const credentials_1 = require("./credentials"); | ||
const client_1 = require("./client"); | ||
const endpoint = 'http://localhost:4010'; | ||
class TestCredentials extends credentials_1.Credentials { | ||
constructor(testEndpoint, testAccessToken, testExpiresInSeconds, testRefreshToken) { | ||
super(testEndpoint); | ||
this.testAccessToken = testAccessToken; | ||
this.testExpiration = Date.now() + 1000 * testExpiresInSeconds; | ||
this.testRefreshToken = testRefreshToken; | ||
} | ||
TestCredentials.prototype.getToken = function () { | ||
var _this = this; | ||
return new Promise(function (resolve, reject) { | ||
resolve(new credentials_1.Token(_this.testAccessToken, _this.testExpiration, _this.testRefreshToken)); | ||
getToken() { | ||
return new Promise((resolve, _reject) => { | ||
resolve(new credentials_1.Token(this.testAccessToken, this.testExpiration, this.testRefreshToken)); | ||
}); | ||
}; | ||
return TestCredentials; | ||
}(credentials_1.Credentials)); | ||
} | ||
} | ||
exports.TestCredentials = TestCredentials; | ||
const uuidWithoutDashes = () => (0, uuid_1.v4)().replace(/-/g, ''); | ||
exports.uuidWithoutDashes = uuidWithoutDashes; | ||
function sleep(seconds) { | ||
return new Promise(function (resolve) { return setTimeout(resolve, 1000 * seconds); }); | ||
return new Promise((resolve) => setTimeout(resolve, 1000 * seconds)); | ||
} | ||
exports.sleep = sleep; | ||
function getTestClient() { | ||
var testAccessToken = 'testAccessToken'; | ||
var testExpiresInSeconds = 3600; | ||
var testRefreshToken = 'testRefreshToken'; | ||
var credentials = new TestCredentials(endpoint, testAccessToken, testExpiresInSeconds, testRefreshToken); | ||
const testAccessToken = 'testAccessToken'; | ||
const testExpiresInSeconds = 3600; | ||
const testRefreshToken = 'testRefreshToken'; | ||
const credentials = new TestCredentials(endpoint, testAccessToken, testExpiresInSeconds, testRefreshToken); | ||
return new client_1.Client(credentials); | ||
} | ||
exports.getTestClient = getTestClient; |
/// <reference types="node" /> | ||
import { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
export declare type RequestConfig = { | ||
requestConfig?: Pick<AxiosRequestConfig, 'signal'>; | ||
}; | ||
export declare type ContentType = 'application/pdf' | 'image/jpeg' | 'image/png' | 'image/tiff'; | ||
@@ -24,3 +27,3 @@ export declare type GroundTruth = { | ||
export declare type LasDocumentWithoutContent = Omit<LasDocument, 'content'>; | ||
export interface CreateDocumentOptions { | ||
export declare type CreateDocumentOptions = RequestConfig & { | ||
consentId?: string; | ||
@@ -30,15 +33,17 @@ datasetId?: string; | ||
retentionInDays?: number; | ||
} | ||
export interface UpdateDocumentOptions { | ||
}; | ||
export declare type UpdateDocumentOptions = RequestConfig & { | ||
groundTruth?: Array<GroundTruth>; | ||
retentionInDays?: number; | ||
} | ||
export declare type DeleteDocumentOptions = PaginationOptions & { | ||
}; | ||
export declare type GetDocumentOptions = RequestConfig; | ||
export declare type DeleteDocumentsOptions = RequestConfig & PaginationOptions & { | ||
consentId?: string | Array<string>; | ||
datasetId?: string | Array<string>; | ||
}; | ||
export declare type ListDocumentsOptions = PaginationOptions & { | ||
export declare type ListDocumentsOptions = RequestConfig & PaginationOptions & { | ||
consentId?: string | Array<string>; | ||
datasetId?: string | Array<string>; | ||
}; | ||
export declare type DeleteDocumentOptions = RequestConfig; | ||
export declare type LasDocumentList = { | ||
@@ -59,3 +64,3 @@ documents: Array<LasDocumentWithoutContent>; | ||
export declare type PostprocessConfig = BestFirst | BestNPages; | ||
export interface CreatePredictionsOptions { | ||
export declare type CreatePredictionsOptions = RequestConfig & { | ||
maxPages?: number; | ||
@@ -65,3 +70,3 @@ autoRotate?: boolean; | ||
postprocessConfig?: PostprocessConfig; | ||
} | ||
}; | ||
export interface PaginationOptions { | ||
@@ -71,3 +76,3 @@ maxResults?: number; | ||
} | ||
export declare type ListTransitionOptions = PaginationOptions & { | ||
export declare type ListTransitionOptions = RequestConfig & PaginationOptions & { | ||
transitionType?: string | Array<string>; | ||
@@ -91,3 +96,3 @@ }; | ||
}; | ||
export declare type TransitionExecutionListOptions = PaginationOptions & { | ||
export declare type TransitionExecutionListOptions = RequestConfig & PaginationOptions & { | ||
status?: TransitionExecutionStatus | Array<TransitionExecutionStatus>; | ||
@@ -98,3 +103,3 @@ executionId?: string | Array<string>; | ||
}; | ||
export interface UpdateTransitionExecution { | ||
export declare type UpdateTransitionExecution = RequestConfig & { | ||
status: Exclude<TransitionExecutionStatus, 'running'>; | ||
@@ -106,4 +111,4 @@ output?: Record<any, any>; | ||
startTime?: string; | ||
} | ||
export interface CreateTransitionOptions { | ||
}; | ||
export declare type CreateTransitionOptions = RequestConfig & { | ||
name?: string | null; | ||
@@ -114,3 +119,3 @@ inputJsonSchema?: Record<any, any>; | ||
parameters?: CreateTransitionParams; | ||
} | ||
}; | ||
export declare type CreateTransitionDockerParams = { | ||
@@ -134,3 +139,4 @@ environment?: object; | ||
export declare type TransitionType = 'docker' | 'manual'; | ||
export declare type UpdateTransitionOptions = { | ||
export declare type GetTransitionOptions = RequestConfig; | ||
export declare type UpdateTransitionOptions = RequestConfig & { | ||
name?: string; | ||
@@ -151,2 +157,3 @@ description?: string; | ||
}; | ||
export declare type DeleteTransitionOptions = RequestConfig; | ||
export declare type TransitionList = { | ||
@@ -156,2 +163,5 @@ transitions: Array<Transition>; | ||
}; | ||
export declare type ExecuteTransitionOptions = RequestConfig; | ||
export declare type GetTransitionExecutionOptions = RequestConfig; | ||
export declare type PostHeartbeatOptions = RequestConfig; | ||
export declare type WorkflowSpecification = { | ||
@@ -180,4 +190,4 @@ definition: object; | ||
}; | ||
export declare type ListWorkflowOptions = PaginationOptions; | ||
export declare type ListWorkflowExecutionsOptions = PaginationOptions & { | ||
export declare type ListWorkflowOptions = RequestConfig & PaginationOptions; | ||
export declare type ListWorkflowExecutionsOptions = RequestConfig & PaginationOptions & { | ||
status?: string | Array<string>; | ||
@@ -187,3 +197,3 @@ sortBy?: 'startTime' | 'endTime'; | ||
}; | ||
export declare type CreateWorkflowOptions = { | ||
export declare type CreateWorkflowOptions = RequestConfig & { | ||
description?: string | null; | ||
@@ -193,3 +203,3 @@ errorConfig?: WorkflowErrorConfig; | ||
}; | ||
export interface UpdateWorkflowOptions { | ||
export declare type UpdateWorkflowOptions = RequestConfig & { | ||
name?: string | null; | ||
@@ -199,9 +209,14 @@ description?: string | null; | ||
completedConfig?: WorkflowCompletedConfig; | ||
} | ||
export interface UpdateWorkflowExecutionOptions { | ||
}; | ||
export declare type GetWorkflowOptions = RequestConfig; | ||
export declare type DeleteWorkflowOptions = RequestConfig; | ||
export declare type ExecuteWorkflowOptions = RequestConfig; | ||
export declare type GetWorkflowExecutionOptions = RequestConfig; | ||
export declare type UpdateWorkflowExecutionOptions = RequestConfig & { | ||
nextTransitionId: string; | ||
} | ||
}; | ||
export declare type WorkflowList = { | ||
workflows: Array<Workflow>; | ||
}; | ||
export declare type DeleteWorkflowExecution = RequestConfig; | ||
export declare type WorkflowExecution = { | ||
@@ -241,3 +256,3 @@ executionId: string; | ||
}; | ||
export declare type ListPredictionsOptions = PaginationOptions; | ||
export declare type ListPredictionsOptions = RequestConfig & PaginationOptions; | ||
export declare type PredictionList = { | ||
@@ -247,2 +262,4 @@ predictions: Array<PredictionResponse>; | ||
}; | ||
export declare type CreateAssetOptions = RequestConfig; | ||
export declare type DeleteAssetOptions = RequestConfig; | ||
export declare type Dataset = { | ||
@@ -263,3 +280,3 @@ containsPersonallyIdentifiableInformation: boolean; | ||
}; | ||
export declare type CreateDatasetOptions = { | ||
export declare type CreateDatasetOptions = RequestConfig & { | ||
name?: string; | ||
@@ -270,3 +287,3 @@ description?: string; | ||
}; | ||
export declare type UpdateDatasetOptions = { | ||
export declare type UpdateDatasetOptions = RequestConfig & { | ||
description?: string; | ||
@@ -279,3 +296,5 @@ name?: string; | ||
}; | ||
export declare type ListDatasetsOptions = PaginationOptions; | ||
export declare type GetDatasetOptions = RequestConfig; | ||
export declare type ListDatasetsOptions = RequestConfig & PaginationOptions; | ||
export declare type DeleteDatasetOptions = RequestConfig; | ||
export declare type DataBundle = { | ||
@@ -294,7 +313,8 @@ createdBy: string | null; | ||
}; | ||
export declare type CreateDataBundleOptions = { | ||
export declare type CreateDataBundleOptions = RequestConfig & { | ||
name?: string; | ||
description?: string; | ||
}; | ||
export declare type UpdateDataBundleOptions = { | ||
export declare type DeleteDataBundleOptions = RequestConfig; | ||
export declare type UpdateDataBundleOptions = RequestConfig & { | ||
description?: string; | ||
@@ -307,3 +327,3 @@ name?: string; | ||
}; | ||
export declare type ListDataBundleOptions = PaginationOptions; | ||
export declare type ListDataBundleOptions = RequestConfig & PaginationOptions; | ||
export declare type User = { | ||
@@ -319,3 +339,3 @@ avatar: string | null; | ||
}; | ||
export declare type CreateUserOptions = { | ||
export declare type CreateUserOptions = RequestConfig & { | ||
name?: string; | ||
@@ -325,7 +345,9 @@ avatar?: string; | ||
}; | ||
export declare type UpdateUserOptions = { | ||
export declare type UpdateUserOptions = RequestConfig & { | ||
name?: string | null; | ||
avatar?: string | null; | ||
}; | ||
export declare type ListUsersOptions = PaginationOptions; | ||
export declare type ListUsersOptions = RequestConfig & PaginationOptions; | ||
export declare type GetUserOptions = RequestConfig; | ||
export declare type DeleteUserOptions = RequestConfig; | ||
export declare type UserList = { | ||
@@ -340,3 +362,3 @@ users: Array<User>; | ||
}; | ||
export declare type ListSecretsOptions = PaginationOptions; | ||
export declare type ListSecretsOptions = RequestConfig & PaginationOptions; | ||
export declare type SecretList = { | ||
@@ -346,11 +368,12 @@ secrets: Array<Secret>; | ||
}; | ||
export interface CreateSecretOptions { | ||
export declare type CreateSecretOptions = RequestConfig & { | ||
description?: string; | ||
} | ||
export interface UpdateSecretOptions { | ||
}; | ||
export declare type UpdateSecretOptions = RequestConfig & { | ||
data?: Record<any, any>; | ||
description?: string | null; | ||
name?: string | null; | ||
} | ||
export declare type UpdateOrganizationOptions = { | ||
}; | ||
export declare type GetOrganizationOptions = RequestConfig; | ||
export declare type UpdateOrganizationOptions = RequestConfig & { | ||
description?: string; | ||
@@ -368,2 +391,4 @@ name?: string; | ||
monthlyNumberOfPredictionsCreated: number; | ||
monthlyNumberOfTrainingsAllowed: number; | ||
monthlyNumberOfTrainingsCreated: number; | ||
monthlyNumberOfTransitionExecutionsAllowed: number; | ||
@@ -392,4 +417,5 @@ monthlyNumberOfTransitionExecutionsCreated: number; | ||
organizationId: string; | ||
planId: string | null; | ||
}; | ||
export declare type CreateAppClientOptions = { | ||
export declare type CreateAppClientOptions = RequestConfig & { | ||
callbackUrls?: Array<string>; | ||
@@ -403,3 +429,3 @@ description?: string; | ||
}; | ||
export declare type UpdateAppClientOptions = { | ||
export declare type UpdateAppClientOptions = RequestConfig & { | ||
defaultLoginUrl?: string; | ||
@@ -430,3 +456,4 @@ description?: string; | ||
}; | ||
export declare type ListAppClientsOptions = PaginationOptions; | ||
export declare type ListAppClientsOptions = RequestConfig & PaginationOptions; | ||
export declare type DeleteAppClientOptions = RequestConfig; | ||
export declare type Asset = { | ||
@@ -452,3 +479,3 @@ assetId: string; | ||
export declare type FieldConfig = Record<string, Field>; | ||
export declare type CreateModelOptions = { | ||
export declare type CreateModelOptions = RequestConfig & { | ||
description?: string; | ||
@@ -458,3 +485,4 @@ name?: string; | ||
}; | ||
export declare type UpdateModelOptions = { | ||
export declare type GetModelOptions = RequestConfig; | ||
export declare type UpdateModelOptions = RequestConfig & { | ||
description?: string; | ||
@@ -467,2 +495,3 @@ fieldConfig?: FieldConfig; | ||
}; | ||
export declare type DeleteModelOptions = RequestConfig; | ||
export declare type Model = { | ||
@@ -477,2 +506,3 @@ createdBy: string | null; | ||
numberOfDataBundles: number; | ||
numberOfRunningTrainings: number; | ||
preprocessConfig: PreprocessConfig; | ||
@@ -484,3 +514,59 @@ status: 'active' | 'inactive'; | ||
}; | ||
export declare type ListModelsOptions = PaginationOptions; | ||
export declare type TrainingInstanceType = 'small-gpu' | 'medium-gpu' | 'large-gpu'; | ||
export declare type TrainingStatus = 'waiting-for-approval' | 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled'; | ||
export declare type Training = { | ||
createdBy: string | null; | ||
createdTime: string | null; | ||
dataBundleIds: Array<string>; | ||
description: string | null; | ||
instanceType: TrainingInstanceType; | ||
modelId: string; | ||
name: string | null; | ||
status: TrainingStatus; | ||
trainingId: string; | ||
updatedBy: string | null; | ||
updatedTime: string | null; | ||
}; | ||
export declare type TrainingList = { | ||
trainings: Array<Training>; | ||
nextToken: string | null; | ||
status: Array<TrainingStatus>; | ||
}; | ||
export declare type ListTrainingsOptions = RequestConfig & PaginationOptions & { | ||
status?: TrainingStatus | Array<TrainingStatus>; | ||
}; | ||
export declare type CreateTrainingOption = { | ||
dataBundleIds: [string, ...string[]]; | ||
instanceType?: TrainingInstanceType; | ||
name?: string | null; | ||
description?: string | null; | ||
}; | ||
export declare type UpdateTrainingOptions = { | ||
name?: string | null; | ||
description?: string | null; | ||
status?: 'cancelled'; | ||
}; | ||
export declare type PlanCurrency = 'NOK' | 'USD' | 'EUR'; | ||
export declare type Plan = { | ||
billingCycle: number; | ||
currency: PlanCurrency; | ||
latest: number; | ||
name: string | null; | ||
organizationId: string | null; | ||
planId: string; | ||
license?: Record<any, any>; | ||
gpuHours?: Record<any, any>; | ||
activeModels?: Record<any, any>; | ||
description?: string | null; | ||
predictions?: Record<any, any>; | ||
}; | ||
export declare type PlanList = { | ||
plans: Array<Plan>; | ||
nextToken: string | null; | ||
owner: Array<string>; | ||
}; | ||
export declare type ListPlansOptions = RequestConfig & PaginationOptions & { | ||
owner?: string | Array<string>; | ||
}; | ||
export declare type ListModelsOptions = RequestConfig & PaginationOptions; | ||
export declare type ModelList = { | ||
@@ -490,6 +576,7 @@ models: Array<Model>; | ||
}; | ||
export interface UpdateAssetOptions { | ||
export declare type UpdateAssetOptions = RequestConfig & { | ||
content?: string | Buffer; | ||
} | ||
export declare type ListAssetsOptions = PaginationOptions; | ||
}; | ||
export declare type ListAssetsOptions = RequestConfig & PaginationOptions; | ||
export declare type GetAssetOptions = RequestConfig; | ||
export declare type Log = { | ||
@@ -500,2 +587,3 @@ logId: string; | ||
}; | ||
export declare type GetLogOptions = RequestConfig; | ||
export declare type AuthorizationHeaders = { | ||
@@ -502,0 +590,0 @@ Authorization: string; |
@@ -8,5 +8,5 @@ "use strict"; | ||
} | ||
var searchParams = new URLSearchParams(); | ||
Object.entries(params).forEach(function (param) { | ||
var key = param[0], value = param[1]; | ||
const searchParams = new URLSearchParams(); | ||
Object.entries(params).forEach((param) => { | ||
const [key, value] = param; | ||
if (value === undefined) { | ||
@@ -24,3 +24,3 @@ return; | ||
if (Array.isArray(value)) { | ||
value.forEach(function (val) { | ||
value.forEach((val) => { | ||
searchParams.append(key, val); | ||
@@ -30,8 +30,8 @@ }); | ||
}); | ||
return url + "?" + searchParams; | ||
return `${url}?${searchParams}`; | ||
} | ||
exports.buildURL = buildURL; | ||
function wait(ms) { | ||
return new Promise(function (resolve) { return setTimeout(resolve, ms); }); | ||
return new Promise((resolve) => setTimeout(resolve, ms)); | ||
} | ||
exports.wait = wait; |
{ | ||
"name": "@lucidtech/las-sdk-core", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"author": "Lucidtech AS <hello@lucidtech.ai>", | ||
@@ -16,20 +16,20 @@ "maintainers": [ | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"compile": "tsc", | ||
"upgrade": "npm update", | ||
"lint": "eslint ./src/**/*", | ||
"test": "jest src" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.1" | ||
"axios": "^0.24.0", | ||
"buffer": "^6.0.3", | ||
"node-abort-controller": "^3.0.1" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testEnvironment": "node" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^16.11.9", | ||
"@types/uuid": "^8.3.0", | ||
"uuid": "^8.3.1" | ||
}, | ||
"gitHead": "f08a027432ea4b2ec4a04f08e452526690d130a1" | ||
} | ||
"scripts": { | ||
"build": "tsc --project tsconfig.build.json", | ||
"lint": "eslint ./src/**/*", | ||
"test": "jest src", | ||
"bump-patch": "pnpm version patch", | ||
"bump-minor": "pnpm version minor", | ||
"bump-major": "pnpm version major" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
1
51
116715
3
3
17
2399
+ Addedbuffer@^6.0.3
+ Addednode-abort-controller@^3.0.1
+ Addedaxios@0.24.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addednode-abort-controller@3.1.1(transitive)
- Removedaxios@0.21.4(transitive)
Updatedaxios@^0.24.0