resend 4.6.0 → 4.7.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +233 -128
- package/dist/index.d.ts +233 -128
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -51,10 +51,13 @@ interface CreateApiKeyResponseSuccess {
|
|
|
51
51
|
token: string;
|
|
52
52
|
id: string;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
data: CreateApiKeyResponseSuccess
|
|
56
|
-
error:
|
|
57
|
-
}
|
|
54
|
+
type CreateApiKeyResponse = {
|
|
55
|
+
data: CreateApiKeyResponseSuccess;
|
|
56
|
+
error: null;
|
|
57
|
+
} | {
|
|
58
|
+
data: null;
|
|
59
|
+
error: ErrorResponse;
|
|
60
|
+
};
|
|
58
61
|
|
|
59
62
|
interface ApiKey {
|
|
60
63
|
created_at: string;
|
|
@@ -63,16 +66,22 @@ interface ApiKey {
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
type ListApiKeysResponseSuccess = Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
|
|
66
|
-
|
|
67
|
-
data: ListApiKeysResponseSuccess
|
|
68
|
-
error:
|
|
69
|
-
}
|
|
69
|
+
type ListApiKeysResponse = {
|
|
70
|
+
data: ListApiKeysResponseSuccess;
|
|
71
|
+
error: null;
|
|
72
|
+
} | {
|
|
73
|
+
data: null;
|
|
74
|
+
error: ErrorResponse;
|
|
75
|
+
};
|
|
70
76
|
|
|
71
77
|
type RemoveApiKeyResponseSuccess = {};
|
|
72
|
-
|
|
73
|
-
data: RemoveApiKeyResponseSuccess
|
|
74
|
-
error:
|
|
75
|
-
}
|
|
78
|
+
type RemoveApiKeyResponse = {
|
|
79
|
+
data: RemoveApiKeyResponseSuccess;
|
|
80
|
+
error: null;
|
|
81
|
+
} | {
|
|
82
|
+
data: null;
|
|
83
|
+
error: ErrorResponse;
|
|
84
|
+
};
|
|
76
85
|
|
|
77
86
|
declare class ApiKeys {
|
|
78
87
|
private readonly resend;
|
|
@@ -96,36 +105,48 @@ interface CreateAudienceRequestOptions extends PostOptions {
|
|
|
96
105
|
interface CreateAudienceResponseSuccess extends Pick<Audience, 'name' | 'id'> {
|
|
97
106
|
object: 'audience';
|
|
98
107
|
}
|
|
99
|
-
|
|
100
|
-
data: CreateAudienceResponseSuccess
|
|
101
|
-
error:
|
|
102
|
-
}
|
|
108
|
+
type CreateAudienceResponse = {
|
|
109
|
+
data: CreateAudienceResponseSuccess;
|
|
110
|
+
error: null;
|
|
111
|
+
} | {
|
|
112
|
+
data: null;
|
|
113
|
+
error: ErrorResponse;
|
|
114
|
+
};
|
|
103
115
|
|
|
104
116
|
interface GetAudienceResponseSuccess extends Pick<Audience, 'id' | 'name' | 'created_at'> {
|
|
105
117
|
object: 'audience';
|
|
106
118
|
}
|
|
107
|
-
|
|
108
|
-
data: GetAudienceResponseSuccess
|
|
109
|
-
error:
|
|
110
|
-
}
|
|
119
|
+
type GetAudienceResponse = {
|
|
120
|
+
data: GetAudienceResponseSuccess;
|
|
121
|
+
error: null;
|
|
122
|
+
} | {
|
|
123
|
+
data: null;
|
|
124
|
+
error: ErrorResponse;
|
|
125
|
+
};
|
|
111
126
|
|
|
112
127
|
type ListAudiencesResponseSuccess = {
|
|
113
128
|
object: 'list';
|
|
114
129
|
data: Audience[];
|
|
115
130
|
};
|
|
116
|
-
|
|
117
|
-
data: ListAudiencesResponseSuccess
|
|
118
|
-
error:
|
|
119
|
-
}
|
|
131
|
+
type ListAudiencesResponse = {
|
|
132
|
+
data: ListAudiencesResponseSuccess;
|
|
133
|
+
error: null;
|
|
134
|
+
} | {
|
|
135
|
+
data: null;
|
|
136
|
+
error: ErrorResponse;
|
|
137
|
+
};
|
|
120
138
|
|
|
121
139
|
interface RemoveAudiencesResponseSuccess extends Pick<Audience, 'id'> {
|
|
122
140
|
object: 'audience';
|
|
123
141
|
deleted: boolean;
|
|
124
142
|
}
|
|
125
|
-
|
|
126
|
-
data: RemoveAudiencesResponseSuccess
|
|
127
|
-
error:
|
|
128
|
-
}
|
|
143
|
+
type RemoveAudiencesResponse = {
|
|
144
|
+
data: RemoveAudiencesResponseSuccess;
|
|
145
|
+
error: null;
|
|
146
|
+
} | {
|
|
147
|
+
data: null;
|
|
148
|
+
error: ErrorResponse;
|
|
149
|
+
};
|
|
129
150
|
|
|
130
151
|
declare class Audiences {
|
|
131
152
|
private readonly resend;
|
|
@@ -239,10 +260,13 @@ interface CreateEmailResponseSuccess {
|
|
|
239
260
|
/** The ID of the newly created email. */
|
|
240
261
|
id: string;
|
|
241
262
|
}
|
|
242
|
-
|
|
243
|
-
data: CreateEmailResponseSuccess
|
|
244
|
-
error:
|
|
245
|
-
}
|
|
263
|
+
type CreateEmailResponse = {
|
|
264
|
+
data: CreateEmailResponseSuccess;
|
|
265
|
+
error: null;
|
|
266
|
+
} | {
|
|
267
|
+
data: null;
|
|
268
|
+
error: ErrorResponse;
|
|
269
|
+
};
|
|
246
270
|
interface Attachment {
|
|
247
271
|
/** Content of an attached file. */
|
|
248
272
|
content?: string | Buffer;
|
|
@@ -273,10 +297,13 @@ interface CreateBatchSuccessResponse {
|
|
|
273
297
|
id: string;
|
|
274
298
|
}[];
|
|
275
299
|
}
|
|
276
|
-
|
|
277
|
-
data: CreateBatchSuccessResponse
|
|
278
|
-
error:
|
|
279
|
-
}
|
|
300
|
+
type CreateBatchResponse = {
|
|
301
|
+
data: CreateBatchSuccessResponse;
|
|
302
|
+
error: null;
|
|
303
|
+
} | {
|
|
304
|
+
data: null;
|
|
305
|
+
error: ErrorResponse;
|
|
306
|
+
};
|
|
280
307
|
|
|
281
308
|
declare class Batch {
|
|
282
309
|
private readonly resend;
|
|
@@ -351,10 +378,13 @@ interface CreateBroadcastResponseSuccess {
|
|
|
351
378
|
/** The ID of the newly sent broadcasts. */
|
|
352
379
|
id: string;
|
|
353
380
|
}
|
|
354
|
-
|
|
355
|
-
data: CreateBroadcastResponseSuccess
|
|
356
|
-
error:
|
|
357
|
-
}
|
|
381
|
+
type CreateBroadcastResponse = {
|
|
382
|
+
data: CreateBroadcastResponseSuccess;
|
|
383
|
+
error: null;
|
|
384
|
+
} | {
|
|
385
|
+
data: null;
|
|
386
|
+
error: ErrorResponse;
|
|
387
|
+
};
|
|
358
388
|
|
|
359
389
|
interface Broadcast {
|
|
360
390
|
id: string;
|
|
@@ -373,28 +403,37 @@ interface Broadcast {
|
|
|
373
403
|
interface GetBroadcastResponseSuccess extends Broadcast {
|
|
374
404
|
object: 'broadcast';
|
|
375
405
|
}
|
|
376
|
-
|
|
377
|
-
data: GetBroadcastResponseSuccess
|
|
378
|
-
error:
|
|
379
|
-
}
|
|
406
|
+
type GetBroadcastResponse = {
|
|
407
|
+
data: GetBroadcastResponseSuccess;
|
|
408
|
+
error: null;
|
|
409
|
+
} | {
|
|
410
|
+
data: null;
|
|
411
|
+
error: ErrorResponse;
|
|
412
|
+
};
|
|
380
413
|
|
|
381
414
|
type ListBroadcastsResponseSuccess = {
|
|
382
415
|
object: 'list';
|
|
383
416
|
data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
|
|
384
417
|
};
|
|
385
|
-
|
|
386
|
-
data: ListBroadcastsResponseSuccess
|
|
387
|
-
error:
|
|
388
|
-
}
|
|
418
|
+
type ListBroadcastsResponse = {
|
|
419
|
+
data: ListBroadcastsResponseSuccess;
|
|
420
|
+
error: null;
|
|
421
|
+
} | {
|
|
422
|
+
data: null;
|
|
423
|
+
error: ErrorResponse;
|
|
424
|
+
};
|
|
389
425
|
|
|
390
426
|
interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
391
427
|
object: 'broadcast';
|
|
392
428
|
deleted: boolean;
|
|
393
429
|
}
|
|
394
|
-
|
|
395
|
-
data: RemoveBroadcastResponseSuccess
|
|
396
|
-
error:
|
|
397
|
-
}
|
|
430
|
+
type RemoveBroadcastResponse = {
|
|
431
|
+
data: RemoveBroadcastResponseSuccess;
|
|
432
|
+
error: null;
|
|
433
|
+
} | {
|
|
434
|
+
data: null;
|
|
435
|
+
error: ErrorResponse;
|
|
436
|
+
};
|
|
398
437
|
|
|
399
438
|
interface SendBroadcastBaseOptions {
|
|
400
439
|
/**
|
|
@@ -413,10 +452,13 @@ interface SendBroadcastResponseSuccess {
|
|
|
413
452
|
/** The ID of the sent broadcast. */
|
|
414
453
|
id: string;
|
|
415
454
|
}
|
|
416
|
-
|
|
417
|
-
data: SendBroadcastResponseSuccess
|
|
418
|
-
error:
|
|
419
|
-
}
|
|
455
|
+
type SendBroadcastResponse = {
|
|
456
|
+
data: SendBroadcastResponseSuccess;
|
|
457
|
+
error: null;
|
|
458
|
+
} | {
|
|
459
|
+
data: null;
|
|
460
|
+
error: ErrorResponse;
|
|
461
|
+
};
|
|
420
462
|
|
|
421
463
|
interface UpdateBroadcastResponseSuccess {
|
|
422
464
|
id: string;
|
|
@@ -431,10 +473,13 @@ interface UpdateBroadcastOptions {
|
|
|
431
473
|
replyTo?: string[];
|
|
432
474
|
previewText?: string;
|
|
433
475
|
}
|
|
434
|
-
|
|
435
|
-
data: UpdateBroadcastResponseSuccess
|
|
436
|
-
error:
|
|
437
|
-
}
|
|
476
|
+
type UpdateBroadcastResponse = {
|
|
477
|
+
data: UpdateBroadcastResponseSuccess;
|
|
478
|
+
error: null;
|
|
479
|
+
} | {
|
|
480
|
+
data: null;
|
|
481
|
+
error: ErrorResponse;
|
|
482
|
+
};
|
|
438
483
|
|
|
439
484
|
declare class Broadcasts {
|
|
440
485
|
private readonly resend;
|
|
@@ -475,10 +520,13 @@ interface CreateContactRequestOptions extends PostOptions {
|
|
|
475
520
|
interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
|
|
476
521
|
object: 'contact';
|
|
477
522
|
}
|
|
478
|
-
|
|
479
|
-
data: CreateContactResponseSuccess
|
|
480
|
-
error:
|
|
481
|
-
}
|
|
523
|
+
type CreateContactResponse = {
|
|
524
|
+
data: CreateContactResponseSuccess;
|
|
525
|
+
error: null;
|
|
526
|
+
} | {
|
|
527
|
+
data: null;
|
|
528
|
+
error: ErrorResponse;
|
|
529
|
+
};
|
|
482
530
|
|
|
483
531
|
interface GetContactOptions {
|
|
484
532
|
audienceId: string;
|
|
@@ -488,10 +536,13 @@ interface GetContactOptions {
|
|
|
488
536
|
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
|
|
489
537
|
object: 'contact';
|
|
490
538
|
}
|
|
491
|
-
|
|
492
|
-
data: GetContactResponseSuccess
|
|
493
|
-
error:
|
|
494
|
-
}
|
|
539
|
+
type GetContactResponse = {
|
|
540
|
+
data: GetContactResponseSuccess;
|
|
541
|
+
error: null;
|
|
542
|
+
} | {
|
|
543
|
+
data: null;
|
|
544
|
+
error: ErrorResponse;
|
|
545
|
+
};
|
|
495
546
|
|
|
496
547
|
interface ListContactsOptions {
|
|
497
548
|
audienceId: string;
|
|
@@ -500,10 +551,13 @@ interface ListContactsResponseSuccess {
|
|
|
500
551
|
object: 'list';
|
|
501
552
|
data: Contact[];
|
|
502
553
|
}
|
|
503
|
-
|
|
504
|
-
data: ListContactsResponseSuccess
|
|
505
|
-
error:
|
|
506
|
-
}
|
|
554
|
+
type ListContactsResponse = {
|
|
555
|
+
data: ListContactsResponseSuccess;
|
|
556
|
+
error: null;
|
|
557
|
+
} | {
|
|
558
|
+
data: null;
|
|
559
|
+
error: ErrorResponse;
|
|
560
|
+
};
|
|
507
561
|
|
|
508
562
|
type RemoveContactsResponseSuccess = {
|
|
509
563
|
object: 'contact';
|
|
@@ -527,10 +581,13 @@ interface RemoveByOptions {
|
|
|
527
581
|
interface RemoveContactOptions extends RemoveByOptions {
|
|
528
582
|
audienceId: string;
|
|
529
583
|
}
|
|
530
|
-
|
|
531
|
-
data: RemoveContactsResponseSuccess
|
|
532
|
-
error:
|
|
533
|
-
}
|
|
584
|
+
type RemoveContactsResponse = {
|
|
585
|
+
data: RemoveContactsResponseSuccess;
|
|
586
|
+
error: null;
|
|
587
|
+
} | {
|
|
588
|
+
data: null;
|
|
589
|
+
error: ErrorResponse;
|
|
590
|
+
};
|
|
534
591
|
|
|
535
592
|
interface UpdateContactBaseOptions {
|
|
536
593
|
id?: string;
|
|
@@ -545,10 +602,13 @@ interface UpdateContactOptions extends UpdateContactBaseOptions {
|
|
|
545
602
|
type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
|
|
546
603
|
object: 'contact';
|
|
547
604
|
};
|
|
548
|
-
|
|
549
|
-
data: UpdateContactResponseSuccess
|
|
550
|
-
error:
|
|
551
|
-
}
|
|
605
|
+
type UpdateContactResponse = {
|
|
606
|
+
data: UpdateContactResponseSuccess;
|
|
607
|
+
error: null;
|
|
608
|
+
} | {
|
|
609
|
+
data: null;
|
|
610
|
+
error: ErrorResponse;
|
|
611
|
+
};
|
|
552
612
|
|
|
553
613
|
declare class Contacts {
|
|
554
614
|
private readonly resend;
|
|
@@ -603,36 +663,48 @@ interface CreateDomainRequestOptions extends PostOptions {
|
|
|
603
663
|
interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
|
|
604
664
|
records: DomainRecords[];
|
|
605
665
|
}
|
|
606
|
-
|
|
607
|
-
data: CreateDomainResponseSuccess
|
|
608
|
-
error:
|
|
609
|
-
}
|
|
666
|
+
type CreateDomainResponse = {
|
|
667
|
+
data: CreateDomainResponseSuccess;
|
|
668
|
+
error: null;
|
|
669
|
+
} | {
|
|
670
|
+
data: null;
|
|
671
|
+
error: ErrorResponse;
|
|
672
|
+
};
|
|
610
673
|
|
|
611
674
|
interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status'> {
|
|
612
675
|
object: 'domain';
|
|
613
676
|
records: DomainRecords[];
|
|
614
677
|
}
|
|
615
|
-
|
|
616
|
-
data: GetDomainResponseSuccess
|
|
617
|
-
error:
|
|
618
|
-
}
|
|
678
|
+
type GetDomainResponse = {
|
|
679
|
+
data: GetDomainResponseSuccess;
|
|
680
|
+
error: null;
|
|
681
|
+
} | {
|
|
682
|
+
data: null;
|
|
683
|
+
error: ErrorResponse;
|
|
684
|
+
};
|
|
619
685
|
|
|
620
686
|
type ListDomainsResponseSuccess = {
|
|
621
687
|
data: Domain[];
|
|
622
688
|
};
|
|
623
|
-
|
|
624
|
-
data: ListDomainsResponseSuccess
|
|
625
|
-
error:
|
|
626
|
-
}
|
|
689
|
+
type ListDomainsResponse = {
|
|
690
|
+
data: ListDomainsResponseSuccess;
|
|
691
|
+
error: null;
|
|
692
|
+
} | {
|
|
693
|
+
data: null;
|
|
694
|
+
error: ErrorResponse;
|
|
695
|
+
};
|
|
627
696
|
|
|
628
697
|
type RemoveDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
629
698
|
object: 'domain';
|
|
630
699
|
deleted: boolean;
|
|
631
700
|
};
|
|
632
|
-
|
|
633
|
-
data: RemoveDomainsResponseSuccess
|
|
634
|
-
error:
|
|
635
|
-
}
|
|
701
|
+
type RemoveDomainsResponse = {
|
|
702
|
+
data: RemoveDomainsResponseSuccess;
|
|
703
|
+
error: null;
|
|
704
|
+
} | {
|
|
705
|
+
data: null;
|
|
706
|
+
error: ErrorResponse;
|
|
707
|
+
};
|
|
636
708
|
|
|
637
709
|
interface UpdateDomainsOptions {
|
|
638
710
|
id: string;
|
|
@@ -643,18 +715,24 @@ interface UpdateDomainsOptions {
|
|
|
643
715
|
type UpdateDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
644
716
|
object: 'domain';
|
|
645
717
|
};
|
|
646
|
-
|
|
647
|
-
data: UpdateDomainsResponseSuccess
|
|
648
|
-
error:
|
|
649
|
-
}
|
|
718
|
+
type UpdateDomainsResponse = {
|
|
719
|
+
data: UpdateDomainsResponseSuccess;
|
|
720
|
+
error: null;
|
|
721
|
+
} | {
|
|
722
|
+
data: null;
|
|
723
|
+
error: ErrorResponse;
|
|
724
|
+
};
|
|
650
725
|
|
|
651
726
|
type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
652
727
|
object: 'domain';
|
|
653
728
|
};
|
|
654
|
-
|
|
655
|
-
data: VerifyDomainsResponseSuccess
|
|
656
|
-
error:
|
|
657
|
-
}
|
|
729
|
+
type VerifyDomainsResponse = {
|
|
730
|
+
data: VerifyDomainsResponseSuccess;
|
|
731
|
+
error: null;
|
|
732
|
+
} | {
|
|
733
|
+
data: null;
|
|
734
|
+
error: ErrorResponse;
|
|
735
|
+
};
|
|
658
736
|
|
|
659
737
|
declare class Domains {
|
|
660
738
|
private readonly resend;
|
|
@@ -667,14 +745,17 @@ declare class Domains {
|
|
|
667
745
|
verify(id: string): Promise<VerifyDomainsResponse>;
|
|
668
746
|
}
|
|
669
747
|
|
|
670
|
-
interface CancelEmailResponse {
|
|
671
|
-
data: CancelEmailResponseSuccess | null;
|
|
672
|
-
error: ErrorResponse | null;
|
|
673
|
-
}
|
|
674
748
|
interface CancelEmailResponseSuccess {
|
|
675
749
|
object: 'email';
|
|
676
750
|
id: string;
|
|
677
751
|
}
|
|
752
|
+
type CancelEmailResponse = {
|
|
753
|
+
data: CancelEmailResponseSuccess;
|
|
754
|
+
error: null;
|
|
755
|
+
} | {
|
|
756
|
+
data: null;
|
|
757
|
+
error: ErrorResponse;
|
|
758
|
+
};
|
|
678
759
|
|
|
679
760
|
interface GetEmailResponseSuccess {
|
|
680
761
|
bcc: string[] | null;
|
|
@@ -691,10 +772,13 @@ interface GetEmailResponseSuccess {
|
|
|
691
772
|
scheduled_at: string | null;
|
|
692
773
|
object: 'email';
|
|
693
774
|
}
|
|
694
|
-
|
|
695
|
-
data: GetEmailResponseSuccess
|
|
696
|
-
error:
|
|
697
|
-
}
|
|
775
|
+
type GetEmailResponse = {
|
|
776
|
+
data: GetEmailResponseSuccess;
|
|
777
|
+
error: null;
|
|
778
|
+
} | {
|
|
779
|
+
data: null;
|
|
780
|
+
error: ErrorResponse;
|
|
781
|
+
};
|
|
698
782
|
|
|
699
783
|
interface UpdateEmailOptions {
|
|
700
784
|
id: string;
|
|
@@ -704,10 +788,13 @@ interface UpdateEmailResponseSuccess {
|
|
|
704
788
|
id: string;
|
|
705
789
|
object: 'email';
|
|
706
790
|
}
|
|
707
|
-
|
|
708
|
-
data: UpdateEmailResponseSuccess
|
|
709
|
-
error:
|
|
710
|
-
}
|
|
791
|
+
type UpdateEmailResponse = {
|
|
792
|
+
data: UpdateEmailResponseSuccess;
|
|
793
|
+
error: null;
|
|
794
|
+
} | {
|
|
795
|
+
data: null;
|
|
796
|
+
error: ErrorResponse;
|
|
797
|
+
};
|
|
711
798
|
|
|
712
799
|
declare class Emails {
|
|
713
800
|
private readonly resend;
|
|
@@ -732,28 +819,46 @@ declare class Resend {
|
|
|
732
819
|
readonly emails: Emails;
|
|
733
820
|
constructor(key?: string | undefined);
|
|
734
821
|
fetchRequest<T>(path: string, options?: {}): Promise<{
|
|
735
|
-
data: T
|
|
736
|
-
error:
|
|
822
|
+
data: T;
|
|
823
|
+
error: null;
|
|
824
|
+
} | {
|
|
825
|
+
data: null;
|
|
826
|
+
error: ErrorResponse;
|
|
737
827
|
}>;
|
|
738
828
|
post<T>(path: string, entity?: unknown, options?: PostOptions & IdempotentRequest): Promise<{
|
|
739
|
-
data:
|
|
740
|
-
error: ErrorResponse
|
|
829
|
+
data: null;
|
|
830
|
+
error: ErrorResponse;
|
|
831
|
+
} | {
|
|
832
|
+
data: T;
|
|
833
|
+
error: null;
|
|
741
834
|
}>;
|
|
742
835
|
get<T>(path: string, options?: GetOptions): Promise<{
|
|
743
|
-
data:
|
|
744
|
-
error: ErrorResponse
|
|
836
|
+
data: null;
|
|
837
|
+
error: ErrorResponse;
|
|
838
|
+
} | {
|
|
839
|
+
data: T;
|
|
840
|
+
error: null;
|
|
745
841
|
}>;
|
|
746
842
|
put<T>(path: string, entity: unknown, options?: PutOptions): Promise<{
|
|
747
|
-
data:
|
|
748
|
-
error: ErrorResponse
|
|
843
|
+
data: null;
|
|
844
|
+
error: ErrorResponse;
|
|
845
|
+
} | {
|
|
846
|
+
data: T;
|
|
847
|
+
error: null;
|
|
749
848
|
}>;
|
|
750
849
|
patch<T>(path: string, entity: unknown, options?: PatchOptions): Promise<{
|
|
751
|
-
data:
|
|
752
|
-
error: ErrorResponse
|
|
850
|
+
data: null;
|
|
851
|
+
error: ErrorResponse;
|
|
852
|
+
} | {
|
|
853
|
+
data: T;
|
|
854
|
+
error: null;
|
|
753
855
|
}>;
|
|
754
856
|
delete<T>(path: string, query?: unknown): Promise<{
|
|
755
|
-
data:
|
|
756
|
-
error: ErrorResponse
|
|
857
|
+
data: null;
|
|
858
|
+
error: ErrorResponse;
|
|
859
|
+
} | {
|
|
860
|
+
data: T;
|
|
861
|
+
error: null;
|
|
757
862
|
}>;
|
|
758
863
|
}
|
|
759
864
|
|
package/dist/index.d.ts
CHANGED
|
@@ -51,10 +51,13 @@ interface CreateApiKeyResponseSuccess {
|
|
|
51
51
|
token: string;
|
|
52
52
|
id: string;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
data: CreateApiKeyResponseSuccess
|
|
56
|
-
error:
|
|
57
|
-
}
|
|
54
|
+
type CreateApiKeyResponse = {
|
|
55
|
+
data: CreateApiKeyResponseSuccess;
|
|
56
|
+
error: null;
|
|
57
|
+
} | {
|
|
58
|
+
data: null;
|
|
59
|
+
error: ErrorResponse;
|
|
60
|
+
};
|
|
58
61
|
|
|
59
62
|
interface ApiKey {
|
|
60
63
|
created_at: string;
|
|
@@ -63,16 +66,22 @@ interface ApiKey {
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
type ListApiKeysResponseSuccess = Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
|
|
66
|
-
|
|
67
|
-
data: ListApiKeysResponseSuccess
|
|
68
|
-
error:
|
|
69
|
-
}
|
|
69
|
+
type ListApiKeysResponse = {
|
|
70
|
+
data: ListApiKeysResponseSuccess;
|
|
71
|
+
error: null;
|
|
72
|
+
} | {
|
|
73
|
+
data: null;
|
|
74
|
+
error: ErrorResponse;
|
|
75
|
+
};
|
|
70
76
|
|
|
71
77
|
type RemoveApiKeyResponseSuccess = {};
|
|
72
|
-
|
|
73
|
-
data: RemoveApiKeyResponseSuccess
|
|
74
|
-
error:
|
|
75
|
-
}
|
|
78
|
+
type RemoveApiKeyResponse = {
|
|
79
|
+
data: RemoveApiKeyResponseSuccess;
|
|
80
|
+
error: null;
|
|
81
|
+
} | {
|
|
82
|
+
data: null;
|
|
83
|
+
error: ErrorResponse;
|
|
84
|
+
};
|
|
76
85
|
|
|
77
86
|
declare class ApiKeys {
|
|
78
87
|
private readonly resend;
|
|
@@ -96,36 +105,48 @@ interface CreateAudienceRequestOptions extends PostOptions {
|
|
|
96
105
|
interface CreateAudienceResponseSuccess extends Pick<Audience, 'name' | 'id'> {
|
|
97
106
|
object: 'audience';
|
|
98
107
|
}
|
|
99
|
-
|
|
100
|
-
data: CreateAudienceResponseSuccess
|
|
101
|
-
error:
|
|
102
|
-
}
|
|
108
|
+
type CreateAudienceResponse = {
|
|
109
|
+
data: CreateAudienceResponseSuccess;
|
|
110
|
+
error: null;
|
|
111
|
+
} | {
|
|
112
|
+
data: null;
|
|
113
|
+
error: ErrorResponse;
|
|
114
|
+
};
|
|
103
115
|
|
|
104
116
|
interface GetAudienceResponseSuccess extends Pick<Audience, 'id' | 'name' | 'created_at'> {
|
|
105
117
|
object: 'audience';
|
|
106
118
|
}
|
|
107
|
-
|
|
108
|
-
data: GetAudienceResponseSuccess
|
|
109
|
-
error:
|
|
110
|
-
}
|
|
119
|
+
type GetAudienceResponse = {
|
|
120
|
+
data: GetAudienceResponseSuccess;
|
|
121
|
+
error: null;
|
|
122
|
+
} | {
|
|
123
|
+
data: null;
|
|
124
|
+
error: ErrorResponse;
|
|
125
|
+
};
|
|
111
126
|
|
|
112
127
|
type ListAudiencesResponseSuccess = {
|
|
113
128
|
object: 'list';
|
|
114
129
|
data: Audience[];
|
|
115
130
|
};
|
|
116
|
-
|
|
117
|
-
data: ListAudiencesResponseSuccess
|
|
118
|
-
error:
|
|
119
|
-
}
|
|
131
|
+
type ListAudiencesResponse = {
|
|
132
|
+
data: ListAudiencesResponseSuccess;
|
|
133
|
+
error: null;
|
|
134
|
+
} | {
|
|
135
|
+
data: null;
|
|
136
|
+
error: ErrorResponse;
|
|
137
|
+
};
|
|
120
138
|
|
|
121
139
|
interface RemoveAudiencesResponseSuccess extends Pick<Audience, 'id'> {
|
|
122
140
|
object: 'audience';
|
|
123
141
|
deleted: boolean;
|
|
124
142
|
}
|
|
125
|
-
|
|
126
|
-
data: RemoveAudiencesResponseSuccess
|
|
127
|
-
error:
|
|
128
|
-
}
|
|
143
|
+
type RemoveAudiencesResponse = {
|
|
144
|
+
data: RemoveAudiencesResponseSuccess;
|
|
145
|
+
error: null;
|
|
146
|
+
} | {
|
|
147
|
+
data: null;
|
|
148
|
+
error: ErrorResponse;
|
|
149
|
+
};
|
|
129
150
|
|
|
130
151
|
declare class Audiences {
|
|
131
152
|
private readonly resend;
|
|
@@ -239,10 +260,13 @@ interface CreateEmailResponseSuccess {
|
|
|
239
260
|
/** The ID of the newly created email. */
|
|
240
261
|
id: string;
|
|
241
262
|
}
|
|
242
|
-
|
|
243
|
-
data: CreateEmailResponseSuccess
|
|
244
|
-
error:
|
|
245
|
-
}
|
|
263
|
+
type CreateEmailResponse = {
|
|
264
|
+
data: CreateEmailResponseSuccess;
|
|
265
|
+
error: null;
|
|
266
|
+
} | {
|
|
267
|
+
data: null;
|
|
268
|
+
error: ErrorResponse;
|
|
269
|
+
};
|
|
246
270
|
interface Attachment {
|
|
247
271
|
/** Content of an attached file. */
|
|
248
272
|
content?: string | Buffer;
|
|
@@ -273,10 +297,13 @@ interface CreateBatchSuccessResponse {
|
|
|
273
297
|
id: string;
|
|
274
298
|
}[];
|
|
275
299
|
}
|
|
276
|
-
|
|
277
|
-
data: CreateBatchSuccessResponse
|
|
278
|
-
error:
|
|
279
|
-
}
|
|
300
|
+
type CreateBatchResponse = {
|
|
301
|
+
data: CreateBatchSuccessResponse;
|
|
302
|
+
error: null;
|
|
303
|
+
} | {
|
|
304
|
+
data: null;
|
|
305
|
+
error: ErrorResponse;
|
|
306
|
+
};
|
|
280
307
|
|
|
281
308
|
declare class Batch {
|
|
282
309
|
private readonly resend;
|
|
@@ -351,10 +378,13 @@ interface CreateBroadcastResponseSuccess {
|
|
|
351
378
|
/** The ID of the newly sent broadcasts. */
|
|
352
379
|
id: string;
|
|
353
380
|
}
|
|
354
|
-
|
|
355
|
-
data: CreateBroadcastResponseSuccess
|
|
356
|
-
error:
|
|
357
|
-
}
|
|
381
|
+
type CreateBroadcastResponse = {
|
|
382
|
+
data: CreateBroadcastResponseSuccess;
|
|
383
|
+
error: null;
|
|
384
|
+
} | {
|
|
385
|
+
data: null;
|
|
386
|
+
error: ErrorResponse;
|
|
387
|
+
};
|
|
358
388
|
|
|
359
389
|
interface Broadcast {
|
|
360
390
|
id: string;
|
|
@@ -373,28 +403,37 @@ interface Broadcast {
|
|
|
373
403
|
interface GetBroadcastResponseSuccess extends Broadcast {
|
|
374
404
|
object: 'broadcast';
|
|
375
405
|
}
|
|
376
|
-
|
|
377
|
-
data: GetBroadcastResponseSuccess
|
|
378
|
-
error:
|
|
379
|
-
}
|
|
406
|
+
type GetBroadcastResponse = {
|
|
407
|
+
data: GetBroadcastResponseSuccess;
|
|
408
|
+
error: null;
|
|
409
|
+
} | {
|
|
410
|
+
data: null;
|
|
411
|
+
error: ErrorResponse;
|
|
412
|
+
};
|
|
380
413
|
|
|
381
414
|
type ListBroadcastsResponseSuccess = {
|
|
382
415
|
object: 'list';
|
|
383
416
|
data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
|
|
384
417
|
};
|
|
385
|
-
|
|
386
|
-
data: ListBroadcastsResponseSuccess
|
|
387
|
-
error:
|
|
388
|
-
}
|
|
418
|
+
type ListBroadcastsResponse = {
|
|
419
|
+
data: ListBroadcastsResponseSuccess;
|
|
420
|
+
error: null;
|
|
421
|
+
} | {
|
|
422
|
+
data: null;
|
|
423
|
+
error: ErrorResponse;
|
|
424
|
+
};
|
|
389
425
|
|
|
390
426
|
interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
391
427
|
object: 'broadcast';
|
|
392
428
|
deleted: boolean;
|
|
393
429
|
}
|
|
394
|
-
|
|
395
|
-
data: RemoveBroadcastResponseSuccess
|
|
396
|
-
error:
|
|
397
|
-
}
|
|
430
|
+
type RemoveBroadcastResponse = {
|
|
431
|
+
data: RemoveBroadcastResponseSuccess;
|
|
432
|
+
error: null;
|
|
433
|
+
} | {
|
|
434
|
+
data: null;
|
|
435
|
+
error: ErrorResponse;
|
|
436
|
+
};
|
|
398
437
|
|
|
399
438
|
interface SendBroadcastBaseOptions {
|
|
400
439
|
/**
|
|
@@ -413,10 +452,13 @@ interface SendBroadcastResponseSuccess {
|
|
|
413
452
|
/** The ID of the sent broadcast. */
|
|
414
453
|
id: string;
|
|
415
454
|
}
|
|
416
|
-
|
|
417
|
-
data: SendBroadcastResponseSuccess
|
|
418
|
-
error:
|
|
419
|
-
}
|
|
455
|
+
type SendBroadcastResponse = {
|
|
456
|
+
data: SendBroadcastResponseSuccess;
|
|
457
|
+
error: null;
|
|
458
|
+
} | {
|
|
459
|
+
data: null;
|
|
460
|
+
error: ErrorResponse;
|
|
461
|
+
};
|
|
420
462
|
|
|
421
463
|
interface UpdateBroadcastResponseSuccess {
|
|
422
464
|
id: string;
|
|
@@ -431,10 +473,13 @@ interface UpdateBroadcastOptions {
|
|
|
431
473
|
replyTo?: string[];
|
|
432
474
|
previewText?: string;
|
|
433
475
|
}
|
|
434
|
-
|
|
435
|
-
data: UpdateBroadcastResponseSuccess
|
|
436
|
-
error:
|
|
437
|
-
}
|
|
476
|
+
type UpdateBroadcastResponse = {
|
|
477
|
+
data: UpdateBroadcastResponseSuccess;
|
|
478
|
+
error: null;
|
|
479
|
+
} | {
|
|
480
|
+
data: null;
|
|
481
|
+
error: ErrorResponse;
|
|
482
|
+
};
|
|
438
483
|
|
|
439
484
|
declare class Broadcasts {
|
|
440
485
|
private readonly resend;
|
|
@@ -475,10 +520,13 @@ interface CreateContactRequestOptions extends PostOptions {
|
|
|
475
520
|
interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
|
|
476
521
|
object: 'contact';
|
|
477
522
|
}
|
|
478
|
-
|
|
479
|
-
data: CreateContactResponseSuccess
|
|
480
|
-
error:
|
|
481
|
-
}
|
|
523
|
+
type CreateContactResponse = {
|
|
524
|
+
data: CreateContactResponseSuccess;
|
|
525
|
+
error: null;
|
|
526
|
+
} | {
|
|
527
|
+
data: null;
|
|
528
|
+
error: ErrorResponse;
|
|
529
|
+
};
|
|
482
530
|
|
|
483
531
|
interface GetContactOptions {
|
|
484
532
|
audienceId: string;
|
|
@@ -488,10 +536,13 @@ interface GetContactOptions {
|
|
|
488
536
|
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
|
|
489
537
|
object: 'contact';
|
|
490
538
|
}
|
|
491
|
-
|
|
492
|
-
data: GetContactResponseSuccess
|
|
493
|
-
error:
|
|
494
|
-
}
|
|
539
|
+
type GetContactResponse = {
|
|
540
|
+
data: GetContactResponseSuccess;
|
|
541
|
+
error: null;
|
|
542
|
+
} | {
|
|
543
|
+
data: null;
|
|
544
|
+
error: ErrorResponse;
|
|
545
|
+
};
|
|
495
546
|
|
|
496
547
|
interface ListContactsOptions {
|
|
497
548
|
audienceId: string;
|
|
@@ -500,10 +551,13 @@ interface ListContactsResponseSuccess {
|
|
|
500
551
|
object: 'list';
|
|
501
552
|
data: Contact[];
|
|
502
553
|
}
|
|
503
|
-
|
|
504
|
-
data: ListContactsResponseSuccess
|
|
505
|
-
error:
|
|
506
|
-
}
|
|
554
|
+
type ListContactsResponse = {
|
|
555
|
+
data: ListContactsResponseSuccess;
|
|
556
|
+
error: null;
|
|
557
|
+
} | {
|
|
558
|
+
data: null;
|
|
559
|
+
error: ErrorResponse;
|
|
560
|
+
};
|
|
507
561
|
|
|
508
562
|
type RemoveContactsResponseSuccess = {
|
|
509
563
|
object: 'contact';
|
|
@@ -527,10 +581,13 @@ interface RemoveByOptions {
|
|
|
527
581
|
interface RemoveContactOptions extends RemoveByOptions {
|
|
528
582
|
audienceId: string;
|
|
529
583
|
}
|
|
530
|
-
|
|
531
|
-
data: RemoveContactsResponseSuccess
|
|
532
|
-
error:
|
|
533
|
-
}
|
|
584
|
+
type RemoveContactsResponse = {
|
|
585
|
+
data: RemoveContactsResponseSuccess;
|
|
586
|
+
error: null;
|
|
587
|
+
} | {
|
|
588
|
+
data: null;
|
|
589
|
+
error: ErrorResponse;
|
|
590
|
+
};
|
|
534
591
|
|
|
535
592
|
interface UpdateContactBaseOptions {
|
|
536
593
|
id?: string;
|
|
@@ -545,10 +602,13 @@ interface UpdateContactOptions extends UpdateContactBaseOptions {
|
|
|
545
602
|
type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
|
|
546
603
|
object: 'contact';
|
|
547
604
|
};
|
|
548
|
-
|
|
549
|
-
data: UpdateContactResponseSuccess
|
|
550
|
-
error:
|
|
551
|
-
}
|
|
605
|
+
type UpdateContactResponse = {
|
|
606
|
+
data: UpdateContactResponseSuccess;
|
|
607
|
+
error: null;
|
|
608
|
+
} | {
|
|
609
|
+
data: null;
|
|
610
|
+
error: ErrorResponse;
|
|
611
|
+
};
|
|
552
612
|
|
|
553
613
|
declare class Contacts {
|
|
554
614
|
private readonly resend;
|
|
@@ -603,36 +663,48 @@ interface CreateDomainRequestOptions extends PostOptions {
|
|
|
603
663
|
interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
|
|
604
664
|
records: DomainRecords[];
|
|
605
665
|
}
|
|
606
|
-
|
|
607
|
-
data: CreateDomainResponseSuccess
|
|
608
|
-
error:
|
|
609
|
-
}
|
|
666
|
+
type CreateDomainResponse = {
|
|
667
|
+
data: CreateDomainResponseSuccess;
|
|
668
|
+
error: null;
|
|
669
|
+
} | {
|
|
670
|
+
data: null;
|
|
671
|
+
error: ErrorResponse;
|
|
672
|
+
};
|
|
610
673
|
|
|
611
674
|
interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status'> {
|
|
612
675
|
object: 'domain';
|
|
613
676
|
records: DomainRecords[];
|
|
614
677
|
}
|
|
615
|
-
|
|
616
|
-
data: GetDomainResponseSuccess
|
|
617
|
-
error:
|
|
618
|
-
}
|
|
678
|
+
type GetDomainResponse = {
|
|
679
|
+
data: GetDomainResponseSuccess;
|
|
680
|
+
error: null;
|
|
681
|
+
} | {
|
|
682
|
+
data: null;
|
|
683
|
+
error: ErrorResponse;
|
|
684
|
+
};
|
|
619
685
|
|
|
620
686
|
type ListDomainsResponseSuccess = {
|
|
621
687
|
data: Domain[];
|
|
622
688
|
};
|
|
623
|
-
|
|
624
|
-
data: ListDomainsResponseSuccess
|
|
625
|
-
error:
|
|
626
|
-
}
|
|
689
|
+
type ListDomainsResponse = {
|
|
690
|
+
data: ListDomainsResponseSuccess;
|
|
691
|
+
error: null;
|
|
692
|
+
} | {
|
|
693
|
+
data: null;
|
|
694
|
+
error: ErrorResponse;
|
|
695
|
+
};
|
|
627
696
|
|
|
628
697
|
type RemoveDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
629
698
|
object: 'domain';
|
|
630
699
|
deleted: boolean;
|
|
631
700
|
};
|
|
632
|
-
|
|
633
|
-
data: RemoveDomainsResponseSuccess
|
|
634
|
-
error:
|
|
635
|
-
}
|
|
701
|
+
type RemoveDomainsResponse = {
|
|
702
|
+
data: RemoveDomainsResponseSuccess;
|
|
703
|
+
error: null;
|
|
704
|
+
} | {
|
|
705
|
+
data: null;
|
|
706
|
+
error: ErrorResponse;
|
|
707
|
+
};
|
|
636
708
|
|
|
637
709
|
interface UpdateDomainsOptions {
|
|
638
710
|
id: string;
|
|
@@ -643,18 +715,24 @@ interface UpdateDomainsOptions {
|
|
|
643
715
|
type UpdateDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
644
716
|
object: 'domain';
|
|
645
717
|
};
|
|
646
|
-
|
|
647
|
-
data: UpdateDomainsResponseSuccess
|
|
648
|
-
error:
|
|
649
|
-
}
|
|
718
|
+
type UpdateDomainsResponse = {
|
|
719
|
+
data: UpdateDomainsResponseSuccess;
|
|
720
|
+
error: null;
|
|
721
|
+
} | {
|
|
722
|
+
data: null;
|
|
723
|
+
error: ErrorResponse;
|
|
724
|
+
};
|
|
650
725
|
|
|
651
726
|
type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
652
727
|
object: 'domain';
|
|
653
728
|
};
|
|
654
|
-
|
|
655
|
-
data: VerifyDomainsResponseSuccess
|
|
656
|
-
error:
|
|
657
|
-
}
|
|
729
|
+
type VerifyDomainsResponse = {
|
|
730
|
+
data: VerifyDomainsResponseSuccess;
|
|
731
|
+
error: null;
|
|
732
|
+
} | {
|
|
733
|
+
data: null;
|
|
734
|
+
error: ErrorResponse;
|
|
735
|
+
};
|
|
658
736
|
|
|
659
737
|
declare class Domains {
|
|
660
738
|
private readonly resend;
|
|
@@ -667,14 +745,17 @@ declare class Domains {
|
|
|
667
745
|
verify(id: string): Promise<VerifyDomainsResponse>;
|
|
668
746
|
}
|
|
669
747
|
|
|
670
|
-
interface CancelEmailResponse {
|
|
671
|
-
data: CancelEmailResponseSuccess | null;
|
|
672
|
-
error: ErrorResponse | null;
|
|
673
|
-
}
|
|
674
748
|
interface CancelEmailResponseSuccess {
|
|
675
749
|
object: 'email';
|
|
676
750
|
id: string;
|
|
677
751
|
}
|
|
752
|
+
type CancelEmailResponse = {
|
|
753
|
+
data: CancelEmailResponseSuccess;
|
|
754
|
+
error: null;
|
|
755
|
+
} | {
|
|
756
|
+
data: null;
|
|
757
|
+
error: ErrorResponse;
|
|
758
|
+
};
|
|
678
759
|
|
|
679
760
|
interface GetEmailResponseSuccess {
|
|
680
761
|
bcc: string[] | null;
|
|
@@ -691,10 +772,13 @@ interface GetEmailResponseSuccess {
|
|
|
691
772
|
scheduled_at: string | null;
|
|
692
773
|
object: 'email';
|
|
693
774
|
}
|
|
694
|
-
|
|
695
|
-
data: GetEmailResponseSuccess
|
|
696
|
-
error:
|
|
697
|
-
}
|
|
775
|
+
type GetEmailResponse = {
|
|
776
|
+
data: GetEmailResponseSuccess;
|
|
777
|
+
error: null;
|
|
778
|
+
} | {
|
|
779
|
+
data: null;
|
|
780
|
+
error: ErrorResponse;
|
|
781
|
+
};
|
|
698
782
|
|
|
699
783
|
interface UpdateEmailOptions {
|
|
700
784
|
id: string;
|
|
@@ -704,10 +788,13 @@ interface UpdateEmailResponseSuccess {
|
|
|
704
788
|
id: string;
|
|
705
789
|
object: 'email';
|
|
706
790
|
}
|
|
707
|
-
|
|
708
|
-
data: UpdateEmailResponseSuccess
|
|
709
|
-
error:
|
|
710
|
-
}
|
|
791
|
+
type UpdateEmailResponse = {
|
|
792
|
+
data: UpdateEmailResponseSuccess;
|
|
793
|
+
error: null;
|
|
794
|
+
} | {
|
|
795
|
+
data: null;
|
|
796
|
+
error: ErrorResponse;
|
|
797
|
+
};
|
|
711
798
|
|
|
712
799
|
declare class Emails {
|
|
713
800
|
private readonly resend;
|
|
@@ -732,28 +819,46 @@ declare class Resend {
|
|
|
732
819
|
readonly emails: Emails;
|
|
733
820
|
constructor(key?: string | undefined);
|
|
734
821
|
fetchRequest<T>(path: string, options?: {}): Promise<{
|
|
735
|
-
data: T
|
|
736
|
-
error:
|
|
822
|
+
data: T;
|
|
823
|
+
error: null;
|
|
824
|
+
} | {
|
|
825
|
+
data: null;
|
|
826
|
+
error: ErrorResponse;
|
|
737
827
|
}>;
|
|
738
828
|
post<T>(path: string, entity?: unknown, options?: PostOptions & IdempotentRequest): Promise<{
|
|
739
|
-
data:
|
|
740
|
-
error: ErrorResponse
|
|
829
|
+
data: null;
|
|
830
|
+
error: ErrorResponse;
|
|
831
|
+
} | {
|
|
832
|
+
data: T;
|
|
833
|
+
error: null;
|
|
741
834
|
}>;
|
|
742
835
|
get<T>(path: string, options?: GetOptions): Promise<{
|
|
743
|
-
data:
|
|
744
|
-
error: ErrorResponse
|
|
836
|
+
data: null;
|
|
837
|
+
error: ErrorResponse;
|
|
838
|
+
} | {
|
|
839
|
+
data: T;
|
|
840
|
+
error: null;
|
|
745
841
|
}>;
|
|
746
842
|
put<T>(path: string, entity: unknown, options?: PutOptions): Promise<{
|
|
747
|
-
data:
|
|
748
|
-
error: ErrorResponse
|
|
843
|
+
data: null;
|
|
844
|
+
error: ErrorResponse;
|
|
845
|
+
} | {
|
|
846
|
+
data: T;
|
|
847
|
+
error: null;
|
|
749
848
|
}>;
|
|
750
849
|
patch<T>(path: string, entity: unknown, options?: PatchOptions): Promise<{
|
|
751
|
-
data:
|
|
752
|
-
error: ErrorResponse
|
|
850
|
+
data: null;
|
|
851
|
+
error: ErrorResponse;
|
|
852
|
+
} | {
|
|
853
|
+
data: T;
|
|
854
|
+
error: null;
|
|
753
855
|
}>;
|
|
754
856
|
delete<T>(path: string, query?: unknown): Promise<{
|
|
755
|
-
data:
|
|
756
|
-
error: ErrorResponse
|
|
857
|
+
data: null;
|
|
858
|
+
error: ErrorResponse;
|
|
859
|
+
} | {
|
|
860
|
+
data: T;
|
|
861
|
+
error: null;
|
|
757
862
|
}>;
|
|
758
863
|
}
|
|
759
864
|
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED