@verdocs/js-sdk 3.3.2 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Envelopes/Envelopes.d.ts +4 -4
- package/Envelopes/Types.d.ts +24 -8
- package/Templates/Templates.d.ts +39 -1
- package/Templates/Types.d.ts +22 -0
- package/package.json +1 -1
package/Envelopes/Envelopes.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEnvelope, IEnvelopesSummary, IRecipient,
|
|
1
|
+
import { IEnvelope, IEnvelopesSummary, IRecipient, IEnvelopeDocument, IEnvelopeFieldSettings } from './Types';
|
|
2
2
|
import { ICreateEnvelopeRole, IEnvelopesSearchResult, ISigningSessionRequest } from './Types';
|
|
3
3
|
import { TEnvelopeUpdateResult, TEnvelopeStatus, TRecipientStatus } from './Types';
|
|
4
4
|
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
@@ -167,17 +167,17 @@ export declare const getEnvelopeFile: (endpoint: VerdocsEndpoint, envelopeId: st
|
|
|
167
167
|
/**
|
|
168
168
|
* Update a Document field. Typically called during the signing process as a Recipient fills in fields.
|
|
169
169
|
*/
|
|
170
|
-
export declare const updateEnvelopeField: (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, value: any) => Promise<
|
|
170
|
+
export declare const updateEnvelopeField: (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, value: any) => Promise<IEnvelopeFieldSettings>;
|
|
171
171
|
/**
|
|
172
172
|
* Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a
|
|
173
173
|
* signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.
|
|
174
174
|
*/
|
|
175
|
-
export declare const updateEnvelopeFieldSignature: (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, signatureId: string) => Promise<
|
|
175
|
+
export declare const updateEnvelopeFieldSignature: (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, signatureId: string) => Promise<IEnvelopeFieldSettings>;
|
|
176
176
|
/**
|
|
177
177
|
* Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a
|
|
178
178
|
* signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.
|
|
179
179
|
*/
|
|
180
|
-
export declare const updateEnvelopeFieldInitials: (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, initialId: string) => Promise<
|
|
180
|
+
export declare const updateEnvelopeFieldInitials: (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, initialId: string) => Promise<IEnvelopeFieldSettings>;
|
|
181
181
|
/**
|
|
182
182
|
* Get the attached file for an attachment field (if any)
|
|
183
183
|
*/
|
package/Envelopes/Types.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export interface IRecipient {
|
|
|
134
134
|
status: TRecipientStatus;
|
|
135
135
|
type: TRecipientType;
|
|
136
136
|
updated_at: string;
|
|
137
|
-
fields?:
|
|
137
|
+
fields?: IEnvelopeField[];
|
|
138
138
|
}
|
|
139
139
|
export interface IEnvelopeDocument {
|
|
140
140
|
id: string;
|
|
@@ -148,7 +148,7 @@ export interface IEnvelopeDocument {
|
|
|
148
148
|
created_at: string;
|
|
149
149
|
updated_at: string;
|
|
150
150
|
}
|
|
151
|
-
export interface
|
|
151
|
+
export interface IEnvelopeFieldOptions {
|
|
152
152
|
/** The unique ID of the field */
|
|
153
153
|
id: string;
|
|
154
154
|
/** The X position of the field on the page. Self-placed fields will have an X value of 0. */
|
|
@@ -162,7 +162,7 @@ export interface IDocumentFieldOptions {
|
|
|
162
162
|
/** The visible label for the field e.g. 'Not Applicable' */
|
|
163
163
|
value: string;
|
|
164
164
|
}
|
|
165
|
-
export interface
|
|
165
|
+
export interface IEnvelopeFieldSettings {
|
|
166
166
|
type?: string;
|
|
167
167
|
x: number;
|
|
168
168
|
y: number;
|
|
@@ -176,7 +176,7 @@ export interface IDocumentFieldSettings {
|
|
|
176
176
|
alignment?: number;
|
|
177
177
|
upperCase?: boolean;
|
|
178
178
|
/** Dropdowns, checkboxes, radio groups */
|
|
179
|
-
options?:
|
|
179
|
+
options?: IEnvelopeFieldOptions[];
|
|
180
180
|
/** Signatures and Initials, result will be "signed" */
|
|
181
181
|
base64?: string;
|
|
182
182
|
hash?: string;
|
|
@@ -202,9 +202,9 @@ export declare enum DocumentFieldTypes {
|
|
|
202
202
|
PAYMENT = "payment"
|
|
203
203
|
}
|
|
204
204
|
export type TDocumentFieldType = `${DocumentFieldTypes}`;
|
|
205
|
-
export interface
|
|
205
|
+
export interface IEnvelopeField {
|
|
206
206
|
/**
|
|
207
|
-
* The ID of the
|
|
207
|
+
* The ID of the envelope the field is for. For historical reasons, this is called `envelope_id` because documents
|
|
208
208
|
* were previously called envelopes.
|
|
209
209
|
*/
|
|
210
210
|
envelope_id: string;
|
|
@@ -220,10 +220,26 @@ export interface IDocumentField {
|
|
|
220
220
|
type: TDocumentFieldType;
|
|
221
221
|
/** If true, the field will be required */
|
|
222
222
|
required: boolean;
|
|
223
|
-
settings?:
|
|
223
|
+
settings?: IEnvelopeFieldSettings;
|
|
224
224
|
validator: string | null;
|
|
225
225
|
/** Not sent by the server. Used in the UI to identify prepared fields. */
|
|
226
226
|
prepared?: boolean;
|
|
227
|
+
/** If set, the tab index for the field. */
|
|
228
|
+
tabindex: number;
|
|
229
|
+
/** The X position of the field. */
|
|
230
|
+
x: number;
|
|
231
|
+
/** The Y position of the field. */
|
|
232
|
+
y: number;
|
|
233
|
+
/** The width of the field. */
|
|
234
|
+
width: number;
|
|
235
|
+
/** The height of the field. */
|
|
236
|
+
height: number;
|
|
237
|
+
/** The default value for the field. */
|
|
238
|
+
default?: string;
|
|
239
|
+
/** The placeholder to show in the field. */
|
|
240
|
+
placeholder?: string;
|
|
241
|
+
/** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */
|
|
242
|
+
group?: string;
|
|
227
243
|
}
|
|
228
244
|
/**
|
|
229
245
|
* An Envelope is a workflow wrapper that shepherds one or more Documents through the various recipients in a signing
|
|
@@ -255,7 +271,7 @@ export interface IEnvelope {
|
|
|
255
271
|
document?: IEnvelopeDocument | null;
|
|
256
272
|
/** Documents attached to this envelope */
|
|
257
273
|
documents?: IEnvelopeDocument[] | null;
|
|
258
|
-
fields?:
|
|
274
|
+
fields?: IEnvelopeField[];
|
|
259
275
|
}
|
|
260
276
|
export type TEnvelopeUpdateResult = Omit<IEnvelope, 'histories' | 'recipients' | 'certificate' | 'document' | 'fields' | 'profile'>;
|
|
261
277
|
export interface IActivityEntry {
|
package/Templates/Templates.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { ITemplate, ITemplateOwnerInfo, ITemplatesSearchResult, ITemplatesSummary, TTemplateSender } from './Types';
|
|
7
|
+
import { IRole, ITemplate, ITemplateField, ITemplateOwnerInfo, ITemplatesSearchResult, ITemplatesSummary, TTemplateSender } from './Types';
|
|
8
8
|
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
9
9
|
export interface IGetTemplatesParams {
|
|
10
10
|
is_starred?: boolean;
|
|
@@ -44,12 +44,50 @@ export declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
export declare const getTemplateOwnerInfo: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateOwnerInfo>;
|
|
47
|
+
/**
|
|
48
|
+
* Represents a document to be attached to a template via an externally-accessible URI. A copy of the document will be
|
|
49
|
+
* downloaded from the specified URI. Note that the URI will be accessed without headers or other authorization methods
|
|
50
|
+
* set, so the URI itself must encode any security tokens or keys required to access the file.
|
|
51
|
+
*/
|
|
52
|
+
export interface IDocumentFromUri {
|
|
53
|
+
/** The URI to retrieve the file from. */
|
|
54
|
+
uri: string;
|
|
55
|
+
/** A name for the attachment. */
|
|
56
|
+
name: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Represents a document to be attached to a template via a Base64-encoded string attachment. This is the best option
|
|
60
|
+
* for maximum security but there is a 10MB size limit for the entire creation request. Requests attaching larger files
|
|
61
|
+
* should use `IDocumentFromUri` or add attachments via `createTemplateDocument` after creating the template.
|
|
62
|
+
*/
|
|
63
|
+
export interface IDocumentFromData {
|
|
64
|
+
/** Base64-encoded file data. */
|
|
65
|
+
data: string;
|
|
66
|
+
/** A name for the attachment. */
|
|
67
|
+
name: string;
|
|
68
|
+
}
|
|
47
69
|
export interface ITemplateCreateParams {
|
|
70
|
+
/** Name for the template to create. */
|
|
48
71
|
name: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional (defaults to true). Personal templates are only visible to the owner. Non-personal templates are shared
|
|
74
|
+
* within the user's organization.
|
|
75
|
+
*/
|
|
49
76
|
is_personal?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Optional (defaults to false). Public templates may be found (via search) and viewed by anyone.
|
|
79
|
+
*/
|
|
50
80
|
is_public?: boolean;
|
|
81
|
+
/** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */
|
|
51
82
|
sender?: TTemplateSender;
|
|
83
|
+
/** Optional description for the template to help identify it. */
|
|
52
84
|
description?: string;
|
|
85
|
+
/** Optional list of roles to create. Documents are required if roles or fields will also be specified. */
|
|
86
|
+
documents?: (IDocumentFromUri | IDocumentFromData)[];
|
|
87
|
+
/** Optional list of roles to create. Documents are required if fields will also be specified. */
|
|
88
|
+
roles?: IRole[];
|
|
89
|
+
/** Optional list of fields to create. Fields associated with roles or documents that do not exist will be ignored. */
|
|
90
|
+
fields?: ITemplateField[];
|
|
53
91
|
}
|
|
54
92
|
/**
|
|
55
93
|
* Create a template.
|
package/Templates/Types.d.ts
CHANGED
|
@@ -253,8 +253,14 @@ export interface ITemplateDocument {
|
|
|
253
253
|
pages?: IPage[];
|
|
254
254
|
}
|
|
255
255
|
export interface ITemplateField {
|
|
256
|
+
/** The machine name of the field, e.g. `checkbox_groupP1-18` */
|
|
256
257
|
name: string;
|
|
258
|
+
/** The ID of the role in the recipients list, e.g. `Recipient 2` */
|
|
257
259
|
role_name: string;
|
|
260
|
+
/**
|
|
261
|
+
* The ID of the document the field is for. For historical reasons, this is called `envelope_id` because documents
|
|
262
|
+
* were previously called envelopes.
|
|
263
|
+
*/
|
|
258
264
|
template_id: string;
|
|
259
265
|
type: TDocumentFieldType;
|
|
260
266
|
required: boolean;
|
|
@@ -262,6 +268,22 @@ export interface ITemplateField {
|
|
|
262
268
|
page_sequence: number;
|
|
263
269
|
validator?: string;
|
|
264
270
|
label?: string;
|
|
271
|
+
/** If set, the tab index for the field. */
|
|
272
|
+
tabindex: number;
|
|
273
|
+
/** The X position of the field. */
|
|
274
|
+
x: number;
|
|
275
|
+
/** The Y position of the field. */
|
|
276
|
+
y: number;
|
|
277
|
+
/** The width of the field. */
|
|
278
|
+
width: number;
|
|
279
|
+
/** The height of the field. */
|
|
280
|
+
height: number;
|
|
281
|
+
/** The default value for the field. */
|
|
282
|
+
default?: string;
|
|
283
|
+
/** The placeholder to show in the field. */
|
|
284
|
+
placeholder?: string;
|
|
285
|
+
/** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */
|
|
286
|
+
group?: string;
|
|
265
287
|
}
|
|
266
288
|
export interface ITextFieldSetting {
|
|
267
289
|
x: number;
|