postgrid-node 0.1.0-alpha.2 → 0.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +26 -40
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +25 -15
  9. package/core.js.map +1 -1
  10. package/core.mjs +26 -16
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +21 -8
  13. package/index.d.ts +21 -8
  14. package/index.d.ts.map +1 -1
  15. package/index.js +28 -5
  16. package/index.js.map +1 -1
  17. package/index.mjs +28 -5
  18. package/index.mjs.map +1 -1
  19. package/internal/qs/formats.d.ts +6 -0
  20. package/internal/qs/formats.d.ts.map +1 -0
  21. package/internal/qs/formats.js +11 -0
  22. package/internal/qs/formats.js.map +1 -0
  23. package/internal/qs/formats.mjs +8 -0
  24. package/internal/qs/formats.mjs.map +1 -0
  25. package/internal/qs/index.d.ts +10 -0
  26. package/internal/qs/index.d.ts.map +1 -0
  27. package/internal/qs/index.js +14 -0
  28. package/internal/qs/index.js.map +1 -0
  29. package/internal/qs/index.mjs +10 -0
  30. package/internal/qs/index.mjs.map +1 -0
  31. package/internal/qs/stringify.d.ts +3 -0
  32. package/internal/qs/stringify.d.ts.map +1 -0
  33. package/internal/qs/stringify.js +280 -0
  34. package/internal/qs/stringify.js.map +1 -0
  35. package/internal/qs/stringify.mjs +276 -0
  36. package/internal/qs/stringify.mjs.map +1 -0
  37. package/internal/qs/types.d.ts +57 -0
  38. package/internal/qs/types.d.ts.map +1 -0
  39. package/internal/qs/types.js +3 -0
  40. package/internal/qs/types.js.map +1 -0
  41. package/internal/qs/types.mjs +2 -0
  42. package/internal/qs/types.mjs.map +1 -0
  43. package/internal/qs/utils.d.ts +14 -0
  44. package/internal/qs/utils.d.ts.map +1 -0
  45. package/internal/qs/utils.js +229 -0
  46. package/internal/qs/utils.js.map +1 -0
  47. package/internal/qs/utils.mjs +217 -0
  48. package/internal/qs/utils.mjs.map +1 -0
  49. package/package.json +8 -29
  50. package/pagination.d.ts +2 -0
  51. package/pagination.d.ts.map +1 -1
  52. package/pagination.js +2 -1
  53. package/pagination.js.map +1 -1
  54. package/pagination.mjs +2 -1
  55. package/pagination.mjs.map +1 -1
  56. package/resource.d.ts +1 -1
  57. package/resource.d.ts.map +1 -1
  58. package/resource.js.map +1 -1
  59. package/resource.mjs.map +1 -1
  60. package/resources/bank-accounts.d.ts +61 -4
  61. package/resources/bank-accounts.d.ts.map +1 -1
  62. package/resources/bank-accounts.js +25 -0
  63. package/resources/bank-accounts.js.map +1 -1
  64. package/resources/bank-accounts.mjs +25 -0
  65. package/resources/bank-accounts.mjs.map +1 -1
  66. package/resources/boxes.d.ts +80 -15
  67. package/resources/boxes.d.ts.map +1 -1
  68. package/resources/boxes.js +27 -0
  69. package/resources/boxes.js.map +1 -1
  70. package/resources/boxes.mjs +27 -0
  71. package/resources/boxes.mjs.map +1 -1
  72. package/resources/campaigns.d.ts +22 -8
  73. package/resources/campaigns.d.ts.map +1 -1
  74. package/resources/cheques/cheques.d.ts +43 -4
  75. package/resources/cheques/cheques.d.ts.map +1 -1
  76. package/resources/cheques/cheques.js +23 -0
  77. package/resources/cheques/cheques.js.map +1 -1
  78. package/resources/cheques/cheques.mjs +23 -0
  79. package/resources/cheques/cheques.mjs.map +1 -1
  80. package/resources/cheques/url.d.ts +5 -0
  81. package/resources/cheques/url.d.ts.map +1 -1
  82. package/resources/cheques/url.js +5 -0
  83. package/resources/cheques/url.js.map +1 -1
  84. package/resources/cheques/url.mjs +5 -0
  85. package/resources/cheques/url.mjs.map +1 -1
  86. package/resources/cheques/with-deposit-ready-pdf.d.ts +6 -0
  87. package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -1
  88. package/resources/cheques/with-deposit-ready-pdf.js +6 -0
  89. package/resources/cheques/with-deposit-ready-pdf.js.map +1 -1
  90. package/resources/cheques/with-deposit-ready-pdf.mjs +6 -0
  91. package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -1
  92. package/resources/cheques.d.ts +2 -0
  93. package/resources/cheques.d.ts.map +1 -0
  94. package/resources/cheques.js +19 -0
  95. package/resources/cheques.js.map +1 -0
  96. package/resources/cheques.mjs +3 -0
  97. package/resources/cheques.mjs.map +1 -0
  98. package/resources/contacts.d.ts +37 -3
  99. package/resources/contacts.d.ts.map +1 -1
  100. package/resources/contacts.js +20 -0
  101. package/resources/contacts.js.map +1 -1
  102. package/resources/contacts.mjs +20 -0
  103. package/resources/contacts.mjs.map +1 -1
  104. package/resources/index.d.ts +5 -1
  105. package/resources/index.d.ts.map +1 -1
  106. package/resources/index.js +12 -1
  107. package/resources/index.js.map +1 -1
  108. package/resources/index.mjs +4 -0
  109. package/resources/index.mjs.map +1 -1
  110. package/resources/letters.d.ts +50 -6
  111. package/resources/letters.d.ts.map +1 -1
  112. package/resources/letters.js +24 -0
  113. package/resources/letters.js.map +1 -1
  114. package/resources/letters.mjs +24 -0
  115. package/resources/letters.mjs.map +1 -1
  116. package/resources/mailing-list-imports.d.ts +919 -0
  117. package/resources/mailing-list-imports.d.ts.map +1 -0
  118. package/resources/mailing-list-imports.js +95 -0
  119. package/resources/mailing-list-imports.js.map +1 -0
  120. package/resources/mailing-list-imports.mjs +90 -0
  121. package/resources/mailing-list-imports.mjs.map +1 -0
  122. package/resources/mailing-lists.d.ts +398 -0
  123. package/resources/mailing-lists.d.ts.map +1 -0
  124. package/resources/mailing-lists.js +101 -0
  125. package/resources/mailing-lists.js.map +1 -0
  126. package/resources/mailing-lists.mjs +96 -0
  127. package/resources/mailing-lists.mjs.map +1 -0
  128. package/resources/order-profiles/cheques.d.ts +588 -0
  129. package/resources/order-profiles/cheques.d.ts.map +1 -0
  130. package/resources/order-profiles/cheques.js +74 -0
  131. package/resources/order-profiles/cheques.js.map +1 -0
  132. package/resources/order-profiles/cheques.mjs +69 -0
  133. package/resources/order-profiles/cheques.mjs.map +1 -0
  134. package/resources/order-profiles/index.d.ts +6 -0
  135. package/resources/order-profiles/index.d.ts.map +1 -0
  136. package/resources/order-profiles/index.js +19 -0
  137. package/resources/order-profiles/index.js.map +1 -0
  138. package/resources/order-profiles/index.mjs +7 -0
  139. package/resources/order-profiles/index.mjs.map +1 -0
  140. package/resources/order-profiles/letters.d.ts +647 -0
  141. package/resources/order-profiles/letters.d.ts.map +1 -0
  142. package/resources/order-profiles/letters.js +80 -0
  143. package/resources/order-profiles/letters.js.map +1 -0
  144. package/resources/order-profiles/letters.mjs +75 -0
  145. package/resources/order-profiles/letters.mjs.map +1 -0
  146. package/resources/order-profiles/order-profiles.d.ts +22 -0
  147. package/resources/order-profiles/order-profiles.d.ts.map +1 -0
  148. package/resources/order-profiles/order-profiles.js +55 -0
  149. package/resources/order-profiles/order-profiles.js.map +1 -0
  150. package/resources/order-profiles/order-profiles.mjs +28 -0
  151. package/resources/order-profiles/order-profiles.mjs.map +1 -0
  152. package/resources/order-profiles/postcards.d.ts +423 -0
  153. package/resources/order-profiles/postcards.d.ts.map +1 -0
  154. package/resources/order-profiles/postcards.js +73 -0
  155. package/resources/order-profiles/postcards.js.map +1 -0
  156. package/resources/order-profiles/postcards.mjs +68 -0
  157. package/resources/order-profiles/postcards.mjs.map +1 -0
  158. package/resources/order-profiles/self-mailers.d.ts +435 -0
  159. package/resources/order-profiles/self-mailers.d.ts.map +1 -0
  160. package/resources/order-profiles/self-mailers.js +75 -0
  161. package/resources/order-profiles/self-mailers.js.map +1 -0
  162. package/resources/order-profiles/self-mailers.mjs +70 -0
  163. package/resources/order-profiles/self-mailers.mjs.map +1 -0
  164. package/resources/order-profiles.d.ts +2 -0
  165. package/resources/order-profiles.d.ts.map +1 -0
  166. package/resources/order-profiles.js +19 -0
  167. package/resources/order-profiles.js.map +1 -0
  168. package/resources/order-profiles.mjs +3 -0
  169. package/resources/order-profiles.mjs.map +1 -0
  170. package/resources/postcards.d.ts +58 -8
  171. package/resources/postcards.d.ts.map +1 -1
  172. package/resources/postcards.js +26 -0
  173. package/resources/postcards.js.map +1 -1
  174. package/resources/postcards.mjs +26 -0
  175. package/resources/postcards.mjs.map +1 -1
  176. package/resources/reports/exports.d.ts +36 -3
  177. package/resources/reports/exports.d.ts.map +1 -1
  178. package/resources/reports/exports.js +27 -0
  179. package/resources/reports/exports.js.map +1 -1
  180. package/resources/reports/exports.mjs +27 -0
  181. package/resources/reports/exports.mjs.map +1 -1
  182. package/resources/reports/reports.d.ts +76 -8
  183. package/resources/reports/reports.d.ts.map +1 -1
  184. package/resources/reports/reports.js +44 -0
  185. package/resources/reports/reports.js.map +1 -1
  186. package/resources/reports/reports.mjs +44 -0
  187. package/resources/reports/reports.mjs.map +1 -1
  188. package/resources/reports.d.ts +2 -0
  189. package/resources/reports.d.ts.map +1 -0
  190. package/resources/reports.js +19 -0
  191. package/resources/reports.js.map +1 -0
  192. package/resources/reports.mjs +3 -0
  193. package/resources/reports.mjs.map +1 -0
  194. package/resources/self-mailers.d.ts +99 -15
  195. package/resources/self-mailers.d.ts.map +1 -1
  196. package/resources/self-mailers.js +38 -0
  197. package/resources/self-mailers.js.map +1 -1
  198. package/resources/self-mailers.mjs +38 -0
  199. package/resources/self-mailers.mjs.map +1 -1
  200. package/resources/shared.d.ts +6 -2
  201. package/resources/shared.d.ts.map +1 -1
  202. package/resources/sub-organizations.d.ts +394 -0
  203. package/resources/sub-organizations.d.ts.map +1 -0
  204. package/resources/sub-organizations.js +63 -0
  205. package/resources/sub-organizations.js.map +1 -0
  206. package/resources/sub-organizations.mjs +58 -0
  207. package/resources/sub-organizations.mjs.map +1 -0
  208. package/resources/templates.d.ts +43 -3
  209. package/resources/templates.d.ts.map +1 -1
  210. package/resources/templates.js +26 -0
  211. package/resources/templates.js.map +1 -1
  212. package/resources/templates.mjs +26 -0
  213. package/resources/templates.mjs.map +1 -1
  214. package/resources.d.ts +2 -0
  215. package/resources.d.ts.map +1 -0
  216. package/resources.js +18 -0
  217. package/resources.js.map +1 -0
  218. package/resources.mjs +2 -0
  219. package/resources.mjs.map +1 -0
  220. package/src/_shims/index.d.ts +2 -0
  221. package/src/_shims/index.js +5 -1
  222. package/src/_shims/index.mjs +5 -1
  223. package/src/core.ts +44 -16
  224. package/src/index.ts +112 -11
  225. package/src/internal/qs/LICENSE.md +13 -0
  226. package/src/internal/qs/README.md +3 -0
  227. package/src/internal/qs/formats.ts +9 -0
  228. package/src/internal/qs/index.ts +13 -0
  229. package/src/internal/qs/stringify.ts +388 -0
  230. package/src/internal/qs/types.ts +71 -0
  231. package/src/internal/qs/utils.ts +265 -0
  232. package/src/pagination.ts +6 -1
  233. package/src/resource.ts +1 -1
  234. package/src/resources/bank-accounts.ts +57 -4
  235. package/src/resources/boxes.ts +50 -15
  236. package/src/resources/campaigns.ts +8 -8
  237. package/src/resources/cheques/cheques.ts +35 -4
  238. package/src/resources/cheques/url.ts +5 -0
  239. package/src/resources/cheques/with-deposit-ready-pdf.ts +6 -0
  240. package/src/resources/cheques.ts +3 -0
  241. package/src/resources/contacts.ts +31 -3
  242. package/src/resources/index.ts +39 -0
  243. package/src/resources/letters.ts +38 -6
  244. package/src/resources/mailing-list-imports.ts +1076 -0
  245. package/src/resources/mailing-lists.ts +511 -0
  246. package/src/resources/order-profiles/cheques.ts +888 -0
  247. package/src/resources/order-profiles/index.ts +55 -0
  248. package/src/resources/order-profiles/letters.ts +956 -0
  249. package/src/resources/order-profiles/order-profiles.ts +133 -0
  250. package/src/resources/order-profiles/postcards.ts +694 -0
  251. package/src/resources/order-profiles/self-mailers.ts +707 -0
  252. package/src/resources/order-profiles.ts +3 -0
  253. package/src/resources/postcards.ts +42 -8
  254. package/src/resources/reports/exports.ts +30 -3
  255. package/src/resources/reports/reports.ts +60 -8
  256. package/src/resources/reports.ts +3 -0
  257. package/src/resources/self-mailers.ts +80 -14
  258. package/src/resources/shared.ts +2 -2
  259. package/src/resources/sub-organizations.ts +518 -0
  260. package/src/resources/templates.ts +37 -3
  261. package/src/resources.ts +1 -0
  262. package/src/version.ts +1 -1
  263. package/version.d.ts +1 -1
  264. package/version.js +1 -1
  265. package/version.mjs +1 -1
