@signsealer/sdk 1.0.0 → 1.7.0
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/CHANGELOG.md +297 -0
- package/README.md +82 -0
- package/dist/cjs/index.cjs +316 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.d.ts +828 -30
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +282 -17
- package/dist/esm/index.js.map +1 -1
- package/package.json +26 -9
package/dist/esm/index.d.ts
CHANGED
|
@@ -44,6 +44,13 @@ export interface Account {
|
|
|
44
44
|
slug: string;
|
|
45
45
|
key_label: string;
|
|
46
46
|
scopes: string[];
|
|
47
|
+
/** The sites this business's signing pages may be framed on (1.6.0); empty until it proves one. */
|
|
48
|
+
frame_origins?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* `test` when the key is a test key (1.7.0): its account is the business's
|
|
51
|
+
* sandbox, where nothing is sent to anybody and nothing is billed.
|
|
52
|
+
*/
|
|
53
|
+
mode?: "live" | "test";
|
|
47
54
|
}
|
|
48
55
|
/** What `recordSmsConsent` wrote, with the number as we normalised it. */
|
|
49
56
|
export interface SmsConsentRecorded {
|
|
@@ -70,7 +77,97 @@ export interface Template {
|
|
|
70
77
|
version: number;
|
|
71
78
|
is_published: boolean;
|
|
72
79
|
is_latest: boolean;
|
|
80
|
+
/** How long a signature on this template stays good, in months; null when it does not run out (00406). */
|
|
81
|
+
valid_months?: number | null;
|
|
82
|
+
/** Days before the end each signer is emailed a link to sign again (00406). */
|
|
83
|
+
remind_days?: number | null;
|
|
84
|
+
/** Signatures on versions older than this are not current: the terms changed (00406). */
|
|
85
|
+
resign_from_version?: number | null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* One template version, whole (1.6.0): its text, what it asks, the settings
|
|
89
|
+
* its code carries, and every version of the code beside it.
|
|
90
|
+
*/
|
|
91
|
+
export interface TemplateDetail extends Template {
|
|
92
|
+
published_at: string | null;
|
|
93
|
+
created_at: string;
|
|
94
|
+
body: string;
|
|
95
|
+
body_format: "text" | "markdown";
|
|
96
|
+
variables: string[];
|
|
97
|
+
grants: Record<string, unknown>;
|
|
98
|
+
consent_text: string | null;
|
|
99
|
+
fields: Ask[];
|
|
100
|
+
has_pdf: boolean;
|
|
101
|
+
documents: number;
|
|
102
|
+
/** Per code, not per version: they carry over to every version after. */
|
|
103
|
+
settings: TemplateSettings;
|
|
104
|
+
/** What changed in this version (1.7.0), written while it was a draft and frozen when it was published. */
|
|
105
|
+
change_note?: string | null;
|
|
106
|
+
/** Every version of this code, newest first. A published version is never changed or removed. */
|
|
107
|
+
versions: Array<{
|
|
108
|
+
template_id: string;
|
|
109
|
+
version: number;
|
|
110
|
+
is_published: boolean;
|
|
111
|
+
published_at: string | null;
|
|
112
|
+
name?: string;
|
|
113
|
+
created_at?: string;
|
|
114
|
+
change_note?: string | null;
|
|
115
|
+
has_pdf?: boolean;
|
|
116
|
+
documents?: number;
|
|
117
|
+
}>;
|
|
118
|
+
}
|
|
119
|
+
export interface TemplateSettings {
|
|
120
|
+
/** Made to send once rather than reused. */
|
|
121
|
+
one_time: boolean;
|
|
122
|
+
/** The business's address printed under it. */
|
|
123
|
+
show_address: boolean;
|
|
124
|
+
/** How long a signature stays good, in months; null when it does not run out. */
|
|
125
|
+
valid_months: number | null;
|
|
126
|
+
/** Days before the end each signer is sent a link to sign again. */
|
|
127
|
+
remind_days: number | null;
|
|
128
|
+
/** Signatures on versions older than this must be made again. */
|
|
129
|
+
resign_from_version: number | null;
|
|
130
|
+
}
|
|
131
|
+
/** A fresh signing link to put in a frame (1.6.0). */
|
|
132
|
+
export interface EmbedLink {
|
|
133
|
+
document_id: string;
|
|
134
|
+
signer_id: string;
|
|
135
|
+
url: string;
|
|
136
|
+
/** The sites the page may be framed on. Anywhere else the browser refuses it; empty means nowhere yet. */
|
|
137
|
+
frame_origins: string[];
|
|
138
|
+
expires_at: string | null;
|
|
73
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* What the signing page tells the page framing it, by `postMessage` (1.6.0).
|
|
142
|
+
* `ready` on every page, with its height; `signed` and `declined` once.
|
|
143
|
+
*/
|
|
144
|
+
export interface EmbedEvent {
|
|
145
|
+
source: "signsealer";
|
|
146
|
+
event: "ready" | "signed" | "declined";
|
|
147
|
+
document_id: string | null;
|
|
148
|
+
signer_id: string | null;
|
|
149
|
+
height: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Whether a signed document is still good (00406): `current`, `expired`,
|
|
153
|
+
* `resign` (signed on a version the business has since asked everybody to
|
|
154
|
+
* sign again), `renewed` (the same person has signed the template since) or
|
|
155
|
+
* `on_file` (the template has no period).
|
|
156
|
+
*/
|
|
157
|
+
export type Standing = "current" | "expired" | "resign" | "renewed" | "on_file";
|
|
158
|
+
/** What `standing` answers: a person's newest signature on one template (00406). */
|
|
159
|
+
export type PersonStanding = {
|
|
160
|
+
template: string;
|
|
161
|
+
found: false;
|
|
162
|
+
} | {
|
|
163
|
+
template: string;
|
|
164
|
+
found: true;
|
|
165
|
+
document_id: string;
|
|
166
|
+
signed_at: string;
|
|
167
|
+
template_version: number;
|
|
168
|
+
standing: Standing;
|
|
169
|
+
valid_until: string | null;
|
|
170
|
+
};
|
|
74
171
|
/** One question a template asks besides a signature. */
|
|
75
172
|
export interface Ask {
|
|
76
173
|
/** Lower-case, letters then letters/digits/underscore, up to 59 characters. */
|
|
@@ -88,7 +185,48 @@ export interface Ask {
|
|
|
88
185
|
supplied_by?: "adult" | "per_child" | "staff";
|
|
89
186
|
options?: string[];
|
|
90
187
|
hint?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Ask it only when an earlier question was answered a certain way (00375).
|
|
190
|
+
* Only a question *above* it: a form is read top to bottom. A hidden
|
|
191
|
+
* question is not required, and changing the answer it depends on clears
|
|
192
|
+
* it, so the certificate never carries an answer to a question nobody saw.
|
|
193
|
+
*/
|
|
194
|
+
show_if?: ShowIf | null;
|
|
195
|
+
/**
|
|
196
|
+
* Put the answer in front of a person when it matches (00373). Staff see
|
|
197
|
+
* the flag, in the dashboard and on `document`; the signer never does.
|
|
198
|
+
*/
|
|
199
|
+
flag_when?: AnswerRule | null;
|
|
200
|
+
/**
|
|
201
|
+
* A set of questions asked as one thing (00372) -- a safety declaration, a
|
|
202
|
+
* medical section. Name the same `block` on each; give `block_label` (and
|
|
203
|
+
* `block_intro`, if any) once, on whichever comes first.
|
|
204
|
+
*/
|
|
205
|
+
block?: string | null;
|
|
206
|
+
block_label?: string | null;
|
|
207
|
+
block_intro?: string | null;
|
|
208
|
+
/** The block gets a page of its own, with a Next button (00379). */
|
|
209
|
+
block_step?: boolean | null;
|
|
210
|
+
/** Where it is answered on an uploaded PDF's page (00243), in fractions of the page. */
|
|
211
|
+
place?: Place | null;
|
|
91
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* A rule about an answer, exactly one of these (00373, 00375): `equals` for a
|
|
215
|
+
* choice, `ticked` or `unticked` for a checkbox, `answered` for anything.
|
|
216
|
+
*/
|
|
217
|
+
export type AnswerRule = {
|
|
218
|
+
equals: string[];
|
|
219
|
+
} | {
|
|
220
|
+
ticked: boolean;
|
|
221
|
+
} | {
|
|
222
|
+
unticked: boolean;
|
|
223
|
+
} | {
|
|
224
|
+
answered: boolean;
|
|
225
|
+
};
|
|
226
|
+
/** A rule about an earlier question's answer, naming which question. */
|
|
227
|
+
export type ShowIf = AnswerRule & {
|
|
228
|
+
field: string;
|
|
229
|
+
};
|
|
92
230
|
/** What `createTemplate` takes. */
|
|
93
231
|
export interface TemplateInput {
|
|
94
232
|
/** Lower-case, starting with a letter: `rental-agreement`, `liability_waiver`. */
|
|
@@ -175,12 +313,74 @@ export interface SealSummary {
|
|
|
175
313
|
}
|
|
176
314
|
export interface SignerLink {
|
|
177
315
|
signer_id: string;
|
|
178
|
-
|
|
316
|
+
/** Null for a signer reachable only by text. */
|
|
317
|
+
email: string | null;
|
|
318
|
+
/** E.164, as the engine normalised it. Null unless a number was given. */
|
|
319
|
+
phone?: string | null;
|
|
179
320
|
full_name?: string;
|
|
180
321
|
role?: string;
|
|
181
322
|
participant?: boolean;
|
|
182
|
-
/** The signing
|
|
323
|
+
/** The signing token. Returned once, and never again — only its hash is kept. */
|
|
183
324
|
token: string;
|
|
325
|
+
/** The page to send them to, built from the token (1.6.0). */
|
|
326
|
+
url?: string;
|
|
327
|
+
/** `embedded`: nothing was sent to them; show them `url` yourself (1.6.0). */
|
|
328
|
+
delivery?: "send" | "embedded";
|
|
329
|
+
}
|
|
330
|
+
/** Who has signed one document (00340): names and states, nothing else. */
|
|
331
|
+
export interface DocumentSigners {
|
|
332
|
+
document_id: string;
|
|
333
|
+
title: string;
|
|
334
|
+
status: string;
|
|
335
|
+
sent_at: string | null;
|
|
336
|
+
completed_at: string | null;
|
|
337
|
+
/** Whether it is still good once signed, and until when (00406). */
|
|
338
|
+
standing?: Standing | null;
|
|
339
|
+
valid_until?: string | null;
|
|
340
|
+
signers: Array<{
|
|
341
|
+
signer_id: string;
|
|
342
|
+
full_name: string;
|
|
343
|
+
role: string;
|
|
344
|
+
sign_order: number;
|
|
345
|
+
status: string;
|
|
346
|
+
signed_at: string | null;
|
|
347
|
+
declined_at: string | null;
|
|
348
|
+
}>;
|
|
349
|
+
/**
|
|
350
|
+
* Whether you may mint a fresh link for it with `gateLink` (00409). Always
|
|
351
|
+
* true for a key; for a paired tablet, only on a document it or its form
|
|
352
|
+
* started, unless the business let that tablet show links for every open
|
|
353
|
+
* document (`setDevice(id, { gate: "account" })`).
|
|
354
|
+
*/
|
|
355
|
+
link_allowed?: boolean;
|
|
356
|
+
}
|
|
357
|
+
/** A fresh signing link for a signer who has not signed, with a QR code to hold up (00340). */
|
|
358
|
+
export interface GateLink {
|
|
359
|
+
document_id: string;
|
|
360
|
+
signer_id: string;
|
|
361
|
+
url: string;
|
|
362
|
+
/** The QR code as SVG, drawn on the server. */
|
|
363
|
+
qr_svg: string;
|
|
364
|
+
}
|
|
365
|
+
/** What a signing code resolves to for a tablet (00321). */
|
|
366
|
+
export interface PacketLookup {
|
|
367
|
+
found: boolean;
|
|
368
|
+
why?: string;
|
|
369
|
+
packet_id?: string;
|
|
370
|
+
code?: string;
|
|
371
|
+
state?: string;
|
|
372
|
+
required?: number;
|
|
373
|
+
completed?: number;
|
|
374
|
+
outstanding?: number;
|
|
375
|
+
declined?: number;
|
|
376
|
+
expires_at?: string | null;
|
|
377
|
+
items?: Array<{
|
|
378
|
+
item_id: string;
|
|
379
|
+
who: string;
|
|
380
|
+
workflow: string;
|
|
381
|
+
required: boolean;
|
|
382
|
+
status: string;
|
|
383
|
+
}>;
|
|
184
384
|
}
|
|
185
385
|
export interface StartedWorkflow {
|
|
186
386
|
document_id: string;
|
|
@@ -210,8 +410,102 @@ export interface Participant {
|
|
|
210
410
|
/** The `ref` of the adult who signs for this minor. */
|
|
211
411
|
guardian_ref?: string;
|
|
212
412
|
}
|
|
413
|
+
/** One row of `GET /v1/documents`: enough for a list, never the signers' addresses. */
|
|
414
|
+
export interface DocumentRow {
|
|
415
|
+
document_id: string;
|
|
416
|
+
title: string;
|
|
417
|
+
status: string;
|
|
418
|
+
signers: number;
|
|
419
|
+
signed: number;
|
|
420
|
+
waiting_on: string | null;
|
|
421
|
+
sent_at: string | null;
|
|
422
|
+
completed_at: string | null;
|
|
423
|
+
/** Whether it is still good once signed, and until when (00406). */
|
|
424
|
+
standing?: Standing | null;
|
|
425
|
+
valid_until?: string | null;
|
|
426
|
+
/** Your own reference, when you gave one (1.6.0). */
|
|
427
|
+
external_ref?: string | null;
|
|
428
|
+
}
|
|
429
|
+
/** What `document` answers. The trail and the signers are as the API documents them. */
|
|
430
|
+
export interface DocumentDetail {
|
|
431
|
+
document_id: string;
|
|
432
|
+
title: string;
|
|
433
|
+
status: string;
|
|
434
|
+
body: string;
|
|
435
|
+
body_format?: "text" | "markdown";
|
|
436
|
+
body_sha256_hex?: string;
|
|
437
|
+
template_code: string | null;
|
|
438
|
+
template_version: number | null;
|
|
439
|
+
sent_at: string | null;
|
|
440
|
+
completed_at: string | null;
|
|
441
|
+
voided_at: string | null;
|
|
442
|
+
void_reason: string | null;
|
|
443
|
+
integrity_ok: boolean | null;
|
|
444
|
+
redacted_at?: string | null;
|
|
445
|
+
/** Whether it is still good, until when, and the newer signing that replaced it (00406). */
|
|
446
|
+
standing?: Standing | null;
|
|
447
|
+
valid_until?: string | null;
|
|
448
|
+
renewed_by?: string | null;
|
|
449
|
+
signers: Array<Record<string, unknown>>;
|
|
450
|
+
events: Array<Record<string, unknown>>;
|
|
451
|
+
/** Every question, in the form's order, with the signer it belongs to (00395). */
|
|
452
|
+
answers: DocumentAnswer[];
|
|
453
|
+
/** How many answers want a person to read them. */
|
|
454
|
+
flagged: number;
|
|
455
|
+
[key: string]: unknown;
|
|
456
|
+
/** What you set when you made it (1.6.0). */
|
|
457
|
+
external_ref?: string | null;
|
|
458
|
+
metadata?: Record<string, string>;
|
|
459
|
+
return_url?: string | null;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* One answer on a document (00395).
|
|
463
|
+
*
|
|
464
|
+
* `asked` is whether the question was on the signer's page: a question its
|
|
465
|
+
* condition hid is `asked: false`, has no value and is never `flagged`. A
|
|
466
|
+
* sensitive answer is masked, as it is for the business's own staff. A
|
|
467
|
+
* redacted document keeps its questions and gives up every value.
|
|
468
|
+
*/
|
|
469
|
+
export interface DocumentAnswer {
|
|
470
|
+
signer_id: string;
|
|
471
|
+
key: string;
|
|
472
|
+
label: string;
|
|
473
|
+
kind: string;
|
|
474
|
+
block: {
|
|
475
|
+
key: string;
|
|
476
|
+
label: string | null;
|
|
477
|
+
} | null;
|
|
478
|
+
/** Whose answer, when one is asked per child. */
|
|
479
|
+
about: string | null;
|
|
480
|
+
required: boolean;
|
|
481
|
+
sensitive: boolean;
|
|
482
|
+
asked: boolean;
|
|
483
|
+
value: string | null;
|
|
484
|
+
supplied_at: string | null;
|
|
485
|
+
flagged: boolean;
|
|
486
|
+
}
|
|
487
|
+
/** One row of `GET /v1/workflows`: a public form, QR or kiosk workflow. */
|
|
488
|
+
export interface Workflow {
|
|
489
|
+
id: string;
|
|
490
|
+
code: string;
|
|
491
|
+
name: string;
|
|
492
|
+
kind: string;
|
|
493
|
+
active: boolean;
|
|
494
|
+
template_published: boolean;
|
|
495
|
+
form_fields: Array<{
|
|
496
|
+
key: string;
|
|
497
|
+
label: string;
|
|
498
|
+
required?: boolean;
|
|
499
|
+
}>;
|
|
500
|
+
intro: string | null;
|
|
501
|
+
}
|
|
213
502
|
export interface ClientOptions {
|
|
214
|
-
|
|
503
|
+
/**
|
|
504
|
+
* The key. Optional for one call only: `pairDevice`, where the pairing code
|
|
505
|
+
* is the credential. A client built without a key sends no authorization
|
|
506
|
+
* header and every other route refuses it, which is the right answer.
|
|
507
|
+
*/
|
|
508
|
+
apiKey?: string;
|
|
215
509
|
baseUrl?: string;
|
|
216
510
|
/** Total attempts for a retryable failure, the first included. */
|
|
217
511
|
maxAttempts?: number;
|
|
@@ -237,7 +531,7 @@ export declare class SignSealer {
|
|
|
237
531
|
* polling for it.
|
|
238
532
|
*/
|
|
239
533
|
agreementsRemaining: number | null;
|
|
240
|
-
constructor(opts
|
|
534
|
+
constructor(opts?: ClientOptions);
|
|
241
535
|
/** Prove the key works, and say whose account it is. */
|
|
242
536
|
/**
|
|
243
537
|
* The brand this account shows its signers.
|
|
@@ -249,7 +543,75 @@ export declare class SignSealer {
|
|
|
249
543
|
*/
|
|
250
544
|
branding(): Promise<Branding>;
|
|
251
545
|
account(): Promise<Account>;
|
|
252
|
-
|
|
546
|
+
/** Every version of every template, newest first; `code` narrows it to one template's versions. No text: `template(id)` has that. */
|
|
547
|
+
templates(filter?: {
|
|
548
|
+
code?: string;
|
|
549
|
+
}): Promise<Template[]>;
|
|
550
|
+
/** One template version, whole: text, questions, settings, and every version of its code (1.6.0). */
|
|
551
|
+
template(id: string): Promise<TemplateDetail>;
|
|
552
|
+
/**
|
|
553
|
+
* Change a draft (1.6.0). `fields`, when given, replaces the whole list.
|
|
554
|
+
* A published version refuses: what people signed does not change, so
|
|
555
|
+
* make the next version with `reviseTemplate`.
|
|
556
|
+
*/
|
|
557
|
+
editTemplate(id: string, input: {
|
|
558
|
+
name?: string;
|
|
559
|
+
body?: string;
|
|
560
|
+
body_format?: "text" | "markdown";
|
|
561
|
+
variables?: string[];
|
|
562
|
+
fields?: Ask[];
|
|
563
|
+
/** What changed in this draft (1.7.0); null clears it. */
|
|
564
|
+
change_note?: string | null;
|
|
565
|
+
}): Promise<TemplateDetail>;
|
|
566
|
+
/**
|
|
567
|
+
* Publish a draft (1.6.0): from now on documents made from its code use
|
|
568
|
+
* this version, and its text can no longer change. Refused, naming what
|
|
569
|
+
* is wrong, for a placeholder the template does not declare or a PDF with
|
|
570
|
+
* pages nobody has drawn.
|
|
571
|
+
*/
|
|
572
|
+
publishTemplate(id: string, idempotencyKey?: string): Promise<TemplateDetail>;
|
|
573
|
+
/**
|
|
574
|
+
* The next version of a published template, as a draft (1.6.0): the
|
|
575
|
+
* newest version copied, with whatever you change. `id` must be the
|
|
576
|
+
* newest version; an older one answers 409 naming the newest. Documents
|
|
577
|
+
* already sent keep the version they were sent on.
|
|
578
|
+
*/
|
|
579
|
+
reviseTemplate(id: string, input?: {
|
|
580
|
+
name?: string;
|
|
581
|
+
body?: string;
|
|
582
|
+
variables?: string[];
|
|
583
|
+
fields?: Ask[];
|
|
584
|
+
/** What changed (1.7.0), kept in the template's history. */
|
|
585
|
+
change_note?: string;
|
|
586
|
+
}, idempotencyKey?: string): Promise<TemplateDetail>;
|
|
587
|
+
/**
|
|
588
|
+
* An older published version back as a new draft at the top (1.7.0): its
|
|
589
|
+
* text, questions, consent wording and file. Its `change_note` says
|
|
590
|
+
* "Restored from version N", and yours after it. Refused for the newest
|
|
591
|
+
* version, a draft, and while the template has an open draft.
|
|
592
|
+
*/
|
|
593
|
+
restoreTemplate(id: string, input?: {
|
|
594
|
+
change_note?: string;
|
|
595
|
+
}, idempotencyKey?: string): Promise<TemplateDetail>;
|
|
596
|
+
/** Throw away a draft nothing was made from (1.6.0). A published version is never discarded. */
|
|
597
|
+
discardTemplate(id: string): Promise<{
|
|
598
|
+
template_id: string;
|
|
599
|
+
code: string;
|
|
600
|
+
version: number;
|
|
601
|
+
discarded: true;
|
|
602
|
+
}>;
|
|
603
|
+
/**
|
|
604
|
+
* The settings a template's code carries to every version (1.6.0).
|
|
605
|
+
* `resign: true` asks everybody who signed an older version to sign the
|
|
606
|
+
* newest published one; `valid_months: null` clears the period.
|
|
607
|
+
*/
|
|
608
|
+
setTemplateSettings(id: string, input: {
|
|
609
|
+
one_time?: boolean;
|
|
610
|
+
show_address?: boolean;
|
|
611
|
+
valid_months?: number | null;
|
|
612
|
+
remind_days?: number | null;
|
|
613
|
+
resign?: boolean;
|
|
614
|
+
}): Promise<TemplateDetail>;
|
|
253
615
|
/**
|
|
254
616
|
* Whether a template is an uploaded PDF, and whether it is usable yet.
|
|
255
617
|
*
|
|
@@ -262,9 +624,9 @@ export declare class SignSealer {
|
|
|
262
624
|
* Create a template. Version 1, as a draft.
|
|
263
625
|
*
|
|
264
626
|
* A template is not usable until it is published, and publishing is what
|
|
265
|
-
* freezes the text people will have signed
|
|
266
|
-
*
|
|
267
|
-
*
|
|
627
|
+
* freezes the text people will have signed. Publish it with
|
|
628
|
+
* `publishTemplate` once the words are right -- in the dashboard, or from
|
|
629
|
+
* here when your own software is where the words are decided (1.6.0).
|
|
268
630
|
*
|
|
269
631
|
* `fields` says what the document asks for besides a signature, and is
|
|
270
632
|
* set in the same call rather than in a second one: a template that
|
|
@@ -312,28 +674,110 @@ export declare class SignSealer {
|
|
|
312
674
|
* on the account.
|
|
313
675
|
*/
|
|
314
676
|
smsConsent(phone: string): Promise<SmsConsent>;
|
|
677
|
+
/**
|
|
678
|
+
* Documents, filtered and paged.
|
|
679
|
+
*
|
|
680
|
+
* `limit` is 1–200 (50 by default); asking for more than 200 gets 200.
|
|
681
|
+
* `offset` was missing, so a business with more than two hundred documents
|
|
682
|
+
* had no way to reach the second page from this client at all — the API
|
|
683
|
+
* had always taken it.
|
|
684
|
+
*/
|
|
315
685
|
documents(filter?: {
|
|
316
686
|
status?: string;
|
|
317
687
|
q?: string;
|
|
318
688
|
limit?: number;
|
|
689
|
+
offset?: number;
|
|
690
|
+
/** Your own reference, exactly as you gave it (1.6.0). */
|
|
691
|
+
external_ref?: string;
|
|
319
692
|
}): Promise<{
|
|
320
|
-
documents:
|
|
693
|
+
documents: DocumentRow[];
|
|
694
|
+
total: number;
|
|
695
|
+
has_more: boolean;
|
|
696
|
+
limit: number;
|
|
697
|
+
offset: number;
|
|
698
|
+
}>;
|
|
699
|
+
/**
|
|
700
|
+
* One document: its text, its signers, the whole trail, and every answer
|
|
701
|
+
* (00395). `flagged` counts the answers the template's rules say a person
|
|
702
|
+
* should read -- the question an integration usually wants answered first.
|
|
703
|
+
* Answers are here and deliberately not in webhooks.
|
|
704
|
+
*/
|
|
705
|
+
document(id: string): Promise<DocumentDetail>;
|
|
706
|
+
/**
|
|
707
|
+
* Who has signed one document (00340): each signer's name, role and state
|
|
708
|
+
* and nothing else -- no text, no addresses, no trail. The question a gate
|
|
709
|
+
* attendant asks; the route a paired tablet may read.
|
|
710
|
+
*/
|
|
711
|
+
documentSigners(id: string): Promise<DocumentSigners>;
|
|
712
|
+
/**
|
|
713
|
+
* Does this person have a current signature on this template (00406)? By
|
|
714
|
+
* the template's code and the person's email or phone. `found: false` is
|
|
715
|
+
* "send them the form", not an error.
|
|
716
|
+
*/
|
|
717
|
+
standing(who: {
|
|
718
|
+
template: string;
|
|
719
|
+
email?: string;
|
|
720
|
+
phone?: string;
|
|
721
|
+
}): Promise<PersonStanding>;
|
|
722
|
+
/**
|
|
723
|
+
* A fresh signing link for a signer who has not signed, as a QR code to
|
|
724
|
+
* hold up (00340). The link they were sent stops working; the trail says
|
|
725
|
+
* a link was shown at the gate. Refused for a signer who has signed or
|
|
726
|
+
* declined, a copied recipient, or a document that is not open.
|
|
727
|
+
*/
|
|
728
|
+
gateLink(documentId: string, signerId: string): Promise<GateLink>;
|
|
729
|
+
/**
|
|
730
|
+
* Send one signer a reminder with a fresh link (1.6.0); the one they had
|
|
731
|
+
* stops working. Refused inside an hour of their last reminder, and for
|
|
732
|
+
* somebody there is no way to reach -- with their link left as it was.
|
|
733
|
+
*/
|
|
734
|
+
remind(documentId: string, signerId: string, idempotencyKey?: string): Promise<{
|
|
735
|
+
document_id: string;
|
|
736
|
+
signer_id: string;
|
|
737
|
+
reminded: true;
|
|
738
|
+
by: "email" | "sms";
|
|
321
739
|
}>;
|
|
322
|
-
|
|
740
|
+
/**
|
|
741
|
+
* A fresh signing link to put in an `<iframe>` (1.6.0), with the sites it
|
|
742
|
+
* may be framed on. Call it when the page is about to be shown rather than
|
|
743
|
+
* keeping a link; the one the signer had stops working. Inside the frame
|
|
744
|
+
* the page posts an `EmbedEvent` to its parent.
|
|
745
|
+
*/
|
|
746
|
+
embedLink(documentId: string, signerId: string): Promise<EmbedLink>;
|
|
323
747
|
prepareDocument(input: {
|
|
324
748
|
template_code: string;
|
|
325
749
|
title?: string;
|
|
326
750
|
values?: Record<string, string>;
|
|
327
751
|
expires_at?: string | null;
|
|
328
752
|
sequential?: boolean;
|
|
753
|
+
/** Your own reference; every webhook about it carries it back as `document.metadata.external_ref` (1.6.0). */
|
|
754
|
+
external_ref?: string;
|
|
755
|
+
/** Up to 20 names of your own with text values; back as `document.metadata.custom` (1.6.0). */
|
|
756
|
+
metadata?: Record<string, string>;
|
|
757
|
+
/** Where the signed page offers to take them: https, on a host the business has proven (1.6.0). */
|
|
758
|
+
return_url?: string;
|
|
329
759
|
}, idempotencyKey?: string): Promise<{
|
|
330
760
|
document_id: string;
|
|
331
761
|
}>;
|
|
762
|
+
/**
|
|
763
|
+
* Send, and take the links back once.
|
|
764
|
+
*
|
|
765
|
+
* Each signer needs an `email`, a `phone`, or both; a `cc` may have neither.
|
|
766
|
+
* Given both, the same link goes out twice — by mail and by text — because a
|
|
767
|
+
* person who does not check one inbox checks the other. The text goes only
|
|
768
|
+
* where the business has consent on file for `signing.link`; where it does
|
|
769
|
+
* not, the email still goes and the reason is on the evidence trail.
|
|
770
|
+
*/
|
|
332
771
|
send(documentId: string, signers: Array<{
|
|
333
|
-
email
|
|
772
|
+
email?: string;
|
|
773
|
+
/** The signer's mobile. Any format; the engine normalises to E.164. */
|
|
774
|
+
phone?: string;
|
|
334
775
|
full_name: string;
|
|
335
776
|
role?: "signer" | "approver" | "witness" | "cc";
|
|
336
777
|
sign_order?: number;
|
|
778
|
+
party_id?: string | null;
|
|
779
|
+
/** `embedded`: nothing is sent to them; you show them the page yourself (1.6.0). */
|
|
780
|
+
delivery?: "send" | "embedded";
|
|
337
781
|
}>, idempotencyKey?: string): Promise<{
|
|
338
782
|
links: SignerLink[];
|
|
339
783
|
}>;
|
|
@@ -364,7 +808,7 @@ export declare class SignSealer {
|
|
|
364
808
|
* The evidence bundle: the sealed PDF with the evidence package printed
|
|
365
809
|
* after the audit trail — every message, every webhook, the record's state
|
|
366
810
|
* — as one sealed file. Null before the document is executed, like `pdf`;
|
|
367
|
-
* `
|
|
811
|
+
* `document` has the answers and the trail before then.
|
|
368
812
|
*/
|
|
369
813
|
bundle(documentId: string): Promise<{
|
|
370
814
|
filename: string;
|
|
@@ -372,7 +816,7 @@ export declare class SignSealer {
|
|
|
372
816
|
seal: SealSummary | null;
|
|
373
817
|
} | null>;
|
|
374
818
|
workflows(): Promise<{
|
|
375
|
-
workflows:
|
|
819
|
+
workflows: Workflow[];
|
|
376
820
|
}>;
|
|
377
821
|
/** The QR code for a workflow's public form: its address, an SVG, and a 1024px PNG as base64. 404 with no public address. */
|
|
378
822
|
workflowQr(workflowId: string): Promise<{
|
|
@@ -389,6 +833,16 @@ export declare class SignSealer {
|
|
|
389
833
|
fields?: Record<string, string>;
|
|
390
834
|
values?: Record<string, string>;
|
|
391
835
|
external_ref?: string;
|
|
836
|
+
/** The template version the form was rendered from, for a start run with no network; 409 `template_changed` if it moved on. */
|
|
837
|
+
expected_template_version?: number;
|
|
838
|
+
/** The device's own clock and name, kept as a claim with the skew computed. */
|
|
839
|
+
captured?: {
|
|
840
|
+
offline: boolean;
|
|
841
|
+
at: string;
|
|
842
|
+
device: string;
|
|
843
|
+
};
|
|
844
|
+
/** Where the signed page sends the person afterwards: https, on a domain the business has proven (else 422). */
|
|
845
|
+
return_url?: string;
|
|
392
846
|
}, idempotencyKey?: string): Promise<StartedWorkflow>;
|
|
393
847
|
/**
|
|
394
848
|
* Import a reservation and its guests, and get back what is now required.
|
|
@@ -412,6 +866,13 @@ export declare class SignSealer {
|
|
|
412
866
|
packet: PacketSummary;
|
|
413
867
|
}>;
|
|
414
868
|
packet(packetId: string): Promise<unknown>;
|
|
869
|
+
/**
|
|
870
|
+
* A signing code from the receipt, resolved (00321): what is still owed,
|
|
871
|
+
* each item by first name and last initial. Only a paired tablet's own
|
|
872
|
+
* credential may ask; a code from another business, a code nobody holds
|
|
873
|
+
* and a malformed one answer `found: false` the same way.
|
|
874
|
+
*/
|
|
875
|
+
packetByCode(code: string): Promise<PacketLookup>;
|
|
415
876
|
startPacketItem(itemId: string, idempotencyKey?: string): Promise<StartedWorkflow>;
|
|
416
877
|
webhooks(): Promise<{
|
|
417
878
|
endpoints: unknown;
|
|
@@ -490,9 +951,54 @@ export declare class SignSealer {
|
|
|
490
951
|
platform?: "ios" | "android" | "other";
|
|
491
952
|
app_version?: string;
|
|
492
953
|
os_version?: string;
|
|
954
|
+
}): Promise<PairedDevice>;
|
|
955
|
+
/**
|
|
956
|
+
* Tablets, from your own software (00335).
|
|
957
|
+
*
|
|
958
|
+
* Everything the Apps & tablets page does: a platform that runs many
|
|
959
|
+
* businesses puts a tablet on each counter from its own back office. The
|
|
960
|
+
* key needs `signing:devices`. The pairing itself stays with `pairDevice`,
|
|
961
|
+
* which takes no key: the code is the credential.
|
|
962
|
+
*/
|
|
963
|
+
devices(): Promise<{
|
|
964
|
+
devices: Device[];
|
|
965
|
+
}>;
|
|
966
|
+
/** Add a tablet. The pairing code comes back once and never again. */
|
|
967
|
+
addDevice(input: {
|
|
968
|
+
name: string;
|
|
969
|
+
workflow_id?: string | null;
|
|
970
|
+
for_review?: boolean;
|
|
971
|
+
}): Promise<PairingCode>;
|
|
972
|
+
/** A new code for a tablet; any tablet paired to it stops the moment the code is made. */
|
|
973
|
+
newDeviceCode(id: string): Promise<PairingCode>;
|
|
974
|
+
/** Rename a tablet or change what it runs; `workflow_id: null` makes it a staff tablet. */
|
|
975
|
+
setDevice(id: string, input: {
|
|
976
|
+
name?: string;
|
|
977
|
+
workflow_id?: string | null;
|
|
978
|
+
hand_off?: "walk_up" | "same_device" | "separate";
|
|
979
|
+
/** `own` (the default) or `account`: a link a tablet shows is one whoever holds it could open. */
|
|
980
|
+
gate?: "own" | "account";
|
|
493
981
|
}): Promise<{
|
|
494
|
-
|
|
495
|
-
|
|
982
|
+
updated: true;
|
|
983
|
+
}>;
|
|
984
|
+
/**
|
|
985
|
+
* Everything a tablet needs to run a workflow with no network (00336):
|
|
986
|
+
* the workflow, the published template with its version, the consent and
|
|
987
|
+
* intent wording with theirs, and the page list of an uploaded PDF. Keep
|
|
988
|
+
* it, render the form yourself when the connection is down, then start
|
|
989
|
+
* the workflow naming `expected_template_version`; a 409 `template_changed`
|
|
990
|
+
* means the form moved on and the customer signs again on the current one.
|
|
991
|
+
*/
|
|
992
|
+
workflowBundle(id: string): Promise<WorkflowBundle>;
|
|
993
|
+
/** One page of the workflow's PDF template as PNG bytes, for the same purpose. 404 for a text template. */
|
|
994
|
+
workflowPage(id: string, page: number): Promise<{
|
|
995
|
+
page: number;
|
|
996
|
+
contentType: string;
|
|
997
|
+
bytes: Uint8Array<ArrayBufferLike>;
|
|
998
|
+
}>;
|
|
999
|
+
/** Stop a tablet. Its credential stops with it; the reason goes on the audit trail. */
|
|
1000
|
+
removeDevice(id: string, reason: string): Promise<{
|
|
1001
|
+
revoked: true;
|
|
496
1002
|
}>;
|
|
497
1003
|
/**
|
|
498
1004
|
* Say the device is still here, and read back what it should be running.
|
|
@@ -506,16 +1012,72 @@ export declare class SignSealer {
|
|
|
506
1012
|
deviceHeartbeat(input?: {
|
|
507
1013
|
app_version?: string;
|
|
508
1014
|
os_version?: string;
|
|
1015
|
+
/** 00341: the queue's shape, so the fleet screen can say what is waiting on this tablet. */
|
|
1016
|
+
queue_waiting?: number;
|
|
1017
|
+
queue_refused?: number;
|
|
1018
|
+
synced?: boolean;
|
|
509
1019
|
}): Promise<Record<string, unknown>>;
|
|
1020
|
+
/**
|
|
1021
|
+
* A problem, as a tablet may state it (00341): names and numbers, never
|
|
1022
|
+
* text. There is no field for a message, because a message is where a
|
|
1023
|
+
* customer's name ends up. Thirty an hour per tablet.
|
|
1024
|
+
*/
|
|
1025
|
+
reportProblem(input: {
|
|
1026
|
+
code: string;
|
|
1027
|
+
screen?: string;
|
|
1028
|
+
step?: string;
|
|
1029
|
+
online?: boolean;
|
|
1030
|
+
queue_waiting?: number;
|
|
1031
|
+
http_status?: number;
|
|
1032
|
+
app_version?: string;
|
|
1033
|
+
os_version?: string;
|
|
1034
|
+
}): Promise<{
|
|
1035
|
+
report_id: string;
|
|
1036
|
+
device_id: string;
|
|
1037
|
+
}>;
|
|
510
1038
|
}
|
|
511
1039
|
export interface SigningLink {
|
|
512
1040
|
ok: boolean;
|
|
513
1041
|
/** Why it will not take a signature, in a sentence meant for a person. */
|
|
514
1042
|
reason: string | null;
|
|
515
1043
|
document_id: string | null;
|
|
1044
|
+
document_status?: string | null;
|
|
516
1045
|
title: string | null;
|
|
517
1046
|
body: string | null;
|
|
1047
|
+
/**
|
|
1048
|
+
* How to draw `body` (00305). `markdown` uses headings, bold, italics and
|
|
1049
|
+
* lists -- every starter template does -- and a page that prints it as
|
|
1050
|
+
* text shows the signer `# Waiver` and `**What this covers.**`. The hash
|
|
1051
|
+
* is over the text either way.
|
|
1052
|
+
*/
|
|
1053
|
+
body_format?: "text" | "markdown" | null;
|
|
518
1054
|
body_sha256_hex: string | null;
|
|
1055
|
+
/**
|
|
1056
|
+
* The business asked for the questions first and the document after them
|
|
1057
|
+
* (00393). Frozen onto the document when it was made. A page honouring it
|
|
1058
|
+
* shows the document once no required visible question is left -- which is
|
|
1059
|
+
* also exactly when a signature is accepted, so the two never disagree.
|
|
1060
|
+
*/
|
|
1061
|
+
document_after_questions?: boolean;
|
|
1062
|
+
signer_id?: string | null;
|
|
1063
|
+
signed_at?: string | null;
|
|
1064
|
+
/** False when the business bought white label (00213): the page wears their name, not ours. */
|
|
1065
|
+
powered_by?: boolean;
|
|
1066
|
+
/** Their colours and logo when white label is on (00220); null otherwise. */
|
|
1067
|
+
theme?: SigningTheme | null;
|
|
1068
|
+
/** Their name and light logo (00264): it goes on the document, white label or not. */
|
|
1069
|
+
mark?: {
|
|
1070
|
+
tenant_id: string;
|
|
1071
|
+
name: string;
|
|
1072
|
+
logo: "svg" | "png" | null;
|
|
1073
|
+
} | null;
|
|
1074
|
+
/** Their address under the document (00265), when the template asks for it. */
|
|
1075
|
+
footer?: {
|
|
1076
|
+
name: string;
|
|
1077
|
+
lines: string[];
|
|
1078
|
+
} | null;
|
|
1079
|
+
/** What the business asks for by way of ID evidence (00228); `idEvidence` reads it on its own. */
|
|
1080
|
+
id_evidence?: Record<string, unknown> | null;
|
|
519
1081
|
tenant_name: string | null;
|
|
520
1082
|
full_name: string | null;
|
|
521
1083
|
email: string | null;
|
|
@@ -550,21 +1112,7 @@ export interface SigningLink {
|
|
|
550
1112
|
code_sent_at?: string | null;
|
|
551
1113
|
/** Everyone on the document — for "waiting on Dana", not for contacting them. */
|
|
552
1114
|
signers?: unknown;
|
|
553
|
-
fields:
|
|
554
|
-
key: string;
|
|
555
|
-
label: string;
|
|
556
|
-
kind: string;
|
|
557
|
-
required: boolean;
|
|
558
|
-
about: string | null;
|
|
559
|
-
supplied: boolean;
|
|
560
|
-
/**
|
|
561
|
-
* Where this question sits on the document, when the template is an
|
|
562
|
-
* uploaded PDF. A fraction of the page a reader *sees*, origin top left,
|
|
563
|
-
* so it means the same thing at any image resolution and any screen
|
|
564
|
-
* width. Absent for a question asked underneath the document.
|
|
565
|
-
*/
|
|
566
|
-
place?: Place | null;
|
|
567
|
-
}>;
|
|
1115
|
+
fields: SigningField[];
|
|
568
1116
|
/**
|
|
569
1117
|
* The pages of an uploaded PDF. Empty for a template that is words.
|
|
570
1118
|
*
|
|
@@ -575,6 +1123,64 @@ export interface SigningLink {
|
|
|
575
1123
|
*/
|
|
576
1124
|
pages?: Page[];
|
|
577
1125
|
}
|
|
1126
|
+
/** One question on a signing link, as the engine hands it to a page. */
|
|
1127
|
+
export interface SigningField {
|
|
1128
|
+
key: string;
|
|
1129
|
+
label: string;
|
|
1130
|
+
/** `text`, `paragraph`, `email`, `phone`, `address`, `number`, `date`, `birthdate`, `choice`, `checkbox`, `initials`, `signature`, `photo`. */
|
|
1131
|
+
kind: string;
|
|
1132
|
+
required: boolean;
|
|
1133
|
+
about: string | null;
|
|
1134
|
+
supplied: boolean;
|
|
1135
|
+
hint?: string | null;
|
|
1136
|
+
/** A choice's choices. */
|
|
1137
|
+
options?: string[] | null;
|
|
1138
|
+
sensitive?: boolean;
|
|
1139
|
+
/**
|
|
1140
|
+
* Where this question sits on the document, when the template is an
|
|
1141
|
+
* uploaded PDF. A fraction of the page a reader *sees*, origin top left,
|
|
1142
|
+
* so it means the same thing at any image resolution and any screen
|
|
1143
|
+
* width. Absent for a question asked underneath the document.
|
|
1144
|
+
*/
|
|
1145
|
+
place?: Place | null;
|
|
1146
|
+
/** The set of questions this one is asked with (00372), and whether it has a page of its own (00379). */
|
|
1147
|
+
block?: FieldBlock | null;
|
|
1148
|
+
/** The condition on an earlier answer (00375), for a page that wants to show why. */
|
|
1149
|
+
show_if?: ShowIf | null;
|
|
1150
|
+
/**
|
|
1151
|
+
* The engine's own answer to `show_if`: draw only the visible questions. A
|
|
1152
|
+
* hidden one is not required, and the signature gate reads this same value,
|
|
1153
|
+
* so a page that follows it can never be refused for a question it hid.
|
|
1154
|
+
*/
|
|
1155
|
+
visible?: boolean;
|
|
1156
|
+
/**
|
|
1157
|
+
* 00399: the signer has been past it -- answered it, or left an optional
|
|
1158
|
+
* one blank. A passed question is done for a page's purposes; only
|
|
1159
|
+
* `supplied` says an answer was given. Absent from a server before it.
|
|
1160
|
+
*/
|
|
1161
|
+
passed?: boolean;
|
|
1162
|
+
}
|
|
1163
|
+
/** A set of questions asked as one thing, under one heading. */
|
|
1164
|
+
export interface FieldBlock {
|
|
1165
|
+
key: string;
|
|
1166
|
+
label: string | null;
|
|
1167
|
+
intro: string | null;
|
|
1168
|
+
/** True when the block gets a page of its own, with a Next button. */
|
|
1169
|
+
step: boolean | null;
|
|
1170
|
+
}
|
|
1171
|
+
/** A white-label business's colours and logo on its signing page (00220). */
|
|
1172
|
+
export interface SigningTheme {
|
|
1173
|
+
tenant_id: string;
|
|
1174
|
+
name: string;
|
|
1175
|
+
primary_color: string;
|
|
1176
|
+
accent_color: string;
|
|
1177
|
+
background_color: string;
|
|
1178
|
+
text_color: string;
|
|
1179
|
+
button_text_color: string;
|
|
1180
|
+
logo: "svg" | "png" | null;
|
|
1181
|
+
logo_dark: "svg" | "png" | null;
|
|
1182
|
+
footer_text: string | null;
|
|
1183
|
+
}
|
|
578
1184
|
/** A rectangle on a page, in fractions of the page a reader sees. */
|
|
579
1185
|
export interface Place {
|
|
580
1186
|
page: number;
|
|
@@ -590,6 +1196,136 @@ export interface Page {
|
|
|
590
1196
|
height: number;
|
|
591
1197
|
}
|
|
592
1198
|
/** What a device says about when something happened, when it happened offline. */
|
|
1199
|
+
/** What pairing hands back: the tablet's own credential, its name and its workflow. */
|
|
1200
|
+
export interface PairedDevice {
|
|
1201
|
+
device_id: string;
|
|
1202
|
+
name: string;
|
|
1203
|
+
key: string;
|
|
1204
|
+
workflow_id: string | null;
|
|
1205
|
+
workflow_name: string | null;
|
|
1206
|
+
}
|
|
1207
|
+
/** A pairing code, shown once. `review` codes last thirty days; the rest fifteen minutes. */
|
|
1208
|
+
export interface PairingCode {
|
|
1209
|
+
id: string;
|
|
1210
|
+
code: string;
|
|
1211
|
+
expires_at: string;
|
|
1212
|
+
review: boolean;
|
|
1213
|
+
}
|
|
1214
|
+
/** Words a signer is shown and the engine records, by reference and fingerprint. */
|
|
1215
|
+
export interface BundleDisclosure {
|
|
1216
|
+
ref: string;
|
|
1217
|
+
text: string;
|
|
1218
|
+
sha256: string;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* A question as the form on a tablet carries it (00398), in the template's
|
|
1222
|
+
* order. A section's heading, sentence and step are written as the template
|
|
1223
|
+
* writes them: once, on whichever of its questions declares them first.
|
|
1224
|
+
*/
|
|
1225
|
+
export interface BundleQuestion {
|
|
1226
|
+
key: string;
|
|
1227
|
+
label: string;
|
|
1228
|
+
kind: string;
|
|
1229
|
+
required: boolean;
|
|
1230
|
+
hint: string | null;
|
|
1231
|
+
options: string[] | null;
|
|
1232
|
+
show_if: ShowIf | null;
|
|
1233
|
+
block: string | null;
|
|
1234
|
+
block_label: string | null;
|
|
1235
|
+
block_intro: string | null;
|
|
1236
|
+
block_step: boolean | null;
|
|
1237
|
+
/** Placed on the document's pages (00399): answered with the document in view, so never asked before it. */
|
|
1238
|
+
placed: boolean;
|
|
1239
|
+
}
|
|
1240
|
+
/** What a tablet keeps to run a workflow offline (00336). */
|
|
1241
|
+
export interface WorkflowBundle {
|
|
1242
|
+
workflow: {
|
|
1243
|
+
id: string;
|
|
1244
|
+
code: string;
|
|
1245
|
+
name: string;
|
|
1246
|
+
kind: string;
|
|
1247
|
+
intro: string | null;
|
|
1248
|
+
form_fields: Array<{
|
|
1249
|
+
key: string;
|
|
1250
|
+
label: string;
|
|
1251
|
+
required?: boolean;
|
|
1252
|
+
}>;
|
|
1253
|
+
signer_roles: unknown[];
|
|
1254
|
+
sequential: boolean;
|
|
1255
|
+
countersign: boolean;
|
|
1256
|
+
};
|
|
1257
|
+
template: {
|
|
1258
|
+
id: string;
|
|
1259
|
+
code: string;
|
|
1260
|
+
name: string;
|
|
1261
|
+
kind: string;
|
|
1262
|
+
version: number;
|
|
1263
|
+
variables: string[];
|
|
1264
|
+
body: string | null;
|
|
1265
|
+
body_sha256: string;
|
|
1266
|
+
/** 00364: `markdown` is drawn as headings and lists, not as marks. */
|
|
1267
|
+
body_format?: "text" | "markdown";
|
|
1268
|
+
};
|
|
1269
|
+
consent: {
|
|
1270
|
+
text: string;
|
|
1271
|
+
version: string;
|
|
1272
|
+
};
|
|
1273
|
+
intent: {
|
|
1274
|
+
text: string;
|
|
1275
|
+
version: string;
|
|
1276
|
+
};
|
|
1277
|
+
/** 00339: what the counter offers by way of an ID photo, with the words for it. */
|
|
1278
|
+
id_evidence?: {
|
|
1279
|
+
offered: "off" | "id" | "id_selfie";
|
|
1280
|
+
id_disclosure: BundleDisclosure | null;
|
|
1281
|
+
selfie_disclosure: BundleDisclosure | null;
|
|
1282
|
+
};
|
|
1283
|
+
/** 00363: whether the counter asks where the customer is, with the words for it. */
|
|
1284
|
+
location?: {
|
|
1285
|
+
offered: "off" | "ask";
|
|
1286
|
+
disclosure: BundleDisclosure | null;
|
|
1287
|
+
};
|
|
1288
|
+
business_name: string;
|
|
1289
|
+
pages: Array<{
|
|
1290
|
+
n: number;
|
|
1291
|
+
width: number;
|
|
1292
|
+
height: number;
|
|
1293
|
+
}>;
|
|
1294
|
+
/** 00342: the photographs the template asks the signer at the counter for. */
|
|
1295
|
+
photos?: Array<{
|
|
1296
|
+
key: string;
|
|
1297
|
+
label: string;
|
|
1298
|
+
hint: string | null;
|
|
1299
|
+
required: boolean;
|
|
1300
|
+
}>;
|
|
1301
|
+
/** 00398: every question the template asks the signer at the counter, photographs included. */
|
|
1302
|
+
questions?: BundleQuestion[];
|
|
1303
|
+
/** 00393, 00398: ask the questions first and show the document after them. */
|
|
1304
|
+
document_after_questions?: boolean;
|
|
1305
|
+
fetched_at: string;
|
|
1306
|
+
}
|
|
1307
|
+
/** A tablet as the account sees it. Never carries a pairing code. */
|
|
1308
|
+
export interface Device {
|
|
1309
|
+
id: string;
|
|
1310
|
+
name: string;
|
|
1311
|
+
workflow_id: string | null;
|
|
1312
|
+
workflow_name: string | null;
|
|
1313
|
+
paired: boolean;
|
|
1314
|
+
paired_at: string | null;
|
|
1315
|
+
platform: "ios" | "android" | "other" | null;
|
|
1316
|
+
app_version: string | null;
|
|
1317
|
+
os_version: string | null;
|
|
1318
|
+
last_seen_at: string | null;
|
|
1319
|
+
revoked_at: string | null;
|
|
1320
|
+
revoke_reason: string | null;
|
|
1321
|
+
pairing_open: boolean;
|
|
1322
|
+
pair_expires_at: string | null;
|
|
1323
|
+
review?: boolean;
|
|
1324
|
+
/** How the tablet is handed a customer (00343). */
|
|
1325
|
+
hand_off?: "walk_up" | "same_device" | "separate";
|
|
1326
|
+
/** Whose documents its Gate screen may show a signing link for (00409): its own and its form's, or every open one. */
|
|
1327
|
+
gate?: "own" | "account";
|
|
1328
|
+
}
|
|
593
1329
|
export interface Captured {
|
|
594
1330
|
offline?: boolean;
|
|
595
1331
|
/** ISO 8601. Recorded as a claim beside our own received time. */
|
|
@@ -668,6 +1404,68 @@ export declare class SignSealerSigning {
|
|
|
668
1404
|
supply(token: string, key: string, value: string, about?: string): Promise<{
|
|
669
1405
|
supplied: true;
|
|
670
1406
|
}>;
|
|
1407
|
+
/**
|
|
1408
|
+
* A photograph as a field's answer (00342): a JPEG or PNG for a field of
|
|
1409
|
+
* kind `photo`, shrunk on the server, kept encrypted with the document
|
|
1410
|
+
* for as long as the document is kept; the field carries its hash. A
|
|
1411
|
+
* second photograph replaces the first.
|
|
1412
|
+
*/
|
|
1413
|
+
supplyPhoto(token: string, key: string, image: {
|
|
1414
|
+
contentType: string;
|
|
1415
|
+
bytes: Uint8Array | string;
|
|
1416
|
+
}, options?: {
|
|
1417
|
+
about?: string;
|
|
1418
|
+
captured?: Captured;
|
|
1419
|
+
}): Promise<{
|
|
1420
|
+
supplied: true;
|
|
1421
|
+
key: string;
|
|
1422
|
+
sha256: string;
|
|
1423
|
+
}>;
|
|
1424
|
+
/**
|
|
1425
|
+
* Whether the business asks where the signer is (00231), and the wording
|
|
1426
|
+
* the capture is taken under. `mode` is `off`, `ask` or `require`;
|
|
1427
|
+
* `require` means the signature is refused until an answer is on record.
|
|
1428
|
+
*
|
|
1429
|
+
* Show `disclosure.text` before you ask the device, not after.
|
|
1430
|
+
*/
|
|
1431
|
+
location(token: string): Promise<Record<string, unknown> | null>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Where the signer is, or that they would not say.
|
|
1434
|
+
*
|
|
1435
|
+
* Send the refusal too. Under `require` the engine waits for an *answer*,
|
|
1436
|
+
* and a decline is one — so a person who says no, or a device that cannot
|
|
1437
|
+
* get a fix, is told here rather than at the signature, which is the last
|
|
1438
|
+
* screen and the worst place to find out.
|
|
1439
|
+
*/
|
|
1440
|
+
recordLocation(token: string, position: {
|
|
1441
|
+
shared: false;
|
|
1442
|
+
} | {
|
|
1443
|
+
shared: true;
|
|
1444
|
+
lat: number;
|
|
1445
|
+
lon: number;
|
|
1446
|
+
accuracyM?: number;
|
|
1447
|
+
}): Promise<{
|
|
1448
|
+
shared: boolean;
|
|
1449
|
+
}>;
|
|
1450
|
+
/**
|
|
1451
|
+
* What the business asks the signer for by way of ID evidence (00228,
|
|
1452
|
+
* 00339): the mode, what is captured so far by hash, and the words each
|
|
1453
|
+
* capture is taken under. Never an identity check, and never the image.
|
|
1454
|
+
*/
|
|
1455
|
+
idEvidence(token: string): Promise<Record<string, unknown> | null>;
|
|
1456
|
+
/**
|
|
1457
|
+
* A photo of the ID, or of the person, when the business asked (00339).
|
|
1458
|
+
* Kept encrypted for thirty days, the hash on the trail. Refused when
|
|
1459
|
+
* the business did not ask.
|
|
1460
|
+
*/
|
|
1461
|
+
captureIdEvidence(token: string, kind: "id" | "selfie", image: {
|
|
1462
|
+
contentType: string;
|
|
1463
|
+
bytes: Uint8Array | string;
|
|
1464
|
+
}, captured?: Captured): Promise<{
|
|
1465
|
+
captured: true;
|
|
1466
|
+
kind: string;
|
|
1467
|
+
sha256: string;
|
|
1468
|
+
}>;
|
|
671
1469
|
sign(token: string, method: "typed" | "drawn" | "clicked" | "uploaded", value: string, captured?: Captured): Promise<{
|
|
672
1470
|
event_id: string;
|
|
673
1471
|
}>;
|