instasign 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,218 +1,4 @@
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
- }
216
2
 
217
3
  /**
218
4
  * This file was auto-generated by openapi-typescript.
@@ -220,7 +6,7 @@ declare class Webhooks {
220
6
  */
221
7
 
222
8
  interface paths {
223
- "/functions/addSignRequestToEnvelope": {
9
+ "/functions/envelope:add-sign-request": {
224
10
  parameters: {
225
11
  query?: never;
226
12
  header?: never;
@@ -229,7 +15,7 @@ interface paths {
229
15
  };
230
16
  get?: never;
231
17
  put?: never;
232
- /** Cloud Function: addSignRequestToEnvelope */
18
+ /** envelope:add-sign-request */
233
19
  post: {
234
20
  parameters: {
235
21
  query?: never;
@@ -240,15 +26,10 @@ interface paths {
240
26
  requestBody?: {
241
27
  content: {
242
28
  "application/json": {
243
- /** @description The unique identifier of the envelope */
244
29
  envelopeId: string;
245
- /** @description The name of the file to be signed */
246
30
  filename: string;
247
- /** @description The base64 encoded content of the file */
248
31
  base64File?: string;
249
- /** @description Remote URL of the file. MUST be publicly accessible. */
250
32
  fileUrl?: string;
251
- /** @description Associated metadata for the sign request */
252
33
  metadata?: {
253
34
  [key: string]: unknown;
254
35
  };
@@ -263,11 +44,7 @@ interface paths {
263
44
  };
264
45
  content: {
265
46
  "application/json": {
266
- result?: {
267
- requestId?: string;
268
- signUrl?: string;
269
- envelopeSignUrl?: string;
270
- };
47
+ result: components["schemas"]["EnvelopeAddSignRequestResult"];
271
48
  };
272
49
  };
273
50
  };
@@ -279,7 +56,7 @@ interface paths {
279
56
  patch?: never;
280
57
  trace?: never;
281
58
  };
282
- "/functions/completeEnvelope": {
59
+ "/functions/envelope:complete": {
283
60
  parameters: {
284
61
  query?: never;
285
62
  header?: never;
@@ -288,7 +65,7 @@ interface paths {
288
65
  };
289
66
  get?: never;
290
67
  put?: never;
291
- /** Cloud Function: completeEnvelope */
68
+ /** envelope:complete */
292
69
  post: {
293
70
  parameters: {
294
71
  query?: never;
@@ -299,7 +76,6 @@ interface paths {
299
76
  requestBody?: {
300
77
  content: {
301
78
  "application/json": {
302
- /** @description The unique identifier of the envelope to mark as completed */
303
79
  envelopeId: string;
304
80
  };
305
81
  };
@@ -312,10 +88,7 @@ interface paths {
312
88
  };
313
89
  content: {
314
90
  "application/json": {
315
- result?: {
316
- success?: boolean;
317
- message?: string;
318
- };
91
+ result: components["schemas"]["EnvelopeCompleteResult"];
319
92
  };
320
93
  };
321
94
  };
@@ -327,7 +100,7 @@ interface paths {
327
100
  patch?: never;
328
101
  trace?: never;
329
102
  };
330
- "/functions/createEnvelope": {
103
+ "/functions/envelope:create": {
331
104
  parameters: {
332
105
  query?: never;
333
106
  header?: never;
@@ -336,7 +109,7 @@ interface paths {
336
109
  };
337
110
  get?: never;
338
111
  put?: never;
339
- /** Cloud Function: createEnvelope */
112
+ /** envelope:create */
340
113
  post: {
341
114
  parameters: {
342
115
  query?: never;
@@ -347,20 +120,13 @@ interface paths {
347
120
  requestBody?: {
348
121
  content: {
349
122
  "application/json": {
350
- /** @description The name of the envelope */
351
123
  name: string;
352
- /** @description The description of the envelope */
353
124
  description?: string;
354
- /** @description Associated metadata for the envelope */
355
125
  metadata?: {
356
126
  [key: string]: unknown;
357
127
  };
358
- /**
359
- * Format: date-time
360
- * @description The expiration date of the envelope
361
- */
128
+ /** Format: date-time */
362
129
  expirationDate?: string;
363
- /** @description External reference ID for the client */
364
130
  clientReferenceId?: string;
365
131
  };
366
132
  };
@@ -373,9 +139,7 @@ interface paths {
373
139
  };
374
140
  content: {
375
141
  "application/json": {
376
- result?: {
377
- envelopeId?: string;
378
- };
142
+ result: components["schemas"]["EnvelopeCreateResult"];
379
143
  };
380
144
  };
381
145
  };
@@ -387,7 +151,7 @@ interface paths {
387
151
  patch?: never;
388
152
  trace?: never;
389
153
  };
390
- "/functions/deleteEnvelope": {
154
+ "/functions/envelope:delete": {
391
155
  parameters: {
392
156
  query?: never;
393
157
  header?: never;
@@ -396,7 +160,7 @@ interface paths {
396
160
  };
397
161
  get?: never;
398
162
  put?: never;
399
- /** Cloud Function: deleteEnvelope */
163
+ /** envelope:delete */
400
164
  post: {
401
165
  parameters: {
402
166
  query?: never;
@@ -407,7 +171,6 @@ interface paths {
407
171
  requestBody?: {
408
172
  content: {
409
173
  "application/json": {
410
- /** @description The unique identifier of the envelope to delete */
411
174
  envelopeId: string;
412
175
  };
413
176
  };
@@ -420,9 +183,7 @@ interface paths {
420
183
  };
421
184
  content: {
422
185
  "application/json": {
423
- result?: {
424
- success?: boolean;
425
- };
186
+ result: components["schemas"]["EnvelopeDeleteResult"];
426
187
  };
427
188
  };
428
189
  };
@@ -434,7 +195,7 @@ interface paths {
434
195
  patch?: never;
435
196
  trace?: never;
436
197
  };
437
- "/functions/getEnvelope": {
198
+ "/functions/envelope:get": {
438
199
  parameters: {
439
200
  query?: never;
440
201
  header?: never;
@@ -443,7 +204,7 @@ interface paths {
443
204
  };
444
205
  get?: never;
445
206
  put?: never;
446
- /** Cloud Function: getEnvelope */
207
+ /** envelope:get */
447
208
  post: {
448
209
  parameters: {
449
210
  query?: never;
@@ -454,8 +215,8 @@ interface paths {
454
215
  requestBody?: {
455
216
  content: {
456
217
  "application/json": {
457
- /** @description The unique identifier of the envelope */
458
218
  envelopeId: string;
219
+ includeSignRequests?: boolean;
459
220
  };
460
221
  };
461
222
  };
@@ -467,29 +228,7 @@ interface paths {
467
228
  };
468
229
  content: {
469
230
  "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
- }[];
492
- };
231
+ result: components["schemas"]["EnvelopeGetResult"];
493
232
  };
494
233
  };
495
234
  };
@@ -501,7 +240,7 @@ interface paths {
501
240
  patch?: never;
502
241
  trace?: never;
503
242
  };
504
- "/functions/getEnvelopes": {
243
+ "/functions/envelope:list": {
505
244
  parameters: {
506
245
  query?: never;
507
246
  header?: never;
@@ -510,7 +249,7 @@ interface paths {
510
249
  };
511
250
  get?: never;
512
251
  put?: never;
513
- /** Cloud Function: getEnvelopes */
252
+ /** envelope:list */
514
253
  post: {
515
254
  parameters: {
516
255
  query?: never;
@@ -521,28 +260,20 @@ interface paths {
521
260
  requestBody?: {
522
261
  content: {
523
262
  "application/json": {
524
- /** @description Filter by envelope name (case-insensitive regex) */
525
263
  name?: string;
526
- /** @description Filter by envelope status */
527
- status?: string;
528
- /** @description Filter by client reference ID */
264
+ /** @enum {string} */
265
+ status?: "pending" | "in-progress" | "completed" | "cancelled";
529
266
  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 */
267
+ signRequests?: string[];
268
+ /** @enum {string} */
269
+ orderBy?: "updatedAt" | "createdAt";
270
+ /** @enum {string} */
271
+ orderDirection?: "asc" | "desc";
539
272
  expirationDateStart?: string;
540
- /** @description Filter by expiration date less than or equal to */
541
273
  expirationDateEnd?: string;
542
- /** @description Number of items to skip for pagination */
543
274
  skip?: number;
544
- /** @description Maximum number of items to return */
545
275
  limit?: number;
276
+ includeSignRequests?: boolean;
546
277
  };
547
278
  };
548
279
  };
@@ -554,414 +285,7 @@ interface paths {
554
285
  };
555
286
  content: {
556
287
  "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
- }[];
288
+ result: components["schemas"]["EnvelopeListResult"][];
965
289
  };
966
290
  };
967
291
  };
@@ -973,7 +297,7 @@ interface paths {
973
297
  patch?: never;
974
298
  trace?: never;
975
299
  };
976
- "/functions/removeSignRequestFromEnvelope": {
300
+ "/functions/envelope:remove-sign-request": {
977
301
  parameters: {
978
302
  query?: never;
979
303
  header?: never;
@@ -982,7 +306,7 @@ interface paths {
982
306
  };
983
307
  get?: never;
984
308
  put?: never;
985
- /** Cloud Function: removeSignRequestFromEnvelope */
309
+ /** envelope:remove-sign-request */
986
310
  post: {
987
311
  parameters: {
988
312
  query?: never;
@@ -993,9 +317,7 @@ interface paths {
993
317
  requestBody?: {
994
318
  content: {
995
319
  "application/json": {
996
- /** @description The unique identifier of the envelope */
997
320
  envelopeId: string;
998
- /** @description The unique identifier of the sign request */
999
321
  requestId: string;
1000
322
  };
1001
323
  };
@@ -1008,10 +330,7 @@ interface paths {
1008
330
  };
1009
331
  content: {
1010
332
  "application/json": {
1011
- result?: {
1012
- success?: boolean;
1013
- message?: string;
1014
- };
333
+ result: components["schemas"]["EnvelopeRemoveSignRequestResult"];
1015
334
  };
1016
335
  };
1017
336
  };
@@ -1023,7 +342,7 @@ interface paths {
1023
342
  patch?: never;
1024
343
  trace?: never;
1025
344
  };
1026
- "/functions/updateEnvelopeMetadata": {
345
+ "/functions/envelope:update-metadata": {
1027
346
  parameters: {
1028
347
  query?: never;
1029
348
  header?: never;
@@ -1032,7 +351,7 @@ interface paths {
1032
351
  };
1033
352
  get?: never;
1034
353
  put?: never;
1035
- /** Cloud Function: updateEnvelopeMetadata */
354
+ /** envelope:update-metadata */
1036
355
  post: {
1037
356
  parameters: {
1038
357
  query?: never;
@@ -1043,9 +362,7 @@ interface paths {
1043
362
  requestBody?: {
1044
363
  content: {
1045
364
  "application/json": {
1046
- /** @description The unique identifier of the envelope */
1047
365
  envelopeId: string;
1048
- /** @description The metadata to be merged into the existing envelope metadata */
1049
366
  metadata: {
1050
367
  [key: string]: unknown;
1051
368
  };
@@ -1060,12 +377,7 @@ interface paths {
1060
377
  };
1061
378
  content: {
1062
379
  "application/json": {
1063
- result?: {
1064
- envelopeId?: string;
1065
- metadata?: {
1066
- [key: string]: unknown;
1067
- };
1068
- };
380
+ result: components["schemas"]["EnvelopeUpdateMetadataResult"];
1069
381
  };
1070
382
  };
1071
383
  };
@@ -1077,7 +389,7 @@ interface paths {
1077
389
  patch?: never;
1078
390
  trace?: never;
1079
391
  };
1080
- "/functions/completeSignRequest": {
392
+ "/functions/sign-request:complete": {
1081
393
  parameters: {
1082
394
  query?: never;
1083
395
  header?: never;
@@ -1086,7 +398,7 @@ interface paths {
1086
398
  };
1087
399
  get?: never;
1088
400
  put?: never;
1089
- /** Cloud Function: completeSignRequest */
401
+ /** sign-request:complete */
1090
402
  post: {
1091
403
  parameters: {
1092
404
  query?: never;
@@ -1097,9 +409,7 @@ interface paths {
1097
409
  requestBody?: {
1098
410
  content: {
1099
411
  "application/json": {
1100
- /** @description The unique identifier of the sign request to complete */
1101
412
  requestId: string;
1102
- /** @description The base64 encoded content of the signed file */
1103
413
  signedFileDataBase64: string;
1104
414
  };
1105
415
  };
@@ -1112,9 +422,7 @@ interface paths {
1112
422
  };
1113
423
  content: {
1114
424
  "application/json": {
1115
- result?: {
1116
- signedFileUrl?: string;
1117
- };
425
+ result: components["schemas"]["SignRequestCompleteResult"];
1118
426
  };
1119
427
  };
1120
428
  };
@@ -1126,7 +434,7 @@ interface paths {
1126
434
  patch?: never;
1127
435
  trace?: never;
1128
436
  };
1129
- "/functions/createSignRequest": {
437
+ "/functions/sign-request:create": {
1130
438
  parameters: {
1131
439
  query?: never;
1132
440
  header?: never;
@@ -1135,7 +443,7 @@ interface paths {
1135
443
  };
1136
444
  get?: never;
1137
445
  put?: never;
1138
- /** Cloud Function: createSignRequest */
446
+ /** sign-request:create */
1139
447
  post: {
1140
448
  parameters: {
1141
449
  query?: never;
@@ -1146,16 +454,15 @@ interface paths {
1146
454
  requestBody?: {
1147
455
  content: {
1148
456
  "application/json": {
1149
- /** @description The name of the file to be signed */
1150
457
  filename: string;
1151
- /** @description The base64 encoded content of the file */
1152
458
  base64File?: string;
1153
- /** @description Remote URL of the file. MUST be publicly accessible. */
1154
459
  fileUrl?: string;
1155
- /** @description Associated metadata for the sign request */
1156
460
  metadata?: {
1157
461
  [key: string]: unknown;
1158
462
  };
463
+ clientReferenceId?: string;
464
+ /** Format: date-time */
465
+ expirationDate?: string;
1159
466
  };
1160
467
  };
1161
468
  };
@@ -1167,64 +474,7 @@ interface paths {
1167
474
  };
1168
475
  content: {
1169
476
  "application/json": {
1170
- result?: {
1171
- requestId?: string;
1172
- signUrl?: string;
1173
- };
1174
- };
1175
- };
1176
- };
1177
- };
1178
- };
1179
- delete?: never;
1180
- options?: never;
1181
- head?: never;
1182
- patch?: never;
1183
- trace?: never;
1184
- };
1185
- "/functions/getFileFromRequestId": {
1186
- parameters: {
1187
- query?: never;
1188
- header?: never;
1189
- path?: never;
1190
- cookie?: never;
1191
- };
1192
- get?: never;
1193
- put?: never;
1194
- /** Cloud Function: getFileFromRequestId */
1195
- post: {
1196
- parameters: {
1197
- query?: never;
1198
- header?: never;
1199
- path?: never;
1200
- cookie?: never;
1201
- };
1202
- requestBody?: {
1203
- content: {
1204
- "application/json": {
1205
- /** @description The unique identifier of the sign request */
1206
- requestId: string;
1207
- };
1208
- };
1209
- };
1210
- responses: {
1211
- /** @description Successful response */
1212
- 200: {
1213
- headers: {
1214
- [name: string]: unknown;
1215
- };
1216
- content: {
1217
- "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;
1227
- };
477
+ result: components["schemas"]["SignRequestCreateResult"];
1228
478
  };
1229
479
  };
1230
480
  };
@@ -1236,7 +486,7 @@ interface paths {
1236
486
  patch?: never;
1237
487
  trace?: never;
1238
488
  };
1239
- "/functions/getSignedFile": {
489
+ "/functions/sign-request:get": {
1240
490
  parameters: {
1241
491
  query?: never;
1242
492
  header?: never;
@@ -1245,7 +495,7 @@ interface paths {
1245
495
  };
1246
496
  get?: never;
1247
497
  put?: never;
1248
- /** Cloud Function: getSignedFile */
498
+ /** sign-request:get */
1249
499
  post: {
1250
500
  parameters: {
1251
501
  query?: never;
@@ -1256,7 +506,6 @@ interface paths {
1256
506
  requestBody?: {
1257
507
  content: {
1258
508
  "application/json": {
1259
- /** @description The unique identifier of the sign request */
1260
509
  requestId: string;
1261
510
  };
1262
511
  };
@@ -1269,11 +518,7 @@ interface paths {
1269
518
  };
1270
519
  content: {
1271
520
  "application/json": {
1272
- result?: {
1273
- fileName?: string;
1274
- fileUrl?: string;
1275
- signedFileUrl?: string;
1276
- };
521
+ result: components["schemas"]["SignRequestGetResult"];
1277
522
  };
1278
523
  };
1279
524
  };
@@ -1285,7 +530,7 @@ interface paths {
1285
530
  patch?: never;
1286
531
  trace?: never;
1287
532
  };
1288
- "/functions/updateSignRequestMetadata": {
533
+ "/functions/sign-request:update-metadata": {
1289
534
  parameters: {
1290
535
  query?: never;
1291
536
  header?: never;
@@ -1294,7 +539,7 @@ interface paths {
1294
539
  };
1295
540
  get?: never;
1296
541
  put?: never;
1297
- /** Cloud Function: updateSignRequestMetadata */
542
+ /** sign-request:update-metadata */
1298
543
  post: {
1299
544
  parameters: {
1300
545
  query?: never;
@@ -1305,9 +550,7 @@ interface paths {
1305
550
  requestBody?: {
1306
551
  content: {
1307
552
  "application/json": {
1308
- /** @description The unique identifier of the sign request */
1309
553
  requestId: string;
1310
- /** @description The metadata to be merged into the existing sign request metadata */
1311
554
  metadata: {
1312
555
  [key: string]: unknown;
1313
556
  };
@@ -1322,12 +565,7 @@ interface paths {
1322
565
  };
1323
566
  content: {
1324
567
  "application/json": {
1325
- result?: {
1326
- requestId?: string;
1327
- metadata?: {
1328
- [key: string]: unknown;
1329
- };
1330
- };
568
+ result: components["schemas"]["SignRequestUpdateMetadataResult"];
1331
569
  };
1332
570
  };
1333
571
  };
@@ -1343,55 +581,115 @@ interface paths {
1343
581
  type webhooks = Record<string, never>;
1344
582
  interface components {
1345
583
  schemas: {
1346
- ApiLog: {
1347
- apiKey?: string;
1348
- functionName?: string;
1349
- statusCode?: string;
1350
- statusMessage?: string;
584
+ EnvelopeAddSignRequestResult: {
585
+ requestId: string;
586
+ signUrl: string;
587
+ envelopeSignUrl?: string;
1351
588
  };
1352
- Authentication: {
1353
- apiKey?: string;
1354
- name?: string;
1355
- status?: string;
1356
- expirationDate?: string;
1357
- callbackUrl?: string;
1358
- webhookSecret?: string;
589
+ EnvelopeCompleteResult: {
590
+ success: boolean;
591
+ message: string;
592
+ };
593
+ EnvelopeCreateResult: {
594
+ envelopeId: string;
595
+ };
596
+ EnvelopeDeleteResult: {
597
+ success: boolean;
1359
598
  };
1360
- Envelope: {
1361
- name?: string;
599
+ EnvelopeGetResult: {
600
+ envelopeId: string;
601
+ name: string;
1362
602
  description?: string;
1363
- envelopeId?: string;
1364
- signRequests?: string;
1365
- status?: string;
1366
- metadata?: string;
1367
- apiKey?: string;
603
+ /** @enum {string} */
604
+ status: "pending" | "in-progress" | "completed" | "cancelled";
605
+ clientReferenceId?: string;
606
+ signRequestsCount: number;
607
+ signRequests: {
608
+ requestId: string;
609
+ /** @enum {string} */
610
+ status: "pending" | "completed" | "canceled" | "queued";
611
+ fileName: string;
612
+ fileUrl: string;
613
+ signedFileUrl?: string;
614
+ metadata: {
615
+ [key: string]: unknown;
616
+ };
617
+ clientReferenceId?: string;
618
+ }[];
619
+ /** Format: date-time */
620
+ createdAt: string;
621
+ /** Format: date-time */
622
+ updatedAt: string;
623
+ /** Format: date-time */
1368
624
  expirationDate?: string;
1369
- isDeleted?: string;
625
+ signUrl?: string;
626
+ };
627
+ EnvelopeListResult: {
628
+ envelopeId: string;
629
+ name: string;
630
+ description?: string;
631
+ /** @enum {string} */
632
+ status: "pending" | "in-progress" | "completed" | "cancelled";
1370
633
  clientReferenceId?: string;
634
+ signRequestsCount: number;
635
+ signRequests: {
636
+ requestId: string;
637
+ /** @enum {string} */
638
+ status: "pending" | "completed" | "canceled" | "queued";
639
+ fileName: string;
640
+ fileUrl: string;
641
+ signedFileUrl?: string;
642
+ metadata: {
643
+ [key: string]: unknown;
644
+ };
645
+ clientReferenceId?: string;
646
+ }[];
647
+ /** Format: date-time */
648
+ createdAt: string;
649
+ /** Format: date-time */
650
+ updatedAt: string;
651
+ /** Format: date-time */
652
+ expirationDate?: string;
653
+ signUrl?: string;
1371
654
  };
1372
- SignRequest: {
1373
- status?: string;
1374
- file?: string;
1375
- fileName?: string;
655
+ EnvelopeRemoveSignRequestResult: {
656
+ success: boolean;
657
+ message: string;
658
+ };
659
+ EnvelopeUpdateMetadataResult: {
660
+ envelopeId: string;
661
+ metadata: {
662
+ [key: string]: unknown;
663
+ };
664
+ };
665
+ SignRequestCompleteResult: {
666
+ signedFileUrl: string;
667
+ };
668
+ SignRequestCreateResult: {
669
+ requestId: string;
670
+ signUrl: string;
671
+ };
672
+ SignRequestGetResult: {
673
+ requestId: string;
674
+ /** @enum {string} */
675
+ status: "pending" | "completed" | "canceled" | "queued";
676
+ fileName: string;
677
+ originalFile: string;
1376
678
  signedFile?: string;
1377
- requestId?: string;
1378
- metadata?: string;
1379
- apiKey?: string;
1380
- expirationDate?: string;
1381
- isDeleted?: string;
679
+ metadata?: {
680
+ [key: string]: unknown;
681
+ };
1382
682
  clientReferenceId?: string;
683
+ /** Format: date-time */
684
+ createdAt: string;
685
+ /** Format: date-time */
686
+ updatedAt: string;
1383
687
  };
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;
688
+ SignRequestUpdateMetadataResult: {
689
+ requestId: string;
690
+ metadata: {
691
+ [key: string]: unknown;
692
+ };
1395
693
  };
1396
694
  };
1397
695
  responses: never;
@@ -1403,6 +701,174 @@ interface components {
1403
701
  type $defs = Record<string, never>;
1404
702
  type operations = Record<string, never>;
1405
703
 
704
+ declare const VALID_WEBHOOK_EVENT_TYPES: readonly ["envelope_created", "envelope_expired", "sign_request_created", "sign_request_signed", "sign_request_expired"];
705
+ type WebhookEventType = typeof VALID_WEBHOOK_EVENT_TYPES[number];
706
+ type WebhookStatus = 'pending' | 'success' | 'error';
707
+ type WebhookPayloadMap = {
708
+ 'envelope_created': {
709
+ envelopeId: string;
710
+ };
711
+ 'envelope_expired': {
712
+ envelopeId: string;
713
+ };
714
+ 'sign_request_created': {
715
+ requestId: string;
716
+ status: string;
717
+ envelopeId?: string;
718
+ };
719
+ 'sign_request_signed': {
720
+ requestId: string;
721
+ status: string;
722
+ envelopeId?: string;
723
+ };
724
+ 'sign_request_expired': {
725
+ requestId: string;
726
+ };
727
+ };
728
+ declare const VALID_SIGN_REQUEST_STATUSES: readonly ["pending", "completed", "canceled", "queued"];
729
+ type SignRequestStatus = typeof VALID_SIGN_REQUEST_STATUSES[number];
730
+ declare const VALID_ENVELOPE_STATUSES: readonly ["pending", "in-progress", "completed", "cancelled"];
731
+ type EnvelopeStatus = typeof VALID_ENVELOPE_STATUSES[number];
732
+ type SignRequestMetadata = Record<string, unknown>;
733
+ type EnvelopeMetadata = Record<string, unknown>;
734
+ declare const VALID_ORDER_BY: readonly ["updatedAt", "createdAt"];
735
+ type OrderBy = (typeof VALID_ORDER_BY)[number];
736
+ declare const VALID_ORDER_DIRECTION: readonly ["asc", "desc"];
737
+ type OrderDirection = (typeof VALID_ORDER_DIRECTION)[number];
738
+
739
+ /** Extract a named component schema from the OpenAPI definition */
740
+ type SchemaResult<N extends keyof components['schemas']> = components['schemas'][N];
741
+ interface OperationResponse {
742
+ success?: boolean;
743
+ message?: string;
744
+ }
745
+ /** Extract the result type from a Cloud Function response */
746
+ type ResponseResult<P extends keyof paths> = NonNullable<NonNullable<paths[P]['post']['responses']>[200]['content']>['application/json']['result'];
747
+ /** Extract the request body type from a Cloud Function */
748
+ type RequestBody<P extends keyof paths> = NonNullable<NonNullable<paths[P]['post']['requestBody']>['content']>['application/json'];
749
+ /** A full envelope with its sign requests */
750
+ interface Envelope extends SchemaResult<'EnvelopeGetResult'> {
751
+ }
752
+ /** Envelope as returned in a list */
753
+ interface EnvelopeListItem extends SchemaResult<'EnvelopeListResult'> {
754
+ }
755
+ interface CreateEnvelopeParams extends RequestBody<'/functions/envelope:create'> {
756
+ }
757
+ interface GetEnvelopesParams extends RequestBody<'/functions/envelope:list'> {
758
+ }
759
+ interface UpdateEnvelopeMetadataParams extends RequestBody<'/functions/envelope:update-metadata'> {
760
+ }
761
+ interface RemoveSignRequestFromEnvelopeParams extends RequestBody<'/functions/envelope:remove-sign-request'> {
762
+ }
763
+ interface AddSignRequestToEnvelopeParams extends RequestBody<'/functions/envelope:add-sign-request'> {
764
+ }
765
+ interface CreateEnvelopeResponse extends ResponseResult<'/functions/envelope:create'> {
766
+ }
767
+ interface UpdateEnvelopeMetadataResponse extends ResponseResult<'/functions/envelope:update-metadata'> {
768
+ }
769
+ interface AddSignRequestToEnvelopeResponse extends ResponseResult<'/functions/envelope:add-sign-request'> {
770
+ }
771
+ /** A single sign request */
772
+ interface SignRequest extends SchemaResult<'SignRequestGetResult'> {
773
+ }
774
+ interface CreateSignRequestParams extends RequestBody<'/functions/sign-request:create'> {
775
+ }
776
+ interface CompleteSignRequestParams extends RequestBody<'/functions/sign-request:complete'> {
777
+ }
778
+ interface GetFileFromRequestIdParams extends RequestBody<'/functions/sign-request:get'> {
779
+ }
780
+ interface UpdateSignRequestMetadataParams extends RequestBody<'/functions/sign-request:update-metadata'> {
781
+ }
782
+ interface CreateSignRequestResponse extends ResponseResult<'/functions/sign-request:create'> {
783
+ }
784
+ interface CompleteSignRequestResponse extends ResponseResult<'/functions/sign-request:complete'> {
785
+ }
786
+ interface UpdateSignRequestMetadataResponse extends ResponseResult<'/functions/sign-request:update-metadata'> {
787
+ }
788
+ type WebhookEvent = {
789
+ [T in WebhookEventType]: {
790
+ eventType: T;
791
+ } & WebhookPayloadMap[T];
792
+ }[WebhookEventType];
793
+ type EnvelopeCreatedEvent = Extract<WebhookEvent, {
794
+ eventType: 'envelope_created';
795
+ }>;
796
+ type EnvelopeExpiredEvent = Extract<WebhookEvent, {
797
+ eventType: 'envelope_expired';
798
+ }>;
799
+ type SignRequestCreatedEvent = Extract<WebhookEvent, {
800
+ eventType: 'sign_request_created';
801
+ }>;
802
+ type SignRequestSignedEvent = Extract<WebhookEvent, {
803
+ eventType: 'sign_request_signed';
804
+ }>;
805
+ type SignRequestExpiredEvent = Extract<WebhookEvent, {
806
+ eventType: 'sign_request_expired';
807
+ }>;
808
+
809
+ declare class Envelopes {
810
+ private client;
811
+ constructor(client: AxiosInstance);
812
+ /**
813
+ * Create a new envelope
814
+ */
815
+ create(params: CreateEnvelopeParams): Promise<CreateEnvelopeResponse | undefined>;
816
+ /**
817
+ * List envelopes
818
+ */
819
+ list(params?: GetEnvelopesParams): Promise<Envelope[] | undefined>;
820
+ /**
821
+ * Retrieve a single envelope with its sign requests
822
+ */
823
+ get(envelopeId: string): Promise<Envelope | undefined>;
824
+ /**
825
+ * Complete an envelope
826
+ */
827
+ complete(envelopeId: string): Promise<OperationResponse | undefined>;
828
+ /**
829
+ * Delete an envelope
830
+ */
831
+ delete(envelopeId: string): Promise<OperationResponse | undefined>;
832
+ /**
833
+ * Update envelope metadata
834
+ */
835
+ updateMetadata(params: UpdateEnvelopeMetadataParams): Promise<UpdateEnvelopeMetadataResponse | undefined>;
836
+ /**
837
+ * Remove a sign request from an envelope
838
+ */
839
+ removeSignRequest(params: RemoveSignRequestFromEnvelopeParams): Promise<OperationResponse | undefined>;
840
+ /**
841
+ * Add a sign request to an envelope
842
+ */
843
+ addSignRequest(params: AddSignRequestToEnvelopeParams): Promise<AddSignRequestToEnvelopeResponse | undefined>;
844
+ }
845
+
846
+ declare class SignRequests {
847
+ private client;
848
+ constructor(client: AxiosInstance);
849
+ /**
850
+ * Create a new sign request
851
+ */
852
+ create(params: CreateSignRequestParams): Promise<CreateSignRequestResponse | undefined>;
853
+ /**
854
+ * Complete a sign request
855
+ */
856
+ complete(params: CompleteSignRequestParams): Promise<CompleteSignRequestResponse | undefined>;
857
+ /**
858
+ * Get the file associated with a sign request
859
+ */
860
+ get(requestId: string): Promise<SignRequest | undefined>;
861
+ }
862
+
863
+ declare class Webhooks {
864
+ private tolerance;
865
+ constructor(tolerance?: number);
866
+ /**
867
+ * Verify and parse a webhook event
868
+ */
869
+ constructEvent(payload: string, signatureHeader: string, webhookSecret: string): WebhookEvent;
870
+ }
871
+
1406
872
  interface IInstasignConfig {
1407
873
  apiKey: string;
1408
874
  appId?: string;
@@ -1412,10 +878,10 @@ interface IInstasignConfig {
1412
878
  }
1413
879
  declare class Instasign {
1414
880
  private client;
1415
- envelopes: Envelopes;
1416
- signRequests: SignRequests;
1417
- webhooks: Webhooks;
881
+ readonly envelopes: Envelopes;
882
+ readonly signRequests: SignRequests;
883
+ readonly webhooks: Webhooks;
1418
884
  constructor(config: IInstasignConfig);
1419
885
  }
1420
886
 
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 };
887
+ 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 EnvelopeMetadata, type EnvelopeStatus, Envelopes, type GetEnvelopesParams, type GetFileFromRequestIdParams, type IInstasignConfig, Instasign, type OperationResponse, type OrderBy, type OrderDirection, type RemoveSignRequestFromEnvelopeParams, type RequestBody, type ResponseResult, type SchemaResult, type SignRequest, type SignRequestCreatedEvent, type SignRequestExpiredEvent, type SignRequestMetadata, type SignRequestSignedEvent, type SignRequestStatus, SignRequests, type UpdateEnvelopeMetadataParams, type UpdateEnvelopeMetadataResponse, type UpdateSignRequestMetadataParams, type UpdateSignRequestMetadataResponse, VALID_ENVELOPE_STATUSES, VALID_ORDER_BY, VALID_ORDER_DIRECTION, VALID_SIGN_REQUEST_STATUSES, VALID_WEBHOOK_EVENT_TYPES, type WebhookEvent, type WebhookEventType, type WebhookPayloadMap, type WebhookStatus, Webhooks, type components, type operations, type paths, type webhooks };