postgrid-node 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +25 -39
- package/core.d.ts +7 -4
- package/core.d.ts.map +1 -1
- package/core.js +16 -9
- package/core.js.map +1 -1
- package/core.mjs +16 -9
- package/core.mjs.map +1 -1
- package/index.d.mts +21 -8
- package/index.d.ts +21 -8
- package/index.d.ts.map +1 -1
- package/index.js +28 -5
- package/index.js.map +1 -1
- package/index.mjs +28 -5
- package/index.mjs.map +1 -1
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +280 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +4 -5
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +2 -1
- package/pagination.js.map +1 -1
- package/pagination.mjs +2 -1
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/bank-accounts.d.ts +61 -4
- package/resources/bank-accounts.d.ts.map +1 -1
- package/resources/bank-accounts.js +25 -0
- package/resources/bank-accounts.js.map +1 -1
- package/resources/bank-accounts.mjs +25 -0
- package/resources/bank-accounts.mjs.map +1 -1
- package/resources/boxes.d.ts +80 -15
- package/resources/boxes.d.ts.map +1 -1
- package/resources/boxes.js +27 -0
- package/resources/boxes.js.map +1 -1
- package/resources/boxes.mjs +27 -0
- package/resources/boxes.mjs.map +1 -1
- package/resources/campaigns.d.ts +21 -7
- package/resources/campaigns.d.ts.map +1 -1
- package/resources/cheques/cheques.d.ts +43 -4
- package/resources/cheques/cheques.d.ts.map +1 -1
- package/resources/cheques/cheques.js +23 -0
- package/resources/cheques/cheques.js.map +1 -1
- package/resources/cheques/cheques.mjs +23 -0
- package/resources/cheques/cheques.mjs.map +1 -1
- package/resources/cheques/url.d.ts +5 -0
- package/resources/cheques/url.d.ts.map +1 -1
- package/resources/cheques/url.js +5 -0
- package/resources/cheques/url.js.map +1 -1
- package/resources/cheques/url.mjs +5 -0
- package/resources/cheques/url.mjs.map +1 -1
- package/resources/cheques/with-deposit-ready-pdf.d.ts +6 -0
- package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -1
- package/resources/cheques/with-deposit-ready-pdf.js +6 -0
- package/resources/cheques/with-deposit-ready-pdf.js.map +1 -1
- package/resources/cheques/with-deposit-ready-pdf.mjs +6 -0
- package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -1
- package/resources/contacts.d.ts +37 -3
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +20 -0
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +20 -0
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.ts +5 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +12 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/letters.d.ts +50 -6
- package/resources/letters.d.ts.map +1 -1
- package/resources/letters.js +24 -0
- package/resources/letters.js.map +1 -1
- package/resources/letters.mjs +24 -0
- package/resources/letters.mjs.map +1 -1
- package/resources/mailing-list-imports.d.ts +919 -0
- package/resources/mailing-list-imports.d.ts.map +1 -0
- package/resources/mailing-list-imports.js +95 -0
- package/resources/mailing-list-imports.js.map +1 -0
- package/resources/mailing-list-imports.mjs +90 -0
- package/resources/mailing-list-imports.mjs.map +1 -0
- package/resources/mailing-lists.d.ts +398 -0
- package/resources/mailing-lists.d.ts.map +1 -0
- package/resources/mailing-lists.js +101 -0
- package/resources/mailing-lists.js.map +1 -0
- package/resources/mailing-lists.mjs +96 -0
- package/resources/mailing-lists.mjs.map +1 -0
- package/resources/order-profiles/cheques.d.ts +588 -0
- package/resources/order-profiles/cheques.d.ts.map +1 -0
- package/resources/order-profiles/cheques.js +74 -0
- package/resources/order-profiles/cheques.js.map +1 -0
- package/resources/order-profiles/cheques.mjs +69 -0
- package/resources/order-profiles/cheques.mjs.map +1 -0
- package/resources/order-profiles/index.d.ts +6 -0
- package/resources/order-profiles/index.d.ts.map +1 -0
- package/resources/order-profiles/index.js +19 -0
- package/resources/order-profiles/index.js.map +1 -0
- package/resources/order-profiles/index.mjs +7 -0
- package/resources/order-profiles/index.mjs.map +1 -0
- package/resources/order-profiles/letters.d.ts +647 -0
- package/resources/order-profiles/letters.d.ts.map +1 -0
- package/resources/order-profiles/letters.js +80 -0
- package/resources/order-profiles/letters.js.map +1 -0
- package/resources/order-profiles/letters.mjs +75 -0
- package/resources/order-profiles/letters.mjs.map +1 -0
- package/resources/order-profiles/order-profiles.d.ts +22 -0
- package/resources/order-profiles/order-profiles.d.ts.map +1 -0
- package/resources/order-profiles/order-profiles.js +55 -0
- package/resources/order-profiles/order-profiles.js.map +1 -0
- package/resources/order-profiles/order-profiles.mjs +28 -0
- package/resources/order-profiles/order-profiles.mjs.map +1 -0
- package/resources/order-profiles/postcards.d.ts +423 -0
- package/resources/order-profiles/postcards.d.ts.map +1 -0
- package/resources/order-profiles/postcards.js +73 -0
- package/resources/order-profiles/postcards.js.map +1 -0
- package/resources/order-profiles/postcards.mjs +68 -0
- package/resources/order-profiles/postcards.mjs.map +1 -0
- package/resources/order-profiles/self-mailers.d.ts +435 -0
- package/resources/order-profiles/self-mailers.d.ts.map +1 -0
- package/resources/order-profiles/self-mailers.js +75 -0
- package/resources/order-profiles/self-mailers.js.map +1 -0
- package/resources/order-profiles/self-mailers.mjs +70 -0
- package/resources/order-profiles/self-mailers.mjs.map +1 -0
- package/resources/order-profiles.d.ts +2 -0
- package/resources/order-profiles.d.ts.map +1 -0
- package/resources/order-profiles.js +19 -0
- package/resources/order-profiles.js.map +1 -0
- package/resources/order-profiles.mjs +3 -0
- package/resources/order-profiles.mjs.map +1 -0
- package/resources/postcards.d.ts +58 -8
- package/resources/postcards.d.ts.map +1 -1
- package/resources/postcards.js +26 -0
- package/resources/postcards.js.map +1 -1
- package/resources/postcards.mjs +26 -0
- package/resources/postcards.mjs.map +1 -1
- package/resources/reports/exports.d.ts +36 -3
- package/resources/reports/exports.d.ts.map +1 -1
- package/resources/reports/exports.js +27 -0
- package/resources/reports/exports.js.map +1 -1
- package/resources/reports/exports.mjs +27 -0
- package/resources/reports/exports.mjs.map +1 -1
- package/resources/reports/reports.d.ts +76 -8
- package/resources/reports/reports.d.ts.map +1 -1
- package/resources/reports/reports.js +44 -0
- package/resources/reports/reports.js.map +1 -1
- package/resources/reports/reports.mjs +44 -0
- package/resources/reports/reports.mjs.map +1 -1
- package/resources/self-mailers.d.ts +99 -15
- package/resources/self-mailers.d.ts.map +1 -1
- package/resources/self-mailers.js +38 -0
- package/resources/self-mailers.js.map +1 -1
- package/resources/self-mailers.mjs +38 -0
- package/resources/self-mailers.mjs.map +1 -1
- package/resources/shared.d.ts +6 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/sub-organizations.d.ts +394 -0
- package/resources/sub-organizations.d.ts.map +1 -0
- package/resources/sub-organizations.js +63 -0
- package/resources/sub-organizations.js.map +1 -0
- package/resources/sub-organizations.mjs +58 -0
- package/resources/sub-organizations.mjs.map +1 -0
- package/resources/templates.d.ts +43 -3
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +26 -0
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +26 -0
- package/resources/templates.mjs.map +1 -1
- package/src/core.ts +17 -8
- package/src/index.ts +112 -11
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/pagination.ts +6 -1
- package/src/resource.ts +1 -1
- package/src/resources/bank-accounts.ts +57 -4
- package/src/resources/boxes.ts +50 -15
- package/src/resources/campaigns.ts +7 -7
- package/src/resources/cheques/cheques.ts +35 -4
- package/src/resources/cheques/url.ts +5 -0
- package/src/resources/cheques/with-deposit-ready-pdf.ts +6 -0
- package/src/resources/contacts.ts +31 -3
- package/src/resources/index.ts +39 -0
- package/src/resources/letters.ts +38 -6
- package/src/resources/mailing-list-imports.ts +1076 -0
- package/src/resources/mailing-lists.ts +511 -0
- package/src/resources/order-profiles/cheques.ts +888 -0
- package/src/resources/order-profiles/index.ts +55 -0
- package/src/resources/order-profiles/letters.ts +956 -0
- package/src/resources/order-profiles/order-profiles.ts +133 -0
- package/src/resources/order-profiles/postcards.ts +694 -0
- package/src/resources/order-profiles/self-mailers.ts +707 -0
- package/src/resources/order-profiles.ts +3 -0
- package/src/resources/postcards.ts +42 -8
- package/src/resources/reports/exports.ts +30 -3
- package/src/resources/reports/reports.ts +60 -8
- package/src/resources/self-mailers.ts +80 -14
- package/src/resources/shared.ts +2 -2
- package/src/resources/sub-organizations.ts +518 -0
- package/src/resources/templates.ts +37 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -40,6 +40,19 @@ export class Cheques extends APIResource {
|
|
|
40
40
|
* }
|
|
41
41
|
* }
|
|
42
42
|
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const cheque = await client.cheques.create({
|
|
47
|
+
* amount: 1000,
|
|
48
|
+
* bankAccount: 'bank_123',
|
|
49
|
+
* from: 'contact_123',
|
|
50
|
+
* to: 'contact_123',
|
|
51
|
+
* currencyCode: 'USD',
|
|
52
|
+
* number: 123456,
|
|
53
|
+
* size: 'us_letter',
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
43
56
|
*/
|
|
44
57
|
create(body: ChequeCreateParams, options?: Core.RequestOptions): Core.APIPromise<Cheque> {
|
|
45
58
|
return this._client.post('/cheques', { body, ...options });
|
|
@@ -47,6 +60,11 @@ export class Cheques extends APIResource {
|
|
|
47
60
|
|
|
48
61
|
/**
|
|
49
62
|
* Retrieve a cheque by ID.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const cheque = await client.cheques.retrieve('id');
|
|
67
|
+
* ```
|
|
50
68
|
*/
|
|
51
69
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Cheque> {
|
|
52
70
|
return this._client.get(`/cheques/${id}`, options);
|
|
@@ -54,6 +72,14 @@ export class Cheques extends APIResource {
|
|
|
54
72
|
|
|
55
73
|
/**
|
|
56
74
|
* Get a list of cheques.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* // Automatically fetches more pages as needed.
|
|
79
|
+
* for await (const cheque of client.cheques.list()) {
|
|
80
|
+
* // ...
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
57
83
|
*/
|
|
58
84
|
list(query?: ChequeListParams, options?: Core.RequestOptions): Core.PagePromise<ChequesList, Cheque>;
|
|
59
85
|
list(options?: Core.RequestOptions): Core.PagePromise<ChequesList, Cheque>;
|
|
@@ -69,6 +95,11 @@ export class Cheques extends APIResource {
|
|
|
69
95
|
|
|
70
96
|
/**
|
|
71
97
|
* Cancel a cheque by ID. Note that this operation cannot be undone.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const cheque = await client.cheques.cancel('id');
|
|
102
|
+
* ```
|
|
72
103
|
*/
|
|
73
104
|
cancel(id: string, options?: Core.RequestOptions): Core.APIPromise<Cheque> {
|
|
74
105
|
return this._client.delete(`/cheques/${id}`, options);
|
|
@@ -246,7 +277,7 @@ export interface Cheque {
|
|
|
246
277
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
247
278
|
* PDFs uploaded with the order.
|
|
248
279
|
*/
|
|
249
|
-
mergeVariables?:
|
|
280
|
+
mergeVariables?: { [key: string]: unknown };
|
|
250
281
|
|
|
251
282
|
/**
|
|
252
283
|
* The message of the cheque.
|
|
@@ -256,7 +287,7 @@ export interface Cheque {
|
|
|
256
287
|
/**
|
|
257
288
|
* See the section on Metadata.
|
|
258
289
|
*/
|
|
259
|
-
metadata?:
|
|
290
|
+
metadata?: { [key: string]: unknown };
|
|
260
291
|
|
|
261
292
|
/**
|
|
262
293
|
* The number of the cheque. If you don't provide this, it will automatically be
|
|
@@ -410,7 +441,7 @@ export interface ChequeCreateParams {
|
|
|
410
441
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
411
442
|
* PDFs uploaded with the order.
|
|
412
443
|
*/
|
|
413
|
-
mergeVariables?:
|
|
444
|
+
mergeVariables?: { [key: string]: unknown };
|
|
414
445
|
|
|
415
446
|
/**
|
|
416
447
|
* The message of the cheque.
|
|
@@ -420,7 +451,7 @@ export interface ChequeCreateParams {
|
|
|
420
451
|
/**
|
|
421
452
|
* See the section on Metadata.
|
|
422
453
|
*/
|
|
423
|
-
metadata?:
|
|
454
|
+
metadata?: { [key: string]: unknown };
|
|
424
455
|
|
|
425
456
|
/**
|
|
426
457
|
* The number of the cheque. If you don't provide this, it will automatically be
|
|
@@ -11,6 +11,11 @@ export class URL extends APIResource {
|
|
|
11
11
|
* offers document generation and hosting capabilities. This endpoint has a much
|
|
12
12
|
* higher rate limit than the regular order retrieval endpoint, so it is suitable
|
|
13
13
|
* for customer-facing use-cases.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const url = await client.cheques.url.retrieve('id');
|
|
18
|
+
* ```
|
|
14
19
|
*/
|
|
15
20
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<URLRetrieveResponse> {
|
|
16
21
|
return this._client.get(`/cheques/${id}/url`, options);
|
|
@@ -10,6 +10,12 @@ export class WithDepositReadyPdf extends APIResource {
|
|
|
10
10
|
* be called by users with 'Admin' role. In test mode, the preview PDF of the
|
|
11
11
|
* digitalOnly cheque and the deposit-ready PDF are the same. In live mode, the
|
|
12
12
|
* deposit-ready will have the full account number.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const cheque =
|
|
17
|
+
* await client.cheques.withDepositReadyPdf.retrieve('id');
|
|
18
|
+
* ```
|
|
13
19
|
*/
|
|
14
20
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ChequesAPI.Cheque> {
|
|
15
21
|
return this._client.get(`/cheques/${id}/with_deposit_ready_pdf`, options);
|
|
@@ -20,6 +20,16 @@ export class Contacts extends APIResource {
|
|
|
20
20
|
* _Note that if you create a contact that has identical information to another
|
|
21
21
|
* contact, this will simply update the description of the existing contact and
|
|
22
22
|
* return it. This avoids creating duplicate contacts._
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const contact = await client.contacts.create({
|
|
27
|
+
* addressLine1: '90 Canal St Suite 600, Boston MA 90210',
|
|
28
|
+
* countryCode: 'US',
|
|
29
|
+
* firstName: 'Kevin',
|
|
30
|
+
* companyName: 'PostGrid',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
23
33
|
*/
|
|
24
34
|
create(body: ContactCreateParams, options?: Core.RequestOptions): Core.APIPromise<Contact> {
|
|
25
35
|
return this._client.post('/contacts', { body, ...options });
|
|
@@ -27,6 +37,11 @@ export class Contacts extends APIResource {
|
|
|
27
37
|
|
|
28
38
|
/**
|
|
29
39
|
* Retrieve a contact.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const contact = await client.contacts.retrieve('id');
|
|
44
|
+
* ```
|
|
30
45
|
*/
|
|
31
46
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Contact> {
|
|
32
47
|
return this._client.get(`/contacts/${id}`, options);
|
|
@@ -34,6 +49,14 @@ export class Contacts extends APIResource {
|
|
|
34
49
|
|
|
35
50
|
/**
|
|
36
51
|
* Get a list of contacts.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* // Automatically fetches more pages as needed.
|
|
56
|
+
* for await (const contact of client.contacts.list()) {
|
|
57
|
+
* // ...
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
37
60
|
*/
|
|
38
61
|
list(query?: ContactListParams, options?: Core.RequestOptions): Core.PagePromise<ContactsList, Contact>;
|
|
39
62
|
list(options?: Core.RequestOptions): Core.PagePromise<ContactsList, Contact>;
|
|
@@ -50,6 +73,11 @@ export class Contacts extends APIResource {
|
|
|
50
73
|
/**
|
|
51
74
|
* Delete a contact. Note that this will not affect orders that were sent to this
|
|
52
75
|
* contact.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const contact = await client.contacts.delete('id');
|
|
80
|
+
* ```
|
|
53
81
|
*/
|
|
54
82
|
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<ContactDeleteResponse> {
|
|
55
83
|
return this._client.delete(`/contacts/${id}`, options);
|
|
@@ -155,7 +183,7 @@ export interface Contact {
|
|
|
155
183
|
/**
|
|
156
184
|
* See the section on Metadata.
|
|
157
185
|
*/
|
|
158
|
-
metadata?:
|
|
186
|
+
metadata?: { [key: string]: unknown };
|
|
159
187
|
|
|
160
188
|
/**
|
|
161
189
|
* Phone number of the contact.
|
|
@@ -256,7 +284,7 @@ export declare namespace ContactCreateParams {
|
|
|
256
284
|
/**
|
|
257
285
|
* See the section on Metadata.
|
|
258
286
|
*/
|
|
259
|
-
metadata?:
|
|
287
|
+
metadata?: { [key: string]: unknown };
|
|
260
288
|
|
|
261
289
|
/**
|
|
262
290
|
* Phone number of the contact.
|
|
@@ -338,7 +366,7 @@ export declare namespace ContactCreateParams {
|
|
|
338
366
|
/**
|
|
339
367
|
* See the section on Metadata.
|
|
340
368
|
*/
|
|
341
|
-
metadata?:
|
|
369
|
+
metadata?: { [key: string]: unknown };
|
|
342
370
|
|
|
343
371
|
/**
|
|
344
372
|
* Phone number of the contact.
|
package/src/resources/index.ts
CHANGED
|
@@ -59,6 +59,33 @@ export {
|
|
|
59
59
|
type LetterCreateParams,
|
|
60
60
|
type LetterListParams,
|
|
61
61
|
} from './letters';
|
|
62
|
+
export {
|
|
63
|
+
MailingListImportListResponsesList,
|
|
64
|
+
MailingListImports,
|
|
65
|
+
type MailingListImportCreateResponse,
|
|
66
|
+
type MailingListImportRetrieveResponse,
|
|
67
|
+
type MailingListImportUpdateResponse,
|
|
68
|
+
type MailingListImportListResponse,
|
|
69
|
+
type MailingListImportDeleteResponse,
|
|
70
|
+
type MailingListImportCreateParams,
|
|
71
|
+
type MailingListImportUpdateParams,
|
|
72
|
+
type MailingListImportListParams,
|
|
73
|
+
} from './mailing-list-imports';
|
|
74
|
+
export {
|
|
75
|
+
MailingListListResponsesList,
|
|
76
|
+
MailingLists,
|
|
77
|
+
type MailingListCreateResponse,
|
|
78
|
+
type MailingListRetrieveResponse,
|
|
79
|
+
type MailingListUpdateResponse,
|
|
80
|
+
type MailingListListResponse,
|
|
81
|
+
type MailingListDeleteResponse,
|
|
82
|
+
type MailingListSubmitJobResponse,
|
|
83
|
+
type MailingListCreateParams,
|
|
84
|
+
type MailingListUpdateParams,
|
|
85
|
+
type MailingListListParams,
|
|
86
|
+
type MailingListSubmitJobParams,
|
|
87
|
+
} from './mailing-lists';
|
|
88
|
+
export { OrderProfiles } from './order-profiles/order-profiles';
|
|
62
89
|
export {
|
|
63
90
|
PostcardsList,
|
|
64
91
|
Postcards,
|
|
@@ -91,9 +118,21 @@ export {
|
|
|
91
118
|
type SelfMailerRetrieveResponse,
|
|
92
119
|
type SelfMailerListResponse,
|
|
93
120
|
type SelfMailerCancelResponse,
|
|
121
|
+
type SelfMailerRetrievePreviewURLResponse,
|
|
94
122
|
type SelfMailerCreateParams,
|
|
95
123
|
type SelfMailerListParams,
|
|
96
124
|
} from './self-mailers';
|
|
125
|
+
export {
|
|
126
|
+
SubOrganizationListResponsesList,
|
|
127
|
+
SubOrganizations,
|
|
128
|
+
type SubOrganizationCreateResponse,
|
|
129
|
+
type SubOrganizationRetrieveResponse,
|
|
130
|
+
type SubOrganizationListResponse,
|
|
131
|
+
type SubOrganizationListUsersResponse,
|
|
132
|
+
type SubOrganizationCreateParams,
|
|
133
|
+
type SubOrganizationListParams,
|
|
134
|
+
type SubOrganizationListUsersParams,
|
|
135
|
+
} from './sub-organizations';
|
|
97
136
|
export {
|
|
98
137
|
TemplatesList,
|
|
99
138
|
Templates,
|
package/src/resources/letters.ts
CHANGED
|
@@ -15,6 +15,15 @@ export class Letters extends APIResource {
|
|
|
15
15
|
* - A template ID for the letter
|
|
16
16
|
* - A URL or file for a PDF for the letter
|
|
17
17
|
* - Upload the aforementioned PDF file via a multipart form upload request
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const letter = await client.letters.create({
|
|
22
|
+
* from: 'contact_123',
|
|
23
|
+
* html: '<html>Content</html>',
|
|
24
|
+
* to: 'contact_123',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
18
27
|
*/
|
|
19
28
|
create(body: LetterCreateParams, options?: Core.RequestOptions): Core.APIPromise<Letter> {
|
|
20
29
|
return this._client.post('/letters', { body, ...options });
|
|
@@ -22,6 +31,11 @@ export class Letters extends APIResource {
|
|
|
22
31
|
|
|
23
32
|
/**
|
|
24
33
|
* Retrieve a letter by ID.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const letter = await client.letters.retrieve('id');
|
|
38
|
+
* ```
|
|
25
39
|
*/
|
|
26
40
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Letter> {
|
|
27
41
|
return this._client.get(`/letters/${id}`, options);
|
|
@@ -29,6 +43,14 @@ export class Letters extends APIResource {
|
|
|
29
43
|
|
|
30
44
|
/**
|
|
31
45
|
* Get a list of letters.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* // Automatically fetches more pages as needed.
|
|
50
|
+
* for await (const letter of client.letters.list()) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
32
54
|
*/
|
|
33
55
|
list(query?: LetterListParams, options?: Core.RequestOptions): Core.PagePromise<LettersList, Letter>;
|
|
34
56
|
list(options?: Core.RequestOptions): Core.PagePromise<LettersList, Letter>;
|
|
@@ -44,6 +66,11 @@ export class Letters extends APIResource {
|
|
|
44
66
|
|
|
45
67
|
/**
|
|
46
68
|
* Cancel a letter by ID. Note that this operation cannot be undone.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const letter = await client.letters.delete('id');
|
|
73
|
+
* ```
|
|
47
74
|
*/
|
|
48
75
|
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<Letter> {
|
|
49
76
|
return this._client.delete(`/letters/${id}`, options);
|
|
@@ -56,6 +83,11 @@ export class Letters extends APIResource {
|
|
|
56
83
|
* offers document generation and hosting capabilities. This endpoint has a much
|
|
57
84
|
* higher rate limit than the regular order retrieval endpoint, so it is suitable
|
|
58
85
|
* for customer-facing use-cases.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const response = await client.letters.url('id');
|
|
90
|
+
* ```
|
|
59
91
|
*/
|
|
60
92
|
url(id: string, options?: Core.RequestOptions): Core.APIPromise<LetterURLResponse> {
|
|
61
93
|
return this._client.get(`/letters/${id}/url`, options);
|
|
@@ -217,12 +249,12 @@ export interface Letter {
|
|
|
217
249
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
218
250
|
* PDFs uploaded with the order.
|
|
219
251
|
*/
|
|
220
|
-
mergeVariables?:
|
|
252
|
+
mergeVariables?: { [key: string]: unknown };
|
|
221
253
|
|
|
222
254
|
/**
|
|
223
255
|
* See the section on Metadata.
|
|
224
256
|
*/
|
|
225
|
-
metadata?:
|
|
257
|
+
metadata?: { [key: string]: unknown };
|
|
226
258
|
|
|
227
259
|
/**
|
|
228
260
|
* The ID of the PDF workflow run that created the letter, if any.
|
|
@@ -492,12 +524,12 @@ export declare namespace LetterCreateParams {
|
|
|
492
524
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
493
525
|
* PDFs uploaded with the order.
|
|
494
526
|
*/
|
|
495
|
-
mergeVariables?:
|
|
527
|
+
mergeVariables?: { [key: string]: unknown };
|
|
496
528
|
|
|
497
529
|
/**
|
|
498
530
|
* See the section on Metadata.
|
|
499
531
|
*/
|
|
500
|
-
metadata?:
|
|
532
|
+
metadata?: { [key: string]: unknown };
|
|
501
533
|
|
|
502
534
|
/**
|
|
503
535
|
* If specified, indicates which letter page is perforated. Currently, only the
|
|
@@ -717,12 +749,12 @@ export declare namespace LetterCreateParams {
|
|
|
717
749
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
718
750
|
* PDFs uploaded with the order.
|
|
719
751
|
*/
|
|
720
|
-
mergeVariables?:
|
|
752
|
+
mergeVariables?: { [key: string]: unknown };
|
|
721
753
|
|
|
722
754
|
/**
|
|
723
755
|
* See the section on Metadata.
|
|
724
756
|
*/
|
|
725
|
-
metadata?:
|
|
757
|
+
metadata?: { [key: string]: unknown };
|
|
726
758
|
|
|
727
759
|
/**
|
|
728
760
|
* If specified, indicates which letter page is perforated. Currently, only the
|