Skip to content

Commit

Permalink
[eversign#71] Add missing fields when for DocumentTemplate.
Browse files Browse the repository at this point in the history
Allows setting missing paramaters 'require_all_signers' & 'reminders' when using a template to create a document.
  • Loading branch information
fishsaidno committed Jun 13, 2023
1 parent 1ab0618 commit 7211333
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/DocumentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ function Template(templateId) {
*/
expires: undefined,

/**
* Set to true to enable Auto Reminders for this Document
* @var {Boolean} reminders
* @type {Boolean}
*/
reminders: undefined,

/**
* Set to true requires all signers to sign the document to complete it
* @var {Boolean} requireAllSigners
* @type {Boolean}
*/
requireAllSigners: undefined,

/**
* Array of Signer Objects which are associated with the Document
*
Expand Down Expand Up @@ -192,6 +206,22 @@ function Template(templateId) {
return template.expires;
};

this.setReminders = function (newReminders) {
document.reminders = newReminders;
};

this.getReminders = function () {
return document.reminders;
};

this.setRequireAllSigners = function (newRequireAllSigners) {
document.requireAllSigners = newRequireAllSigners;
};

this.getRequireAllSigners = function () {
return document.requireAllSigners;
};

this.getSigners = function () {
return template.signers.map(function (signer) {
signer = _.mapKeys(signer, function(v, k ){ return _.camelCase(k); });
Expand Down
12 changes: 12 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ declare module 'eversign/lib/DocumentTemplate' {
public getMessage(): string
public getRecipients(): Recipient[]
public getRedirect(): string
public getReminders(): boolean
public getRequireAllSigners(): boolean
public getRedirectDecline(): string
public getSandbox(): boolean
public getSigners(): Signer[]
Expand All @@ -435,6 +437,8 @@ declare module 'eversign/lib/DocumentTemplate' {
public setRecipients(recipients: Recipient[]): void
public setRedirect(redirect: string): void
public setRedirectDecline(redirect_decline: string): void
public setReminders(newReminders: boolean): void
public setRequireAllSigners(newRequireAllSigners: boolean): void
public setSandbox(sandbox: boolean): void
public setSigners(signers: Signer[]): void
public setTemplateId(templateId?: string | undefined): void
Expand Down Expand Up @@ -493,6 +497,14 @@ declare module 'eversign/lib/DocumentTemplate' {
* Expiration Time of the Document, default expiration time will be used if unset
*/
expires: Date,
/**
* Set to true to enable Auto Reminders for this Document
*/
reminders: boolean,
/**
* Set to true requires all signers to sign the document to complete it
*/
requireAllSigners: boolean,
/**
* Array of Signer Objects which are associated with the Document
*/
Expand Down

0 comments on commit 7211333

Please sign in to comment.