instasign 1.1.2 → 1.1.3

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/dist/index.d.ts CHANGED
@@ -1,218 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { WebhookEventType, WebhookPayloadMap } from '@instasign/types';
3
-
4
- type Metadata = Record<string, unknown>;
5
- /** A sign request nested inside an envelope response */
6
- interface EnvelopeSignRequest {
7
- requestId?: string;
8
- status?: Metadata;
9
- fileName?: string;
10
- fileUrl?: string;
11
- signedFileUrl?: string;
12
- metadata?: Metadata;
13
- clientReferenceId?: string;
14
- }
15
- /** A full envelope with its sign requests */
16
- interface Envelope {
17
- signUrl?: string;
18
- envelopeId?: string;
19
- name?: string;
20
- description?: string;
21
- status?: Metadata;
22
- clientReferenceId?: string;
23
- signRequests?: EnvelopeSignRequest[];
24
- }
25
- /** Envelope as returned in a list (includes createdAt as ISO string) */
26
- interface EnvelopeListItem extends Envelope {
27
- createdAt?: string;
28
- }
29
- interface CreateEnvelopeParams {
30
- /** The name of the envelope */
31
- name: string;
32
- /** The description of the envelope */
33
- description?: string;
34
- /** Associated metadata for the envelope */
35
- metadata?: Metadata;
36
- /** The expiration date of the envelope (ISO 8601) */
37
- expirationDate?: string;
38
- /** External reference ID for the client */
39
- clientReferenceId?: string;
40
- }
41
- interface GetEnvelopesParams {
42
- /** Filter by envelope name (case-insensitive regex) */
43
- name?: string;
44
- /** Filter by envelope status */
45
- status?: string;
46
- /** Filter by client reference ID */
47
- clientReferenceId?: string;
48
- signRequests?: Metadata[];
49
- /** Field to order by (createdAt or updatedAt) */
50
- orderBy?: string;
51
- /** Order direction (asc or desc) */
52
- orderDirection?: string;
53
- /** Filter by expiration date greater than or equal to */
54
- expirationDateStart?: string;
55
- /** Filter by expiration date less than or equal to */
56
- expirationDateEnd?: string;
57
- /** Number of items to skip for pagination */
58
- skip?: number;
59
- /** Maximum number of items to return */
60
- limit?: number;
61
- }
62
- interface UpdateEnvelopeMetadataParams {
63
- /** The unique identifier of the envelope */
64
- envelopeId: string;
65
- /** The metadata to be merged into the existing envelope metadata */
66
- metadata: Metadata;
67
- }
68
- interface RemoveSignRequestFromEnvelopeParams {
69
- /** The unique identifier of the envelope */
70
- envelopeId: string;
71
- /** The unique identifier of the sign request */
72
- requestId: string;
73
- }
74
- interface AddSignRequestToEnvelopeParams {
75
- /** The unique identifier of the envelope */
76
- envelopeId: string;
77
- /** The name of the file to be signed */
78
- filename: string;
79
- /** The base64 encoded content of the file */
80
- base64File?: string;
81
- /** Remote URL of the file. MUST be publicly accessible. */
82
- fileUrl?: string;
83
- /** Associated metadata for the sign request */
84
- metadata?: Metadata;
85
- }
86
- interface CreateEnvelopeResponse {
87
- envelopeId?: string;
88
- }
89
- interface OperationResponse {
90
- success?: boolean;
91
- message?: string;
92
- }
93
- interface UpdateEnvelopeMetadataResponse {
94
- envelopeId?: string;
95
- metadata?: Metadata;
96
- }
97
- interface AddSignRequestToEnvelopeResponse {
98
- requestId?: string;
99
- signUrl?: string;
100
- envelopeSignUrl?: string;
101
- }
102
- interface CreateSignRequestParams {
103
- /** The name of the file to be signed */
104
- filename: string;
105
- /** The base64 encoded content of the file */
106
- base64File?: string;
107
- /** Remote URL of the file. MUST be publicly accessible. */
108
- fileUrl?: string;
109
- /** Associated metadata for the sign request */
110
- metadata?: Metadata;
111
- }
112
- interface CompleteSignRequestParams {
113
- /** The unique identifier of the sign request to complete */
114
- requestId: string;
115
- /** The base64 encoded content of the signed file */
116
- signedFileDataBase64: string;
117
- }
118
- interface CreateSignRequestResponse {
119
- requestId?: string;
120
- signUrl?: string;
121
- }
122
- interface CompleteSignRequestResponse {
123
- signedFileUrl?: string;
124
- }
125
- interface SignRequestFile {
126
- requestId?: string;
127
- name?: string;
128
- originalFile?: string;
129
- signedFile?: string;
130
- metadata?: Metadata;
131
- status?: string;
132
- }
133
- type WebhookEvent = {
134
- [T in WebhookEventType]: {
135
- eventType: T;
136
- } & WebhookPayloadMap[T];
137
- }[WebhookEventType];
138
- type EnvelopeCreatedEvent = Extract<WebhookEvent, {
139
- eventType: 'envelope_created';
140
- }>;
141
- type EnvelopeExpiredEvent = Extract<WebhookEvent, {
142
- eventType: 'envelope_expired';
143
- }>;
144
- type SignRequestCreatedEvent = Extract<WebhookEvent, {
145
- eventType: 'sign_request_created';
146
- }>;
147
- type SignRequestSignedEvent = Extract<WebhookEvent, {
148
- eventType: 'sign_request_signed';
149
- }>;
150
- type SignRequestExpiredEvent = Extract<WebhookEvent, {
151
- eventType: 'sign_request_expired';
152
- }>;
153
-
154
- declare class Envelopes {
155
- private client;
156
- constructor(client: AxiosInstance);
157
- /**
158
- * Create a new envelope
159
- */
160
- create(params: CreateEnvelopeParams): Promise<CreateEnvelopeResponse | undefined>;
161
- /**
162
- * List envelopes
163
- */
164
- list(params?: GetEnvelopesParams): Promise<EnvelopeListItem[] | undefined>;
165
- /**
166
- * Retrieve a single envelope with its sign requests
167
- */
168
- get(envelopeId: string): Promise<Envelope | undefined>;
169
- /**
170
- * Complete an envelope
171
- */
172
- complete(envelopeId: string): Promise<OperationResponse | undefined>;
173
- /**
174
- * Delete an envelope
175
- */
176
- delete(envelopeId: string): Promise<OperationResponse | undefined>;
177
- /**
178
- * Update envelope metadata
179
- */
180
- updateMetadata(params: UpdateEnvelopeMetadataParams): Promise<UpdateEnvelopeMetadataResponse | undefined>;
181
- /**
182
- * Remove a sign request from an envelope
183
- */
184
- removeSignRequest(params: RemoveSignRequestFromEnvelopeParams): Promise<OperationResponse | undefined>;
185
- /**
186
- * Add a sign request to an envelope
187
- */
188
- addSignRequest(params: AddSignRequestToEnvelopeParams): Promise<AddSignRequestToEnvelopeResponse | undefined>;
189
- }
190
-
191
- declare class SignRequests {
192
- private client;
193
- constructor(client: AxiosInstance);
194
- /**
195
- * Create a new sign request
196
- */
197
- create(params: CreateSignRequestParams): Promise<CreateSignRequestResponse | undefined>;
198
- /**
199
- * Complete a sign request
200
- */
201
- complete(params: CompleteSignRequestParams): Promise<CompleteSignRequestResponse | undefined>;
202
- /**
203
- * Get the file associated with a sign request
204
- */
205
- getFile(requestId: string): Promise<SignRequestFile | undefined>;
206
- }
207
-
208
- declare class Webhooks {
209
- private tolerance;
210
- constructor(tolerance?: number);
211
- /**
212
- * Verify and parse a webhook event
213
- */
214
- constructEvent(payload: string, signatureHeader: string, webhookSecret: string): WebhookEvent;
215
- }
2
+ import { WebhookEventType, WebhookPayloadMap } from './webhook.types.js';
216
3
 
