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
|
@@ -16,6 +16,17 @@ export class Postcards extends APIResource {
|
|
|
16
16
|
* - A URL or file for a 2 page PDF where the first page is the front of the
|
|
17
17
|
* postcard and the second page is the back
|
|
18
18
|
* - Upload the aforementioned PDF file via a multipart form upload request
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const postcard = await client.postcards.create({
|
|
23
|
+
* backHTML: '<html>Back</html>',
|
|
24
|
+
* frontHTML: '<html>Front</html>',
|
|
25
|
+
* size: '6x4',
|
|
26
|
+
* to: 'contact_456',
|
|
27
|
+
* from: 'contact_123',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
19
30
|
*/
|
|
20
31
|
create(body: PostcardCreateParams, options?: Core.RequestOptions): Core.APIPromise<Postcard> {
|
|
21
32
|
return this._client.post('/postcards', { body, ...options });
|
|
@@ -23,6 +34,11 @@ export class Postcards extends APIResource {
|
|
|
23
34
|
|
|
24
35
|
/**
|
|
25
36
|
* Retrieve a postcard by ID.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const postcard = await client.postcards.retrieve('id');
|
|
41
|
+
* ```
|
|
26
42
|
*/
|
|
27
43
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Postcard> {
|
|
28
44
|
return this._client.get(`/postcards/${id}`, options);
|
|
@@ -30,6 +46,14 @@ export class Postcards extends APIResource {
|
|
|
30
46
|
|
|
31
47
|
/**
|
|
32
48
|
* Get a list of postcards.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* // Automatically fetches more pages as needed.
|
|
53
|
+
* for await (const postcard of client.postcards.list()) {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
33
57
|
*/
|
|
34
58
|
list(query?: PostcardListParams, options?: Core.RequestOptions): Core.PagePromise<PostcardsList, Postcard>;
|
|
35
59
|
list(options?: Core.RequestOptions): Core.PagePromise<PostcardsList, Postcard>;
|
|
@@ -45,6 +69,11 @@ export class Postcards extends APIResource {
|
|
|
45
69
|
|
|
46
70
|
/**
|
|
47
71
|
* Cancel a postcard by ID. Note that this operation cannot be undone.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const postcard = await client.postcards.delete('id');
|
|
76
|
+
* ```
|
|
48
77
|
*/
|
|
49
78
|
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<Postcard> {
|
|
50
79
|
return this._client.delete(`/postcards/${id}`, options);
|
|
@@ -57,6 +86,11 @@ export class Postcards extends APIResource {
|
|
|
57
86
|
* offers document generation and hosting capabilities. This endpoint has a much
|
|
58
87
|
* higher rate limit than the regular order retrieval endpoint, so it is suitable
|
|
59
88
|
* for customer-facing use-cases.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const response = await client.postcards.url('id');
|
|
93
|
+
* ```
|
|
60
94
|
*/
|
|
61
95
|
url(id: string, options?: Core.RequestOptions): Core.APIPromise<PostcardURLResponse> {
|
|
62
96
|
return this._client.get(`/postcards/${id}/url`, options);
|
|
@@ -187,12 +221,12 @@ export interface Postcard {
|
|
|
187
221
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
188
222
|
* PDFs uploaded with the order.
|
|
189
223
|
*/
|
|
190
|
-
mergeVariables?:
|
|
224
|
+
mergeVariables?: { [key: string]: unknown };
|
|
191
225
|
|
|
192
226
|
/**
|
|
193
227
|
* See the section on Metadata.
|
|
194
228
|
*/
|
|
195
|
-
metadata?:
|
|
229
|
+
metadata?: { [key: string]: unknown };
|
|
196
230
|
|
|
197
231
|
/**
|
|
198
232
|
* The tracking number of this order. Populated after an express/certified order
|
|
@@ -324,12 +358,12 @@ export declare namespace PostcardCreateParams {
|
|
|
324
358
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
325
359
|
* PDFs uploaded with the order.
|
|
326
360
|
*/
|
|
327
|
-
mergeVariables?:
|
|
361
|
+
mergeVariables?: { [key: string]: unknown };
|
|
328
362
|
|
|
329
363
|
/**
|
|
330
364
|
* See the section on Metadata.
|
|
331
365
|
*/
|
|
332
|
-
metadata?:
|
|
366
|
+
metadata?: { [key: string]: unknown };
|
|
333
367
|
|
|
334
368
|
/**
|
|
335
369
|
* This order will transition from `ready` to `printing` on the day after this
|
|
@@ -423,12 +457,12 @@ export declare namespace PostcardCreateParams {
|
|
|
423
457
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
424
458
|
* PDFs uploaded with the order.
|
|
425
459
|
*/
|
|
426
|
-
mergeVariables?:
|
|
460
|
+
mergeVariables?: { [key: string]: unknown };
|
|
427
461
|
|
|
428
462
|
/**
|
|
429
463
|
* See the section on Metadata.
|
|
430
464
|
*/
|
|
431
|
-
metadata?:
|
|
465
|
+
metadata?: { [key: string]: unknown };
|
|
432
466
|
|
|
433
467
|
/**
|
|
434
468
|
* This order will transition from `ready` to `printing` on the day after this
|
|
@@ -508,12 +542,12 @@ export declare namespace PostcardCreateParams {
|
|
|
508
542
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
509
543
|
* PDFs uploaded with the order.
|
|
510
544
|
*/
|
|
511
|
-
mergeVariables?:
|
|
545
|
+
mergeVariables?: { [key: string]: unknown };
|
|
512
546
|
|
|
513
547
|
/**
|
|
514
548
|
* See the section on Metadata.
|
|
515
549
|
*/
|
|
516
|
-
metadata?:
|
|
550
|
+
metadata?: { [key: string]: unknown };
|
|
517
551
|
|
|
518
552
|
/**
|
|
519
553
|
* This order will transition from `ready` to `printing` on the day after this
|
|
@@ -9,6 +9,17 @@ export class Exports extends APIResource {
|
|
|
9
9
|
* asynchronously and generates a downloadable CSV file with the full results. Your
|
|
10
10
|
* queries can run for up to 13 minutes the resulting file can be up to 100mb
|
|
11
11
|
* large.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const _export = await client.reports.exports.create(
|
|
16
|
+
* 'reportID',
|
|
17
|
+
* {
|
|
18
|
+
* description: 'October Orders Export',
|
|
19
|
+
* params: ['2023-10-01T00:00:00Z'],
|
|
20
|
+
* },
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
12
23
|
*/
|
|
13
24
|
create(
|
|
14
25
|
reportId: string,
|
|
@@ -21,6 +32,14 @@ export class Exports extends APIResource {
|
|
|
21
32
|
/**
|
|
22
33
|
* Retrieve the status and details of a specific report export job. Check the
|
|
23
34
|
* `outputURL` property for the download link once generation is complete.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const _export = await client.reports.exports.retrieve(
|
|
39
|
+
* 'reportID',
|
|
40
|
+
* 'exportID',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
24
43
|
*/
|
|
25
44
|
retrieve(
|
|
26
45
|
reportId: string,
|
|
@@ -34,6 +53,14 @@ export class Exports extends APIResource {
|
|
|
34
53
|
* Delete a completed or failed report export job and its associated output file
|
|
35
54
|
* (if any). This action cannot be undone. You cannot delete an export that is
|
|
36
55
|
* still generating.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const _export = await client.reports.exports.delete(
|
|
60
|
+
* 'reportID',
|
|
61
|
+
* 'exportID',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
37
64
|
*/
|
|
38
65
|
delete(
|
|
39
66
|
reportId: string,
|
|
@@ -91,7 +118,7 @@ export interface ExportCreateResponse {
|
|
|
91
118
|
/**
|
|
92
119
|
* Optional key-value metadata associated with the export.
|
|
93
120
|
*/
|
|
94
|
-
metadata?:
|
|
121
|
+
metadata?: { [key: string]: string };
|
|
95
122
|
|
|
96
123
|
/**
|
|
97
124
|
* A signed URL to download the exported data (CSV format). Available when
|
|
@@ -184,7 +211,7 @@ export interface ExportRetrieveResponse {
|
|
|
184
211
|
/**
|
|
185
212
|
* Optional key-value metadata associated with the export.
|
|
186
213
|
*/
|
|
187
|
-
metadata?:
|
|
214
|
+
metadata?: { [key: string]: string };
|
|
188
215
|
|
|
189
216
|
/**
|
|
190
217
|
* A signed URL to download the exported data (CSV format). Available when
|
|
@@ -254,7 +281,7 @@ export interface ExportCreateParams {
|
|
|
254
281
|
/**
|
|
255
282
|
* Optional key-value metadata associated with the export.
|
|
256
283
|
*/
|
|
257
|
-
metadata?:
|
|
284
|
+
metadata?: { [key: string]: string };
|
|
258
285
|
|
|
259
286
|
/**
|
|
260
287
|
* Optional parameters to bind to the SQL query of the associated report.
|
|
@@ -22,6 +22,16 @@ export class Reports extends APIResource {
|
|
|
22
22
|
*
|
|
23
23
|
* If you just want to do ad-hoc queries, you should use the `/reports/samples`
|
|
24
24
|
* endpoint.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const report = await client.reports.create({
|
|
29
|
+
* sqlQuery:
|
|
30
|
+
* 'SELECT id, status FROM orders WHERE created_at > ?',
|
|
31
|
+
* description: 'Recent Orders',
|
|
32
|
+
* metadata: { team: 'Sales' },
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
25
35
|
*/
|
|
26
36
|
create(body: ReportCreateParams, options?: Core.RequestOptions): Core.APIPromise<ReportCreateResponse> {
|
|
27
37
|
return this._client.post('/reports/', { body, ...options });
|
|
@@ -29,6 +39,11 @@ export class Reports extends APIResource {
|
|
|
29
39
|
|
|
30
40
|
/**
|
|
31
41
|
* Retrieve the details of a specific saved report by its ID.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const report = await client.reports.retrieve('id');
|
|
46
|
+
* ```
|
|
32
47
|
*/
|
|
33
48
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ReportRetrieveResponse> {
|
|
34
49
|
return this._client.get(`/reports/${id}`, options);
|
|
@@ -37,6 +52,13 @@ export class Reports extends APIResource {
|
|
|
37
52
|
/**
|
|
38
53
|
* Update an existing saved report definition. You can change the query,
|
|
39
54
|
* description, or metadata.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const report = await client.reports.update('id', {
|
|
59
|
+
* description: 'Recent Orders (Updated)',
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
40
62
|
*/
|
|
41
63
|
update(
|
|
42
64
|
id: string,
|
|
@@ -48,6 +70,14 @@ export class Reports extends APIResource {
|
|
|
48
70
|
|
|
49
71
|
/**
|
|
50
72
|
* Retrieve a list of saved reports for your organization.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* // Automatically fetches more pages as needed.
|
|
77
|
+
* for await (const reportListResponse of client.reports.list()) {
|
|
78
|
+
* // ...
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
51
81
|
*/
|
|
52
82
|
list(
|
|
53
83
|
query?: ReportListParams,
|
|
@@ -67,6 +97,11 @@ export class Reports extends APIResource {
|
|
|
67
97
|
/**
|
|
68
98
|
* Delete a saved report definition. This action cannot be undone. Associated
|
|
69
99
|
* exports are not automatically deleted.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const report = await client.reports.delete('id');
|
|
104
|
+
* ```
|
|
70
105
|
*/
|
|
71
106
|
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<ReportDeleteResponse> {
|
|
72
107
|
return this._client.delete(`/reports/${id}`, options);
|
|
@@ -76,6 +111,15 @@ export class Reports extends APIResource {
|
|
|
76
111
|
* Run an ad-hoc SQL query against your data lake and get a sample of the results.
|
|
77
112
|
* This is useful for quickly testing queries without saving them as a report. The
|
|
78
113
|
* query execution time and result size are limited.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const response = await client.reports.runAdHocQuery({
|
|
118
|
+
* sqlQuery: 'SELECT id FROM contacts LIMIT 5',
|
|
119
|
+
* limit: 5,
|
|
120
|
+
* params: [],
|
|
121
|
+
* });
|
|
122
|
+
* ```
|
|
79
123
|
*/
|
|
80
124
|
runAdHocQuery(
|
|
81
125
|
body: ReportRunAdHocQueryParams,
|
|
@@ -89,6 +133,14 @@ export class Reports extends APIResource {
|
|
|
89
133
|
* This allows getting up to 1000 rows of resutls but the runtime of the query is
|
|
90
134
|
* limited to 30 seconds. If you need more rows or longer runtime, you should
|
|
91
135
|
* create an export from this report.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const response = await client.reports.sample('id', {
|
|
140
|
+
* limit: 10,
|
|
141
|
+
* params: ['2023-10-01T00:00:00Z'],
|
|
142
|
+
* });
|
|
143
|
+
* ```
|
|
92
144
|
*/
|
|
93
145
|
sample(
|
|
94
146
|
id: string,
|
|
@@ -143,7 +195,7 @@ export interface ReportCreateResponse {
|
|
|
143
195
|
/**
|
|
144
196
|
* Optional key-value metadata associated with the report.
|
|
145
197
|
*/
|
|
146
|
-
metadata?:
|
|
198
|
+
metadata?: { [key: string]: string };
|
|
147
199
|
}
|
|
148
200
|
|
|
149
201
|
/**
|
|
@@ -188,7 +240,7 @@ export interface ReportRetrieveResponse {
|
|
|
188
240
|
/**
|
|
189
241
|
* Optional key-value metadata associated with the report.
|
|
190
242
|
*/
|
|
191
|
-
metadata?:
|
|
243
|
+
metadata?: { [key: string]: string };
|
|
192
244
|
}
|
|
193
245
|
|
|
194
246
|
/**
|
|
@@ -233,7 +285,7 @@ export interface ReportUpdateResponse {
|
|
|
233
285
|
/**
|
|
234
286
|
* Optional key-value metadata associated with the report.
|
|
235
287
|
*/
|
|
236
|
-
metadata?:
|
|
288
|
+
metadata?: { [key: string]: string };
|
|
237
289
|
}
|
|
238
290
|
|
|
239
291
|
/**
|
|
@@ -278,7 +330,7 @@ export interface ReportListResponse {
|
|
|
278
330
|
/**
|
|
279
331
|
* Optional key-value metadata associated with the report.
|
|
280
332
|
*/
|
|
281
|
-
metadata?:
|
|
333
|
+
metadata?: { [key: string]: string };
|
|
282
334
|
}
|
|
283
335
|
|
|
284
336
|
/**
|
|
@@ -308,7 +360,7 @@ export interface ReportRunAdHocQueryResponse {
|
|
|
308
360
|
/**
|
|
309
361
|
* The actual data records returned by the sample query.
|
|
310
362
|
*/
|
|
311
|
-
records: Array<
|
|
363
|
+
records: Array<{ [key: string]: unknown }>;
|
|
312
364
|
|
|
313
365
|
/**
|
|
314
366
|
* The ID of the report this sample was generated from, or null for ad-hoc samples.
|
|
@@ -328,7 +380,7 @@ export interface ReportSampleResponse {
|
|
|
328
380
|
/**
|
|
329
381
|
* The actual data records returned by the sample query.
|
|
330
382
|
*/
|
|
331
|
-
records: Array<
|
|
383
|
+
records: Array<{ [key: string]: unknown }>;
|
|
332
384
|
|
|
333
385
|
/**
|
|
334
386
|
* The ID of the report this sample was generated from, or null for ad-hoc samples.
|
|
@@ -350,7 +402,7 @@ export interface ReportCreateParams {
|
|
|
350
402
|
/**
|
|
351
403
|
* Optional key-value metadata associated with the report.
|
|
352
404
|
*/
|
|
353
|
-
metadata?:
|
|
405
|
+
metadata?: { [key: string]: string };
|
|
354
406
|
}
|
|
355
407
|
|
|
356
408
|
export interface ReportUpdateParams {
|
|
@@ -362,7 +414,7 @@ export interface ReportUpdateParams {
|
|
|
362
414
|
/**
|
|
363
415
|
* Optional key-value metadata associated with the report. Set to null to remove.
|
|
364
416
|
*/
|
|
365
|
-
metadata?:
|
|
417
|
+
metadata?: { [key: string]: string } | null;
|
|
366
418
|
|
|
367
419
|
/**
|
|
368
420
|
* The SQL query defining the report.
|
|
@@ -16,6 +16,17 @@ export class SelfMailers extends APIResource {
|
|
|
16
16
|
* - A URL or file for a 2 page PDF where the first page is the outside of the
|
|
17
17
|
* self-mailer and the second page is the inside
|
|
18
18
|
* - Upload the aforementioned PDF file via a multipart form upload request
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const selfMailer = await client.selfMailers.create({
|
|
23
|
+
* from: 'contact_123',
|
|
24
|
+
* insideHTML: '<html>Inside</html>',
|
|
25
|
+
* outsideHTML: '<html>Outside</html>',
|
|
26
|
+
* size: '8.5x11_bifold',
|
|
27
|
+
* to: 'contact_456',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
19
30
|
*/
|
|
20
31
|
create(
|
|
21
32
|
body: SelfMailerCreateParams,
|
|
@@ -26,6 +37,11 @@ export class SelfMailers extends APIResource {
|
|
|
26
37
|
|
|
27
38
|
/**
|
|
28
39
|
* Retrieve a self-mailer by ID.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const selfMailer = await client.selfMailers.retrieve('id');
|
|
44
|
+
* ```
|
|
29
45
|
*/
|
|
30
46
|
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<SelfMailerRetrieveResponse> {
|
|
31
47
|
return this._client.get(`/self_mailers/${id}`, options);
|
|
@@ -33,6 +49,14 @@ export class SelfMailers extends APIResource {
|
|
|
33
49
|
|
|
34
50
|
/**
|
|
35
51
|
* Get a list of self-mailers.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* // Automatically fetches more pages as needed.
|
|
56
|
+
* for await (const selfMailerListResponse of client.selfMailers.list()) {
|
|
57
|
+
* // ...
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
36
60
|
*/
|
|
37
61
|
list(
|
|
38
62
|
query?: SelfMailerListParams,
|
|
@@ -51,10 +75,36 @@ export class SelfMailers extends APIResource {
|
|
|
51
75
|
|
|
52
76
|
/**
|
|
53
77
|
* Cancel a self-mailer by ID. Note that this operation cannot be undone.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const response = await client.selfMailers.cancel('id');
|
|
82
|
+
* ```
|
|
54
83
|
*/
|
|
55
84
|
cancel(id: string, options?: Core.RequestOptions): Core.APIPromise<SelfMailerCancelResponse> {
|
|
56
85
|
return this._client.delete(`/self_mailers/${id}`, options);
|
|
57
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve a self-mailer preview URL.
|
|
90
|
+
*
|
|
91
|
+
* This is only available for customers with our document management addon, which
|
|
92
|
+
* offers document generation and hosting capabilities. This endpoint has a much
|
|
93
|
+
* higher rate limit than the regular order retrieval endpoint, so it is suitable
|
|
94
|
+
* for customer-facing use-cases.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const response =
|
|
99
|
+
* await client.selfMailers.retrievePreviewURL('id');
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
retrievePreviewURL(
|
|
103
|
+
id: string,
|
|
104
|
+
options?: Core.RequestOptions,
|
|
105
|
+
): Core.APIPromise<SelfMailerRetrievePreviewURLResponse> {
|
|
106
|
+
return this._client.get(`/self_mailers/${id}/url`, options);
|
|
107
|
+
}
|
|
58
108
|
}
|
|
59
109
|
|
|
60
110
|
export class SelfMailerListResponsesList extends List<SelfMailerListResponse> {}
|
|
@@ -181,12 +231,12 @@ export interface SelfMailerCreateResponse {
|
|
|
181
231
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
182
232
|
* PDFs uploaded with the order.
|
|
183
233
|
*/
|
|
184
|
-
mergeVariables?:
|
|
234
|
+
mergeVariables?: { [key: string]: unknown };
|
|
185
235
|
|
|
186
236
|
/**
|
|
187
237
|
* See the section on Metadata.
|
|
188
238
|
*/
|
|
189
|
-
metadata?:
|
|
239
|
+
metadata?: { [key: string]: unknown };
|
|
190
240
|
|
|
191
241
|
/**
|
|
192
242
|
* The tracking number of this order. Populated after an express/certified order
|
|
@@ -329,12 +379,12 @@ export interface SelfMailerRetrieveResponse {
|
|
|
329
379
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
330
380
|
* PDFs uploaded with the order.
|
|
331
381
|
*/
|
|
332
|
-
mergeVariables?:
|
|
382
|
+
mergeVariables?: { [key: string]: unknown };
|
|
333
383
|
|
|
334
384
|
/**
|
|
335
385
|
* See the section on Metadata.
|
|
336
386
|
*/
|
|
337
|
-
metadata?:
|
|
387
|
+
metadata?: { [key: string]: unknown };
|
|
338
388
|
|
|
339
389
|
/**
|
|
340
390
|
* The tracking number of this order. Populated after an express/certified order
|
|
@@ -477,12 +527,12 @@ export interface SelfMailerListResponse {
|
|
|
477
527
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
478
528
|
* PDFs uploaded with the order.
|
|
479
529
|
*/
|
|
480
|
-
mergeVariables?:
|
|
530
|
+
mergeVariables?: { [key: string]: unknown };
|
|
481
531
|
|
|
482
532
|
/**
|
|
483
533
|
* See the section on Metadata.
|
|
484
534
|
*/
|
|
485
|
-
metadata?:
|
|
535
|
+
metadata?: { [key: string]: unknown };
|
|
486
536
|
|
|
487
537
|
/**
|
|
488
538
|
* The tracking number of this order. Populated after an express/certified order
|
|
@@ -625,12 +675,12 @@ export interface SelfMailerCancelResponse {
|
|
|
625
675
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
626
676
|
* PDFs uploaded with the order.
|
|
627
677
|
*/
|
|
628
|
-
mergeVariables?:
|
|
678
|
+
mergeVariables?: { [key: string]: unknown };
|
|
629
679
|
|
|
630
680
|
/**
|
|
631
681
|
* See the section on Metadata.
|
|
632
682
|
*/
|
|
633
|
-
metadata?:
|
|
683
|
+
metadata?: { [key: string]: unknown };
|
|
634
684
|
|
|
635
685
|
/**
|
|
636
686
|
* The tracking number of this order. Populated after an express/certified order
|
|
@@ -651,6 +701,21 @@ export interface SelfMailerCancelResponse {
|
|
|
651
701
|
url?: string;
|
|
652
702
|
}
|
|
653
703
|
|
|
704
|
+
export interface SelfMailerRetrievePreviewURLResponse {
|
|
705
|
+
/**
|
|
706
|
+
* A unique ID prefixed with self*mailer*
|
|
707
|
+
*/
|
|
708
|
+
id: string;
|
|
709
|
+
|
|
710
|
+
object: string;
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* A signed URL linking to the order preview PDF. The link remains valid for 15
|
|
714
|
+
* minutes from the time of the API call.
|
|
715
|
+
*/
|
|
716
|
+
url: string;
|
|
717
|
+
}
|
|
718
|
+
|
|
654
719
|
export type SelfMailerCreateParams =
|
|
655
720
|
| SelfMailerCreateParams.SelfMailerCreateWithHTML
|
|
656
721
|
| SelfMailerCreateParams.SelfMailerCreateWithTemplate
|
|
@@ -734,12 +799,12 @@ export declare namespace SelfMailerCreateParams {
|
|
|
734
799
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
735
800
|
* PDFs uploaded with the order.
|
|
736
801
|
*/
|
|
737
|
-
mergeVariables?:
|
|
802
|
+
mergeVariables?: { [key: string]: unknown };
|
|
738
803
|
|
|
739
804
|
/**
|
|
740
805
|
* See the section on Metadata.
|
|
741
806
|
*/
|
|
742
|
-
metadata?:
|
|
807
|
+
metadata?: { [key: string]: unknown };
|
|
743
808
|
|
|
744
809
|
/**
|
|
745
810
|
* This order will transition from `ready` to `printing` on the day after this
|
|
@@ -833,12 +898,12 @@ export declare namespace SelfMailerCreateParams {
|
|
|
833
898
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
834
899
|
* PDFs uploaded with the order.
|
|
835
900
|
*/
|
|
836
|
-
mergeVariables?:
|
|
901
|
+
mergeVariables?: { [key: string]: unknown };
|
|
837
902
|
|
|
838
903
|
/**
|
|
839
904
|
* See the section on Metadata.
|
|
840
905
|
*/
|
|
841
|
-
metadata?:
|
|
906
|
+
metadata?: { [key: string]: unknown };
|
|
842
907
|
|
|
843
908
|
/**
|
|
844
909
|
* This order will transition from `ready` to `printing` on the day after this
|
|
@@ -917,12 +982,12 @@ export declare namespace SelfMailerCreateParams {
|
|
|
917
982
|
* template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
|
|
918
983
|
* PDFs uploaded with the order.
|
|
919
984
|
*/
|
|
920
|
-
mergeVariables?:
|
|
985
|
+
mergeVariables?: { [key: string]: unknown };
|
|
921
986
|
|
|
922
987
|
/**
|
|
923
988
|
* See the section on Metadata.
|
|
924
989
|
*/
|
|
925
|
-
metadata?:
|
|
990
|
+
metadata?: { [key: string]: unknown };
|
|
926
991
|
|
|
927
992
|
/**
|
|
928
993
|
* This order will transition from `ready` to `printing` on the day after this
|
|
@@ -951,6 +1016,7 @@ export declare namespace SelfMailers {
|
|
|
951
1016
|
type SelfMailerRetrieveResponse as SelfMailerRetrieveResponse,
|
|
952
1017
|
type SelfMailerListResponse as SelfMailerListResponse,
|
|
953
1018
|
type SelfMailerCancelResponse as SelfMailerCancelResponse,
|
|
1019
|
+
type SelfMailerRetrievePreviewURLResponse as SelfMailerRetrievePreviewURLResponse,
|
|
954
1020
|
SelfMailerListResponsesList as SelfMailerListResponsesList,
|
|
955
1021
|
type SelfMailerCreateParams as SelfMailerCreateParams,
|
|
956
1022
|
type SelfMailerListParams as SelfMailerListParams,
|
package/src/resources/shared.ts
CHANGED
|
@@ -75,7 +75,7 @@ export interface ContactCreateWithCompanyName {
|
|
|
75
75
|
/**
|
|
76
76
|
* See the section on Metadata.
|
|
77
77
|
*/
|
|
78
|
-
metadata?:
|
|
78
|
+
metadata?: { [key: string]: unknown };
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* Phone number of the contact.
|
|
@@ -157,7 +157,7 @@ export interface ContactCreateWithFirstName {
|
|
|
157
157
|
/**
|
|
158
158
|
* See the section on Metadata.
|
|
159
159
|
*/
|
|
160
|
-
metadata?:
|
|
160
|
+
metadata?: { [key: string]: unknown };
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* Phone number of the contact.
|