@lucidtech/las-sdk-core
Advanced tools
Comparing version 3.0.1 to 3.0.2
import { Credentials } from './credentials'; | ||
import { Asset, Assets, Batch, ContentType, Feedback, LasDocument, LasDocumentList, PostTransitionParams, PredictionResponse, Transition, TransitionExecution, TransitionList, TransitionType, User, UserList, Workflow, WorkflowExecution, WorkflowExecutionList, WorkflowList, WorkflowSpecification } from './types'; | ||
import { Asset, Assets, Batch, ContentType, GroundTruth, LasDocument, LasDocumentList, PostTransitionParams, PredictionResponse, Transition, TransitionExecution, TransitionList, TransitionType, User, UserList, Workflow, WorkflowExecution, WorkflowExecutionList, WorkflowList, WorkflowSpecification } from './types'; | ||
/** | ||
@@ -16,6 +16,6 @@ * A high-level http client for communicating with the Lucidtech REST API | ||
* @param batchId Id of the associated batch | ||
* @param feedback List of feedback items representing the ground truth values for the document | ||
* @param groundTruth List of GroundTruth items representing the ground truth values for the document | ||
* @returns Document response from REST API | ||
*/ | ||
createDocument(content: string, contentType: ContentType, consentId?: string, batchId?: string, feedback?: Array<Feedback>): Promise<LasDocument>; | ||
createDocument(content: string, contentType: ContentType, consentId?: string, batchId?: string, groundTruth?: Array<GroundTruth>): Promise<LasDocument>; | ||
/** | ||
@@ -31,4 +31,4 @@ * Get document from the REST API, calls the GET /documents/{documentId} endpoint. | ||
* | ||
* @param batchId Id of the batch that contains the documents of interest | ||
* @param consentId Id of the consent that marks the owner of the document handle | ||
* @param batchId Ids of the batches that contains the documents of interest | ||
* @param consentId Ids of the consents that marks the owner of the document handle | ||
* @param maxResults Maximum number of results to be returned | ||
@@ -38,13 +38,13 @@ * @param nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
*/ | ||
listDocuments(batchId?: string, consentId?: string, maxResults?: number, nextToken?: string): Promise<LasDocumentList>; | ||
listDocuments(batchId?: string | Array<string>, consentId?: string | Array<string>, maxResults?: number, nextToken?: string): Promise<LasDocumentList>; | ||
/** | ||
* Post feedback to the REST API, calls the PATCH /documents/{documentId} endpoint. | ||
* Posting feedback means posting the ground truth data for the particular document. | ||
* Post ground truth to the REST API, calls the PATCH /documents/{documentId} endpoint. | ||
* Posting ground truth means posting the ground truth data for the particular document. | ||
* This enables the API to learn from past mistakes. | ||
* | ||
* @param documentId Id of the document | ||
* @param feedback List of feedback items representing the ground truth values for the document | ||
* @param groundTruth List of GroundTruth items representing the ground truth values for the document | ||
* @returns Document response from REST API | ||
*/ | ||
updateDocument(documentId: string, feedback: Array<Feedback>): Promise<LasDocument>; | ||
updateDocument(documentId: string, groundTruth: Array<GroundTruth>): Promise<LasDocument>; | ||
/** | ||
@@ -54,6 +54,6 @@ * Delete documents with the provided consentId, calls the DELETE /documents endpoint. | ||
* | ||
* @param consentId Id of the consent that marks the owner of the document handle | ||
* @param consentId Ids of the consents that marks the owner of the document handle | ||
* @returns Documents response from REST API | ||
*/ | ||
deleteDocuments(consentId?: string): Promise<LasDocumentList>; | ||
deleteDocuments(consentId?: string | Array<string>): Promise<LasDocumentList>; | ||
/** | ||
@@ -68,7 +68,7 @@ * Creates a transition handle, calls the POST /transitions endpoint. | ||
*/ | ||
createTransition(transitionType: TransitionType, inputJsonSchema: object, outputJsonSchema: object, params?: PostTransitionParams): Promise<Transition>; | ||
createTransition(name: string, transitionType: TransitionType, inputJsonSchema: object, outputJsonSchema: object, description?: string, params?: PostTransitionParams): Promise<Transition>; | ||
/** | ||
* List transitions, calls the GET /transitions endpoint. | ||
* | ||
* @param transitionType Type of transition | ||
* @param transitionType Types of transitions | ||
* @param maxResults Maximum number of results to be returned | ||
@@ -78,3 +78,3 @@ * @param nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
*/ | ||
listTransitions(transitionType?: string, maxResults?: number, nextToken?: string): Promise<TransitionList>; | ||
listTransitions(transitionType?: string | Array<string>, maxResults?: number, nextToken?: string): Promise<TransitionList>; | ||
/** | ||
@@ -139,3 +139,3 @@ * Start executing a manual transition, calls the POST /transitions/{transitionId}/executions endpoint. | ||
* @param workflowId Id of the workflow | ||
* @param status Status of the executions | ||
* @param status Statuses of the executions | ||
* @param maxResults Maximum number of results to be returned | ||
@@ -142,0 +142,0 @@ * @param nextToken A unique token for each page, use the returned token to retrieve the next page. |
@@ -69,6 +69,6 @@ "use strict"; | ||
* @param batchId Id of the associated batch | ||
* @param feedback List of feedback items representing the ground truth values for the document | ||
* @param groundTruth List of GroundTruth items representing the ground truth values for the document | ||
* @returns Document response from REST API | ||
*/ | ||
Client.prototype.createDocument = function (content, contentType, consentId, batchId, feedback) { | ||
Client.prototype.createDocument = function (content, contentType, consentId, batchId, groundTruth) { | ||
var body = { | ||
@@ -84,4 +84,4 @@ content: Buffer.from(content).toString('base64'), | ||
} | ||
if (feedback) { | ||
body = __assign(__assign({}, body), { feedback: feedback }); | ||
if (groundTruth) { | ||
body = __assign(__assign({}, body), { groundTruth: groundTruth }); | ||
} | ||
@@ -102,4 +102,4 @@ return this.makePostRequest('/documents', body); | ||
* | ||
* @param batchId Id of the batch that contains the documents of interest | ||
* @param consentId Id of the consent that marks the owner of the document handle | ||
* @param batchId Ids of the batches that contains the documents of interest | ||
* @param consentId Ids of the consents that marks the owner of the document handle | ||
* @param maxResults Maximum number of results to be returned | ||
@@ -119,13 +119,13 @@ * @param nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
/** | ||
* Post feedback to the REST API, calls the PATCH /documents/{documentId} endpoint. | ||
* Posting feedback means posting the ground truth data for the particular document. | ||
* Post ground truth to the REST API, calls the PATCH /documents/{documentId} endpoint. | ||
* Posting ground truth means posting the ground truth data for the particular document. | ||
* This enables the API to learn from past mistakes. | ||
* | ||
* @param documentId Id of the document | ||
* @param feedback List of feedback items representing the ground truth values for the document | ||
* @param groundTruth List of GroundTruth items representing the ground truth values for the document | ||
* @returns Document response from REST API | ||
*/ | ||
Client.prototype.updateDocument = function (documentId, feedback) { | ||
Client.prototype.updateDocument = function (documentId, groundTruth) { | ||
var body = { | ||
feedback: feedback, | ||
groundTruth: groundTruth, | ||
}; | ||
@@ -138,3 +138,3 @@ return this.makePatchRequest("/documents/" + documentId, body); | ||
* | ||
* @param consentId Id of the consent that marks the owner of the document handle | ||
* @param consentId Ids of the consents that marks the owner of the document handle | ||
* @returns Documents response from REST API | ||
@@ -155,3 +155,3 @@ */ | ||
*/ | ||
Client.prototype.createTransition = function (transitionType, inputJsonSchema, outputJsonSchema, params) { | ||
Client.prototype.createTransition = function (name, transitionType, inputJsonSchema, outputJsonSchema, description, params) { | ||
var body = { | ||
@@ -161,2 +161,4 @@ transitionType: transitionType, | ||
outputJsonSchema: outputJsonSchema, | ||
name: name, | ||
description: description, | ||
}; | ||
@@ -171,3 +173,3 @@ if (params) { | ||
* | ||
* @param transitionType Type of transition | ||
* @param transitionType Types of transitions | ||
* @param maxResults Maximum number of results to be returned | ||
@@ -271,3 +273,3 @@ * @param nextToken A unique token for each page, use the returned token to retrieve the next page. | ||
* @param workflowId Id of the workflow | ||
* @param status Status of the executions | ||
* @param status Statuses of the executions | ||
* @param maxResults Maximum number of results to be returned | ||
@@ -274,0 +276,0 @@ * @param nextToken A unique token for each page, use the returned token to retrieve the next page. |
@@ -6,3 +6,3 @@ import { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
contentType: ContentType; | ||
feedback?: Array<Feedback>; | ||
groundTruth?: Array<GroundTruth>; | ||
consentId?: string; | ||
@@ -36,2 +36,3 @@ batchId?: string; | ||
export declare type PostTransitions = { | ||
name: string; | ||
transitionType: TransitionType; | ||
@@ -41,2 +42,3 @@ inputJsonSchema: object; | ||
params?: PostTransitionParams; | ||
description?: string; | ||
}; | ||
@@ -103,3 +105,3 @@ export declare type Transition = { | ||
}; | ||
export declare type Feedback = { | ||
export declare type GroundTruth = { | ||
/** maxLength: 36, minLength: 1, pattern: ^[0-9A-Za-z_]+$ */ | ||
@@ -116,3 +118,3 @@ label: string; | ||
}; | ||
export declare type Prediction = Feedback & { | ||
export declare type Prediction = GroundTruth & { | ||
/** minimum: 0, maximum: 1 */ | ||
@@ -141,3 +143,3 @@ confidence: number; | ||
documentId: string; | ||
feedback?: Array<Feedback>; | ||
groundTruth?: Array<GroundTruth>; | ||
/** pattern: ^las:consent:[a-f0-9]{32}$ */ | ||
@@ -144,0 +146,0 @@ consentId?: string; |
@@ -21,3 +21,7 @@ "use strict"; | ||
} | ||
searchParams.append(key, value.join(',')); | ||
if (Array.isArray(value)) { | ||
value.forEach(function (val) { | ||
searchParams.append(key, val); | ||
}); | ||
} | ||
}); | ||
@@ -24,0 +28,0 @@ return url + "?" + searchParams; |
{ | ||
"name": "@lucidtech/las-sdk-core", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"author": "Lucidtech AS <hello@lucidtech.ai>", | ||
@@ -32,3 +32,3 @@ "maintainers": [ | ||
}, | ||
"gitHead": "9363991d0a367f3e2cef250841e41cfcfb94f1ea" | ||
"gitHead": "fd791c9a3511887eb9e3ac7c978125756f50f67f" | ||
} |
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
96410
2130