217
4
  /**
218
5
  * This file was auto-generated by openapi-typescript.
@@ -220,7 +7,7 @@ declare class Webhooks {
220
7
  */
221
8
 
222
9
  interface paths {
223
- "/functions/addSignRequestToEnvelope": {
10
+ "/functions/envelope:add-sign-request": {
224
11
  parameters: {
225
12
  query?: never;
226
13
  header?: never;
@@ -229,7 +16,7 @@ interface paths {
229
16
  };
230
17
  get?: never;
231
18
  put?: never;
232
- /** Cloud Function: addSignRequestToEnvelope */
19
+ /** envelope:add-sign-request */
233
20
  post: {
234
21
  parameters: {
235
22
  query?: never;
@@ -240,15 +27,10 @@ interface paths {
240
27
  requestBody?: {
241
28
  content: {
242
29
  "application/json": {
243
- /** @description The unique identifier of the envelope */
244
30
  envelopeId: string;
245
- /** @description The name of the file to be signed */
246
31
  filename: string;
247
- /** @description The base64 encoded content of the file */
248
32
  base64File?: string;
249
- /** @description Remote URL of the file. MUST be publicly accessible. */
250
33
  fileUrl?: string;
251
- /** @description Associated metadata for the sign request */
252
34
  metadata?: {
253
35
  [key: string]: unknown;
254
36
  };
@@ -263,9 +45,9 @@ interface paths {
263
45
  };
264
46
  content: {
265
47
  "application/json": {
266
- result?: {
267
- requestId?: string;
268
- signUrl?: string;
48
+ result: {
49
+ requestId: string;
50
+ signUrl: string;
269
51
  envelopeSignUrl?: string;
270
52
  };
271
53
  };
@@ -279,162 +61,7 @@ interface paths {
279
61
  patch?: never;
280
62
  trace?: never;
281
63
  };
282
- "/functions/completeEnvelope": {
283
- parameters: {
284
- query?: never;
285
- header?: never;
286
- path?: never;
287
- cookie?: never;
288
- };
289
- get?: never;
290
- put?: never;
291
- /** Cloud Function: completeEnvelope */
292
- post: {
293
- parameters: {
294
- query?: never;
295
- header?: never;
296
- path?: never;
297
- cookie?: never;
298
- };
299
- requestBody?: {
300
- content: {
301
- "application/json": {
302
- /** @description The unique identifier of the envelope to mark as completed */
303
- envelopeId: string;
304
- };
305
- };
306
- };
307
- responses: {
308
- /** @description Successful response */
309
- 200: {
310
- headers: {
311
- [name: string]: unknown;
312
- };
313
- content: {
314
- "application/json": {
315
- result?: {
316
- success?: boolean;
317
- message?: string;
318
- };
319
- };
320
- };
321
- };
322
- };
323
- };
324
- delete?: never;
325
- options?: never;
326
- head?: never;
327
- patch?: never;
328
- trace?: never;
329
- };
330
- "/functions/createEnvelope": {
331
- parameters: {
332
- query?: never;
333
- header?: never;
334
- path?: never;
335
- cookie?: never;
336
- };
337
- get?: never;
338
- put?: never;
339
- /** Cloud Function: createEnvelope */
340
- post: {
341
- parameters: {
342
- query?: never;
343
- header?: never;
344
- path?: never;
345
- cookie?: never;
346
- };
347
- requestBody?: {
348
- content: {
349
- "application/json": {
350
- /** @description The name of the envelope */
351
- name: string;
352
- /** @description The description of the envelope */
353
- description?: string;
354
- /** @description Associated metadata for the envelope */
355
- metadata?: {
356
- [key: string]: unknown;
357
- };
358
- /**
359
- * Format: date-time
360
- * @description The expiration date of the envelope
361
- */
362
- expirationDate?: string;
363
- /** @description External reference ID for the client */
364
- clientReferenceId?: string;
365
- };
366
- };
367
- };
368
- responses: {
369
- /** @description Successful response */
370
- 200: {
371
- headers: {
372
- [name: string]: unknown;
373
- };
374
- content: {
375
- "application/json": {
376
- result?: {
377
- envelopeId?: string;
378
- };
379
- };
380
- };
381
- };
382
- };
383
- };
384
- delete?: never;
385
- options?: never;
386
- head?: never;
387
- patch?: never;
388
- trace?: never;
389
- };
390
- "/functions/deleteEnvelope": {
391
- parameters: {
392
- query?: never;
393
- header?: never;
394
- path?: never;
395
- cookie?: never;
396
- };
397
- get?: never;
398
- put?: never;
399
- /** Cloud Function: deleteEnvelope */
400
- post: {
401
- parameters: {
402
- query?: never;
403
- header?: never;
404
- path?: never;
405
- cookie?: never;
406
- };
407
- requestBody?: {
408
- content: {
409
- "application/json": {
410
- /** @description The unique identifier of the envelope to delete */
411
- envelopeId: string;
412
- };
413
- };
414
- };
415
- responses: {
416
- /** @description Successful response */
417
- 200: {
418
- headers: {
419
- [name: string]: unknown;
420
- };
421
- content: {
422
- "application/json": {
423
- result?: {
424
- success?: boolean;
425
- };
426
- };
427
- };
428
- };
429
- };
430
- };
431
- delete?: never;
432
- options?: never;
433
- head?: never;
434
- patch?: never;
435
- trace?: never;
436
- };
437
- "/functions/getEnvelope": {
64
+ "/functions/envelope:complete": {
438
65
  parameters: {
439
66
  query?: never;
440
67
  header?: never;
@@ -443,7 +70,7 @@ interface paths {
443
70
  };
444
71
  get?: never;
445
72
  put?: never;
446
- /** Cloud Function: getEnvelope */
73
+ /** envelope:complete */
447
74
  post: {
448
75
  parameters: {
449
76
  query?: never;
@@ -454,7 +81,6 @@ interface paths {
454
81
  requestBody?: {
455
82
  content: {
456
83
  "application/json": {
457
- /** @description The unique identifier of the envelope */
458
84
  envelopeId: string;
459
85
  };
460
86
  };
@@ -467,28 +93,9 @@ interface paths {
467
93
  };
468
94
  content: {
469
95
  "application/json": {
470
- result?: {
471
- signUrl?: string;
472
- envelopeId?: string;
473
- name?: string;
474
- description?: string;
475
- status?: {
476
- [key: string]: unknown;
477
- };
478
- clientReferenceId?: string;
479
- signRequests?: {
480
- requestId?: string;
481
- status?: {
482
- [key: string]: unknown;
483
- };
484
- fileName?: string;
485
- fileUrl?: string;
486
- signedFileUrl?: string;
487
- metadata?: {
488
- [key: string]: unknown;
489
- };
490
- clientReferenceId?: string;
491
- }[];
96
+ result: {
97
+ success: boolean;
98
+ message: string;
492
99
  };
493
100
  };
494
101
  };
@@ -501,7 +108,7 @@ interface paths {
501
108
  patch?: never;
502
109
  trace?: never;
503
110
  };
504
- "/functions/getEnvelopes": {
111
+ "/functions/envelope:create": {
505
112
  parameters: {
506
113
  query?: never;
507
114
  header?: never;
@@ -510,7 +117,7 @@ interface paths {
510
117
  };
511
118
  get?: never;
512
119
  put?: never;
513
- /** Cloud Function: getEnvelopes */
120
+ /** envelope:create */
514
121
  post: {
515
122
  parameters: {
516
123
  query?: never;
@@ -521,447 +128,28 @@ interface paths {
521
128
  requestBody?: {
522
129
  content: {
523
130
  "application/json": {
524
- /** @description Filter by envelope name (case-insensitive regex) */
525
- name?: string;
526
- /** @description Filter by envelope status */
527
- status?: string;
528
- /** @description Filter by client reference ID */
529
- clientReferenceId?: string;
530
- /** @description Filter by a list of sign request IDs */
531
- signRequests?: {
532
- [key: string]: unknown;
533
- }[];
534
- /** @description Field to order by (createdAt or updatedAt) */
535
- orderBy?: string;
536
- /** @description Order direction (asc or desc) */
537
- orderDirection?: string;
538
- /** @description Filter by expiration date greater than or equal to */
539
- expirationDateStart?: string;
540
- /** @description Filter by expiration date less than or equal to */
541
- expirationDateEnd?: string;
542
- /** @description Number of items to skip for pagination */
543
- skip?: number;
544
- /** @description Maximum number of items to return */
545
- limit?: number;
546
- };
547
- };
548
- };
549
- responses: {
550
- /** @description Successful response */
551
- 200: {
552
- headers: {
553
- [name: string]: unknown;
554
- };
555
- content: {
556
- "application/json": {
557
- result?: {
558
- signUrl?: string;
559
- envelopeId?: string;
560
- name?: string;
561
- description?: string;
562
- status?: {
563
- [key: string]: unknown;
564
- };
565
- clientReferenceId?: string;
566
- signRequests?: {
567
- requestId?: {
568
- [key: string]: unknown;
569
- };
570
- status?: {
571
- [key: string]: unknown;
572
- };
573
- fileName?: {
574
- [key: string]: unknown;
575
- };
576
- fileUrl?: {
577
- [key: string]: unknown;
578
- };
579
- signedFileUrl?: {
580
- [key: string]: unknown;
581
- };
582
- metadata?: {
583
- [key: string]: unknown;
584
- };
585
- clientReferenceId?: {
586
- [key: string]: unknown;
587
- };
588
- }[];
589
- createdAt?: {
590
- toDateString?: {
591
- [key: string]: unknown;
592
- };
593
- toTimeString?: {
594
- [key: string]: unknown;
595
- };
596
- toLocaleDateString?: {
597
- [key: string]: unknown;
598
- };
599
- toLocaleTimeString?: {
600
- [key: string]: unknown;
601
- };
602
- getTime?: {
603
- [key: string]: unknown;
604
- };
605
- getFullYear?: {
606
- [key: string]: unknown;
607
- };
608
- getUTCFullYear?: {
609
- [key: string]: unknown;
610
- };
611
- getMonth?: {
612
- [key: string]: unknown;
613
- };
614
- getUTCMonth?: {
615
- [key: string]: unknown;
616
- };
617
- getDate?: {
618
- [key: string]: unknown;
619
- };
620
- getUTCDate?: {
621
- [key: string]: unknown;
622
- };
623
- getDay?: {
624
- [key: string]: unknown;
625
- };
626
- getUTCDay?: {
627
- [key: string]: unknown;
628
- };
629
- getHours?: {
630
- [key: string]: unknown;
631
- };
632
- getUTCHours?: {
633
- [key: string]: unknown;
634
- };
635
- getMinutes?: {
636
- [key: string]: unknown;
637
- };
638
- getUTCMinutes?: {
639
- [key: string]: unknown;
640
- };
641
- getSeconds?: {
642
- [key: string]: unknown;
643
- };
644
- getUTCSeconds?: {
645
- [key: string]: unknown;
646
- };
647
- getMilliseconds?: {
648
- [key: string]: unknown;
649
- };
650
- getUTCMilliseconds?: {
651
- [key: string]: unknown;
652
- };
653
- getTimezoneOffset?: {
654
- [key: string]: unknown;
655
- };
656
- setTime?: {
657
- [key: string]: unknown;
658
- };
659
- setMilliseconds?: {
660
- [key: string]: unknown;
661
- };
662
- setUTCMilliseconds?: {
663
- [key: string]: unknown;
664
- };
665
- setSeconds?: {
666
- [key: string]: unknown;
667
- };
668
- setUTCSeconds?: {
669
- [key: string]: unknown;
670
- };
671
- setMinutes?: {
672
- [key: string]: unknown;
673
- };
674
- setUTCMinutes?: {
675
- [key: string]: unknown;
676
- };
677
- setHours?: {
678
- [key: string]: unknown;
679
- };
680
- setUTCHours?: {
681
- [key: string]: unknown;
682
- };
683
- setDate?: {
684
- [key: string]: unknown;
685
- };
686
- setUTCDate?: {
687
- [key: string]: unknown;
688
- };
689
- setMonth?: {
690
- [key: string]: unknown;
691
- };
692
- setUTCMonth?: {
693
- [key: string]: unknown;
694
- };
695
- setFullYear?: {
696
- [key: string]: unknown;
697
- };
698
- setUTCFullYear?: {
699
- [key: string]: unknown;
700
- };
701
- toUTCString?: {
702
- [key: string]: unknown;
703
- };
704
- toISOString?: {
705
- [key: string]: unknown;
706
- };
707
- toJSON?: {
708
- [key: string]: unknown;
709
- };
710
- getVarDate?: {
711
- [key: string]: unknown;
712
- };
713
- };
714
- updatedAt?: {
715
- toDateString?: {
716
- [key: string]: unknown;
717
- };
718
- toTimeString?: {
719
- [key: string]: unknown;
720
- };
721
- toLocaleDateString?: {
722
- [key: string]: unknown;
723
- };
724
- toLocaleTimeString?: {
725
- [key: string]: unknown;
726
- };
727
- getTime?: {
728
- [key: string]: unknown;
729
- };
730
- getFullYear?: {
731
- [key: string]: unknown;
732
- };
733
- getUTCFullYear?: {
734
- [key: string]: unknown;
735
- };
736
- getMonth?: {
737
- [key: string]: unknown;
738
- };
739
- getUTCMonth?: {
740
- [key: string]: unknown;
741
- };
742
- getDate?: {
743
- [key: string]: unknown;
744
- };
745
- getUTCDate?: {
746
- [key: string]: unknown;
747
- };
748
- getDay?: {
749
- [key: string]: unknown;
750
- };
751
- getUTCDay?: {
752
- [key: string]: unknown;
753
- };
754
- getHours?: {
755
- [key: string]: unknown;
756
- };
757
- getUTCHours?: {
758
- [key: string]: unknown;
759
- };
760
- getMinutes?: {
761
- [key: string]: unknown;
762
- };
763
- getUTCMinutes?: {
764
- [key: string]: unknown;
765
- };
766
- getSeconds?: {
767
- [key: string]: unknown;
768
- };
769
- getUTCSeconds?: {
770
- [key: string]: unknown;
771
- };
772
- getMilliseconds?: {
773
- [key: string]: unknown;
774
- };
775
- getUTCMilliseconds?: {
776
- [key: string]: unknown;
777
- };
778
- getTimezoneOffset?: {
779
- [key: string]: unknown;
780
- };
781
- setTime?: {
782
- [key: string]: unknown;
783
- };
784
- setMilliseconds?: {
785
- [key: string]: unknown;
786
- };
787
- setUTCMilliseconds?: {
788
- [key: string]: unknown;
789
- };
790
- setSeconds?: {
791
- [key: string]: unknown;
792
- };
793
- setUTCSeconds?: {
794
- [key: string]: unknown;
795
- };
796
- setMinutes?: {
797
- [key: string]: unknown;
798
- };
799
- setUTCMinutes?: {
800
- [key: string]: unknown;
801
- };
802
- setHours?: {
803
- [key: string]: unknown;
804
- };
805
- setUTCHours?: {
806
- [key: string]: unknown;
807
- };
808
- setDate?: {
809
- [key: string]: unknown;
810
- };
811
- setUTCDate?: {
812
- [key: string]: unknown;
813
- };
814
- setMonth?: {
815
- [key: string]: unknown;
816
- };
817
- setUTCMonth?: {
818
- [key: string]: unknown;
819
- };
820
- setFullYear?: {
821
- [key: string]: unknown;
822
- };
823
- setUTCFullYear?: {
824
- [key: string]: unknown;
825
- };
826
- toUTCString?: {
827
- [key: string]: unknown;
828
- };
829
- toISOString?: {
830
- [key: string]: unknown;
831
- };
832
- toJSON?: {
833
- [key: string]: unknown;
834
- };
835
- getVarDate?: {
836
- [key: string]: unknown;
837
- };
838
- };
839
- expirationDate?: {
840
- toDateString?: {
841
- [key: string]: unknown;
842
- };
843
- toTimeString?: {
844
- [key: string]: unknown;
845
- };
846
- toLocaleDateString?: {
847
- [key: string]: unknown;
848
- };
849
- toLocaleTimeString?: {
850
- [key: string]: unknown;
851
- };
852
- getTime?: {
853
- [key: string]: unknown;
854
- };
855
- getFullYear?: {
856
- [key: string]: unknown;
857
- };
858
- getUTCFullYear?: {
859
- [key: string]: unknown;
860
- };
861
- getMonth?: {
862
- [key: string]: unknown;
863
- };
864
- getUTCMonth?: {
865
- [key: string]: unknown;
866
- };
867
- getDate?: {
868
- [key: string]: unknown;
869
- };
870
- getUTCDate?: {
871
- [key: string]: unknown;
872
- };
873
- getDay?: {
874
- [key: string]: unknown;
875
- };
876
- getUTCDay?: {
877
- [key: string]: unknown;
878
- };
879
- getHours?: {
880
- [key: string]: unknown;
881
- };
882
- getUTCHours?: {
883
- [key: string]: unknown;
884
- };
885
- getMinutes?: {
886
- [key: string]: unknown;
887
- };
888
- getUTCMinutes?: {
889
- [key: string]: unknown;
890
- };
891
- getSeconds?: {
892
- [key: string]: unknown;
893
- };
894
- getUTCSeconds?: {
895
- [key: string]: unknown;
896
- };
897
- getMilliseconds?: {
898
- [key: string]: unknown;
899
- };
900
- getUTCMilliseconds?: {
901
- [key: string]: unknown;
902
- };
903
- getTimezoneOffset?: {
904
- [key: string]: unknown;
905
- };
906
- setTime?: {
907
- [key: string]: unknown;
908
- };
909
- setMilliseconds?: {
910
- [key: string]: unknown;
911
- };
912
- setUTCMilliseconds?: {
913
- [key: string]: unknown;
914
- };
915
- setSeconds?: {
916
- [key: string]: unknown;
917
- };
918
- setUTCSeconds?: {
919
- [key: string]: unknown;
920
- };
921
- setMinutes?: {
922
- [key: string]: unknown;
923
- };
924
- setUTCMinutes?: {
925
- [key: string]: unknown;
926
- };
927
- setHours?: {
928
- [key: string]: unknown;
929
- };
930
- setUTCHours?: {
931
- [key: string]: unknown;
932
- };
933
- setDate?: {
934
- [key: string]: unknown;
935
- };
936
- setUTCDate?: {
937
- [key: string]: unknown;
938
- };
939
- setMonth?: {
940
- [key: string]: unknown;
941
- };
942
- setUTCMonth?: {
943
- [key: string]: unknown;
944
- };
945
- setFullYear?: {
946
- [key: string]: unknown;
947
- };
948
- setUTCFullYear?: {
949
- [key: string]: unknown;
950
- };
951
- toUTCString?: {
952
- [key: string]: unknown;
953
- };
954
- toISOString?: {
955
- [key: string]: unknown;
956
- };
957
- toJSON?: {
958
- [key: string]: unknown;
959
- };
960
- getVarDate?: {
961
- [key: string]: unknown;
962
- };
963
- };
964
- }[];
131
+ name: string;
132
+ description?: string;
133
+ metadata?: {
134
+ [key: string]: unknown;
135
+ };
136
+ /** Format: date-time */
137
+ expirationDate?: string;
138
+ clientReferenceId?: string;
139
+ };
140
+ };
141
+ };
142
+ responses: {
143
+ /** @description Successful response */
144
+ 200: {
145
+ headers: {
146
+ [name: string]: unknown;
147
+ };
148
+ content: {
149
+ "application/json": {
150
+ result: {
151
+ envelopeId: string;
152
+ };
965
153
  };
966
154
  };
967
155
  };
@@ -973,7 +161,7 @@ interface paths {
973
161
  patch?: never;
974
162
  trace?: never;
975
163
  };
976
- "/functions/removeSignRequestFromEnvelope": {
164
+ "/functions/envelope:delete": {
977
165
  parameters: {
978
166
  query?: never;
979
167
  header?: never;
@@ -982,7 +170,7 @@ interface paths {
982
170
  };
983
171
  get?: never;
984
172
  put?: never;
985
- /** Cloud Function: removeSignRequestFromEnvelope */
173
+ /** envelope:delete */
986
174
  post: {
987
175
  parameters: {
988
176
  query?: never;
@@ -993,10 +181,7 @@ interface paths {
993
181
  requestBody?: {
994
182
  content: {
995
183
  "application/json": {
996
- /** @description The unique identifier of the envelope */
997
184
  envelopeId: string;
998
- /** @description The unique identifier of the sign request */
999
- requestId: string;
1000
185
  };
1001
186
  };
1002
187
  };
@@ -1008,9 +193,8 @@ interface paths {
1008
193
  };
1009
194
  content: {
1010
195
  "application/json": {
1011
- result?: {
1012
- success?: boolean;
1013
- message?: string;
196
+ result: {
197
+ success: boolean;
1014
198
  };
1015
199
  };
1016
200
  };
@@ -1023,7 +207,7 @@ interface paths {
1023
207
  patch?: never;
1024
208
  trace?: never;
1025
209
  };
1026
- "/functions/updateEnvelopeMetadata": {
210
+ "/functions/envelope:get": {
1027
211
  parameters: {
1028
212
  query?: never;
1029
213
  header?: never;
@@ -1032,7 +216,7 @@ interface paths {
1032
216
  };
1033
217
  get?: never;
1034
218
  put?: never;
1035
- /** Cloud Function: updateEnvelopeMetadata */
219
+ /** envelope:get */
1036
220
  post: {
1037
221
  parameters: {
1038
222
  query?: never;
@@ -1043,12 +227,8 @@ interface paths {
1043
227
  requestBody?: {
1044
228
  content: {
1045
229
  "application/json": {
1046
- /** @description The unique identifier of the envelope */
1047
230
  envelopeId: string;
1048
- /** @description The metadata to be merged into the existing envelope metadata */
1049
- metadata: {
1050
- [key: string]: unknown;
1051
- };
231
+ includeSignRequests?: boolean;
1052
232
  };
1053
233
  };
1054
234
  };
@@ -1060,11 +240,33 @@ interface paths {
1060
240
  };
1061
241
  content: {
1062
242
  "application/json": {
1063
- result?: {
1064
- envelopeId?: string;
1065
- metadata?: {
1066
- [key: string]: unknown;
1067
- };
243
+ result: {
244
+ envelopeId: string;
245
+ name: string;
246
+ description?: string;
247
+ /** @enum {string} */
248
+ status: "pending" | "in-progress" | "completed" | "cancelled";
249
+ clientReferenceId?: string;
250
+ signRequestsCount: number;
251
+ signRequests: {
252
+ requestId: string;
253
+ /** @enum {string} */
254
+ status: "pending" | "completed" | "canceled" | "queued";
255
+ fileName: string;
256
+ fileUrl: string;
257
+ signedFileUrl?: string;
258
+ metadata: {
259
+ [key: string]: unknown;
260
+ };
261
+ clientReferenceId?: string;
262
+ }[];
263
+ /** Format: date-time */
264
+ createdAt: string;
265
+ /** Format: date-time */
266
+ updatedAt: string;
267
+ /** Format: date-time */
268
+ expirationDate?: string;
269
+ signUrl?: string;
1068
270
  };
1069
271
  };
1070
272
  };
@@ -1077,7 +279,91 @@ interface paths {
1077
279
  patch?: never;
1078
280
  trace?: never;
1079
281
  };
1080
- "/functions/completeSignRequest": {
282
+ "/functions/envelope:list": {
283
+ parameters: {
284
+ query?: never;
285
+ header?: never;
286
+ path?: never;
287
+ cookie?: never;
288
+ };
289
+ get?: never;
290
+ put?: never;
291
+ /** envelope:list */
292
+ post: {
293
+ parameters: {
294
+ query?: never;
295
+ header?: never;
296
+ path?: never;
297
+ cookie?: never;
298
+ };
299
+ requestBody?: {
300
+ content: {
301
+ "application/json": {
302
+ name?: string;
303
+ /** @enum {string} */
304
+ status?: "pending" | "in-progress" | "completed" | "cancelled";
305
+ clientReferenceId?: string;
306
+ signRequests?: string[];
307
+ /** @enum {string} */
308
+ orderBy?: "updatedAt" | "createdAt";
309
+ /** @enum {string} */
310
+ orderDirection?: "asc" | "desc";
311
+ expirationDateStart?: string;
312
+ expirationDateEnd?: string;
313
+ skip?: number;
314
+ limit?: number;
315
+ includeSignRequests?: boolean;
316
+ };
317
+ };
318
+ };
319
+ responses: {
320
+ /** @description Successful response */
321
+ 200: {
322
+ headers: {
323
+ [name: string]: unknown;
324
+ };
325
+ content: {
326
+ "application/json": {
327
+ result: {
328
+ envelopeId: string;
329
+ name: string;
330
+ description?: string;
331
+ /** @enum {string} */
332
+ status: "pending" | "in-progress" | "completed" | "cancelled";
333
+ clientReferenceId?: string;
334
+ signRequestsCount: number;
335
+ signRequests: {
336
+ requestId: string;
337
+ /** @enum {string} */
338
+ status: "pending" | "completed" | "canceled" | "queued";
339
+ fileName: string;
340
+ fileUrl: string;
341
+ signedFileUrl?: string;
342
+ metadata: {
343
+ [key: string]: unknown;
344
+ };
345
+ clientReferenceId?: string;
346
+ }[];
347
+ /** Format: date-time */
348
+ createdAt: string;
349
+ /** Format: date-time */
350
+ updatedAt: string;
351
+ /** Format: date-time */
352
+ expirationDate?: string;
353
+ signUrl?: string;
354
+ }[];
355
+ };
356
+ };
357
+ };
358
+ };
359
+ };
360
+ delete?: never;
361
+ options?: never;
362
+ head?: never;
363
+ patch?: never;
364
+ trace?: never;
365
+ };
366
+ "/functions/envelope:remove-sign-request": {
1081
367
  parameters: {
1082
368
  query?: never;
1083
369
  header?: never;
@@ -1086,7 +372,7 @@ interface paths {
1086
372
  };
1087
373
  get?: never;
1088
374
  put?: never;
1089
- /** Cloud Function: completeSignRequest */
375
+ /** envelope:remove-sign-request */
1090
376
  post: {
1091
377
  parameters: {
1092
378
  query?: never;
@@ -1097,10 +383,8 @@ interface paths {
1097
383
  requestBody?: {
1098
384
  content: {
1099
385
  "application/json": {
1100
- /** @description The unique identifier of the sign request to complete */
386
+ envelopeId: string;
1101
387
  requestId: string;
1102
- /** @description The base64 encoded content of the signed file */
1103
- signedFileDataBase64: string;
1104
388
  };
1105
389
  };
1106
390
  };
@@ -1112,8 +396,9 @@ interface paths {
1112
396
  };
1113
397
  content: {
1114
398
  "application/json": {
1115
- result?: {
1116
- signedFileUrl?: string;
399
+ result: {
400
+ success: boolean;
401
+ message: string;
1117
402
  };
1118
403
  };
1119
404
  };
@@ -1126,7 +411,7 @@ interface paths {
1126
411
  patch?: never;
1127
412
  trace?: never;
1128
413
  };
1129
- "/functions/createSignRequest": {
414
+ "/functions/envelope:update-metadata": {
1130
415
  parameters: {
1131
416
  query?: never;
1132
417
  header?: never;
@@ -1135,7 +420,7 @@ interface paths {
1135
420
  };
1136
421
  get?: never;
1137
422
  put?: never;
1138
- /** Cloud Function: createSignRequest */
423
+ /** envelope:update-metadata */
1139
424
  post: {
1140
425
  parameters: {
1141
426
  query?: never;
@@ -1146,14 +431,8 @@ interface paths {
1146
431
  requestBody?: {
1147
432
  content: {
1148
433
  "application/json": {
1149
- /** @description The name of the file to be signed */
1150
- filename: string;
1151
- /** @description The base64 encoded content of the file */
1152
- base64File?: string;
1153
- /** @description Remote URL of the file. MUST be publicly accessible. */
1154
- fileUrl?: string;
1155
- /** @description Associated metadata for the sign request */
1156
- metadata?: {
434
+ envelopeId: string;
435
+ metadata: {
1157
436
  [key: string]: unknown;
1158
437
  };
1159
438
  };
@@ -1167,9 +446,11 @@ interface paths {
1167
446
  };
1168
447
  content: {
1169
448
  "application/json": {
1170
- result?: {
1171
- requestId?: string;
1172
- signUrl?: string;
449
+ result: {
450
+ envelopeId: string;
451
+ metadata: {
452
+ [key: string]: unknown;
453
+ };
1173
454
  };
1174
455
  };
1175
456
  };
@@ -1182,7 +463,7 @@ interface paths {
1182
463
  patch?: never;
1183
464
  trace?: never;
1184
465
  };
1185
- "/functions/getFileFromRequestId": {
466
+ "/functions/sign-request:complete": {
1186
467
  parameters: {
1187
468
  query?: never;
1188
469
  header?: never;
@@ -1191,7 +472,7 @@ interface paths {
1191
472
  };
1192
473
  get?: never;
1193
474
  put?: never;
1194
- /** Cloud Function: getFileFromRequestId */
475
+ /** sign-request:complete */
1195
476
  post: {
1196
477
  parameters: {
1197
478
  query?: never;
@@ -1202,8 +483,8 @@ interface paths {
1202
483
  requestBody?: {
1203
484
  content: {
1204
485
  "application/json": {
1205
- /** @description The unique identifier of the sign request */
1206
486
  requestId: string;
487
+ signedFileDataBase64: string;
1207
488
  };
1208
489
  };
1209
490
  };
@@ -1215,15 +496,63 @@ interface paths {
1215
496
  };
1216
497
  content: {
1217
498
  "application/json": {
1218
- result?: {
1219
- requestId?: string;
1220
- name?: string;
1221
- originalFile?: string;
1222
- signedFile?: string;
1223
- metadata?: {
1224
- [key: string]: unknown;
1225
- };
1226
- status?: string;
499
+ result: {
500
+ signedFileUrl: string;
501
+ };
502
+ };
503
+ };
504
+ };
505
+ };
506
+ };
507
+ delete?: never;
508
+ options?: never;
509
+ head?: never;
510
+ patch?: never;
511
+ trace?: never;
512
+ };
513
+ "/functions/sign-request:create": {
514
+ parameters: {
515
+ query?: never;
516
+ header?: never;
517
+ path?: never;
518
+ cookie?: never;
519
+ };
520
+ get?: never;
521
+ put?: never;
522
+ /** sign-request:create */
523
+ post: {
524
+ parameters: {
525
+ query?: never;
526
+ header?: never;
527
+ path?: never;
528
+ cookie?: never;
529
+ };
530
+ requestBody?: {
531
+ content: {
532
+ "application/json": {
533
+ filename: string;
534
+ base64File?: string;
535
+ fileUrl?: string;
536
+ metadata?: {
537
+ [key: string]: unknown;
538
+ };
539
+ clientReferenceId?: string;
540
+ /** Format: date-time */
541
+ expirationDate?: string;
542
+ };
543
+ };
544
+ };
545
+ responses: {
546
+ /** @description Successful response */
547
+ 200: {
548
+ headers: {
549
+ [name: string]: unknown;
550
+ };
551
+ content: {
552
+ "application/json": {
553
+ result: {
554
+ requestId: string;
555
+ signUrl: string;
1227
556
  };
1228
557
  };
1229
558
  };
@@ -1236,7 +565,7 @@ interface paths {
1236
565
  patch?: never;
1237
566
  trace?: never;
1238
567
  };
1239
- "/functions/getSignedFile": {
568
+ "/functions/sign-request:get": {
1240
569
  parameters: {
1241
570
  query?: never;
1242
571
  header?: never;
@@ -1245,7 +574,7 @@ interface paths {
1245
574
  };
1246
575
  get?: never;
1247
576
  put?: never;
1248
- /** Cloud Function: getSignedFile */
577
+ /** sign-request:get */
1249
578
  post: {
1250
579
  parameters: {
1251
580
  query?: never;
@@ -1256,7 +585,6 @@ interface paths {
1256
585
  requestBody?: {
1257
586
  content: {
1258
587
  "application/json": {
1259
- /** @description The unique identifier of the sign request */
1260
588
  requestId: string;
1261
589
  };
1262
590
  };
@@ -1269,10 +597,21 @@ interface paths {
1269
597
  };
1270
598
  content: {
1271
599
  "application/json": {
1272
- result?: {
1273
- fileName?: string;
1274
- fileUrl?: string;
1275
- signedFileUrl?: string;
600
+ result: {
601
+ requestId: string;
602
+ /** @enum {string} */
603
+ status: "pending" | "completed" | "canceled" | "queued";
604
+ fileName: string;
605
+ originalFile: string;
606
+ signedFile?: string;
607
+ metadata?: {
608
+ [key: string]: unknown;
609
+ };
610
+ clientReferenceId?: string;
611
+ /** Format: date-time */
612
+ createdAt: string;
613
+ /** Format: date-time */
614
+ updatedAt: string;
1276
615
  };
1277
616
  };
1278
617
  };
@@ -1285,7 +624,7 @@ interface paths {
1285
624
  patch?: never;
1286
625
  trace?: never;
1287
626
  };
1288
- "/functions/updateSignRequestMetadata": {
627
+ "/functions/sign-request:update-metadata": {
1289
628
  parameters: {
1290
629
  query?: never;
1291
630
  header?: never;
@@ -1294,7 +633,7 @@ interface paths {
1294
633
  };
1295
634
  get?: never;
1296
635
  put?: never;
1297
- /** Cloud Function: updateSignRequestMetadata */
636
+ /** sign-request:update-metadata */
1298
637
  post: {
1299
638
  parameters: {
1300
639
  query?: never;
@@ -1305,9 +644,7 @@ interface paths {
1305
644
  requestBody?: {
1306
645
  content: {
1307
646
  "application/json": {
1308
- /** @description The unique identifier of the sign request */
1309
647
  requestId: string;
1310
- /** @description The metadata to be merged into the existing sign request metadata */
1311
648
  metadata: {
1312
649
  [key: string]: unknown;
1313
650
  };
@@ -1322,9 +659,9 @@ interface paths {
1322
659
  };
1323
660
  content: {
1324
661
  "application/json": {
1325
- result?: {
1326
- requestId?: string;
1327
- metadata?: {
662
+ result: {
663
+ requestId: string;
664
+ metadata: {
1328
665
  [key: string]: unknown;
1329
666
  };
1330
667
  };
@@ -1342,58 +679,7 @@ interface paths {
1342
679
  }
1343
680
  type webhooks = Record<string, never>;
1344
681
  interface components {
1345
- schemas: {
1346
- ApiLog: {
1347
- apiKey?: string;
1348
- functionName?: string;
1349
- statusCode?: string;
1350
- statusMessage?: string;
1351
- };
1352
- Authentication: {
1353
- apiKey?: string;
1354
- name?: string;
1355
- status?: string;
1356
- expirationDate?: string;
1357
- callbackUrl?: string;
1358
- webhookSecret?: string;
1359
- };
1360
- Envelope: {
1361
- name?: string;
1362
- description?: string;
1363
- envelopeId?: string;
1364
- signRequests?: string;
1365
- status?: string;
1366
- metadata?: string;
1367
- apiKey?: string;
1368
- expirationDate?: string;
1369
- isDeleted?: string;
1370
- clientReferenceId?: string;
1371
- };
1372
- SignRequest: {
1373
- status?: string;
1374
- file?: string;
1375
- fileName?: string;
1376
- signedFile?: string;
1377
- requestId?: string;
1378
- metadata?: string;
1379
- apiKey?: string;
1380
- expirationDate?: string;
1381
- isDeleted?: string;
1382
- clientReferenceId?: string;
1383
- };
1384
- WebhookLog: {
1385
- status?: string;
1386
- message?: string;
1387
- signRequest?: string;
1388
- envelope?: string;
1389
- eventType?: string;
1390
- delivered?: string;
1391
- retryCount?: string;
1392
- nextRetryAt?: string;
1393
- payload?: string;
1394
- apiKey?: string;
1395
- };
1396
- };
682
+ schemas: never;
1397
683
  responses: never;
1398
684
  parameters: never;
1399
685
  requestBodies: never;
@@ -1403,6 +689,119 @@ interface components {
1403
689
  type $defs = Record<string, never>;
1404
690
  type operations = Record<string, never>;
1405
691
 
692
+ interface OperationResponse {
693
+ success?: boolean;
694
+ message?: string;
695
+ }
696
+ /** Extract the result type from a Cloud Function response */
697
+ type ResponseResult<P extends keyof paths> = NonNullable<NonNullable<paths[P]['post']['responses']>[200]['content']>['application/json']['result'];
698
+ /** Extract the request body type from a Cloud Function */
699
+ type RequestBody<P extends keyof paths> = NonNullable<NonNullable<paths[P]['post']['requestBody']>['content']>['application/json'];
700
+
701
+ /** A full envelope with its sign requests */
702
+ type Envelope = ResponseResult<'/functions/envelope:get'>;
703
+ /** Envelope as returned in a list */
704
+ type EnvelopeListItem = ResponseResult<'/functions/envelope:list'>[number];
705
+ type CreateEnvelopeParams = RequestBody<'/functions/envelope:create'>;
706
+ type GetEnvelopesParams = RequestBody<'/functions/envelope:list'>;
707
+ type UpdateEnvelopeMetadataParams = RequestBody<'/functions/envelope:update-metadata'>;
708
+ type RemoveSignRequestFromEnvelopeParams = RequestBody<'/functions/envelope:remove-sign-request'>;
709
+ type AddSignRequestToEnvelopeParams = RequestBody<'/functions/envelope:add-sign-request'>;
710
+ type CreateEnvelopeResponse = ResponseResult<'/functions/envelope:create'>;
711
+ type UpdateEnvelopeMetadataResponse = ResponseResult<'/functions/envelope:update-metadata'>;
712
+ type AddSignRequestToEnvelopeResponse = ResponseResult<'/functions/envelope:add-sign-request'>;
713
+
714
+ /** A single sign request */
715
+ type SignRequest = ResponseResult<'/functions/envelope:get'>['signRequests'][number];
716
+ type CreateSignRequestParams = RequestBody<'/functions/sign-request:create'>;
717
+ type CompleteSignRequestParams = RequestBody<'/functions/sign-request:complete'>;
718
+ type CreateSignRequestResponse = ResponseResult<'/functions/sign-request:create'>;
719
+ type CompleteSignRequestResponse = ResponseResult<'/functions/sign-request:complete'>;
720
+
721
+ type WebhookEvent = {
722
+ [T in WebhookEventType]: {
723
+ eventType: T;
724
+ } & WebhookPayloadMap[T];
725
+ }[WebhookEventType];
726
+ type EnvelopeCreatedEvent = Extract<WebhookEvent, {
727
+ eventType: 'envelope_created';
728
+ }>;
729
+ type EnvelopeExpiredEvent = Extract<WebhookEvent, {
730
+ eventType: 'envelope_expired';
731
+ }>;
732
+ type SignRequestCreatedEvent = Extract<WebhookEvent, {
733
+ eventType: 'sign_request_created';
734
+ }>;
735
+ type SignRequestSignedEvent = Extract<WebhookEvent, {
736
+ eventType: 'sign_request_signed';
737
+ }>;
738
+ type SignRequestExpiredEvent = Extract<WebhookEvent, {
739
+ eventType: 'sign_request_expired';
740
+ }>;
741
+
742
+ declare class Envelopes {
743
+ private client;
744
+ constructor(client: AxiosInstance);
745
+ /**
746
+ * Create a new envelope
747
+ */
748
+ create(params: CreateEnvelopeParams): Promise<CreateEnvelopeResponse | undefined>;
749
+ /**
750
+ * List envelopes
751
+ */
752
+ list(params?: GetEnvelopesParams): Promise<Envelope[] | undefined>;
753
+ /**
754
+ * Retrieve a single envelope with its sign requests
755
+ */
756
+ get(envelopeId: string): Promise<Envelope | undefined>;
757
+ /**
758
+ * Complete an envelope
759
+ */
760
+ complete(envelopeId: string): Promise<OperationResponse | undefined>;
761
+ /**
762
+ * Delete an envelope
763
+ */
764
+ delete(envelopeId: string): Promise<OperationResponse | undefined>;
765
+ /**
766
+ * Update envelope metadata
767
+ */
768
+ updateMetadata(params: UpdateEnvelopeMetadataParams): Promise<UpdateEnvelopeMetadataResponse | undefined>;
769
+ /**
770
+ * Remove a sign request from an envelope
771
+ */
772
+ removeSignRequest(params: RemoveSignRequestFromEnvelopeParams): Promise<OperationResponse | undefined>;
773
+ /**
774
+ * Add a sign request to an envelope
775
+ */
776
+ addSignRequest(params: AddSignRequestToEnvelopeParams): Promise<AddSignRequestToEnvelopeResponse | undefined>;
777
+ }
778
+
779
+ declare class SignRequests {
780
+ private client;
781
+ constructor(client: AxiosInstance);
782
+ /**
783
+ * Create a new sign request
784
+ */
785
+ create(params: CreateSignRequestParams): Promise<CreateSignRequestResponse | undefined>;
786
+ /**
787
+ * Complete a sign request
788
+ */
789
+ complete(params: CompleteSignRequestParams): Promise<CompleteSignRequestResponse | undefined>;
790
+ /**
791
+ * Get the file associated with a sign request
792
+ */
793
+ get(requestId: string): Promise<SignRequest | undefined>;
794
+ }
795
+
796
+ declare class Webhooks {
797
+ private tolerance;
798
+ constructor(tolerance?: number);
799
+ /**
800
+ * Verify and parse a webhook event
801
+ */
802
+ constructEvent(payload: string, signatureHeader: string, webhookSecret: string): WebhookEvent;
803
+ }
804
+
1406
805
  interface IInstasignConfig {
1407
806
  apiKey: string;
1408
807
  appId?: string;
@@ -1412,10 +811,10 @@ interface IInstasignConfig {
1412
811
  }
1413
812
  declare class Instasign {
1414
813
  private client;
1415
- envelopes: Envelopes;
1416
- signRequests: SignRequests;
1417
- webhooks: Webhooks;
814
+ readonly envelopes: Envelopes;
815
+ readonly signRequests: SignRequests;
816
+ readonly webhooks: Webhooks;
1418
817
  constructor(config: IInstasignConfig);
1419
818
  }
1420
819
 
1421
- export { type $defs, type AddSignRequestToEnvelopeParams, type AddSignRequestToEnvelopeResponse, type CompleteSignRequestParams, type CompleteSignRequestResponse, type CreateEnvelopeParams, type CreateEnvelopeResponse, type CreateSignRequestParams, type CreateSignRequestResponse, type Envelope, type EnvelopeCreatedEvent, type EnvelopeExpiredEvent, type EnvelopeListItem, type EnvelopeSignRequest, Envelopes, type GetEnvelopesParams, type IInstasignConfig, Instasign, type Metadata, type OperationResponse, type RemoveSignRequestFromEnvelopeParams, type SignRequestCreatedEvent, type SignRequestExpiredEvent, type SignRequestFile, type SignRequestSignedEvent, SignRequests, type UpdateEnvelopeMetadataParams, type UpdateEnvelopeMetadataResponse, type WebhookEvent, Webhooks, type components, type operations, type paths, type webhooks };
820
+ export { type $defs, type AddSignRequestToEnvelopeParams, type AddSignRequestToEnvelopeResponse, type CompleteSignRequestParams, type CompleteSignRequestResponse, type CreateEnvelopeParams, type CreateEnvelopeResponse, type CreateSignRequestParams, type CreateSignRequestResponse, type Envelope, type EnvelopeCreatedEvent, type EnvelopeExpiredEvent, type EnvelopeListItem, Envelopes, type GetEnvelopesParams, type IInstasignConfig, Instasign, type OperationResponse, type RemoveSignRequestFromEnvelopeParams, type RequestBody, type ResponseResult, type SignRequest, type SignRequestCreatedEvent, type SignRequestExpiredEvent, type SignRequestSignedEvent, SignRequests, type UpdateEnvelopeMetadataParams, type UpdateEnvelopeMetadataResponse, type WebhookEvent, Webhooks, type components, type operations, type paths, type webhooks };