From 6ee6db5f46dd8e0f52204935e59f8e11eec681bb Mon Sep 17 00:00:00 2001 From: Minh Nguyen Cong Date: Fri, 6 Oct 2023 08:46:11 +0200 Subject: [PATCH 1/4] Update package-lock --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9c81d19e..c46abd2c 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "promise-queue": "^2.2.3", "proxy-agent": "^6.3.0", "request": "^2.88.0", + "tough-cookie": "^4.1.3", "url-template": "^2.0.8", "uuid": "^9.0.0" }, From 80ce188aaa609b82ed71f620ffa0f8f7d52e4648 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Cong Date: Fri, 29 Dec 2023 14:35:08 +0100 Subject: [PATCH 2/4] feat: Sign request signer group ID --- ...d-information-barrier-reports.generated.ts | 6 ++--- ...ation-barrier-segment-members.generated.ts | 4 +-- ...-barrier-segment-restrictions.generated.ts | 4 +-- ...-information-barrier-segments.generated.ts | 4 +-- .../shield-information-barriers.generated.ts | 14 +++++----- src/schemas/folder-mini.generated.ts | 10 +++---- src/schemas/index.generated.ts | 5 ++++ ...d-information-barrier-reports.generated.ts | 26 +++++++++++++++++++ ...ation-barrier-segment-members.generated.ts | 26 +++++++++++++++++++ ...-barrier-segment-restrictions.generated.ts | 26 +++++++++++++++++++ ...-information-barrier-segments.generated.ts | 26 +++++++++++++++++++ .../shield-information-barriers.generated.ts | 25 ++++++++++++++++++ .../sign-request-create-request.generated.ts | 8 ++++-- .../sign-request-create-signer.generated.ts | 12 +++++++-- .../sign-request-prefill-tag.generated.ts | 2 +- .../sign-request-signer-input.generated.ts | 20 +++++++------- src/schemas/sign-requests.generated.ts | 11 +++----- src/schemas/sign-templates.generated.ts | 18 ++++++++++--- .../template-signer-input.generated.ts | 14 +++++++++- src/schemas/template-signer.generated.ts | 7 +++++ 20 files changed, 220 insertions(+), 48 deletions(-) create mode 100644 src/schemas/shield-information-barrier-reports.generated.ts create mode 100644 src/schemas/shield-information-barrier-segment-members.generated.ts create mode 100644 src/schemas/shield-information-barrier-segment-restrictions.generated.ts create mode 100644 src/schemas/shield-information-barrier-segments.generated.ts create mode 100644 src/schemas/shield-information-barriers.generated.ts diff --git a/src/managers/shield-information-barrier-reports.generated.ts b/src/managers/shield-information-barrier-reports.generated.ts index 1404d86b..06c8604b 100644 --- a/src/managers/shield-information-barrier-reports.generated.ts +++ b/src/managers/shield-information-barrier-reports.generated.ts @@ -49,13 +49,13 @@ class ShieldInformationBarrierReportsManager { /** * List shield information barrier reports * - * Lists shield information barrier reports with specific IDs. + * Lists shield information barrier reports. * @param {object} options Options for the request * @param {string} options.shield_information_barrier_id The ID of the shield information barrier. * @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. * @param {number} [options.limit] The maximum number of items to return per page. * @param {Function} [callback] Passed the result if successful, error otherwise - * @returns {Promise} A promise resolving to the result or rejecting with an error + * @returns {Promise} A promise resolving to the result or rejecting with an error */ getAll( options: { @@ -76,7 +76,7 @@ class ShieldInformationBarrierReportsManager { readonly limit?: number; }, callback?: Function - ): Promise { + ): Promise { const { ...queryParams } = options, apiPath = urlPath('shield_information_barrier_reports'), params = { diff --git a/src/managers/shield-information-barrier-segment-members.generated.ts b/src/managers/shield-information-barrier-segment-members.generated.ts index 28dcf8c1..6b9972e0 100644 --- a/src/managers/shield-information-barrier-segment-members.generated.ts +++ b/src/managers/shield-information-barrier-segment-members.generated.ts @@ -58,7 +58,7 @@ class ShieldInformationBarrierSegmentMembersManager { * @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. * @param {number} [options.limit] The maximum number of items to return per page. * @param {Function} [callback] Passed the result if successful, error otherwise - * @returns {Promise} A promise resolving to the result or rejecting with an error + * @returns {Promise} A promise resolving to the result or rejecting with an error */ getAll( options: { @@ -79,7 +79,7 @@ class ShieldInformationBarrierSegmentMembersManager { readonly limit?: number; }, callback?: Function - ): Promise { + ): Promise { const { ...queryParams } = options, apiPath = urlPath('shield_information_barrier_segment_members'), params = { diff --git a/src/managers/shield-information-barrier-segment-restrictions.generated.ts b/src/managers/shield-information-barrier-segment-restrictions.generated.ts index 39a8be87..bba599de 100644 --- a/src/managers/shield-information-barrier-segment-restrictions.generated.ts +++ b/src/managers/shield-information-barrier-segment-restrictions.generated.ts @@ -58,7 +58,7 @@ class ShieldInformationBarrierSegmentRestrictionsManager { * @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. * @param {number} [options.limit] The maximum number of items to return per page. * @param {Function} [callback] Passed the result if successful, error otherwise - * @returns {Promise} A promise resolving to the result or rejecting with an error + * @returns {Promise} A promise resolving to the result or rejecting with an error */ getAll( options: { @@ -79,7 +79,7 @@ class ShieldInformationBarrierSegmentRestrictionsManager { readonly limit?: number; }, callback?: Function - ): Promise { + ): Promise { const { ...queryParams } = options, apiPath = urlPath('shield_information_barrier_segment_restrictions'), params = { diff --git a/src/managers/shield-information-barrier-segments.generated.ts b/src/managers/shield-information-barrier-segments.generated.ts index 11a64e4a..c36b768f 100644 --- a/src/managers/shield-information-barrier-segments.generated.ts +++ b/src/managers/shield-information-barrier-segments.generated.ts @@ -57,7 +57,7 @@ class ShieldInformationBarrierSegmentsManager { * @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. * @param {number} [options.limit] The maximum number of items to return per page. * @param {Function} [callback] Passed the result if successful, error otherwise - * @returns {Promise} A promise resolving to the result or rejecting with an error + * @returns {Promise} A promise resolving to the result or rejecting with an error */ getAll( options: { @@ -78,7 +78,7 @@ class ShieldInformationBarrierSegmentsManager { readonly limit?: number; }, callback?: Function - ): Promise { + ): Promise { const { ...queryParams } = options, apiPath = urlPath('shield_information_barrier_segments'), params = { diff --git a/src/managers/shield-information-barriers.generated.ts b/src/managers/shield-information-barriers.generated.ts index 0ca21b28..8614aa94 100644 --- a/src/managers/shield-information-barriers.generated.ts +++ b/src/managers/shield-information-barriers.generated.ts @@ -14,7 +14,7 @@ class ShieldInformationBarrierManager { /** * Get shield information barrier with specified ID * - * Get shield information barrier based on provided ID.. + * Get shield information barrier based on provided ID. * @param {object} options Options for the request * @param {string} options.shield_information_barrier_id The ID of the shield information barrier. * @param {Function} [callback] Passed the result if successful, error otherwise @@ -52,18 +52,16 @@ class ShieldInformationBarrierManager { * Retrieves a list of shield information barrier objects * for the enterprise of JWT. * @param {object} [options] Options for the request - * @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. + * @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. * @param {number} [options.limit] The maximum number of items to return per page. * @param {Function} [callback] Passed the result if successful, error otherwise - * @returns {Promise} A promise resolving to the result or rejecting with an error + * @returns {Promise} A promise resolving to the result or rejecting with an error */ getAll( options?: { /** * Defines the position marker at which to begin returning results. This is * used when paginating using marker-based pagination. - * - * This requires `usemarker` to be set to `true`. */ readonly marker?: string; /** @@ -72,7 +70,7 @@ class ShieldInformationBarrierManager { readonly limit?: number; }, callback?: Function - ): Promise { + ): Promise { const { ...queryParams } = options, apiPath = urlPath('shield_information_barriers'), params = { @@ -90,13 +88,13 @@ class ShieldInformationBarrierManager { * Creates a shield information barrier to * separate individuals/groups within the same * firm and prevents confidential information passing between them. - * @param {schemas.ShieldInformationBarrier} body + * @param {object} body * @param {object} [options] Options for the request * @param {Function} [callback] Passed the result if successful, error otherwise * @returns {Promise} A promise resolving to the result or rejecting with an error */ create( - body: schemas.ShieldInformationBarrier, + body: object, options?: {}, callback?: Function ): Promise { diff --git a/src/schemas/folder-mini.generated.ts b/src/schemas/folder-mini.generated.ts index 585aecc7..76ffdea2 100644 --- a/src/schemas/folder-mini.generated.ts +++ b/src/schemas/folder-mini.generated.ts @@ -6,11 +6,6 @@ import * as schemas from '.'; * nested under another resource. */ export interface FolderMini extends schemas.FolderBase { - /** - * The name of the folder. - * Example: Contracts - */ - name?: string; /** * A numeric identifier that represents the most recent user event * that has been applied to this item. @@ -28,4 +23,9 @@ export interface FolderMini extends schemas.FolderBase { * Example: 3 */ sequence_id?: string; + /** + * The name of the folder. + * Example: Contracts + */ + name?: string; } diff --git a/src/schemas/index.generated.ts b/src/schemas/index.generated.ts index 5e466b70..83e822aa 100644 --- a/src/schemas/index.generated.ts +++ b/src/schemas/index.generated.ts @@ -10,14 +10,19 @@ export * from './shield-information-barrier-reference.generated'; export * from './shield-information-barrier-report-base.generated'; export * from './shield-information-barrier-report-details.generated'; export * from './shield-information-barrier-report.generated'; +export * from './shield-information-barrier-reports.generated'; export * from './shield-information-barrier-segment-member-base.generated'; export * from './shield-information-barrier-segment-member-mini.generated'; export * from './shield-information-barrier-segment-member.generated'; +export * from './shield-information-barrier-segment-members.generated'; export * from './shield-information-barrier-segment-restriction-base.generated'; export * from './shield-information-barrier-segment-restriction-mini.generated'; export * from './shield-information-barrier-segment-restriction.generated'; +export * from './shield-information-barrier-segment-restrictions.generated'; export * from './shield-information-barrier-segment.generated'; +export * from './shield-information-barrier-segments.generated'; export * from './shield-information-barrier.generated'; +export * from './shield-information-barriers.generated'; export * from './sign-request-base.generated'; export * from './sign-request-create-request.generated'; export * from './sign-request-create-signer.generated'; diff --git a/src/schemas/shield-information-barrier-reports.generated.ts b/src/schemas/shield-information-barrier-reports.generated.ts new file mode 100644 index 00000000..0e63fa2a --- /dev/null +++ b/src/schemas/shield-information-barrier-reports.generated.ts @@ -0,0 +1,26 @@ +import * as schemas from '.'; +/** + * List of Shield Information Barrier Reports + * + * The part of an API response that describes marker + * based pagination + */ +export interface ShieldInformationBarrierReports { + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. + * Example: 1000 + */ + limit?: number; + /** + * The marker for the start of the next page of results. + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii + */ + next_marker?: string; + /** + * A list of shield information + * barrier reports. + */ + entries?: schemas.ShieldInformationBarrierReport[]; +} diff --git a/src/schemas/shield-information-barrier-segment-members.generated.ts b/src/schemas/shield-information-barrier-segment-members.generated.ts new file mode 100644 index 00000000..59026233 --- /dev/null +++ b/src/schemas/shield-information-barrier-segment-members.generated.ts @@ -0,0 +1,26 @@ +import * as schemas from '.'; +/** + * List of Shield Information Barrier Segment Members + * + * The part of an API response that describes marker + * based pagination + */ +export interface ShieldInformationBarrierSegmentMembers { + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. + * Example: 1000 + */ + limit?: number; + /** + * The marker for the start of the next page of results. + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii + */ + next_marker?: string; + /** + * A list of shield information + * barrier segment members + */ + entries?: schemas.ShieldInformationBarrierSegmentMember[]; +} diff --git a/src/schemas/shield-information-barrier-segment-restrictions.generated.ts b/src/schemas/shield-information-barrier-segment-restrictions.generated.ts new file mode 100644 index 00000000..b318453e --- /dev/null +++ b/src/schemas/shield-information-barrier-segment-restrictions.generated.ts @@ -0,0 +1,26 @@ +import * as schemas from '.'; +/** + * List of Shield Information Barrier Segment Restrictions + * + * The part of an API response that describes marker + * based pagination + */ +export interface ShieldInformationBarrierSegmentRestrictions { + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. + * Example: 1000 + */ + limit?: number; + /** + * The marker for the start of the next page of results. + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii + */ + next_marker?: string; + /** + * A list of shield information barrier + * segment restriction objects + */ + entries?: schemas.ShieldInformationBarrierSegmentRestriction[]; +} diff --git a/src/schemas/shield-information-barrier-segments.generated.ts b/src/schemas/shield-information-barrier-segments.generated.ts new file mode 100644 index 00000000..8e7c68ad --- /dev/null +++ b/src/schemas/shield-information-barrier-segments.generated.ts @@ -0,0 +1,26 @@ +import * as schemas from '.'; +/** + * List of Shield Information Barrier Segments + * + * The part of an API response that describes marker + * based pagination + */ +export interface ShieldInformationBarrierSegments { + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. + * Example: 1000 + */ + limit?: number; + /** + * The marker for the start of the next page of results. + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii + */ + next_marker?: string; + /** + * A list of shield information barrier + * segments + */ + entries?: schemas.ShieldInformationBarrierSegment[]; +} diff --git a/src/schemas/shield-information-barriers.generated.ts b/src/schemas/shield-information-barriers.generated.ts new file mode 100644 index 00000000..1901ad55 --- /dev/null +++ b/src/schemas/shield-information-barriers.generated.ts @@ -0,0 +1,25 @@ +import * as schemas from '.'; +/** + * List of Shield Information Barriers + * + * The part of an API response that describes marker + * based pagination + */ +export interface ShieldInformationBarriers { + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. + * Example: 1000 + */ + limit?: number; + /** + * The marker for the start of the next page of results. + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii + */ + next_marker?: string; + /** + * A list of shield information barrier objects + */ + entries?: schemas.ShieldInformationBarrier[]; +} diff --git a/src/schemas/sign-request-create-request.generated.ts b/src/schemas/sign-request-create-request.generated.ts index f70c8816..dba25f8d 100644 --- a/src/schemas/sign-request-create-request.generated.ts +++ b/src/schemas/sign-request-create-request.generated.ts @@ -10,8 +10,12 @@ export interface SignRequestCreateRequest extends schemas.SignRequestBase { */ source_files?: schemas.FileBase[]; /** - * Array of signers for the sign request. 35 is the - * max number of signers permitted. + * Force a specific color for the signature (blue, black, or red) + * Example: blue + */ + signature_color?: 'blue' | 'black' | 'red'; + /** + * Array of signers for the sign request. 35 is the max number of signers permitted. */ signers: schemas.SignRequestCreateSigner[]; } diff --git a/src/schemas/sign-request-create-signer.generated.ts b/src/schemas/sign-request-create-signer.generated.ts index a884bb39..4d4a1214 100644 --- a/src/schemas/sign-request-create-signer.generated.ts +++ b/src/schemas/sign-request-create-signer.generated.ts @@ -6,10 +6,11 @@ import * as schemas from '.'; */ export interface SignRequestCreateSigner { /** - * Email address of the signer + * Email address of the signer. + * The email address of the signer is required when making signature requests, except when using templates that are configured to include emails. * Example: example@gmail.com */ - email: string; + email?: string; /** * Defines the role of the signer in the sign request. A `signer` * must sign the document and an `approver` must approve the document. A @@ -74,4 +75,11 @@ export interface SignRequestCreateSigner { * Example: SecretPassword123 */ password?: string; + /** + * If set, signers who have the same group ID will be assigned to the same input. + * A signer group is expected to have more than one signer. When a group contains fewer than two signers, + * it will be converted to a single signer and the group will be removed. + * Example: cd4ff89-8fc1-42cf-8b29-1890dedd26d7 + */ + signer_group_id?: string; } diff --git a/src/schemas/sign-request-prefill-tag.generated.ts b/src/schemas/sign-request-prefill-tag.generated.ts index 2a024234..b78b53cb 100644 --- a/src/schemas/sign-request-prefill-tag.generated.ts +++ b/src/schemas/sign-request-prefill-tag.generated.ts @@ -23,7 +23,7 @@ export interface SignRequestPrefillTag { checkbox_value?: boolean; /** * Date prefill value - * Example: 2021-04-26T08:12:13.982Z + * Example: 2021-04-26 */ date_value?: string; } diff --git a/src/schemas/sign-request-signer-input.generated.ts b/src/schemas/sign-request-signer-input.generated.ts index bbbe5b0c..a346a8d7 100644 --- a/src/schemas/sign-request-signer-input.generated.ts +++ b/src/schemas/sign-request-signer-input.generated.ts @@ -9,25 +9,27 @@ export interface SignRequestSignerInput extends schemas.SignRequestPrefillTag { * Type of input * Example: text */ - type?: 'signature' | 'date' | 'text' | 'checkbox'; + type?: 'signature' | 'date' | 'text' | 'checkbox' | 'radio' | 'dropdown'; /** * Content type of input * Example: signature */ content_type?: + | 'signature' | 'initial' | 'stamp' - | 'signature' - | 'company' - | 'title' - | 'email' + | 'date' + | 'checkbox' + | 'text' | 'full_name' | 'first_name' | 'last_name' - | 'text' - | 'date' - | 'checkbox' - | 'attachment'; + | 'company' + | 'title' + | 'email' + | 'attachment' + | 'radio' + | 'dropdown'; /** * Index of page that the input is on * Example: 4 diff --git a/src/schemas/sign-requests.generated.ts b/src/schemas/sign-requests.generated.ts index 5ab92146..c2302b3f 100644 --- a/src/schemas/sign-requests.generated.ts +++ b/src/schemas/sign-requests.generated.ts @@ -1,6 +1,6 @@ import * as schemas from '.'; /** - * Sign Requests + * Box Sign * * The part of an API response that describes marker * based pagination @@ -15,14 +15,9 @@ export interface SignRequests { limit?: number; /** * The marker for the start of the next page of results. - * Example: 3000 + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii */ - next_marker?: number; - /** - * The marker for the start of the previous page of results. - * Example: 1000 - */ - prev_marker?: number; + next_marker?: string; /** * A list of sign requests */ diff --git a/src/schemas/sign-templates.generated.ts b/src/schemas/sign-templates.generated.ts index a997b71c..f86da045 100644 --- a/src/schemas/sign-templates.generated.ts +++ b/src/schemas/sign-templates.generated.ts @@ -7,12 +7,24 @@ import * as schemas from '.'; */ export interface SignTemplates { /** - * A list of templates. + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. + * Example: 1000 */ - entries?: schemas.SignTemplate[]; + limit?: number; /** - * The marker for the start of the previous page of results. + * The marker for the start of the next page of results. * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii */ + next_marker?: string; + /** + * The marker for the start of the previous page of results. + * Example: JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih + */ prev_marker?: string; + /** + * A list of templates. + */ + entries?: schemas.SignTemplate[]; } diff --git a/src/schemas/template-signer-input.generated.ts b/src/schemas/template-signer-input.generated.ts index f7cc125c..9e5dc4f1 100644 --- a/src/schemas/template-signer-input.generated.ts +++ b/src/schemas/template-signer-input.generated.ts @@ -9,7 +9,14 @@ export interface TemplateSignerInput extends schemas.SignRequestPrefillTag { * Type of input * Example: text */ - type?: 'signature' | 'date' | 'text' | 'checkbox' | 'radio' | 'dropdown'; + type?: + | 'signature' + | 'date' + | 'text' + | 'checkbox' + | 'attachment' + | 'radio' + | 'dropdown'; /** * Content type of input * Example: text @@ -63,4 +70,9 @@ export interface TemplateSignerInput extends schemas.SignRequestPrefillTag { * The size of the input. */ dimensions?: object; + /** + * The label field is used especially for text, attachment, radio, and checkbox type inputs. + * Example: Legal name + */ + label?: string; } diff --git a/src/schemas/template-signer.generated.ts b/src/schemas/template-signer.generated.ts index 0b783331..79a5ae22 100644 --- a/src/schemas/template-signer.generated.ts +++ b/src/schemas/template-signer.generated.ts @@ -33,4 +33,11 @@ export interface TemplateSigner { * Example: 2 */ order?: number; + /** + * If set, signers who have the same group ID will be assigned to the same input. + * A signer group is expected to have more than one signer. When a group contains fewer than two signers, + * it will be converted to a single signer and the group will be removed. + * Example: cd4ff89-8fc1-42cf-8b29-1890dedd26d7 + */ + signer_group_id?: string; } From 6425022ca98a3e4c8ec7ab89f9b366ffc8bb4207 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Cong Date: Fri, 29 Dec 2023 14:40:27 +0100 Subject: [PATCH 3/4] Update test --- tests/lib/managers/sign-requests-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/managers/sign-requests-test.js b/tests/lib/managers/sign-requests-test.js index fb00a06d..72a591f6 100644 --- a/tests/lib/managers/sign-requests-test.js +++ b/tests/lib/managers/sign-requests-test.js @@ -93,6 +93,7 @@ describe('SignRequests', () => { type: 'folder', id: '1234567890', }, + signer_group_id: '1234567890', }, testQS, ], From ea7c51da195f338d198fa825854b8a2184afcd32 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Cong Date: Fri, 5 Jan 2024 13:41:55 +0100 Subject: [PATCH 4/4] Add integration test --- .../shield-information-barriers.generated.ts | 12 ++++- .../__tests__/sign-request.test.js | 52 +++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/managers/shield-information-barriers.generated.ts b/src/managers/shield-information-barriers.generated.ts index 8614aa94..3ed2eb64 100644 --- a/src/managers/shield-information-barriers.generated.ts +++ b/src/managers/shield-information-barriers.generated.ts @@ -94,7 +94,12 @@ class ShieldInformationBarrierManager { * @returns {Promise} A promise resolving to the result or rejecting with an error */ create( - body: object, + body: { + enterprise: { + type: string; + id: string; + }; + }, options?: {}, callback?: Function ): Promise { @@ -120,7 +125,10 @@ class ShieldInformationBarrierManager { * @returns {Promise} A promise resolving to the result or rejecting with an error */ changeStatusById( - body: object, + body: { + id: string; + status: string; + }, options?: {}, callback?: Function ): Promise { diff --git a/tests/integration_test/__tests__/sign-request.test.js b/tests/integration_test/__tests__/sign-request.test.js index 4f4beaf9..c3aa084a 100644 --- a/tests/integration_test/__tests__/sign-request.test.js +++ b/tests/integration_test/__tests__/sign-request.test.js @@ -92,3 +92,55 @@ test('test sign request', async() => { await file2.dispose(); } }, 120000); + +test('test sign request with signer group', async() => { + let file = await createBoxTestFile(context.client, path.join(__dirname, '../resources/blank.pdf'), 'blank_sign_1.pdf', context.folder.id); + let signerGroup = 'signer_group_id'; + try { + const sr = await context.client.signRequests.create({ + signers: [ + { + email: 'sdk_integration_test@boxdemo.com', + role: 'signer', + signer_group_id: signerGroup, + }, + { + email: 'sdk_integration_test+user1@boxdemo.com', + role: 'signer', + signer_group_id: signerGroup, + } + ], + source_files: [ + { + type: 'file', + id: file.id, + }, + ], + parent_folder: { + id: context.folder.id, + type: 'folder', + }, + }); + expect(sr.signers.length).toBe(3); // Include 2 signers + 1 final copy reader + let signerGroupId = null; + for (let signer of sr.signers) { + if (signer.role === 'signer') { + if (signerGroupId === null) { + signerGroupId = signer.signer_group_id; + } + expect(signer.signer_group_id).toBe(signerGroupId); + } else if (signer.role === 'final_copy_reader') { + expect(signer.email).toBe(context.user.login.toLowerCase()); + } + } + let sr2 = await context.client.signRequests.cancelById({ + sign_request_id: sr.id + }); + sr2 = await context.client.signRequests.getById({ + sign_request_id: sr.id + }); + expect(sr2.status).toBe('cancelled'); + } finally { + await file.dispose(); + } +}, 120000);