Skip to content

Commit 3639902

Browse files
authored
Merge pull request #60 from eversign/issue#59-extending-signer-object
issue#59 Extending signer object with various fields
2 parents 314d5a5 + ccd2606 commit 3639902

File tree

1 file changed

+85
-5
lines changed

1 file changed

+85
-5
lines changed

lib/Signer.js

Lines changed: 85 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,49 @@ function Signer(newSigner = {}) {
9191
*/
9292
status: undefined,
9393

94-
9594
/**
9695
* the embedded/iframe signing url
9796
*
9897
* @var {Date} embeddedSigningUrl
9998
* @type {Date}
10099
*/
101100
embeddedSigningUrl: undefined,
101+
102+
/**
103+
* This parameter is only applicable if embedded_signing_enabled is set to 1.
104+
* When this parameter is set, embedded document signers will be notified by email.
105+
*
106+
* @type {Boolean}
107+
*/
108+
deliverEmail: undefined,
109+
110+
/**
111+
* This parameter is used to specify if signer authentication by SMS is enabled.
112+
*
113+
* @type {Boolean}
114+
*/
115+
signerAuthenticationSmsEnabled: undefined,
116+
117+
/**
118+
* If signer authentication by SMS is enabled, this parameter is used to specify the phone number to which SMS validation will be delivered. ITU call prefix can start both with 00 or + sign.
119+
*
120+
* @type {String}
121+
*/
122+
signerAuthenticationPhoneNumber: undefined,
123+
124+
/**
125+
* This parameter can be used to specify a custom message (upon document delivery) for the current signer. Please note that for the current signer the general document message will be overriden by this parameter.
126+
*
127+
* @type {String}
128+
*/
129+
message: undefined,
130+
131+
/**
132+
* This parameter is used to specify the language in which signing notifications (emails), the document status page and the signature process will appear for this signer.
133+
*
134+
* @type {String}
135+
*/
136+
language: undefined,
102137
};
103138

104139
Object.assign(signer, newSigner);
@@ -143,6 +178,31 @@ function Signer(newSigner = {}) {
143178
return signer.status;
144179
};
145180

181+
this.getEmbeddedSigningUrl = function () {
182+
return signer.embeddedSigningUrl;
183+
};
184+
185+
this.getDeliverEmail = function () {
186+
return signer.deliverEmail;
187+
}
188+
189+
this.getSignerAuthenticationSmsEnabled = function () {
190+
return signer.signerAuthenticationSmsEnabled;
191+
}
192+
193+
this.getSignerAuthenticationPhoneNumber = function () {
194+
return signer.signerAuthenticationPhoneNumber;
195+
}
196+
197+
this.getMessage = function () {
198+
return signer.message;
199+
}
200+
201+
this.getLanguage = function () {
202+
return signer.language;
203+
}
204+
205+
146206
this.setId = function (newId) {
147207
signer.id = newId;
148208
};
@@ -215,14 +275,34 @@ function Signer(newSigner = {}) {
215275
signer.required = newRequired;
216276
}
217277

278+
this.setEmbeddedSigningUrl = function (newEmbeddedSigningUrl) {
279+
signer.embeddedSigningUrl = newEmbeddedSigningUrl;
280+
}
281+
282+
this.setDeliverEmail = function (newDeliverEmail) {
283+
signer.deliverEmail = newDeliverEmail;
284+
}
285+
286+
this.setSignerAuthenticationSmsEnabled = function (newSignerAuthenticationSmsEnabled) {
287+
signer.signerAuthenticationSmsEnabled = newSignerAuthenticationSmsEnabled;
288+
}
289+
290+
this.setSignerAuthenticationPhoneNumber = function (newSignerAuthenticationPhoneNumber) {
291+
signer.signerAuthenticationPhoneNumber = newSignerAuthenticationPhoneNumber;
292+
}
293+
294+
this.setMessage = function (newMessage) {
295+
signer.message = newMessage;
296+
}
297+
298+
this.setLanguage = function (newLanguage) {
299+
signer.language = newLanguage;
300+
}
301+
218302
this.toObject = function () {
219303
return Object.assign(this, signer);
220304
};
221305

222-
this.getEmbeddedSigningUrl = function () {
223-
return signer.embeddedSigningUrl;
224-
};
225-
226306
}
227307

228308
module.exports = Signer;

0 commit comments

Comments
 (0)