postgrid-node 0.1.0-alpha.1
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 +19 -0
- package/LICENSE +201 -0
- package/README.md +346 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +914 -0
- package/core.js.map +1 -0
- package/core.mjs +882 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +144 -0
- package/index.d.ts +144 -0
- package/index.d.ts.map +1 -0
- package/index.js +161 -0
- package/index.js.map +1 -0
- package/index.mjs +118 -0
- package/index.mjs.map +1 -0
- package/package.json +124 -0
- package/pagination.d.ts +24 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +45 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +41 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/bank-accounts.d.ts +285 -0
- package/resources/bank-accounts.d.ts.map +1 -0
- package/resources/bank-accounts.js +45 -0
- package/resources/bank-accounts.js.map +1 -0
- package/resources/bank-accounts.mjs +40 -0
- package/resources/bank-accounts.mjs.map +1 -0
- package/resources/boxes.d.ts +683 -0
- package/resources/boxes.d.ts.map +1 -0
- package/resources/boxes.js +54 -0
- package/resources/boxes.js.map +1 -0
- package/resources/boxes.mjs +49 -0
- package/resources/boxes.mjs.map +1 -0
- package/resources/campaigns.d.ts +644 -0
- package/resources/campaigns.d.ts.map +1 -0
- package/resources/campaigns.js +67 -0
- package/resources/campaigns.js.map +1 -0
- package/resources/campaigns.mjs +62 -0
- package/resources/campaigns.mjs.map +1 -0
- package/resources/cheques/cheques.d.ts +349 -0
- package/resources/cheques/cheques.d.ts.map +1 -0
- package/resources/cheques/cheques.js +95 -0
- package/resources/cheques/cheques.js.map +1 -0
- package/resources/cheques/cheques.mjs +67 -0
- package/resources/cheques/cheques.mjs.map +1 -0
- package/resources/cheques/index.d.ts +4 -0
- package/resources/cheques/index.d.ts.map +1 -0
- package/resources/cheques/index.js +12 -0
- package/resources/cheques/index.js.map +1 -0
- package/resources/cheques/index.mjs +5 -0
- package/resources/cheques/index.mjs.map +1 -0
- package/resources/cheques/url.d.ts +29 -0
- package/resources/cheques/url.d.ts.map +1 -0
- package/resources/cheques/url.js +20 -0
- package/resources/cheques/url.js.map +1 -0
- package/resources/cheques/url.mjs +16 -0
- package/resources/cheques/url.mjs.map +1 -0
- package/resources/cheques/with-deposit-ready-pdf.d.ts +13 -0
- package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -0
- package/resources/cheques/with-deposit-ready-pdf.js +18 -0
- package/resources/cheques/with-deposit-ready-pdf.js.map +1 -0
- package/resources/cheques/with-deposit-ready-pdf.mjs +14 -0
- package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -0
- package/resources/contacts.d.ts +295 -0
- package/resources/contacts.d.ts.map +1 -0
- package/resources/contacts.js +52 -0
- package/resources/contacts.js.map +1 -0
- package/resources/contacts.mjs +47 -0
- package/resources/contacts.mjs.map +1 -0
- package/resources/index.d.ts +12 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +50 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +13 -0
- package/resources/index.mjs.map +1 -0
- package/resources/letters.d.ts +639 -0
- package/resources/letters.d.ts.map +1 -0
- package/resources/letters.js +55 -0
- package/resources/letters.js.map +1 -0
- package/resources/letters.mjs +50 -0
- package/resources/letters.mjs.map +1 -0
- package/resources/postcards.d.ts +346 -0
- package/resources/postcards.d.ts.map +1 -0
- package/resources/postcards.js +56 -0
- package/resources/postcards.js.map +1 -0
- package/resources/postcards.mjs +51 -0
- package/resources/postcards.mjs.map +1 -0
- package/resources/reports/exports.d.ts +207 -0
- package/resources/reports/exports.d.ts.map +1 -0
- package/resources/reports/exports.js +33 -0
- package/resources/reports/exports.js.map +1 -0
- package/resources/reports/exports.mjs +29 -0
- package/resources/reports/exports.mjs.map +1 -0
- package/resources/reports/index.d.ts +4 -0
- package/resources/reports/index.d.ts.map +1 -0
- package/resources/reports/index.js +12 -0
- package/resources/reports/index.js.map +1 -0
- package/resources/reports/index.mjs +5 -0
- package/resources/reports/index.mjs.map +1 -0
- package/resources/reports/reports.d.ts +245 -0
- package/resources/reports/reports.d.ts.map +1 -0
- package/resources/reports/reports.js +85 -0
- package/resources/reports/reports.js.map +1 -0
- package/resources/reports/reports.mjs +57 -0
- package/resources/reports/reports.mjs.map +1 -0
- package/resources/reports/samples.d.ts +81 -0
- package/resources/reports/samples.d.ts.map +1 -0
- package/resources/reports/samples.js +26 -0
- package/resources/reports/samples.js.map +1 -0
- package/resources/reports/samples.mjs +22 -0
- package/resources/reports/samples.mjs.map +1 -0
- package/resources/self-mailers.d.ts +622 -0
- package/resources/self-mailers.d.ts.map +1 -0
- package/resources/self-mailers.js +45 -0
- package/resources/self-mailers.js.map +1 -0
- package/resources/self-mailers.mjs +40 -0
- package/resources/self-mailers.mjs.map +1 -0
- package/resources/shared.d.ts +147 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/templates.d.ts +126 -0
- package/resources/templates.d.ts.map +1 -0
- package/resources/templates.js +46 -0
- package/resources/templates.js.map +1 -0
- package/resources/templates.mjs +41 -0
- package/resources/templates.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +428 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +69 -0
- package/src/resource.ts +11 -0
- package/src/resources/bank-accounts.ts +382 -0
- package/src/resources/boxes.ts +982 -0
- package/src/resources/campaigns.ts +853 -0
- package/src/resources/cheques/cheques.ts +493 -0
- package/src/resources/cheques/index.ts +12 -0
- package/src/resources/cheques/url.ts +37 -0
- package/src/resources/cheques/with-deposit-ready-pdf.ts +17 -0
- package/src/resources/contacts.ts +387 -0
- package/src/resources/index.ts +102 -0
- package/src/resources/letters.ts +870 -0
- package/src/resources/postcards.ts +548 -0
- package/src/resources/reports/exports.ts +272 -0
- package/src/resources/reports/index.ts +28 -0
- package/src/resources/reports/reports.ts +359 -0
- package/src/resources/reports/samples.ts +109 -0
- package/src/resources/self-mailers.ts +958 -0
- package/src/resources/shared.ts +182 -0
- package/src/resources/templates.ts +184 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export interface Cancellation {
|
|
4
|
+
/**
|
|
5
|
+
* The reason for the cancellation.
|
|
6
|
+
*/
|
|
7
|
+
reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The user ID who cancelled the order.
|
|
11
|
+
*/
|
|
12
|
+
cancelledByUser?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An optional note provided by the user who cancelled the order.
|
|
16
|
+
*/
|
|
17
|
+
note?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ContactCreateWithCompanyName {
|
|
21
|
+
/**
|
|
22
|
+
* The first line of the contact's address.
|
|
23
|
+
*/
|
|
24
|
+
addressLine1: string;
|
|
25
|
+
|
|
26
|
+
companyName: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The ISO 3611-1 country code of the contact's address.
|
|
30
|
+
*/
|
|
31
|
+
countryCode: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Second line of the contact's address, if applicable.
|
|
35
|
+
*/
|
|
36
|
+
addressLine2?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The city of the contact's address.
|
|
40
|
+
*/
|
|
41
|
+
city?: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An optional string describing this resource. Will be visible in the API and the
|
|
45
|
+
* dashboard.
|
|
46
|
+
*/
|
|
47
|
+
description?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Email of the contact.
|
|
51
|
+
*/
|
|
52
|
+
email?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* First name of the contact.
|
|
56
|
+
*/
|
|
57
|
+
firstName?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* If `true`, PostGrid will force this contact to have an `addressStatus` of
|
|
61
|
+
* `verified` even if our address verification system says otherwise.
|
|
62
|
+
*/
|
|
63
|
+
forceVerifiedStatus?: boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Job title of the contact.
|
|
67
|
+
*/
|
|
68
|
+
jobTitle?: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Last name of the contact.
|
|
72
|
+
*/
|
|
73
|
+
lastName?: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* See the section on Metadata.
|
|
77
|
+
*/
|
|
78
|
+
metadata?: Record<string, unknown>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Phone number of the contact.
|
|
82
|
+
*/
|
|
83
|
+
phoneNumber?: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The postal or ZIP code of the contact's address.
|
|
87
|
+
*/
|
|
88
|
+
postalOrZip?: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Province or state of the contact's address.
|
|
92
|
+
*/
|
|
93
|
+
provinceOrState?: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* If `true`, PostGrid will skip running this contact's address through our address
|
|
97
|
+
* verification system.
|
|
98
|
+
*/
|
|
99
|
+
skipVerification?: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ContactCreateWithFirstName {
|
|
103
|
+
/**
|
|
104
|
+
* The first line of the contact's address.
|
|
105
|
+
*/
|
|
106
|
+
addressLine1: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The ISO 3611-1 country code of the contact's address.
|
|
110
|
+
*/
|
|
111
|
+
countryCode: string;
|
|
112
|
+
|
|
113
|
+
firstName: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Second line of the contact's address, if applicable.
|
|
117
|
+
*/
|
|
118
|
+
addressLine2?: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The city of the contact's address.
|
|
122
|
+
*/
|
|
123
|
+
city?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Company name of the contact.
|
|
127
|
+
*/
|
|
128
|
+
companyName?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* An optional string describing this resource. Will be visible in the API and the
|
|
132
|
+
* dashboard.
|
|
133
|
+
*/
|
|
134
|
+
description?: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Email of the contact.
|
|
138
|
+
*/
|
|
139
|
+
email?: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* If `true`, PostGrid will force this contact to have an `addressStatus` of
|
|
143
|
+
* `verified` even if our address verification system says otherwise.
|
|
144
|
+
*/
|
|
145
|
+
forceVerifiedStatus?: boolean;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Job title of the contact.
|
|
149
|
+
*/
|
|
150
|
+
jobTitle?: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Last name of the contact.
|
|
154
|
+
*/
|
|
155
|
+
lastName?: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* See the section on Metadata.
|
|
159
|
+
*/
|
|
160
|
+
metadata?: Record<string, unknown>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Phone number of the contact.
|
|
164
|
+
*/
|
|
165
|
+
phoneNumber?: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The postal or ZIP code of the contact's address.
|
|
169
|
+
*/
|
|
170
|
+
postalOrZip?: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Province or state of the contact's address.
|
|
174
|
+
*/
|
|
175
|
+
provinceOrState?: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* If `true`, PostGrid will skip running this contact's address through our address
|
|
179
|
+
* verification system.
|
|
180
|
+
*/
|
|
181
|
+
skipVerification?: boolean;
|
|
182
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import { isRequestOptions } from '../core';
|
|
5
|
+
import * as Core from '../core';
|
|
6
|
+
import { List, type ListParams } from '../pagination';
|
|
7
|
+
|
|
8
|
+
export class Templates extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a template. Note that if you want to create a template that works with
|
|
11
|
+
* our template editor, you must use our dashboard.
|
|
12
|
+
*/
|
|
13
|
+
create(body: TemplateCreateParams, options?: Core.RequestOptions): Core.APIPromise<Template> {
|
|
14
|
+
return this._client.post('/templates', { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a template by ID.
|
|
19
|
+
*/
|
|
20
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Template> {
|
|
21
|
+
return this._client.get(`/templates/${id}`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Update a template by ID.
|
|
26
|
+
*/
|
|
27
|
+
update(id: string, body: TemplateUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Template> {
|
|
28
|
+
return this._client.post(`/templates/${id}`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get a list of templates.
|
|
33
|
+
*/
|
|
34
|
+
list(query?: TemplateListParams, options?: Core.RequestOptions): Core.PagePromise<TemplatesList, Template>;
|
|
35
|
+
list(options?: Core.RequestOptions): Core.PagePromise<TemplatesList, Template>;
|
|
36
|
+
list(
|
|
37
|
+
query: TemplateListParams | Core.RequestOptions = {},
|
|
38
|
+
options?: Core.RequestOptions,
|
|
39
|
+
): Core.PagePromise<TemplatesList, Template> {
|
|
40
|
+
if (isRequestOptions(query)) {
|
|
41
|
+
return this.list({}, query);
|
|
42
|
+
}
|
|
43
|
+
return this._client.getAPIList('/templates', TemplatesList, { query, ...options });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Delete a template by ID. Note that this operation cannot be undone.
|
|
48
|
+
*/
|
|
49
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<TemplateDeleteResponse> {
|
|
50
|
+
return this._client.delete(`/templates/${id}`, options);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class TemplatesList extends List<Template> {}
|
|
55
|
+
|
|
56
|
+
export interface Template {
|
|
57
|
+
/**
|
|
58
|
+
* A unique ID prefixed with template\_
|
|
59
|
+
*/
|
|
60
|
+
id: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The UTC time at which this resource was created.
|
|
64
|
+
*/
|
|
65
|
+
createdAt: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* `true` if this is a live mode resource else `false`.
|
|
69
|
+
*/
|
|
70
|
+
live: boolean;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Always `template`.
|
|
74
|
+
*/
|
|
75
|
+
object: 'template';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The UTC time at which this resource was last updated.
|
|
79
|
+
*/
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* An optional string describing this resource. Will be visible in the API and the
|
|
84
|
+
* dashboard.
|
|
85
|
+
*/
|
|
86
|
+
description?: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The HTML content of this template.
|
|
90
|
+
*/
|
|
91
|
+
html?: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* See the section on Metadata.
|
|
95
|
+
*/
|
|
96
|
+
metadata?: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface TemplateList {
|
|
100
|
+
data: Array<Template>;
|
|
101
|
+
|
|
102
|
+
limit: number;
|
|
103
|
+
|
|
104
|
+
object: 'list';
|
|
105
|
+
|
|
106
|
+
skip: number;
|
|
107
|
+
|
|
108
|
+
totalCount: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface TemplateDeleteResponse {
|
|
112
|
+
/**
|
|
113
|
+
* A unique ID prefixed with template\_
|
|
114
|
+
*/
|
|
115
|
+
id: string;
|
|
116
|
+
|
|
117
|
+
deleted: true;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Always `template`.
|
|
121
|
+
*/
|
|
122
|
+
object: 'template';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface TemplateCreateParams {
|
|
126
|
+
/**
|
|
127
|
+
* An optional string describing this resource. Will be visible in the API and the
|
|
128
|
+
* dashboard.
|
|
129
|
+
*/
|
|
130
|
+
description?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The HTML content of this template.
|
|
134
|
+
*/
|
|
135
|
+
html?: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* See the section on Metadata.
|
|
139
|
+
*/
|
|
140
|
+
metadata?: Record<string, unknown>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface TemplateUpdateParams {
|
|
144
|
+
/**
|
|
145
|
+
* An optional string describing this resource. Will be visible in the API and the
|
|
146
|
+
* dashboard.
|
|
147
|
+
*/
|
|
148
|
+
description?: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The HTML content of this template.
|
|
152
|
+
*/
|
|
153
|
+
html?: string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* See the section on Metadata.
|
|
157
|
+
*/
|
|
158
|
+
metadata?: Record<string, unknown>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface TemplateListParams extends ListParams {
|
|
162
|
+
/**
|
|
163
|
+
* You can supply any string to help narrow down the list of resources. For
|
|
164
|
+
* example, if you pass `"New York"` (quoted), it will return resources that have
|
|
165
|
+
* that string present somewhere in their response. Alternatively, you can supply a
|
|
166
|
+
* structured search query. See the documentation on `StructuredSearchQuery` for
|
|
167
|
+
* more details.
|
|
168
|
+
*/
|
|
169
|
+
search?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
Templates.TemplatesList = TemplatesList;
|
|
173
|
+
|
|
174
|
+
export declare namespace Templates {
|
|
175
|
+
export {
|
|
176
|
+
type Template as Template,
|
|
177
|
+
type TemplateList as TemplateList,
|
|
178
|
+
type TemplateDeleteResponse as TemplateDeleteResponse,
|
|
179
|
+
TemplatesList as TemplatesList,
|
|
180
|
+
type TemplateCreateParams as TemplateCreateParams,
|
|
181
|
+
type TemplateUpdateParams as TemplateUpdateParams,
|
|
182
|
+
type TemplateListParams as TemplateListParams,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/node-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/node-runtime';
|
|
5
|
+
setShims(getRuntime());
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/shims/web.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/web-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/web-runtime';
|
|
5
|
+
setShims(getRuntime({ manuallyImported: true }));
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
// this config is included in the published src directory to prevent TS errors
|
|
3
|
+
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
+
// via declaration maps
|
|
5
|
+
"include": ["index.ts"],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"target": "es2015",
|
|
8
|
+
"lib": ["DOM"],
|
|
9
|
+
"moduleResolution": "node"
|
|
10
|
+
}
|
|
11
|
+
}
|