@@ -0,0 +1,956 @@
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 Letters extends APIResource {
9
+ /**
10
+ * Creates a new Letter Profile. You must provide either a `template` ID or upload
11
+ * a `pdf` file for the content. If providing PDF files (`pdf` or
12
+ * `attachedPDFFile`), the request `Content-Type` must be `multipart/form-data`.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const letter = await client.orderProfiles.letters.create({
17
+ * size: 'us_letter',
18
+ * color: true,
19
+ * description: 'Monthly Newsletter Profile',
20
+ * mailingClass: 'first_class',
21
+ * mergeVariables: { salutation: 'Valued Customer' },
22
+ * metadata: { campaign: 'Q1 Newsletter' },
23
+ * template: 'template_abc',
24
+ * });
25
+ * ```
26
+ */
27
+ create(params: LetterCreateParams, options?: Core.RequestOptions): Core.APIPromise<LetterCreateResponse> {
28
+ const { expand, ...body } = params;
29
+ return this._client.post('/order_profiles/letters', { query: { expand }, body, ...options });
30
+ }
31
+
32
+ /**
33
+ * Retrieves the details of a specific Letter Profile by its ID.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const letter = await client.orderProfiles.letters.retrieve(
38
+ * 'id',
39
+ * );
40
+ * ```
41
+ */
42
+ retrieve(
43
+ id: string,
44
+ query?: LetterRetrieveParams,
45
+ options?: Core.RequestOptions,
46
+ ): Core.APIPromise<LetterRetrieveResponse>;
47
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LetterRetrieveResponse>;
48
+ retrieve(
49
+ id: string,
50
+ query: LetterRetrieveParams | Core.RequestOptions = {},
51
+ options?: Core.RequestOptions,
52
+ ): Core.APIPromise<LetterRetrieveResponse> {
53
+ if (isRequestOptions(query)) {
54
+ return this.retrieve(id, {}, query);
55
+ }
56
+ return this._client.get(`/order_profiles/letters/${id}`, { query, ...options });
57
+ }
58
+
59
+ /**
60
+ * Updates specific fields of an existing Letter Profile. Only the fields provided
61
+ * in the request body will be updated. If providing PDF files (`pdf` or
62
+ * `attachedPDFFile`), the request `Content-Type` must be `multipart/form-data`.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const letter = await client.orderProfiles.letters.update(
67
+ * 'id',
68
+ * { description: 'Updated Newsletter Profile' },
69
+ * );
70
+ * ```
71
+ */
72
+ update(
73
+ id: string,
74
+ params: LetterUpdateParams,
75
+ options?: Core.RequestOptions,
76
+ ): Core.APIPromise<LetterUpdateResponse> {
77
+ const { expand, ...body } = params;
78
+ return this._client.post(`/order_profiles/letters/${id}`, { query: { expand }, body, ...options });
79
+ }
80
+
81
+ /**
82
+ * Retrieves a list of Letter Profiles. The profiles are returned sorted by
83
+ * creation date, with the most recent appearing first.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * // Automatically fetches more pages as needed.
88
+ * for await (const letterListResponse of client.orderProfiles.letters.list()) {
89
+ * // ...
90
+ * }
91
+ * ```
92
+ */
93
+ list(
94
+ query?: LetterListParams,
95
+ options?: Core.RequestOptions,
96
+ ): Core.PagePromise<LetterListResponsesList, LetterListResponse>;
97
+ list(options?: Core.RequestOptions): Core.PagePromise<LetterListResponsesList, LetterListResponse>;
98
+ list(
99
+ query: LetterListParams | Core.RequestOptions = {},
100
+ options?: Core.RequestOptions,
101
+ ): Core.PagePromise<LetterListResponsesList, LetterListResponse> {
102
+ if (isRequestOptions(query)) {
103
+ return this.list({}, query);
104
+ }
105
+ return this._client.getAPIList('/order_profiles/letters', LetterListResponsesList, { query, ...options });
106
+ }
107
+
108
+ /**
109
+ * Deletes a Letter Profile. This action cannot be undone. Orders previously
110
+ * created using this profile are not affected.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const letter = await client.orderProfiles.letters.delete(
115
+ * 'id',
116
+ * );
117
+ * ```
118
+ */
119
+ delete(id: string, options?: Core.RequestOptions): Core.APIPromise<LetterDeleteResponse> {
120
+ return this._client.delete(`/order_profiles/letters/${id}`, options);
121
+ }
122
+ }
123
+
124
+ export class LetterListResponsesList extends List<LetterListResponse> {}
125
+
126
+ export interface LetterCreateResponse {
127
+ /**
128
+ * Unique identifier for the order profile.
129
+ */
130
+ id: string;
131
+
132
+ /**
133
+ * Timestamp when the profile was created.
134
+ */
135
+ createdAt: string;
136
+
137
+ /**
138
+ * Indicates if the profile is associated with the live or test environment.
139
+ */
140
+ live: boolean;
141
+
142
+ /**
143
+ * Always `letter_profile`.
144
+ */
145
+ object: 'letter_profile';
146
+
147
+ /**
148
+ * Enum representing the supported letter sizes.
149
+ */
150
+ size: 'us_letter' | 'a4';
151
+
152
+ /**
153
+ * Timestamp when the profile was last updated.
154
+ */
155
+ updatedAt: string;
156
+
157
+ /**
158
+ * Enum representing the placement of the address on the letter.
159
+ */
160
+ addressPlacement?: 'top_first_page' | 'insert_blank_page';
161
+
162
+ /**
163
+ * Model representing an attached PDF.
164
+ */
165
+ attachedPDF?: LetterCreateResponse.AttachedPdf;
166
+
167
+ /**
168
+ * Specifies whether to print in color (true) or black and white (false).
169
+ */
170
+ color?: boolean;
171
+
172
+ /**
173
+ * An optional description for the profile. Set to `null` to remove during update.
174
+ */
175
+ description?: string | null;
176
+
177
+ /**
178
+ * Specifies whether to print on both sides of the paper.
179
+ */
180
+ doubleSided?: boolean;
181
+
182
+ /**
183
+ * ID of a custom envelope to use.
184
+ */
185
+ envelope?: string;
186
+
187
+ /**
188
+ * Mailing class.
189
+ */
190
+ mailingClass?:
191
+ | 'first_class'
192
+ | 'standard_class'
193
+ | 'express'
194
+ | 'certified'
195
+ | 'certified_return_receipt'
196
+ | 'registered'
197
+ | 'usps_first_class'
198
+ | 'usps_standard_class'
199
+ | 'usps_eddm'
200
+ | 'usps_express_2_day'
201
+ | 'usps_express_3_day'
202
+ | 'usps_first_class_certified'
203
+ | 'usps_first_class_certified_return_receipt'
204
+ | 'usps_first_class_registered'
205
+ | 'usps_express_3_day_signature_confirmation'
206
+ | 'usps_express_3_day_certified'
207
+ | 'usps_express_3_day_certified_return_receipt'
208
+ | 'ca_post_lettermail'
209
+ | 'ca_post_personalized'
210
+ | 'ca_post_neighbourhood_mail'
211
+ | 'ups_express_overnight'
212
+ | 'ups_express_2_day'
213
+ | 'ups_express_3_day'
214
+ | 'royal_mail_first_class'
215
+ | 'royal_mail_second_class'
216
+ | 'au_post_second_class';
217
+
218
+ /**
219
+ * Default merge variables for orders created using this profile.
220
+ */
221
+ mergeVariables?: { [key: string]: unknown } | null;
222
+
223
+ /**
224
+ * Optional key-value metadata.
225
+ */
226
+ metadata?: { [key: string]: string } | null;
227
+
228
+ /**
229
+ * Specifies which page number should be perforated (if any).
230
+ */
231
+ perforatedPage?: 1;
232
+
233
+ /**
234
+ * ID of a template to use for the letter content. Cannot be used with `pdf`.
235
+ */
236
+ template?: string;
237
+
238
+ /**
239
+ * A temporary, signed URL to view the uploaded PDF, if any.
240
+ */
241
+ uploadedPDF?: string;
242
+ }
243
+
244
+ export namespace LetterCreateResponse {
245
+ /**
246
+ * Model representing an attached PDF.
247
+ */
248
+ export interface AttachedPdf {
249
+ /**
250
+ * The file (multipart form upload) or URL pointing to a PDF for the attached PDF.
251
+ */
252
+ file: string;
253
+
254
+ /**
255
+ * Enum representing the placement of the attached PDF.
256
+ */
257
+ placement: 'before_template' | 'after_template';
258
+ }
259
+ }
260
+
261
+ export interface LetterRetrieveResponse {
262
+ /**
263
+ * Unique identifier for the order profile.
264
+ */
265
+ id: string;
266
+
267
+ /**
268
+ * Timestamp when the profile was created.
269
+ */
270
+ createdAt: string;
271
+
272
+ /**
273
+ * Indicates if the profile is associated with the live or test environment.
274
+ */
275
+ live: boolean;
276
+
277
+ /**
278
+ * Always `letter_profile`.
279
+ */
280
+ object: 'letter_profile';
281
+
282
+ /**
283
+ * Enum representing the supported letter sizes.
284
+ */
285
+ size: 'us_letter' | 'a4';
286
+
287
+ /**
288
+ * Timestamp when the profile was last updated.
289
+ */
290
+ updatedAt: string;
291
+
292
+ /**
293
+ * Enum representing the placement of the address on the letter.
294
+ */
295
+ addressPlacement?: 'top_first_page' | 'insert_blank_page';
296
+
297
+ /**
298
+ * Model representing an attached PDF.
299
+ */
300
+ attachedPDF?: LetterRetrieveResponse.AttachedPdf;
301
+
302
+ /**
303
+ * Specifies whether to print in color (true) or black and white (false).
304
+ */
305
+ color?: boolean;
306
+
307
+ /**
308
+ * An optional description for the profile. Set to `null` to remove during update.
309
+ */
310
+ description?: string | null;
311
+
312
+ /**
313
+ * Specifies whether to print on both sides of the paper.
314
+ */
315
+ doubleSided?: boolean;
316
+
317
+ /**
318
+ * ID of a custom envelope to use.
319
+ */
320
+ envelope?: string;
321
+
322
+ /**
323
+ * Mailing class.
324
+ */
325
+ mailingClass?:
326
+ | 'first_class'
327
+ | 'standard_class'
328
+ | 'express'
329
+ | 'certified'
330
+ | 'certified_return_receipt'
331
+ | 'registered'
332
+ | 'usps_first_class'
333
+ | 'usps_standard_class'
334
+ | 'usps_eddm'
335
+ | 'usps_express_2_day'
336
+ | 'usps_express_3_day'
337
+ | 'usps_first_class_certified'
338
+ | 'usps_first_class_certified_return_receipt'
339
+ | 'usps_first_class_registered'
340
+ | 'usps_express_3_day_signature_confirmation'
341
+ | 'usps_express_3_day_certified'
342
+ | 'usps_express_3_day_certified_return_receipt'
343
+ | 'ca_post_lettermail'
344
+ | 'ca_post_personalized'
345
+ | 'ca_post_neighbourhood_mail'
346
+ | 'ups_express_overnight'
347
+ | 'ups_express_2_day'
348
+ | 'ups_express_3_day'
349
+ | 'royal_mail_first_class'
350
+ | 'royal_mail_second_class'
351
+ | 'au_post_second_class';
352
+
353
+ /**
354
+ * Default merge variables for orders created using this profile.
355
+ */
356
+ mergeVariables?: { [key: string]: unknown } | null;
357
+
358
+ /**
359
+ * Optional key-value metadata.
360
+ */
361
+ metadata?: { [key: string]: string } | null;
362
+
363
+ /**
364
+ * Specifies which page number should be perforated (if any).
365
+ */
366
+ perforatedPage?: 1;
367
+
368
+ /**
369
+ * ID of a template to use for the letter content. Cannot be used with `pdf`.
370
+ */
371
+ template?: string;
372
+
373
+ /**
374
+ * A temporary, signed URL to view the uploaded PDF, if any.
375
+ */
376
+ uploadedPDF?: string;
377
+ }
378
+
379
+ export namespace LetterRetrieveResponse {
380
+ /**
381
+ * Model representing an attached PDF.
382
+ */
383
+ export interface AttachedPdf {
384
+ /**
385
+ * The file (multipart form upload) or URL pointing to a PDF for the attached PDF.
386
+ */
387
+ file: string;
388
+
389
+ /**
390
+ * Enum representing the placement of the attached PDF.
391
+ */
392
+ placement: 'before_template' | 'after_template';
393
+ }
394
+ }
395
+
396
+ export interface LetterUpdateResponse {
397
+ /**
398
+ * Unique identifier for the order profile.
399
+ */
400
+ id: string;
401
+
402
+ /**
403
+ * Timestamp when the profile was created.
404
+ */
405
+ createdAt: string;
406
+
407
+ /**
408
+ * Indicates if the profile is associated with the live or test environment.
409
+ */
410
+ live: boolean;
411
+
412
+ /**
413
+ * Always `letter_profile`.
414
+ */
415
+ object: 'letter_profile';
416
+
417
+ /**
418
+ * Enum representing the supported letter sizes.
419
+ */
420
+ size: 'us_letter' | 'a4';
421
+
422
+ /**
423
+ * Timestamp when the profile was last updated.
424
+ */
425
+ updatedAt: string;
426
+
427
+ /**
428
+ * Enum representing the placement of the address on the letter.
429
+ */
430
+ addressPlacement?: 'top_first_page' | 'insert_blank_page';
431
+
432
+ /**
433
+ * Model representing an attached PDF.
434
+ */
435
+ attachedPDF?: LetterUpdateResponse.AttachedPdf;
436
+
437
+ /**
438
+ * Specifies whether to print in color (true) or black and white (false).
439
+ */
440
+ color?: boolean;
441
+
442
+ /**
443
+ * An optional description for the profile. Set to `null` to remove during update.
444
+ */
445
+ description?: string | null;
446
+
447
+ /**
448
+ * Specifies whether to print on both sides of the paper.
449
+ */
450
+ doubleSided?: boolean;
451
+
452
+ /**
453
+ * ID of a custom envelope to use.
454
+ */
455
+ envelope?: string;
456
+
457
+ /**
458
+ * Mailing class.
459
+ */
460
+ mailingClass?:
461
+ | 'first_class'
462
+ | 'standard_class'
463
+ | 'express'
464
+ | 'certified'
465
+ | 'certified_return_receipt'
466
+ | 'registered'
467
+ | 'usps_first_class'
468
+ | 'usps_standard_class'
469
+ | 'usps_eddm'
470
+ | 'usps_express_2_day'
471
+ | 'usps_express_3_day'
472
+ | 'usps_first_class_certified'
473
+ | 'usps_first_class_certified_return_receipt'
474
+ | 'usps_first_class_registered'
475
+ | 'usps_express_3_day_signature_confirmation'
476
+ | 'usps_express_3_day_certified'
477
+ | 'usps_express_3_day_certified_return_receipt'
478
+ | 'ca_post_lettermail'
479
+ | 'ca_post_personalized'
480
+ | 'ca_post_neighbourhood_mail'
481
+ | 'ups_express_overnight'
482
+ | 'ups_express_2_day'
483
+ | 'ups_express_3_day'
484
+ | 'royal_mail_first_class'
485
+ | 'royal_mail_second_class'
486
+ | 'au_post_second_class';
487
+
488
+ /**
489
+ * Default merge variables for orders created using this profile.
490
+ */
491
+ mergeVariables?: { [key: string]: unknown } | null;
492
+
493
+ /**
494
+ * Optional key-value metadata.
495
+ */
496
+ metadata?: { [key: string]: string } | null;
497
+
498
+ /**
499
+ * Specifies which page number should be perforated (if any).
500
+ */
501
+ perforatedPage?: 1;
502
+
503
+ /**
504
+ * ID of a template to use for the letter content. Cannot be used with `pdf`.
505
+ */
506
+ template?: string;
507
+
508
+ /**
509
+ * A temporary, signed URL to view the uploaded PDF, if any.
510
+ */
511
+ uploadedPDF?: string;
512
+ }
513
+
514
+ export namespace LetterUpdateResponse {
515
+ /**
516
+ * Model representing an attached PDF.
517
+ */
518
+ export interface AttachedPdf {
519
+ /**
520
+ * The file (multipart form upload) or URL pointing to a PDF for the attached PDF.
521
+ */
522
+ file: string;
523
+
524
+ /**
525
+ * Enum representing the placement of the attached PDF.
526
+ */
527
+ placement: 'before_template' | 'after_template';
528
+ }
529
+ }
530
+
531
+ export interface LetterListResponse {
532
+ /**
533
+ * Unique identifier for the order profile.
534
+ */
535
+ id: string;
536
+
537
+ /**
538
+ * Timestamp when the profile was created.
539
+ */
540
+ createdAt: string;
541
+
542
+ /**
543
+ * Indicates if the profile is associated with the live or test environment.
544
+ */
545
+ live: boolean;
546
+
547
+ /**
548
+ * Always `letter_profile`.
549
+ */
550
+ object: 'letter_profile';
551
+
552
+ /**
553
+ * Enum representing the supported letter sizes.
554
+ */
555
+ size: 'us_letter' | 'a4';
556
+
557
+ /**
558
+ * Timestamp when the profile was last updated.
559
+ */
560
+ updatedAt: string;
561
+
562
+ /**
563
+ * Enum representing the placement of the address on the letter.
564
+ */
565
+ addressPlacement?: 'top_first_page' | 'insert_blank_page';
566
+
567
+ /**
568
+ * Model representing an attached PDF.
569
+ */
570
+ attachedPDF?: LetterListResponse.AttachedPdf;
571
+
572
+ /**
573
+ * Specifies whether to print in color (true) or black and white (false).
574
+ */
575
+ color?: boolean;
576
+
577
+ /**
578
+ * An optional description for the profile. Set to `null` to remove during update.
579
+ */
580
+ description?: string | null;
581
+
582
+ /**
583
+ * Specifies whether to print on both sides of the paper.
584
+ */
585
+ doubleSided?: boolean;
586
+
587
+ /**
588
+ * ID of a custom envelope to use.
589
+ */
590
+ envelope?: string;
591
+
592
+ /**
593
+ * Mailing class.
594
+ */
595
+ mailingClass?:
596
+ | 'first_class'
597
+ | 'standard_class'
598
+ | 'express'
599
+ | 'certified'
600
+ | 'certified_return_receipt'
601
+ | 'registered'
602
+ | 'usps_first_class'
603
+ | 'usps_standard_class'
604
+ | 'usps_eddm'
605
+ | 'usps_express_2_day'
606
+ | 'usps_express_3_day'
607
+ | 'usps_first_class_certified'
608
+ | 'usps_first_class_certified_return_receipt'
609
+ | 'usps_first_class_registered'
610
+ | 'usps_express_3_day_signature_confirmation'
611
+ | 'usps_express_3_day_certified'
612
+ | 'usps_express_3_day_certified_return_receipt'
613
+ | 'ca_post_lettermail'
614
+ | 'ca_post_personalized'
615
+ | 'ca_post_neighbourhood_mail'
616
+ | 'ups_express_overnight'
617
+ | 'ups_express_2_day'
618
+ | 'ups_express_3_day'
619
+ | 'royal_mail_first_class'
620
+ | 'royal_mail_second_class'
621
+ | 'au_post_second_class';
622
+
623
+ /**
624
+ * Default merge variables for orders created using this profile.
625
+ */
626
+ mergeVariables?: { [key: string]: unknown } | null;
627
+
628
+ /**
629
+ * Optional key-value metadata.
630
+ */
631
+ metadata?: { [key: string]: string } | null;
632
+
633
+ /**
634
+ * Specifies which page number should be perforated (if any).
635
+ */
636
+ perforatedPage?: 1;
637
+
638
+ /**
639
+ * ID of a template to use for the letter content. Cannot be used with `pdf`.
640
+ */
641
+ template?: string;
642
+
643
+ /**
644
+ * A temporary, signed URL to view the uploaded PDF, if any.
645
+ */
646
+ uploadedPDF?: string;
647
+ }
648
+
649
+ export namespace LetterListResponse {
650
+ /**
651
+ * Model representing an attached PDF.
652
+ */
653
+ export interface AttachedPdf {
654
+ /**
655
+ * The file (multipart form upload) or URL pointing to a PDF for the attached PDF.
656
+ */
657
+ file: string;
658
+
659
+ /**
660
+ * Enum representing the placement of the attached PDF.
661
+ */
662
+ placement: 'before_template' | 'after_template';
663
+ }
664
+ }
665
+
666
+ export interface LetterDeleteResponse {
667
+ /**
668
+ * Unique identifier for the order profile.
669
+ */
670
+ id: string;
671
+
672
+ deleted: true;
673
+
674
+ /**
675
+ * Always `letter_profile`.
676
+ */
677
+ object: 'letter_profile';
678
+ }
679
+
680
+ export interface LetterCreateParams {
681
+ /**
682
+ * Body param: Enum representing the supported letter sizes.
683
+ */
684
+ size: 'us_letter' | 'a4';
685
+
686
+ /**
687
+ * Query param: Optional list of related resources to expand in the response.
688
+ */
689
+ expand?: Array<string>;
690
+
691
+ /**
692
+ * Body param: Enum representing the placement of the address on the letter.
693
+ */
694
+ addressPlacement?: 'top_first_page' | 'insert_blank_page';
695
+
696
+ /**
697
+ * Body param: Model representing an attached PDF.
698
+ */
699
+ attachedPDF?: LetterCreateParams.AttachedPdf;
700
+
701
+ /**
702
+ * Body param: Specifies whether to print in color (true) or black and white
703
+ * (false).
704
+ */
705
+ color?: boolean;
706
+
707
+ /**
708
+ * Body param: An optional description for the profile. Set to `null` to remove
709
+ * during update.
710
+ */
711
+ description?: string | null;
712
+
713
+ /**
714
+ * Body param: Specifies whether to print on both sides of the paper.
715
+ */
716
+ doubleSided?: boolean;
717
+
718
+ /**
719
+ * Body param: ID of a custom envelope to use.
720
+ */
721
+ envelope?: string;
722
+
723
+ /**
724
+ * Body param: Mailing class.
725
+ */
726
+ mailingClass?:
727
+ | 'first_class'
728
+ | 'standard_class'
729
+ | 'express'
730
+ | 'certified'
731
+ | 'certified_return_receipt'
732
+ | 'registered'
733
+ | 'usps_first_class'
734
+ | 'usps_standard_class'
735
+ | 'usps_eddm'
736
+ | 'usps_express_2_day'
737
+ | 'usps_express_3_day'
738
+ | 'usps_first_class_certified'
739
+ | 'usps_first_class_certified_return_receipt'
740
+ | 'usps_first_class_registered'
741
+ | 'usps_express_3_day_signature_confirmation'
742
+ | 'usps_express_3_day_certified'
743
+ | 'usps_express_3_day_certified_return_receipt'
744
+ | 'ca_post_lettermail'
745
+ | 'ca_post_personalized'
746
+ | 'ca_post_neighbourhood_mail'
747
+ | 'ups_express_overnight'
748
+ | 'ups_express_2_day'
749
+ | 'ups_express_3_day'
750
+ | 'royal_mail_first_class'
751
+ | 'royal_mail_second_class'
752
+ | 'au_post_second_class';
753
+
754
+ /**
755
+ * Body param: Default merge variables for orders created using this profile.
756
+ */
757
+ mergeVariables?: { [key: string]: unknown } | null;
758
+
759
+ /**
760
+ * Body param: Optional key-value metadata.
761
+ */
762
+ metadata?: { [key: string]: string } | null;
763
+
764
+ /**
765
+ * Body param: A PDF file containing the letter content. Cannot be used with
766
+ * `template`.
767
+ */
768
+ pdf?: string;
769
+
770
+ /**
771
+ * Body param: Specifies which page number should be perforated (if any).
772
+ */
773
+ perforatedPage?: 1;
774
+
775
+ /**
776
+ * Body param: ID of a return envelope to include.
777
+ */
778
+ returnEnvelope?: string;
779
+
780
+ /**
781
+ * Body param: ID of a template to use for the letter content. Cannot be used with
782
+ * `pdf`.
783
+ */
784
+ template?: string;
785
+ }
786
+
787
+ export namespace LetterCreateParams {
788
+ /**
789
+ * Model representing an attached PDF.
790
+ */
791
+ export interface AttachedPdf {
792
+ /**
793
+ * The file (multipart form upload) or URL pointing to a PDF for the attached PDF.
794
+ */
795
+ file: string;
796
+
797
+ /**
798
+ * Enum representing the placement of the attached PDF.
799
+ */
800
+ placement: 'before_template' | 'after_template';
801
+ }
802
+ }
803
+
804
+ export interface LetterRetrieveParams {
805
+ /**
806
+ * Optional list of related resources to expand in the response.
807
+ */
808
+ expand?: Array<string>;
809
+ }
810
+
811
+ export interface LetterUpdateParams {
812
+ /**
813
+ * Query param: Optional list of related resources to expand in the response.
814
+ */
815
+ expand?: Array<string>;
816
+
817
+ /**
818
+ * Body param: Enum representing the placement of the address on the letter.
819
+ */
820
+ addressPlacement?: 'top_first_page' | 'insert_blank_page';
821
+
822
+ /**
823
+ * Body param: Model representing an attached PDF.
824
+ */
825
+ attachedPDF?: LetterUpdateParams.AttachedPdf;
826
+
827
+ /**
828
+ * Body param: Specifies whether to print in color (true) or black and white
829
+ * (false).
830
+ */
831
+ color?: boolean;
832
+
833
+ /**
834
+ * Body param: An optional description for the profile. Set to `null` to remove
835
+ * during update.
836
+ */
837
+ description?: string | null;
838
+
839
+ /**
840
+ * Body param: Specifies whether to print on both sides of the paper.
841
+ */
842
+ doubleSided?: boolean;
843
+
844
+ /**
845
+ * Body param: ID of a custom envelope to use.
846
+ */
847
+ envelope?: string;
848
+
849
+ /**
850
+ * Body param: Mailing class.
851
+ */
852
+ mailingClass?:
853
+ | 'first_class'
854
+ | 'standard_class'
855
+ | 'express'
856
+ | 'certified'
857
+ | 'certified_return_receipt'
858
+ | 'registered'
859
+ | 'usps_first_class'
860
+ | 'usps_standard_class'
861
+ | 'usps_eddm'
862
+ | 'usps_express_2_day'
863
+ | 'usps_express_3_day'
864
+ | 'usps_first_class_certified'
865
+ | 'usps_first_class_certified_return_receipt'
866
+ | 'usps_first_class_registered'
867
+ | 'usps_express_3_day_signature_confirmation'
868
+ | 'usps_express_3_day_certified'
869
+ | 'usps_express_3_day_certified_return_receipt'
870
+ | 'ca_post_lettermail'
871
+ | 'ca_post_personalized'
872
+ | 'ca_post_neighbourhood_mail'
873
+ | 'ups_express_overnight'
874
+ | 'ups_express_2_day'
875
+ | 'ups_express_3_day'
876
+ | 'royal_mail_first_class'
877
+ | 'royal_mail_second_class'
878
+ | 'au_post_second_class';
879
+
880
+ /**
881
+ * Body param: Default merge variables for orders created using this profile.
882
+ */
883
+ mergeVariables?: { [key: string]: unknown } | null;
884
+
885
+ /**
886
+ * Body param: Optional key-value metadata.
887
+ */
888
+ metadata?: { [key: string]: string } | null;
889
+
890
+ /**
891
+ * Body param: A PDF file containing the letter content. Cannot be used with
892
+ * `template`.
893
+ */
894
+ pdf?: string;
895
+
896
+ /**
897
+ * Body param: Specifies which page number should be perforated (if any).
898
+ */
899
+ perforatedPage?: 1;
900
+
901
+ /**
902
+ * Body param: ID of a return envelope to include.
903
+ */
904
+ returnEnvelope?: string;
905
+
906
+ /**
907
+ * Body param: ID of a template to use for the letter content. Cannot be used with
908
+ * `pdf`.
909
+ */
910
+ template?: string;
911
+ }
912
+
913
+ export namespace LetterUpdateParams {
914
+ /**
915
+ * Model representing an attached PDF.
916
+ */
917
+ export interface AttachedPdf {
918
+ /**
919
+ * The file (multipart form upload) or URL pointing to a PDF for the attached PDF.
920
+ */
921
+ file: string;
922
+
923
+ /**
924
+ * Enum representing the placement of the attached PDF.
925
+ */
926
+ placement: 'before_template' | 'after_template';
927
+ }
928
+ }
929
+
930
+ export interface LetterListParams extends ListParams {
931
+ /**
932
+ * You can supply any string to help narrow down the list of resources. For
933
+ * example, if you pass `"New York"` (quoted), it will return resources that have
934
+ * that string present somewhere in their response. Alternatively, you can supply a
935
+ * structured search query. See the documentation on `StructuredSearchQuery` for
936
+ * more details.
937
+ */
938
+ search?: string;
939
+ }
940
+
941
+ Letters.LetterListResponsesList = LetterListResponsesList;
942
+
943
+ export declare namespace Letters {
944
+ export {
945
+ type LetterCreateResponse as LetterCreateResponse,
946
+ type LetterRetrieveResponse as LetterRetrieveResponse,
947
+ type LetterUpdateResponse as LetterUpdateResponse,
948
+ type LetterListResponse as LetterListResponse,
949
+ type LetterDeleteResponse as LetterDeleteResponse,
950
+ LetterListResponsesList as LetterListResponsesList,
951
+ type LetterCreateParams as LetterCreateParams,
952
+ type LetterRetrieveParams as LetterRetrieveParams,
953
+ type LetterUpdateParams as LetterUpdateParams,
954
+ type LetterListParams as LetterListParams,
955
+ };
956
+ }