@signsealer/sdk 1.7.0 → 1.11.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 +139 -4
- package/README.md +79 -11
- package/dist/cjs/index.cjs +193 -31
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.d.ts +469 -34
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +191 -30
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.d.ts
CHANGED
|
@@ -14,6 +14,74 @@
|
|
|
14
14
|
* - keeps the request id, so a support mail can quote something we can look
|
|
15
15
|
* up.
|
|
16
16
|
*/
|
|
17
|
+
/** What `startPacket` started and what it could not (00424). */
|
|
18
|
+
export interface PacketStart {
|
|
19
|
+
packet_id: string;
|
|
20
|
+
started: Array<{
|
|
21
|
+
item_id: string;
|
|
22
|
+
requirement: string;
|
|
23
|
+
participant: string;
|
|
24
|
+
document_id: string;
|
|
25
|
+
}>;
|
|
26
|
+
skipped: Array<{
|
|
27
|
+
item_id: string;
|
|
28
|
+
requirement: string;
|
|
29
|
+
participant: string;
|
|
30
|
+
reason: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/** A booking system SignSealer connects to, and where it has got to (00424). */
|
|
34
|
+
export interface IntegrationProvider {
|
|
35
|
+
key: string;
|
|
36
|
+
label: string;
|
|
37
|
+
category: "vacation_rentals" | "tours_activities" | "automation" | "crm" | "storage" | "accounting";
|
|
38
|
+
status: "available" | "beta" | "pending_partner_access" | "planned" | "deprecated" | "disabled";
|
|
39
|
+
connects: "webhook" | "external_app" | "none";
|
|
40
|
+
auth_type: string;
|
|
41
|
+
verification: string;
|
|
42
|
+
connector_version: string;
|
|
43
|
+
api_version: string;
|
|
44
|
+
deprecates_at: string | null;
|
|
45
|
+
sunsets_at: string | null;
|
|
46
|
+
}
|
|
47
|
+
/** One of the business's connections. Credentials and its address are never included. */
|
|
48
|
+
export interface IntegrationConnection {
|
|
49
|
+
id: string;
|
|
50
|
+
provider: string;
|
|
51
|
+
label: string;
|
|
52
|
+
status: "active" | "paused" | "error" | "disconnected";
|
|
53
|
+
/** `membership` when it was paused because the membership ended; it resumes by itself when it starts again (00425). */
|
|
54
|
+
paused_reason: "membership" | null;
|
|
55
|
+
config: {
|
|
56
|
+
send: "on_booking" | "manual";
|
|
57
|
+
void_on_cancel: boolean;
|
|
58
|
+
kind: "reservation" | "activity";
|
|
59
|
+
};
|
|
60
|
+
created_at: string;
|
|
61
|
+
last_event_at: string | null;
|
|
62
|
+
last_success_at: string | null;
|
|
63
|
+
last_error: string | null;
|
|
64
|
+
last_error_at: string | null;
|
|
65
|
+
waiting: number;
|
|
66
|
+
dead: number;
|
|
67
|
+
}
|
|
68
|
+
/** One delivery from a connection, and what became of it. */
|
|
69
|
+
export interface IntegrationEvent {
|
|
70
|
+
id: string;
|
|
71
|
+
event_type: string;
|
|
72
|
+
external_ref: string;
|
|
73
|
+
status: "queued" | "processing" | "done" | "ignored" | "superseded" | "failed" | "dead";
|
|
74
|
+
attempts: number;
|
|
75
|
+
received_at: string;
|
|
76
|
+
processed_at: string | null;
|
|
77
|
+
next_attempt_at: string;
|
|
78
|
+
error: string | null;
|
|
79
|
+
verified_by: string;
|
|
80
|
+
/** What the provider's data said about consent to text. Only NO_CONSENT changes anything, and only to take a number away. */
|
|
81
|
+
consent_evidence: "VERIFIED_CONSENT" | "NO_CONSENT" | "INSUFFICIENT_EVIDENCE" | null;
|
|
82
|
+
subject_id: string | null;
|
|
83
|
+
result: Record<string, unknown>;
|
|
84
|
+
}
|
|
17
85
|
export declare class SignSealerError extends Error {
|
|
18
86
|
readonly status: number;
|
|
19
87
|
readonly code: string;
|
|
@@ -51,6 +119,17 @@ export interface Account {
|
|
|
51
119
|
* sandbox, where nothing is sent to anybody and nothing is billed.
|
|
52
120
|
*/
|
|
53
121
|
mode?: "live" | "test";
|
|
122
|
+
/**
|
|
123
|
+
* Whether this business can text people (00458). Offer a "text me" box only
|
|
124
|
+
* when `available` is true, put `wording` beside it, and record exactly
|
|
125
|
+
* that wording with `recordSmsConsent` when it is ticked. `why_not` is
|
|
126
|
+
* `plan` (no texting on its plan) or `test` (a sandbox) when it cannot.
|
|
127
|
+
*/
|
|
128
|
+
texting?: {
|
|
129
|
+
available: boolean;
|
|
130
|
+
why_not: "test" | "plan" | null;
|
|
131
|
+
wording: string;
|
|
132
|
+
};
|
|
54
133
|
}
|
|
55
134
|
/** What `recordSmsConsent` wrote, with the number as we normalised it. */
|
|
56
135
|
export interface SmsConsentRecorded {
|
|
@@ -121,6 +200,8 @@ export interface TemplateSettings {
|
|
|
121
200
|
one_time: boolean;
|
|
122
201
|
/** The business's address printed under it. */
|
|
123
202
|
show_address: boolean;
|
|
203
|
+
/** The photographs a signer takes as answers are printed after the certificate in the signed PDF (1.10.0). */
|
|
204
|
+
photos_in_copy: boolean;
|
|
124
205
|
/** How long a signature stays good, in months; null when it does not run out. */
|
|
125
206
|
valid_months: number | null;
|
|
126
207
|
/** Days before the end each signer is sent a link to sign again. */
|
|
@@ -241,15 +322,39 @@ export interface TemplateInput {
|
|
|
241
322
|
/** Up to 50. Set here rather than in a second call — see `createTemplate`. */
|
|
242
323
|
fields?: Ask[];
|
|
243
324
|
}
|
|
244
|
-
/**
|
|
325
|
+
/**
|
|
326
|
+
* The brand an account shows its signers (00220). SignSealer's own without
|
|
327
|
+
* the white-label add-on.
|
|
328
|
+
*
|
|
329
|
+
* Named in camelCase because that is what `GET /v1/branding` answers -- the
|
|
330
|
+
* same object the tablet app themes itself with. Up to 1.10.0 this type
|
|
331
|
+
* declared `tenant_name`, `colour`, `has_logo`, `has_logo_dark` and
|
|
332
|
+
* `signing_host`, which the API has never sent: each read as undefined.
|
|
333
|
+
*/
|
|
245
334
|
export interface Branding {
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
335
|
+
businessName: string;
|
|
336
|
+
/** False on SignSealer's own brand: the colours are ours, not the business's. */
|
|
337
|
+
whiteLabelEnabled?: boolean;
|
|
338
|
+
/** Hex colours. */
|
|
339
|
+
primaryColor?: string | null;
|
|
340
|
+
accentColor?: string | null;
|
|
341
|
+
backgroundColor?: string | null;
|
|
342
|
+
textColor?: string | null;
|
|
343
|
+
buttonTextColor?: string | null;
|
|
344
|
+
hasLogo?: boolean;
|
|
345
|
+
hasDarkLogo?: boolean;
|
|
346
|
+
/** A picture the kiosk opens with (00338). */
|
|
347
|
+
hasOpening?: boolean;
|
|
348
|
+
openingType?: string | null;
|
|
349
|
+
openingUpdatedAt?: string | null;
|
|
251
350
|
/** The host this business's signing links use. */
|
|
252
|
-
|
|
351
|
+
signingHost?: string | null;
|
|
352
|
+
footerText?: string | null;
|
|
353
|
+
tenantId?: string;
|
|
354
|
+
/** Where to fetch each picture; null when there is none. */
|
|
355
|
+
logoUrl?: string | null;
|
|
356
|
+
logoDarkUrl?: string | null;
|
|
357
|
+
openingUrl?: string | null;
|
|
253
358
|
[key: string]: unknown;
|
|
254
359
|
}
|
|
255
360
|
/** Where a one-time code went. The address is masked; you are not told it. */
|
|
@@ -283,6 +388,8 @@ export interface TemplatePdf {
|
|
|
283
388
|
drawn?: number;
|
|
284
389
|
/** `drawn === page_count`. A PDF template cannot be published until it is. */
|
|
285
390
|
ready?: boolean;
|
|
391
|
+
/** Why SignSealer could not draw the pages from the file, when it could not (00474); null otherwise. */
|
|
392
|
+
drawing_failed?: string | null;
|
|
286
393
|
pages?: Array<{
|
|
287
394
|
n: number;
|
|
288
395
|
width: number;
|
|
@@ -386,11 +493,18 @@ export interface StartedWorkflow {
|
|
|
386
493
|
document_id: string;
|
|
387
494
|
title: string;
|
|
388
495
|
expires_at: string | null;
|
|
496
|
+
/** The published version the document was made from (00336). */
|
|
497
|
+
template_version?: number;
|
|
498
|
+
/** How many are in the booking's party, when everybody in it signs (00484); null otherwise. */
|
|
499
|
+
party_size?: number | null;
|
|
389
500
|
signers: SignerLink[];
|
|
390
501
|
}
|
|
391
502
|
export interface PacketSummary {
|
|
392
503
|
packet_id: string;
|
|
393
504
|
code: string;
|
|
505
|
+
/** Items this build added, and items it dropped because the guest left. */
|
|
506
|
+
added?: number;
|
|
507
|
+
dropped?: number;
|
|
394
508
|
state: "open" | "ready" | "blocked" | "expired" | "void";
|
|
395
509
|
required: number;
|
|
396
510
|
completed: number;
|
|
@@ -415,11 +529,19 @@ export interface DocumentRow {
|
|
|
415
529
|
document_id: string;
|
|
416
530
|
title: string;
|
|
417
531
|
status: string;
|
|
532
|
+
template_code?: string | null;
|
|
533
|
+
template_version?: number | null;
|
|
534
|
+
subject_name?: string | null;
|
|
418
535
|
signers: number;
|
|
419
536
|
signed: number;
|
|
420
537
|
waiting_on: string | null;
|
|
538
|
+
sequential?: boolean;
|
|
539
|
+
expires_at?: string | null;
|
|
421
540
|
sent_at: string | null;
|
|
422
541
|
completed_at: string | null;
|
|
542
|
+
void_reason?: string | null;
|
|
543
|
+
/** False when a signature was made against different text than the document now holds. */
|
|
544
|
+
integrity_ok?: boolean;
|
|
423
545
|
/** Whether it is still good once signed, and until when (00406). */
|
|
424
546
|
standing?: Standing | null;
|
|
425
547
|
valid_until?: string | null;
|
|
@@ -491,13 +613,35 @@ export interface Workflow {
|
|
|
491
613
|
name: string;
|
|
492
614
|
kind: string;
|
|
493
615
|
active: boolean;
|
|
616
|
+
template_code?: string;
|
|
494
617
|
template_published: boolean;
|
|
618
|
+
public_slug?: string | null;
|
|
495
619
|
form_fields: Array<{
|
|
496
620
|
key: string;
|
|
497
621
|
label: string;
|
|
498
622
|
required?: boolean;
|
|
499
623
|
}>;
|
|
624
|
+
/** Every blank a person starting it is asked (00478); `sender_fields` are the boxes whoever sends it fills. */
|
|
625
|
+
asked_fields?: Array<{
|
|
626
|
+
key: string;
|
|
627
|
+
label: string;
|
|
628
|
+
required?: boolean;
|
|
629
|
+
derived?: boolean;
|
|
630
|
+
}>;
|
|
631
|
+
sender_fields?: Array<{
|
|
632
|
+
key: string;
|
|
633
|
+
label: string;
|
|
634
|
+
kind: string;
|
|
635
|
+
required: boolean;
|
|
636
|
+
}>;
|
|
500
637
|
intro: string | null;
|
|
638
|
+
/** 00484: everybody in a booking's party signs, and how their ages are asked. */
|
|
639
|
+
each_person_signs?: boolean;
|
|
640
|
+
party_ages?: "tick" | "dob";
|
|
641
|
+
majority_age?: number;
|
|
642
|
+
minors_also_sign?: boolean;
|
|
643
|
+
/** 00476: the zone its documents' times are written in. */
|
|
644
|
+
time_zone?: string | null;
|
|
501
645
|
}
|
|
502
646
|
export interface ClientOptions {
|
|
503
647
|
/**
|
|
@@ -532,7 +676,6 @@ export declare class SignSealer {
|
|
|
532
676
|
*/
|
|
533
677
|
agreementsRemaining: number | null;
|
|
534
678
|
constructor(opts?: ClientOptions);
|
|
535
|
-
/** Prove the key works, and say whose account it is. */
|
|
536
679
|
/**
|
|
537
680
|
* The brand this account shows its signers.
|
|
538
681
|
*
|
|
@@ -542,6 +685,7 @@ export declare class SignSealer {
|
|
|
542
685
|
* moment somebody is deciding whether to trust the page.
|
|
543
686
|
*/
|
|
544
687
|
branding(): Promise<Branding>;
|
|
688
|
+
/** Prove the key works, and say whose account it is. */
|
|
545
689
|
account(): Promise<Account>;
|
|
546
690
|
/** Every version of every template, newest first; `code` narrows it to one template's versions. No text: `template(id)` has that. */
|
|
547
691
|
templates(filter?: {
|
|
@@ -608,18 +752,11 @@ export declare class SignSealer {
|
|
|
608
752
|
setTemplateSettings(id: string, input: {
|
|
609
753
|
one_time?: boolean;
|
|
610
754
|
show_address?: boolean;
|
|
755
|
+
photos_in_copy?: boolean;
|
|
611
756
|
valid_months?: number | null;
|
|
612
757
|
remind_days?: number | null;
|
|
613
758
|
resign?: boolean;
|
|
614
759
|
}): Promise<TemplateDetail>;
|
|
615
|
-
/**
|
|
616
|
-
* Whether a template is an uploaded PDF, and whether it is usable yet.
|
|
617
|
-
*
|
|
618
|
-
* `ready` is the one to check: a PDF template cannot be published until
|
|
619
|
-
* every page has a picture a signer can read. Uploading the file is a
|
|
620
|
-
* dashboard step — drawing those pictures needs a browser, which a server
|
|
621
|
-
* does not have — so this is read-only on purpose.
|
|
622
|
-
*/
|
|
623
760
|
/**
|
|
624
761
|
* Create a template. Version 1, as a draft.
|
|
625
762
|
*
|
|
@@ -636,6 +773,14 @@ export declare class SignSealer {
|
|
|
636
773
|
createTemplate(input: TemplateInput, idempotencyKey?: string): Promise<{
|
|
637
774
|
template_id: string;
|
|
638
775
|
}>;
|
|
776
|
+
/**
|
|
777
|
+
* Whether a template is an uploaded PDF, and whether it is usable yet.
|
|
778
|
+
*
|
|
779
|
+
* `ready` is the one to check: a PDF template cannot be published until
|
|
780
|
+
* SignSealer has drawn a picture of every page from the file itself
|
|
781
|
+
* (00474), which it does as the file is uploaded. Uploading the file is a
|
|
782
|
+
* dashboard step, where the boxes are placed; there is no API route for it.
|
|
783
|
+
*/
|
|
639
784
|
templatePdf(id: string): Promise<TemplatePdf>;
|
|
640
785
|
/**
|
|
641
786
|
* Record that you have consent to text a number.
|
|
@@ -649,9 +794,12 @@ export declare class SignSealer {
|
|
|
649
794
|
* `wording` is the field this method exists for. Send the exact words that
|
|
650
795
|
* were in front of the person, because it is kept verbatim and it is what a
|
|
651
796
|
* carrier asks for. It has to say that replying STOP opts out, that HELP
|
|
652
|
-
* gets help, that message and data rates may apply,
|
|
653
|
-
* frequency varies
|
|
654
|
-
*
|
|
797
|
+
* gets help, that message and data rates may apply, that message
|
|
798
|
+
* frequency varies, that consent is not a condition of purchase, and that
|
|
799
|
+
* the number is not shared or sold, and link the terms and the privacy
|
|
800
|
+
* policy; a disclosure missing any of those is refused with 422 naming
|
|
801
|
+
* which, and nothing is recorded. `account().texting.wording` is a
|
|
802
|
+
* sentence that passes.
|
|
655
803
|
*
|
|
656
804
|
* One call covers the link, the reminder and the confirmation. Somebody who
|
|
657
805
|
* agreed to those agreed to all three, and an API that made you post three
|
|
@@ -728,8 +876,13 @@ export declare class SignSealer {
|
|
|
728
876
|
gateLink(documentId: string, signerId: string): Promise<GateLink>;
|
|
729
877
|
/**
|
|
730
878
|
* 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,
|
|
879
|
+
* stops working. Refused (422) inside an hour of their last reminder, past
|
|
880
|
+
* three to one signer or twenty-five for one document in a day, and for
|
|
732
881
|
* somebody there is no way to reach -- with their link left as it was.
|
|
882
|
+
* A signer is texted one reminder over the life of their link, because
|
|
883
|
+
* that is what they agreed to (00507): after it, a reminder goes by email
|
|
884
|
+
* alone (`by: "email"`), and one with no email address is refused (422).
|
|
885
|
+
* `reminded: true` means it was queued: it is screened before it leaves.
|
|
733
886
|
*/
|
|
734
887
|
remind(documentId: string, signerId: string, idempotencyKey?: string): Promise<{
|
|
735
888
|
document_id: string;
|
|
@@ -756,6 +909,12 @@ export declare class SignSealer {
|
|
|
756
909
|
metadata?: Record<string, string>;
|
|
757
910
|
/** Where the signed page offers to take them: https, on a host the business has proven (1.6.0). */
|
|
758
911
|
return_url?: string;
|
|
912
|
+
/**
|
|
913
|
+
* The zone the document's times are in ("America/Denver"). A time blank given as
|
|
914
|
+
* `14:30` or `2026-10-03T09:00` is written as "October 3, 2026 at 9:00 am MDT".
|
|
915
|
+
* Without it, values go into the text as sent (00476).
|
|
916
|
+
*/
|
|
917
|
+
time_zone?: string;
|
|
759
918
|
}, idempotencyKey?: string): Promise<{
|
|
760
919
|
document_id: string;
|
|
761
920
|
}>;
|
|
@@ -835,7 +994,7 @@ export declare class SignSealer {
|
|
|
835
994
|
external_ref?: string;
|
|
836
995
|
/** The template version the form was rendered from, for a start run with no network; 409 `template_changed` if it moved on. */
|
|
837
996
|
expected_template_version?: number;
|
|
838
|
-
/** The device's own clock and name, kept as a claim with the skew computed. */
|
|
997
|
+
/** The device's own clock and name, kept as a claim with the skew computed. A paired tablet only (422 from any other key). */
|
|
839
998
|
captured?: {
|
|
840
999
|
offline: boolean;
|
|
841
1000
|
at: string;
|
|
@@ -874,6 +1033,34 @@ export declare class SignSealer {
|
|
|
874
1033
|
*/
|
|
875
1034
|
packetByCode(code: string): Promise<PacketLookup>;
|
|
876
1035
|
startPacketItem(itemId: string, idempotencyKey?: string): Promise<StartedWorkflow>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Start everything a packet still owes (00424). Items already started are
|
|
1038
|
+
* left alone, so this is safe to call on every booking update; an item
|
|
1039
|
+
* that cannot be started comes back under `skipped` with the reason.
|
|
1040
|
+
*/
|
|
1041
|
+
startPacket(packetId: string): Promise<PacketStart>;
|
|
1042
|
+
/**
|
|
1043
|
+
* Void a packet because the booking was cancelled (00424): what nobody has
|
|
1044
|
+
* finished is voided with the reason, what somebody signed is kept.
|
|
1045
|
+
*/
|
|
1046
|
+
voidPacket(packetId: string, reason: string): Promise<{
|
|
1047
|
+
packet_id: string;
|
|
1048
|
+
voided: number;
|
|
1049
|
+
kept: number;
|
|
1050
|
+
}>;
|
|
1051
|
+
/**
|
|
1052
|
+
* The booking systems this business can connect, and its connections (00424).
|
|
1053
|
+
* `needs_membership` is true on Free: connecting one comes with the membership (00425).
|
|
1054
|
+
*/
|
|
1055
|
+
integrations(): Promise<{
|
|
1056
|
+
providers: IntegrationProvider[];
|
|
1057
|
+
connections: IntegrationConnection[];
|
|
1058
|
+
needs_membership: boolean;
|
|
1059
|
+
}>;
|
|
1060
|
+
/** What arrived from one connection and what became of it, newest first. */
|
|
1061
|
+
integrationEvents(connectionId: string): Promise<{
|
|
1062
|
+
events: IntegrationEvent[];
|
|
1063
|
+
}>;
|
|
877
1064
|
webhooks(): Promise<{
|
|
878
1065
|
endpoints: unknown;
|
|
879
1066
|
}>;
|
|
@@ -885,12 +1072,23 @@ export declare class SignSealer {
|
|
|
885
1072
|
id: string;
|
|
886
1073
|
secret: string;
|
|
887
1074
|
}>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Change an endpoint. Turning one back on forgives its failures and sends
|
|
1077
|
+
* what it held: `resumed` says it was paused, `waiting` how many are now
|
|
1078
|
+
* on their way, and `dropped_while_paused` how many the hold could not
|
|
1079
|
+
* keep (00289). `events`, when given, replaces the list and is checked as
|
|
1080
|
+
* `addWebhook`'s is: a name that is not an event is refused (422), and the
|
|
1081
|
+
* error's `hint` lists every one there is (00507).
|
|
1082
|
+
*/
|
|
888
1083
|
setWebhook(id: string, input: {
|
|
889
1084
|
active?: boolean;
|
|
890
1085
|
events?: string[];
|
|
891
1086
|
label?: string;
|
|
892
1087
|
}): Promise<{
|
|
893
1088
|
updated: true;
|
|
1089
|
+
resumed?: boolean;
|
|
1090
|
+
waiting?: number;
|
|
1091
|
+
dropped_while_paused?: number;
|
|
894
1092
|
}>;
|
|
895
1093
|
removeWebhook(id: string, reason: string): Promise<{
|
|
896
1094
|
deleted: true;
|
|
@@ -975,6 +1173,8 @@ export declare class SignSealer {
|
|
|
975
1173
|
setDevice(id: string, input: {
|
|
976
1174
|
name?: string;
|
|
977
1175
|
workflow_id?: string | null;
|
|
1176
|
+
/** Every form it runs, in the order its kiosk lists them (00420); the first becomes `workflow_id`, `[]` a staff tablet. */
|
|
1177
|
+
workflow_ids?: string[];
|
|
978
1178
|
hand_off?: "walk_up" | "same_device" | "separate";
|
|
979
1179
|
/** `own` (the default) or `account`: a link a tablet shows is one whoever holds it could open. */
|
|
980
1180
|
gate?: "own" | "account";
|
|
@@ -1059,6 +1259,56 @@ export interface SigningLink {
|
|
|
1059
1259
|
* also exactly when a signature is accepted, so the two never disagree.
|
|
1060
1260
|
*/
|
|
1061
1261
|
document_after_questions?: boolean;
|
|
1262
|
+
/** 00476: the zone the document's times are written in ("America/Denver"), or null when none was given. */
|
|
1263
|
+
time_zone?: string | null;
|
|
1264
|
+
/**
|
|
1265
|
+
* 00484: everybody in a booking's party signs. For the person it was
|
|
1266
|
+
* started for (`lead`), how many they still add before they can sign and
|
|
1267
|
+
* each one added; for somebody they added, who added them.
|
|
1268
|
+
*/
|
|
1269
|
+
party?: {
|
|
1270
|
+
size: number;
|
|
1271
|
+
lead: boolean;
|
|
1272
|
+
/** The person it was started for, by name. */
|
|
1273
|
+
lead_name?: string | null;
|
|
1274
|
+
added_by: string | null;
|
|
1275
|
+
/** Whether the lead has said who is in the party yet. */
|
|
1276
|
+
described?: boolean;
|
|
1277
|
+
still_to_add: number;
|
|
1278
|
+
/**
|
|
1279
|
+
* Whether this person may add the others now. Adding them is done on
|
|
1280
|
+
* the signing page (`/s/<token>`), not over the API: send a lead there.
|
|
1281
|
+
*/
|
|
1282
|
+
may_add: boolean;
|
|
1283
|
+
/** How a child is told apart (`tick`: a tick for "under 18"; `dob`: a date of birth), the age of majority, and whether minors sign too. */
|
|
1284
|
+
ages?: "tick" | "dob";
|
|
1285
|
+
majority_age?: number;
|
|
1286
|
+
minors_also_sign?: boolean;
|
|
1287
|
+
/**
|
|
1288
|
+
* For the lead: each person added. `open` is a place kept open for
|
|
1289
|
+
* somebody to take, `claimed` one somebody took from the party link,
|
|
1290
|
+
* `opened` whether their link has been opened (00491).
|
|
1291
|
+
*/
|
|
1292
|
+
others: Array<{
|
|
1293
|
+
signer_id: string;
|
|
1294
|
+
full_name: string;
|
|
1295
|
+
email: string | null;
|
|
1296
|
+
phone: string | null;
|
|
1297
|
+
status: string;
|
|
1298
|
+
signed_at: string | null;
|
|
1299
|
+
open?: boolean;
|
|
1300
|
+
unnamed?: boolean;
|
|
1301
|
+
claimed?: boolean;
|
|
1302
|
+
opened?: boolean;
|
|
1303
|
+
}>;
|
|
1304
|
+
/** For the lead: each child in the party and the adult who signs for them. */
|
|
1305
|
+
minors?: Array<{
|
|
1306
|
+
full_name: string;
|
|
1307
|
+
guardian: string | null;
|
|
1308
|
+
}>;
|
|
1309
|
+
/** The children this person signs for. */
|
|
1310
|
+
signing_for?: string[];
|
|
1311
|
+
} | null;
|
|
1062
1312
|
signer_id?: string | null;
|
|
1063
1313
|
signed_at?: string | null;
|
|
1064
1314
|
/** False when the business bought white label (00213): the page wears their name, not ours. */
|
|
@@ -1127,7 +1377,7 @@ export interface SigningLink {
|
|
|
1127
1377
|
export interface SigningField {
|
|
1128
1378
|
key: string;
|
|
1129
1379
|
label: string;
|
|
1130
|
-
/** `text`, `paragraph`, `email`, `phone`, `address`, `number`, `date`, `birthdate`, `choice`, `checkbox`, `initials`, `signature`, `photo`. */
|
|
1380
|
+
/** `text`, `paragraph`, `email`, `phone`, `address`, `number`, `date`, `birthdate`, `time` (`HH:MM`), `datetime` (`YYYY-MM-DDTHH:MM`), `choice`, `checkbox`, `initials`, `signature`, `photo`. */
|
|
1131
1381
|
kind: string;
|
|
1132
1382
|
required: boolean;
|
|
1133
1383
|
about: string | null;
|
|
@@ -1159,6 +1409,34 @@ export interface SigningField {
|
|
|
1159
1409
|
* `supplied` says an answer was given. Absent from a server before it.
|
|
1160
1410
|
*/
|
|
1161
1411
|
passed?: boolean;
|
|
1412
|
+
/**
|
|
1413
|
+
* 00427: a box on the page that signing fills in -- `signature` for a
|
|
1414
|
+
* signature box, `date` for the box that carries the day it was signed.
|
|
1415
|
+
* Draw it; do not ask for it. Null for a question that is asked.
|
|
1416
|
+
*/
|
|
1417
|
+
at_signing?: "signature" | "date" | null;
|
|
1418
|
+
/**
|
|
1419
|
+
* 00427: what a box on the page carries, so a page can show the document
|
|
1420
|
+
* the way it will be sealed: the answer given, or for a date box filled at
|
|
1421
|
+
* signing, the day it would be today. Null for a sensitive answer and for
|
|
1422
|
+
* a question asked underneath the document.
|
|
1423
|
+
*/
|
|
1424
|
+
placed_value?: string | null;
|
|
1425
|
+
/**
|
|
1426
|
+
* 00438: the words a box on the page shows for `placed_value` -- a date or
|
|
1427
|
+
* a time as a person writes it ("September 27, 2026 at 2:30 pm"), anything
|
|
1428
|
+
* else as given. `placed_value` stays the answer itself, which is what an
|
|
1429
|
+
* input box is filled with. Null where `placed_value` is; absent from a
|
|
1430
|
+
* server before it.
|
|
1431
|
+
*/
|
|
1432
|
+
placed_words?: string | null;
|
|
1433
|
+
/**
|
|
1434
|
+
* 00437: a box on the page filled in by whoever sent the document (a
|
|
1435
|
+
* `staff` question placed on an uploaded PDF, given under `values` when it
|
|
1436
|
+
* was sent). Already answered: show `placed_value`, never ask for it --
|
|
1437
|
+
* supplying it is refused. Absent from a server before it.
|
|
1438
|
+
*/
|
|
1439
|
+
from_sender?: boolean;
|
|
1162
1440
|
}
|
|
1163
1441
|
/** A set of questions asked as one thing, under one heading. */
|
|
1164
1442
|
export interface FieldBlock {
|
|
@@ -1325,6 +1603,21 @@ export interface Device {
|
|
|
1325
1603
|
hand_off?: "walk_up" | "same_device" | "separate";
|
|
1326
1604
|
/** Whose documents its Gate screen may show a signing link for (00409): its own and its form's, or every open one. */
|
|
1327
1605
|
gate?: "own" | "account";
|
|
1606
|
+
/** Every form it runs, in the order its kiosk lists them (00420). */
|
|
1607
|
+
workflows?: Array<{
|
|
1608
|
+
id: string;
|
|
1609
|
+
name: string;
|
|
1610
|
+
kind: string;
|
|
1611
|
+
active: boolean;
|
|
1612
|
+
}>;
|
|
1613
|
+
/** 00337, 00341: against the version rules, and the queue's shape from its last heartbeat. */
|
|
1614
|
+
below_minimum?: boolean;
|
|
1615
|
+
below_recommended?: boolean;
|
|
1616
|
+
queue_waiting?: number;
|
|
1617
|
+
queue_refused?: number;
|
|
1618
|
+
last_synced_at?: string | null;
|
|
1619
|
+
last_problem_code?: string | null;
|
|
1620
|
+
last_problem_at?: string | null;
|
|
1328
1621
|
}
|
|
1329
1622
|
export interface Captured {
|
|
1330
1623
|
offline?: boolean;
|
|
@@ -1343,12 +1636,22 @@ export interface Captured {
|
|
|
1343
1636
|
*
|
|
1344
1637
|
* Use this to build your own signing page. If you want ours, send the signer
|
|
1345
1638
|
* to `https://api.signsealer.com/s/<token>` and skip all of it.
|
|
1639
|
+
*
|
|
1640
|
+
* The one exception is a paired tablet's own credential, `deviceKey` (1.11.0),
|
|
1641
|
+
* sent on one call only: a signature that carries `captured`. The server keeps
|
|
1642
|
+
* an offline signature's claim about when it was taken only from a paired
|
|
1643
|
+
* tablet of the business the link belongs to, because that day is the day the
|
|
1644
|
+
* document says it was signed, and it asks for the tablet's credential to know
|
|
1645
|
+
* it is one. Without it the claim is dropped -- silently, not refused -- and the
|
|
1646
|
+
* signature is dated when it arrives. Nothing else here ever sends it.
|
|
1346
1647
|
*/
|
|
1347
1648
|
export declare class SignSealerSigning {
|
|
1348
1649
|
#private;
|
|
1349
1650
|
constructor(opts?: {
|
|
1350
1651
|
baseUrl?: string;
|
|
1351
1652
|
fetch?: typeof globalThis.fetch;
|
|
1653
|
+
/** A paired tablet's credential, from `pairDevice`. Sent only with `sign` when it carries `captured`. */
|
|
1654
|
+
deviceKey?: string;
|
|
1352
1655
|
});
|
|
1353
1656
|
/**
|
|
1354
1657
|
* Everything the page needs from one token.
|
|
@@ -1409,6 +1712,12 @@ export declare class SignSealerSigning {
|
|
|
1409
1712
|
* kind `photo`, shrunk on the server, kept encrypted with the document
|
|
1410
1713
|
* for as long as the document is kept; the field carries its hash. A
|
|
1411
1714
|
* second photograph replaces the first.
|
|
1715
|
+
*
|
|
1716
|
+
* When the server is reading other photos, or another from this link, it
|
|
1717
|
+
* is refused with a 429 `busy` and nothing is kept: the error's
|
|
1718
|
+
* `retryable` is true and `retryAfter` says how many seconds to wait
|
|
1719
|
+
* (thirty). Show the person its message and send the same photo again
|
|
1720
|
+
* then; this client does not wait that long inside a call for you.
|
|
1412
1721
|
*/
|
|
1413
1722
|
supplyPhoto(token: string, key: string, image: {
|
|
1414
1723
|
contentType: string;
|
|
@@ -1456,7 +1765,8 @@ export declare class SignSealerSigning {
|
|
|
1456
1765
|
/**
|
|
1457
1766
|
* A photo of the ID, or of the person, when the business asked (00339).
|
|
1458
1767
|
* Kept encrypted for thirty days, the hash on the trail. Refused when
|
|
1459
|
-
* the business did not ask
|
|
1768
|
+
* the business did not ask; refused as busy, to be sent again after
|
|
1769
|
+
* `retryAfter` seconds, as `supplyPhoto` is.
|
|
1460
1770
|
*/
|
|
1461
1771
|
captureIdEvidence(token: string, kind: "id" | "selfie", image: {
|
|
1462
1772
|
contentType: string;
|
|
@@ -1466,6 +1776,11 @@ export declare class SignSealerSigning {
|
|
|
1466
1776
|
kind: string;
|
|
1467
1777
|
sha256: string;
|
|
1468
1778
|
}>;
|
|
1779
|
+
/**
|
|
1780
|
+
* Sign. `captured` is for a signature a paired tablet took with no
|
|
1781
|
+
* network, and is kept only when the client was built with that tablet's
|
|
1782
|
+
* `deviceKey`, which goes with this call and no other; see the class.
|
|
1783
|
+
*/
|
|
1469
1784
|
sign(token: string, method: "typed" | "drawn" | "clicked" | "uploaded", value: string, captured?: Captured): Promise<{
|
|
1470
1785
|
event_id: string;
|
|
1471
1786
|
}>;
|
|
@@ -1480,6 +1795,125 @@ export declare class SignSealerSigning {
|
|
|
1480
1795
|
*/
|
|
1481
1796
|
verify(code: string, documentSha256?: string): Promise<Record<string, unknown>>;
|
|
1482
1797
|
}
|
|
1798
|
+
/** This month so far, computed the way it will close (1.8.0). */
|
|
1799
|
+
export interface PartnerMonthToDate {
|
|
1800
|
+
/** The first day of the month, `YYYY-MM-DD`. */
|
|
1801
|
+
month: string;
|
|
1802
|
+
businesses: number;
|
|
1803
|
+
/** What the businesses you brought paid for and used this month, in cents. */
|
|
1804
|
+
gross_cents: number;
|
|
1805
|
+
/** The card fees on that, and the carrier's cost of their texts: both come off before the share. */
|
|
1806
|
+
fees_cents: number;
|
|
1807
|
+
sms_cost_cents: number;
|
|
1808
|
+
/** What is left, which is what the share is of. */
|
|
1809
|
+
revenue_cents: number;
|
|
1810
|
+
share_bp: number;
|
|
1811
|
+
share_cents: number;
|
|
1812
|
+
}
|
|
1813
|
+
/** Your programme (1.8.0). */
|
|
1814
|
+
export interface PartnerProfile {
|
|
1815
|
+
partner: string;
|
|
1816
|
+
client_id: string;
|
|
1817
|
+
referral_code: string;
|
|
1818
|
+
/** A percentage: 12.5 means 12.5%. */
|
|
1819
|
+
share_percent: number;
|
|
1820
|
+
/** False when the programme is paused: businesses already yours stay yours, new ones are not attributed. */
|
|
1821
|
+
active: boolean;
|
|
1822
|
+
/** Your name, colours and logo on your businesses' signing pages: free, set up from your partner dashboard. */
|
|
1823
|
+
custom_branding: boolean;
|
|
1824
|
+
/**
|
|
1825
|
+
* Where the review of your partner account stands. `pending` until a person at SignSealer approves it:
|
|
1826
|
+
* businesses are recorded as yours meanwhile, and nothing accrues until then.
|
|
1827
|
+
*/
|
|
1828
|
+
review?: "pending" | "approved" | "declined";
|
|
1829
|
+
/** True once your account is approved; your share is counted from `earning_since`. */
|
|
1830
|
+
earning?: boolean;
|
|
1831
|
+
earning_since?: string | null;
|
|
1832
|
+
businesses: number;
|
|
1833
|
+
month_to_date: PartnerMonthToDate;
|
|
1834
|
+
/** The link to hand a business: signing up through it makes the business yours. */
|
|
1835
|
+
signup_url: string;
|
|
1836
|
+
}
|
|
1837
|
+
/** A business you brought (1.8.0). */
|
|
1838
|
+
export interface PartnerBusiness {
|
|
1839
|
+
tenant_id: string;
|
|
1840
|
+
name: string;
|
|
1841
|
+
status: string;
|
|
1842
|
+
/** How it came to you: your signup link, installing your app in its first thirty days, your promotion code, or SignSealer setting it. */
|
|
1843
|
+
source: "referral_link" | "oauth_install" | "promotion" | "ops";
|
|
1844
|
+
attributed_at: string;
|
|
1845
|
+
/** What it has added this month after card fees and texts' cost, in cents. Credit SignSealer gave away earns nothing. */
|
|
1846
|
+
month_to_date_cents: number;
|
|
1847
|
+
}
|
|
1848
|
+
/** One closed month (1.8.0). Written once, when the month is over; only `paid` changes after. */
|
|
1849
|
+
export interface PartnerStatement {
|
|
1850
|
+
/** `YYYY-MM`. */
|
|
1851
|
+
month: string;
|
|
1852
|
+
businesses: number;
|
|
1853
|
+
/** What the businesses paid for and used, the card fees and the carrier's cost of texts, and what was left. */
|
|
1854
|
+
gross_cents: number;
|
|
1855
|
+
fees_cents: number;
|
|
1856
|
+
sms_cost_cents: number;
|
|
1857
|
+
revenue_cents: number;
|
|
1858
|
+
share_percent: number;
|
|
1859
|
+
share_cents: number;
|
|
1860
|
+
/** A shortfall from an earlier month, zero or negative. */
|
|
1861
|
+
carried_in_cents: number;
|
|
1862
|
+
payable_cents: number;
|
|
1863
|
+
/** A shortfall carried into the next month, zero or negative. */
|
|
1864
|
+
carried_out_cents: number;
|
|
1865
|
+
paid: boolean;
|
|
1866
|
+
paid_at: string | null;
|
|
1867
|
+
lines: Array<{
|
|
1868
|
+
tenant_id: string;
|
|
1869
|
+
name: string;
|
|
1870
|
+
gross_cents: number;
|
|
1871
|
+
fees_cents: number;
|
|
1872
|
+
sms_cost_cents: number;
|
|
1873
|
+
revenue_cents: number;
|
|
1874
|
+
}>;
|
|
1875
|
+
}
|
|
1876
|
+
export interface PartnerOptions {
|
|
1877
|
+
/** Your OAuth client's id, `ss_client_…`. */
|
|
1878
|
+
clientId: string;
|
|
1879
|
+
/** Its secret, `ss_secret_…`: the one shown once when SignSealer registered you. */
|
|
1880
|
+
clientSecret: string;
|
|
1881
|
+
baseUrl?: string;
|
|
1882
|
+
/** Total attempts for a retryable failure, the first included. Every call here only reads. */
|
|
1883
|
+
maxAttempts?: number;
|
|
1884
|
+
fetch?: typeof globalThis.fetch;
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* A partner reading its own revenue share (1.8.0): the businesses it brought,
|
|
1888
|
+
* what they have paid this month, and every closed month's statement.
|
|
1889
|
+
*
|
|
1890
|
+
* Authenticated with the partner's OAuth client id and secret, by HTTP Basic
|
|
1891
|
+
* -- never with a business's API key or access token, which act as one
|
|
1892
|
+
* business. Only a partner SignSealer has enrolled can use it, and it only
|
|
1893
|
+
* reads: the share and the programme are set by SignSealer, from the signed
|
|
1894
|
+
* agreement. Keep the secret on a server.
|
|
1895
|
+
*/
|
|
1896
|
+
export declare class SignSealerPartner {
|
|
1897
|
+
#private;
|
|
1898
|
+
constructor(opts: PartnerOptions);
|
|
1899
|
+
/**
|
|
1900
|
+
* The link to hand a business, from your referral code, without a call.
|
|
1901
|
+
* `profile().signup_url` is the same link.
|
|
1902
|
+
*/
|
|
1903
|
+
static signupUrl(referralCode: string, appOrigin?: string): string;
|
|
1904
|
+
/** Your programme, this month so far, and your signup link. */
|
|
1905
|
+
profile(): Promise<PartnerProfile>;
|
|
1906
|
+
/** The businesses you brought, newest first. `limit` is 1 to 200, 50 when left out. */
|
|
1907
|
+
businesses(opts?: {
|
|
1908
|
+
limit?: number;
|
|
1909
|
+
offset?: number;
|
|
1910
|
+
}): Promise<{
|
|
1911
|
+
data: PartnerBusiness[];
|
|
1912
|
+
has_more: boolean;
|
|
1913
|
+
}>;
|
|
1914
|
+
/** Every closed month, newest first. */
|
|
1915
|
+
statements(): Promise<PartnerStatement[]>;
|
|
1916
|
+
}
|
|
1483
1917
|
export declare const WEBHOOK_EVENT_HEADER = "signsealer-event-id";
|
|
1484
1918
|
export declare const WEBHOOK_TIMESTAMP_HEADER = "signsealer-timestamp";
|
|
1485
1919
|
export declare const WEBHOOK_SIGNATURE_HEADER = "signsealer-signature";
|
|
@@ -1569,18 +2003,19 @@ export type WebhookHeaders = Headers | Record<string, string | string[] | undefi
|
|
|
1569
2003
|
* signed bytes again with a different id on them, and a receiver keyed on the
|
|
1570
2004
|
* id will treat the replay as a new event.
|
|
1571
2005
|
*
|
|
1572
|
-
*
|
|
1573
|
-
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1578
|
-
*
|
|
1579
|
-
* the
|
|
2006
|
+
* A key derived from `timestamp.body` is authenticated but is *not* stable
|
|
2007
|
+
* across retries, because the sender signs a fresh timestamp on every attempt;
|
|
2008
|
+
* this SDK briefly returned one, which deduplicated replays and broke ordinary
|
|
2009
|
+
* retries, which is the worse failure of the two. A SHA-256 of the body alone
|
|
2010
|
+
* is both: the signature covers the body, and a delivery's body is built once
|
|
2011
|
+
* and sent unchanged on every retry. That is what the WordPress plugin keys on
|
|
2012
|
+
* (1.14.4). What it cannot tell apart is a replay a person asked for
|
|
2013
|
+
* (`replayWebhookDelivery`), which sends the same body under a new id. The
|
|
2014
|
+
* whole fix is to bring the id inside the signature under a `v2=` scheme,
|
|
2015
|
+
* and that is a change to the wire rather than to this file.
|
|
1580
2016
|
*
|
|
1581
|
-
* Until then: deduplicate on `eventId`,
|
|
1582
|
-
* window would be harmful to your system
|
|
1583
|
-
* against your records before acting on it.
|
|
2017
|
+
* Until then: deduplicate on `eventId`, or on a hash of the raw body when a
|
|
2018
|
+
* replay inside a five-minute window would be harmful to your system.
|
|
1584
2019
|
*/
|
|
1585
2020
|
export declare function verifyWebhookRequest(opts: {
|
|
1586
2021
|
secret: string;
|