@lucidtech/las-sdk-core
Advanced tools
Comparing version 1.2.11 to 1.2.12
@@ -27,3 +27,4 @@ import { Credentials } from './credentials'; | ||
patchTasks(taskId: string, taskResult?: any, taskError?: any): Promise<any>; | ||
patchUserId(userId: string, consentHash: string): Promise<any>; | ||
patchUser(userId: string, consentHash: string): Promise<any>; | ||
getUser(userId: string): Promise<any>; | ||
makeGetRequest(path: string, query?: any): Promise<any>; | ||
@@ -30,0 +31,0 @@ makeDeleteRequest(path: string): Promise<any>; |
@@ -96,6 +96,9 @@ "use strict"; | ||
}; | ||
Client.prototype.patchUserId = function (userId, consentHash) { | ||
Client.prototype.patchUser = function (userId, consentHash) { | ||
var body = { consentHash: consentHash }; | ||
return this.makePatchRequest("/users/" + userId, body); | ||
}; | ||
Client.prototype.getUser = function (userId) { | ||
return this.makeGetRequest("/users/" + userId); | ||
}; | ||
Client.prototype.makeGetRequest = function (path, query) { | ||
@@ -102,0 +105,0 @@ return this.makeAuthorizedRequest(axios_1.default.get, utils_1.buildURL(path, query)); |
{ | ||
"name": "@lucidtech/las-sdk-core", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"author": "Lucidtech AS <hello@lucidtech.ai>", | ||
@@ -23,3 +23,3 @@ "maintainers": [ | ||
}, | ||
"gitHead": "19524e8edebfb94911969c49ff4c665bf4a55297" | ||
"gitHead": "6e06264c0a1ee601e94527e1f329832c71c66d66" | ||
} |
@@ -11,3 +11,4 @@ import { default as uuidv4 } from 'uuid/v4'; | ||
const testConsentId = uuidv4(); | ||
const postDocumentsPromise = client.postDocuments(testContent, testContentType, testConsentId); | ||
const testBatchId = uuidv4(); | ||
const postDocumentsPromise = client.postDocuments(testContent, testContentType, testConsentId, testBatchId); | ||
await expect(postDocumentsPromise).resolves.toHaveProperty('consentId'); | ||
@@ -70,4 +71,3 @@ await expect(postDocumentsPromise).resolves.toHaveProperty('contentType'); | ||
const postTasksPromise = client.postTasks(testActivityArn); | ||
await expect(postTasksPromise).resolves.toHaveProperty('taskId'); | ||
await expect(postTasksPromise).resolves.toHaveProperty('taskData'); | ||
await expect(postTasksPromise).resolves.toBeDefined(); | ||
}); | ||
@@ -81,4 +81,3 @@ | ||
const postTasksPromise = client.patchTasks(testTaskId, testTaskResult); | ||
await expect(postTasksPromise).resolves.toHaveProperty('taskId'); | ||
await expect(postTasksPromise).resolves.toHaveProperty('taskData'); | ||
await expect(postTasksPromise).resolves.toBeDefined(); | ||
}); | ||
@@ -103,6 +102,3 @@ | ||
const patchTaskPromise = client.patchTasks(testTaskId, {}, { testTaskError }); | ||
await expect(patchTaskPromise).resolves.toHaveProperty('taskId'); | ||
await expect(patchTaskPromise).resolves.toHaveProperty('taskData'); | ||
await expect(patchTaskPromise).resolves.toHaveProperty('taskError'); | ||
await expect(patchTaskPromise).resolves.toHaveProperty('taskResult'); | ||
await expect(patchTaskPromise).resolves.toBeDefined(); | ||
}) | ||
@@ -115,3 +111,2 @@ | ||
const getDocumentPromise = client.getDocument(documentId); | ||
await expect(getDocumentPromise).resolves.toHaveProperty('content'); | ||
await expect(getDocumentPromise).resolves.toHaveProperty('consentId'); | ||
@@ -125,7 +120,17 @@ await expect(getDocumentPromise).resolves.toHaveProperty('documentId'); | ||
const getProcessesPromise = client.getProcesses({ status: 'APPROVED' }); | ||
await expect(getProcessesPromise).resolves.toHaveProperty('id'); | ||
await expect(getProcessesPromise).resolves.toHaveProperty('documentSource'); | ||
await expect(getProcessesPromise).resolves.toHaveProperty('startDate'); | ||
await expect(getProcessesPromise).resolves.toHaveProperty('status'); | ||
await expect(getProcessesPromise).resolves.toHaveProperty('message'); | ||
await expect(getProcessesPromise).resolves.toHaveProperty('executionArn'); | ||
}); | ||
test('Testing getDocuments', async () => { | ||
const client = getTestClient(); | ||
const testBatchId = uuidv4(); | ||
const getDocumentsPromise = client.getDocuments(testBatchId); | ||
await expect(getDocumentsPromise).resolves.toBeDefined(); | ||
}); | ||
test('Testing postBatches', async () => { | ||
const client = getTestClient(); | ||
const description = "I am going to create a new batch, give me a batch ID!" | ||
const postBatchesPromise = client.postBatches(description); | ||
await expect(postBatchesPromise).resolves.toHaveProperty('batchId'); | ||
}); |
@@ -107,3 +107,3 @@ import axios, { AxiosRequestConfig } from 'axios'; | ||
patchUserId(userId: string, consentHash: string) { | ||
patchUser(userId: string, consentHash: string) { | ||
const body = { consentHash }; | ||
@@ -113,2 +113,6 @@ return this.makePatchRequest(`/users/${userId}`, body); | ||
getUser(userId: string) { | ||
return this.makeGetRequest(`/users/${userId}`); | ||
} | ||
makeGetRequest(path: string, query?: any) { | ||
@@ -115,0 +119,0 @@ return this.makeAuthorizedRequest(axios.get, buildURL(path, query)); |
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
37653
678