@lucidtech/las-sdk-core
Advanced tools
Comparing version 4.2.0 to 4.3.0
/// <reference types="node" /> | ||
import { Credentials } from './credentials'; | ||
import { AppClient, AppClientList, Asset, AssetList, Batch, BatchList, ContentType, CreateAppClientOptions, CreateBatchOptions, CreateDocumentOptions, CreateModelOptions, CreatePredictionsOptions, CreateSecretOptions, CreateTransitionOptions, CreateUserOptions, CreateWorkflowOptions, DeleteDocumentOptions, FieldConfig, LasDocument, LasDocumentList, ListAppClientsOptions, ListAssetsOptions, ListBatchesOptions, ListDocumentsOptions, ListModelsOptions, ListPredictionsOptions, ListSecretsOptions, ListTransitionOptions, ListUsersOptions, ListWorkflowExecutionsOptions, ListWorkflowOptions, Log, Model, ModelList, PredictionList, PredictionResponse, Secret, SecretList, Transition, TransitionExecution, TransitionExecutionList, TransitionExecutionListOptions, TransitionList, TransitionType, UpdateAppClientOptions, UpdateAssetOptions, UpdateBatchOptions, UpdateDocumentOptions, UpdateModelOptions, UpdateSecretOptions, UpdateTransitionExecution, UpdateTransitionOptions, UpdateUserOptions, UpdateWorkflowExecutionOptions, UpdateWorkflowOptions, User, UserList, Workflow, WorkflowExecution, WorkflowExecutionList, WorkflowList, WorkflowSpecification } from './types'; | ||
import { AppClient, AppClientList, Asset, AssetList, Batch, BatchList, ContentType, CreateAppClientOptions, CreateBatchOptions, CreateDocumentOptions, CreateModelOptions, CreatePredictionsOptions, CreateSecretOptions, CreateTransitionOptions, CreateUserOptions, CreateWorkflowOptions, DeleteDocumentOptions, FieldConfig, LasDocument, LasDocumentList, ListAppClientsOptions, ListAssetsOptions, ListBatchesOptions, ListDocumentsOptions, ListModelsOptions, ListPredictionsOptions, ListSecretsOptions, ListTransitionOptions, ListUsersOptions, ListWorkflowExecutionsOptions, ListWorkflowOptions, Log, Model, ModelList, Organization, PredictionList, PredictionResponse, Secret, SecretList, Transition, TransitionExecution, TransitionExecutionList, TransitionExecutionListOptions, TransitionList, TransitionType, UpdateAppClientOptions, UpdateAssetOptions, UpdateBatchOptions, UpdateDocumentOptions, UpdateModelOptions, UpdateOrganizationOptions, UpdateSecretOptions, UpdateTransitionExecution, UpdateTransitionOptions, UpdateUserOptions, UpdateWorkflowExecutionOptions, UpdateWorkflowOptions, User, UserList, Workflow, WorkflowExecution, WorkflowExecutionList, WorkflowList, WorkflowSpecification } from './types'; | ||
/** | ||
@@ -11,2 +11,18 @@ * A high-level http client for communicating with the Lucidtech REST API | ||
/** | ||
* Updates an organization, calls the PATCH /organizations/{organizationId} endpoint. | ||
* | ||
* @param organizationId Id of the organization | ||
* @param options.description Description of organization | ||
* @param options.name Name of organization | ||
* @returns Organization response from REST API with content | ||
*/ | ||
updateOrganization(organizationId: string, options: UpdateOrganizationOptions): Promise<Organization>; | ||
/** | ||
* Get organization from the REST API, calls the GET /organizations/{organizationId} endpoint. | ||
* | ||
* @param organizationId Id of the organization | ||
* @returns Organization response from REST API | ||
*/ | ||
getOrganization(organizationId: string): Promise<Organization>; | ||
/** | ||
* Creates an app client, calls the POST /appClients endpoint. | ||
@@ -13,0 +29,0 @@ * |
@@ -65,2 +65,30 @@ "use strict"; | ||
/** | ||
* Updates an organization, calls the PATCH /organizations/{organizationId} endpoint. | ||
* | ||
* @param organizationId Id of the organization | ||
* @param options.description Description of organization | ||
* @param options.name Name of organization | ||
* @returns Organization response from REST API with content | ||
*/ | ||
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)]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Get organization from the REST API, calls the GET /organizations/{organizationId} endpoint. | ||
* | ||
* @param organizationId Id of the organization | ||
* @returns Organization response from REST API | ||
*/ | ||
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)]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Creates an app client, calls the POST /appClients endpoint. | ||
@@ -67,0 +95,0 @@ * |
@@ -113,6 +113,19 @@ /// <reference types="node" /> | ||
export declare type Workflow = { | ||
name: string; | ||
name: string | null; | ||
workflowId: string; | ||
description?: string; | ||
description: string | null; | ||
numberOfRunningExecutions: number; | ||
completedConfig: WorkflowCompletedConfig; | ||
errorConfig: WorkflowErrorConfig; | ||
}; | ||
export declare type WorkflowCompletedConfig = { | ||
imageUrl: string; | ||
environmentSecrets?: Array<string>; | ||
environment?: Record<string, string>; | ||
secretId?: string; | ||
}; | ||
export declare type WorkflowErrorConfig = { | ||
manualRetry?: boolean; | ||
email?: string; | ||
}; | ||
export declare type ListWorkflowOptions = PaginationOptions; | ||
@@ -125,10 +138,11 @@ export declare type ListWorkflowExecutionsOptions = PaginationOptions & { | ||
export declare type CreateWorkflowOptions = { | ||
description?: string; | ||
errorConfig?: { | ||
email: string; | ||
}; | ||
description?: string | null; | ||
errorConfig?: WorkflowErrorConfig; | ||
completedConfig?: WorkflowCompletedConfig; | ||
}; | ||
export interface UpdateWorkflowOptions { | ||
name?: string; | ||
description?: string; | ||
name?: string | null; | ||
description?: string | null; | ||
errorConfig?: WorkflowErrorConfig; | ||
completedConfig?: WorkflowCompletedConfig; | ||
} | ||
@@ -255,2 +269,36 @@ export interface UpdateWorkflowExecutionOptions { | ||
}; | ||
export declare type UpdateOrganizationOptions = { | ||
description?: string; | ||
name?: string; | ||
}; | ||
export declare type Organization = { | ||
description: string | null; | ||
monthlyNumberOfDocumentsAllowed: number; | ||
monthlyNumberOfDocumentsCreated: number; | ||
monthlyNumberOfPredictionsAllowed: number; | ||
monthlyNumberOfPredictionsCreated: number; | ||
monthlyNumberOfTransitionExecutionsAllowed: number; | ||
monthlyNumberOfTransitionExecutionsCreated: number; | ||
monthlyNumberOfWorkflowExecutionsAllowed: number; | ||
monthlyNumberOfWorkflowExecutionsCreated: number; | ||
monthlyUsageSummary: Record<string, any>; | ||
name: string | null; | ||
numberOfAppClientsAllowed: number; | ||
numberOfAppClientsCreated: number; | ||
numberOfAssetsAllowed: number; | ||
numberOfAssetsCreated: number; | ||
numberOfBatchesAllowed: number; | ||
numberOfBatchesCreated: number; | ||
numberOfModelsAllowed: number; | ||
numberOfModelsCreated: number; | ||
numberOfSecretsAllowed: number; | ||
numberOfSecretsCreated: number; | ||
numberOfTransitionsAllowed: number; | ||
numberOfTransitionsCreated: number; | ||
numberOfUsersAllowed: number; | ||
numberOfUsersCreated: number; | ||
numberOfWorkflowsAllowed: number; | ||
numberOfWorkflowsCreated: number; | ||
organizationId: string; | ||
}; | ||
export declare type CreateAppClientOptions = { | ||
@@ -257,0 +305,0 @@ callbackUrls?: Array<string>; |
{ | ||
"name": "@lucidtech/las-sdk-core", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"author": "Lucidtech AS <hello@lucidtech.ai>", | ||
"maintainers": [ | ||
"August André Kvernmo <august@lucidtech.ai>" | ||
"August André Kvernmo <august@lucidtech.ai>", | ||
"Roger Andersen <roger@lucidtech.ai>" | ||
], | ||
@@ -32,3 +33,3 @@ "homepage": "https://lucidtech.ai", | ||
}, | ||
"gitHead": "78f310748e0a04e6acc9d5cb0f6c5f098a1440a2" | ||
"gitHead": "fc1550533f021b0c703ee1511e5ec7fd1dec6bf1" | ||
} |
@@ -37,2 +37,77 @@ /** | ||
describe('Organizations', () => { | ||
describe('getOrganization', () => { | ||
test('valid request', async () => { | ||
const organizationId = uuidv4(); | ||
const getOrganizationPromise = client.getOrganization(organizationId); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('description'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfDocumentsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfDocumentsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfPredictionsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfPredictionsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfTransitionExecutionsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfTransitionExecutionsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfWorkflowExecutionsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfWorkflowExecutionsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('monthlyUsageSummary'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('name'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfAppClientsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfAppClientsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfAssetsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfAssetsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfBatchesAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfBatchesCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfModelsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfModelsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfSecretsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfSecretsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfTransitionsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfTransitionsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfUsersAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfUsersCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfWorkflowsAllowed'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('numberOfWorkflowsCreated'); | ||
await expect(getOrganizationPromise).resolves.toHaveProperty('organizationId'); | ||
}); | ||
}); | ||
describe('updateOrganization', () => { | ||
test('valid request', async () => { | ||
const organizationId = uuidv4(); | ||
const name = 'My Company Name'; | ||
const description = 'My Company Description'; | ||
const options = { name, description }; | ||
const updateOrganizationPromise = client.updateOrganization(organizationId, options); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('description'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfDocumentsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfDocumentsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfPredictionsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfPredictionsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfTransitionExecutionsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfTransitionExecutionsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfWorkflowExecutionsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyNumberOfWorkflowExecutionsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('monthlyUsageSummary'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('name'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfAppClientsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfAppClientsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfAssetsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfAssetsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfBatchesAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfBatchesCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfModelsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfModelsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfSecretsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfSecretsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfTransitionsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfTransitionsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfUsersAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfUsersCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfWorkflowsAllowed'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('numberOfWorkflowsCreated'); | ||
await expect(updateOrganizationPromise).resolves.toHaveProperty('organizationId'); | ||
}); | ||
}); | ||
}); | ||
describe('Documents', () => { | ||
@@ -39,0 +114,0 @@ describe('createDocument', () => { |
@@ -42,2 +42,3 @@ import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
ModelList, | ||
Organization, | ||
PostPredictions, | ||
@@ -59,2 +60,3 @@ PredictionList, | ||
UpdateModelOptions, | ||
UpdateOrganizationOptions, | ||
UpdateSecretOptions, | ||
@@ -87,2 +89,24 @@ UpdateTransitionExecution, | ||
/** | ||
* Updates an organization, calls the PATCH /organizations/{organizationId} endpoint. | ||
* | ||
* @param organizationId Id of the organization | ||
* @param options.description Description of organization | ||
* @param options.name Name of organization | ||
* @returns Organization response from REST API with content | ||
*/ | ||
async updateOrganization(organizationId: string, options: UpdateOrganizationOptions): Promise<Organization> { | ||
return this.makePatchRequest(`/organizations/${organizationId}`, options); | ||
} | ||
/** | ||
* Get organization from the REST API, calls the GET /organizations/{organizationId} endpoint. | ||
* | ||
* @param organizationId Id of the organization | ||
* @returns Organization response from REST API | ||
*/ | ||
async getOrganization(organizationId: string): Promise<Organization> { | ||
return this.makeGetRequest<Organization>(`/organizations/${organizationId}`); | ||
} | ||
/** | ||
* Creates an app client, calls the POST /appClients endpoint. | ||
@@ -89,0 +113,0 @@ * |
@@ -134,7 +134,22 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export type Workflow = { | ||
name: string; | ||
name: string | null; | ||
workflowId: string; | ||
description?: string; | ||
description: string | null; | ||
numberOfRunningExecutions: number; | ||
completedConfig: WorkflowCompletedConfig; | ||
errorConfig: WorkflowErrorConfig; | ||
}; | ||
export type WorkflowCompletedConfig = { | ||
imageUrl: string; | ||
environmentSecrets?: Array<string>; | ||
environment?: Record<string, string>; | ||
secretId?: string; | ||
} | ||
export type WorkflowErrorConfig = { | ||
manualRetry?: boolean; | ||
email?: string; | ||
} | ||
export type ListWorkflowOptions = PaginationOptions; | ||
@@ -149,9 +164,12 @@ | ||
export type CreateWorkflowOptions = { | ||
description?: string; | ||
errorConfig?: { email: string }; | ||
description?: string | null; | ||
errorConfig?: WorkflowErrorConfig; | ||
completedConfig?: WorkflowCompletedConfig; | ||
}; | ||
export interface UpdateWorkflowOptions { | ||
name?: string; | ||
description?: string; | ||
name?: string | null; | ||
description?: string | null; | ||
errorConfig?: WorkflowErrorConfig; | ||
completedConfig?: WorkflowCompletedConfig; | ||
} | ||
@@ -305,2 +323,38 @@ | ||
export type UpdateOrganizationOptions = { | ||
description?: string; | ||
name?: string; | ||
} | ||
export type Organization = { | ||
description: string | null; | ||
monthlyNumberOfDocumentsAllowed: number; | ||
monthlyNumberOfDocumentsCreated: number; | ||
monthlyNumberOfPredictionsAllowed: number; | ||
monthlyNumberOfPredictionsCreated: number; | ||
monthlyNumberOfTransitionExecutionsAllowed: number; | ||
monthlyNumberOfTransitionExecutionsCreated: number; | ||
monthlyNumberOfWorkflowExecutionsAllowed: number; | ||
monthlyNumberOfWorkflowExecutionsCreated: number; | ||
monthlyUsageSummary: Record<string, any>; | ||
name: string | null; | ||
numberOfAppClientsAllowed: number; | ||
numberOfAppClientsCreated: number; | ||
numberOfAssetsAllowed: number; | ||
numberOfAssetsCreated: number; | ||
numberOfBatchesAllowed: number; | ||
numberOfBatchesCreated: number; | ||
numberOfModelsAllowed: number; | ||
numberOfModelsCreated: number; | ||
numberOfSecretsAllowed: number; | ||
numberOfSecretsCreated: number; | ||
numberOfTransitionsAllowed: number; | ||
numberOfTransitionsCreated: number; | ||
numberOfUsersAllowed: number; | ||
numberOfUsersCreated: number; | ||
numberOfWorkflowsAllowed: number; | ||
numberOfWorkflowsCreated: number; | ||
organizationId: string; | ||
}; | ||
export type CreateAppClientOptions = { | ||
@@ -307,0 +361,0 @@ callbackUrls?: Array<string>; |
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
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
201183
4440