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,1076 @@
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 MailingListImports extends APIResource {
9
+ /**
10
+ * Create a new mailing list import.
11
+ *
12
+ * Initiates the import process for a contact list file. The import enters the
13
+ * `validating` status while contacts are processed and verified.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const mailingListImport =
18
+ * await client.mailingListImports.create({
19
+ * file: 'https://signed-upload-url.csv',
20
+ * fileType: 'csv',
21
+ * receiverAddressMapping: {
22
+ * description: 'Description',
23
+ * firstName: 'First Name',
24
+ * lastName: 'Last Name',
25
+ * email: 'Email',
26
+ * addressLine1: 'Address',
27
+ * city: 'City',
28
+ * postalOrZip: 'Postal Code',
29
+ * provinceOrState: 'State',
30
+ * countryCode: 'Country',
31
+ * },
32
+ * });
33
+ * ```
34
+ */
35
+ create(
36
+ body: MailingListImportCreateParams,
37
+ options?: Core.RequestOptions,
38
+ ): Core.APIPromise<MailingListImportCreateResponse> {
39
+ return this._client.post('/mailing_list_imports', { body, ...options });
40
+ }
41
+
42
+ /**
43
+ * Retrieve a specific mailing list import by its ID.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const mailingListImport =
48
+ * await client.mailingListImports.retrieve('id');
49
+ * ```
50
+ */
51
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<MailingListImportRetrieveResponse> {
52
+ return this._client.get(`/mailing_list_imports/${id}`, options);
53
+ }
54
+
55
+ /**
56
+ * Update an existing mailing list import.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const mailingListImport =
61
+ * await client.mailingListImports.update('id', {
62
+ * description: 'Corrected description',
63
+ * metadata: { batch: 'spring_sale' },
64
+ * });
65
+ * ```
66
+ */
67
+ update(
68
+ id: string,
69
+ body: MailingListImportUpdateParams,
70
+ options?: Core.RequestOptions,
71
+ ): Core.APIPromise<MailingListImportUpdateResponse> {
72
+ return this._client.post(`/mailing_list_imports/${id}`, { body, ...options });
73
+ }
74
+
75
+ /**
76
+ * Retrieve a list of mailing list imports.
77
+ *
78
+ * Returns a paginated list of imports associated with the authenticated
79
+ * organization, filterable by various parameters.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * // Automatically fetches more pages as needed.
84
+ * for await (const mailingListImportListResponse of client.mailingListImports.list()) {
85
+ * // ...
86
+ * }
87
+ * ```
88
+ */
89
+ list(
90
+ query?: MailingListImportListParams,
91
+ options?: Core.RequestOptions,
92
+ ): Core.PagePromise<MailingListImportListResponsesList, MailingListImportListResponse>;
93
+ list(
94
+ options?: Core.RequestOptions,
95
+ ): Core.PagePromise<MailingListImportListResponsesList, MailingListImportListResponse>;
96
+ list(
97
+ query: MailingListImportListParams | Core.RequestOptions = {},
98
+ options?: Core.RequestOptions,
99
+ ): Core.PagePromise<MailingListImportListResponsesList, MailingListImportListResponse> {
100
+ if (isRequestOptions(query)) {
101
+ return this.list({}, query);
102
+ }
103
+ return this._client.getAPIList('/mailing_list_imports', MailingListImportListResponsesList, {
104
+ query,
105
+ ...options,
106
+ });
107
+ }
108
+
109
+ /**
110
+ * Delete a mailing list import.
111
+ *
112
+ * This permanently deletes the import and its associated resources. This operation
113
+ * cannot be undone.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * const mailingListImport =
118
+ * await client.mailingListImports.delete('id');
119
+ * ```
120
+ */
121
+ delete(id: string, options?: Core.RequestOptions): Core.APIPromise<MailingListImportDeleteResponse> {
122
+ return this._client.delete(`/mailing_list_imports/${id}`, options);
123
+ }
124
+ }
125
+
126
+ export class MailingListImportListResponsesList extends List<MailingListImportListResponse> {}
127
+
128
+ /**
129
+ * Read-only view of a MailingListImport
130
+ */
131
+ export interface MailingListImportCreateResponse {
132
+ /**
133
+ * A unique ID prefixed with mailing*list_import*
134
+ */
135
+ id: string;
136
+
137
+ /**
138
+ * The UTC time at which this resource was created.
139
+ */
140
+ createdAt: string;
141
+
142
+ /**
143
+ * A list of processing errors encountered, if any. Present when status is
144
+ * 'changes_required'.
145
+ */
146
+ errors: Array<MailingListImportCreateResponse.Error>;
147
+
148
+ /**
149
+ * The file object your controller returns: all the mappings plus a signed URL.
150
+ */
151
+ file: MailingListImportCreateResponse.File;
152
+
153
+ /**
154
+ * Number of invalid rows found in the file.
155
+ */
156
+ invalidRowCount: number;
157
+
158
+ /**
159
+ * `true` if this is a live mode resource else `false`.
160
+ */
161
+ live: boolean;
162
+
163
+ /**
164
+ * Additional notes about the import process.
165
+ */
166
+ notes: Array<MailingListImportCreateResponse.Note>;
167
+
168
+ /**
169
+ * The organization that owns this import.
170
+ */
171
+ organization: string;
172
+
173
+ /**
174
+ * Count of contact verification statuses.
175
+ */
176
+ receiverStatusCount: MailingListImportCreateResponse.ReceiverStatusCount;
177
+
178
+ /**
179
+ * Status of the mailing list import process.
180
+ */
181
+ status: 'validating' | 'completed' | 'changes_required';
182
+
183
+ /**
184
+ * The UTC time at which this resource was last updated.
185
+ */
186
+ updatedAt: string;
187
+
188
+ /**
189
+ * Number of valid rows processed from the file.
190
+ */
191
+ validRowCount: number;
192
+
193
+ /**
194
+ * An optional string describing this resource. Will be visible in the API and the
195
+ * dashboard.
196
+ */
197
+ description?: string;
198
+
199
+ /**
200
+ * See the section on Metadata.
201
+ */
202
+ metadata?: { [key: string]: unknown };
203
+
204
+ /**
205
+ * A temporary URL to download the processing report, available once the import is
206
+ * completed.
207
+ */
208
+ reportURL?: string;
209
+
210
+ /**
211
+ * Count of contact verification statuses.
212
+ */
213
+ senderStatusCount?: MailingListImportCreateResponse.SenderStatusCount;
214
+ }
215
+
216
+ export namespace MailingListImportCreateResponse {
217
+ /**
218
+ * Details of a specific error encountered during import processing.
219
+ */
220
+ export interface Error {
221
+ /**
222
+ * A human-readable message describing the error.
223
+ */
224
+ message: string;
225
+
226
+ /**
227
+ * Type of error encountered during import processing.
228
+ */
229
+ type:
230
+ | 'no_valid_contacts_error'
231
+ | 'multiple_countries_error'
232
+ | 'invalid_contact_count_error'
233
+ | 'internal_service_error';
234
+ }
235
+
236
+ /**
237
+ * The file object your controller returns: all the mappings plus a signed URL.
238
+ */
239
+ export interface File {
240
+ /**
241
+ * Type of file supported for mailing list imports.
242
+ */
243
+ fileType: 'csv';
244
+
245
+ /**
246
+ * Mapping of columns for receiver addresses. Contact fields to file columns.
247
+ * Possible Contact fields:
248
+ *
249
+ * - description
250
+ * - firstName
251
+ * - lastName
252
+ * - email
253
+ * - phoneNumber
254
+ * - companyName
255
+ * - addressLine1
256
+ * - addressLine2
257
+ * - jobTitle
258
+ * - city
259
+ * - postalOrZip
260
+ * - provinceOrState
261
+ * - countryCode
262
+ */
263
+ receiverAddressMapping: { [key: string]: string };
264
+
265
+ /**
266
+ * The signed URL your controller generates.
267
+ */
268
+ url: string;
269
+
270
+ /**
271
+ * Optional mapping of columns for receiver merge variables.
272
+ */
273
+ receiverMergeVariableMapping?: { [key: string]: string };
274
+
275
+ /**
276
+ * Optional mapping of columns for sender addresses.
277
+ */
278
+ senderAddressMapping?: { [key: string]: string };
279
+
280
+ /**
281
+ * Optional mapping of columns for sender merge variables.
282
+ */
283
+ senderMergeVariableMapping?: { [key: string]: string };
284
+ }
285
+
286
+ /**
287
+ * Details about a note in the import process.
288
+ */
289
+ export interface Note {
290
+ /**
291
+ * A human-readable message describing the note.
292
+ */
293
+ message: string;
294
+
295
+ /**
296
+ * Type of note attached to the import process.
297
+ */
298
+ type: 'truncated_test_file' | 'skipped_invalid_contacts';
299
+ }
300
+
301
+ /**
302
+ * Count of contact verification statuses.
303
+ */
304
+ export interface ReceiverStatusCount {
305
+ /**
306
+ * Number of contacts that were corrected during verification.
307
+ */
308
+ correctedCount: number;
309
+
310
+ /**
311
+ * Number of contacts that failed verification.
312
+ */
313
+ failedCount: number;
314
+
315
+ /**
316
+ * Number of contacts that were verified without changes.
317
+ */
318
+ verifiedCount: number;
319
+ }
320
+
321
+ /**
322
+ * Count of contact verification statuses.
323
+ */
324
+ export interface SenderStatusCount {
325
+ /**
326
+ * Number of contacts that were corrected during verification.
327
+ */
328
+ correctedCount: number;
329
+
330
+ /**
331
+ * Number of contacts that failed verification.
332
+ */
333
+ failedCount: number;
334
+
335
+ /**
336
+ * Number of contacts that were verified without changes.
337
+ */
338
+ verifiedCount: number;
339
+ }
340
+ }
341
+
342
+ /**
343
+ * Read-only view of a MailingListImport
344
+ */
345
+ export interface MailingListImportRetrieveResponse {
346
+ /**
347
+ * A unique ID prefixed with mailing*list_import*
348
+ */
349
+ id: string;
350
+
351
+ /**
352
+ * The UTC time at which this resource was created.
353
+ */
354
+ createdAt: string;
355
+
356
+ /**
357
+ * A list of processing errors encountered, if any. Present when status is
358
+ * 'changes_required'.
359
+ */
360
+ errors: Array<MailingListImportRetrieveResponse.Error>;
361
+
362
+ /**
363
+ * The file object your controller returns: all the mappings plus a signed URL.
364
+ */
365
+ file: MailingListImportRetrieveResponse.File;
366
+
367
+ /**
368
+ * Number of invalid rows found in the file.
369
+ */
370
+ invalidRowCount: number;
371
+
372
+ /**
373
+ * `true` if this is a live mode resource else `false`.
374
+ */
375
+ live: boolean;
376
+
377
+ /**
378
+ * Additional notes about the import process.
379
+ */
380
+ notes: Array<MailingListImportRetrieveResponse.Note>;
381
+
382
+ /**
383
+ * The organization that owns this import.
384
+ */
385
+ organization: string;
386
+
387
+ /**
388
+ * Count of contact verification statuses.
389
+ */
390
+ receiverStatusCount: MailingListImportRetrieveResponse.ReceiverStatusCount;
391
+
392
+ /**
393
+ * Status of the mailing list import process.
394
+ */
395
+ status: 'validating' | 'completed' | 'changes_required';
396
+
397
+ /**
398
+ * The UTC time at which this resource was last updated.
399
+ */
400
+ updatedAt: string;
401
+
402
+ /**
403
+ * Number of valid rows processed from the file.
404
+ */
405
+ validRowCount: number;
406
+
407
+ /**
408
+ * An optional string describing this resource. Will be visible in the API and the
409
+ * dashboard.
410
+ */
411
+ description?: string;
412
+
413
+ /**
414
+ * See the section on Metadata.
415
+ */
416
+ metadata?: { [key: string]: unknown };
417
+
418
+ /**
419
+ * A temporary URL to download the processing report, available once the import is
420
+ * completed.
421
+ */
422
+ reportURL?: string;
423
+
424
+ /**
425
+ * Count of contact verification statuses.
426
+ */
427
+ senderStatusCount?: MailingListImportRetrieveResponse.SenderStatusCount;
428
+ }
429
+
430
+ export namespace MailingListImportRetrieveResponse {
431
+ /**
432
+ * Details of a specific error encountered during import processing.
433
+ */
434
+ export interface Error {
435
+ /**
436
+ * A human-readable message describing the error.
437
+ */
438
+ message: string;
439
+
440
+ /**
441
+ * Type of error encountered during import processing.
442
+ */
443
+ type:
444
+ | 'no_valid_contacts_error'
445
+ | 'multiple_countries_error'
446
+ | 'invalid_contact_count_error'
447
+ | 'internal_service_error';
448
+ }
449
+
450
+ /**
451
+ * The file object your controller returns: all the mappings plus a signed URL.
452
+ */
453
+ export interface File {
454
+ /**
455
+ * Type of file supported for mailing list imports.
456
+ */
457
+ fileType: 'csv';
458
+
459
+ /**
460
+ * Mapping of columns for receiver addresses. Contact fields to file columns.
461
+ * Possible Contact fields:
462
+ *
463
+ * - description
464
+ * - firstName
465
+ * - lastName
466
+ * - email
467
+ * - phoneNumber
468
+ * - companyName
469
+ * - addressLine1
470
+ * - addressLine2
471
+ * - jobTitle
472
+ * - city
473
+ * - postalOrZip
474
+ * - provinceOrState
475
+ * - countryCode
476
+ */
477
+ receiverAddressMapping: { [key: string]: string };
478
+
479
+ /**
480
+ * The signed URL your controller generates.
481
+ */
482
+ url: string;
483
+
484
+ /**
485
+ * Optional mapping of columns for receiver merge variables.
486
+ */
487
+ receiverMergeVariableMapping?: { [key: string]: string };
488
+
489
+ /**
490
+ * Optional mapping of columns for sender addresses.
491
+ */
492
+ senderAddressMapping?: { [key: string]: string };
493
+
494
+ /**
495
+ * Optional mapping of columns for sender merge variables.
496
+ */
497
+ senderMergeVariableMapping?: { [key: string]: string };
498
+ }
499
+
500
+ /**
501
+ * Details about a note in the import process.
502
+ */
503
+ export interface Note {
504
+ /**
505
+ * A human-readable message describing the note.
506
+ */
507
+ message: string;
508
+
509
+ /**
510
+ * Type of note attached to the import process.
511
+ */
512
+ type: 'truncated_test_file' | 'skipped_invalid_contacts';
513
+ }
514
+
515
+ /**
516
+ * Count of contact verification statuses.
517
+ */
518
+ export interface ReceiverStatusCount {
519
+ /**
520
+ * Number of contacts that were corrected during verification.
521
+ */
522
+ correctedCount: number;
523
+
524
+ /**
525
+ * Number of contacts that failed verification.
526
+ */
527
+ failedCount: number;
528
+
529
+ /**
530
+ * Number of contacts that were verified without changes.
531
+ */
532
+ verifiedCount: number;
533
+ }
534
+
535
+ /**
536
+ * Count of contact verification statuses.
537
+ */
538
+ export interface SenderStatusCount {
539
+ /**
540
+ * Number of contacts that were corrected during verification.
541
+ */
542
+ correctedCount: number;
543
+
544
+ /**
545
+ * Number of contacts that failed verification.
546
+ */
547
+ failedCount: number;
548
+
549
+ /**
550
+ * Number of contacts that were verified without changes.
551
+ */
552
+ verifiedCount: number;
553
+ }
554
+ }
555
+
556
+ /**
557
+ * Read-only view of a MailingListImport
558
+ */
559
+ export interface MailingListImportUpdateResponse {
560
+ /**
561
+ * A unique ID prefixed with mailing*list_import*
562
+ */
563
+ id: string;
564
+
565
+ /**
566
+ * The UTC time at which this resource was created.
567
+ */
568
+ createdAt: string;
569
+
570
+ /**
571
+ * A list of processing errors encountered, if any. Present when status is
572
+ * 'changes_required'.
573
+ */
574
+ errors: Array<MailingListImportUpdateResponse.Error>;
575
+
576
+ /**
577
+ * The file object your controller returns: all the mappings plus a signed URL.
578
+ */
579
+ file: MailingListImportUpdateResponse.File;
580
+
581
+ /**
582
+ * Number of invalid rows found in the file.
583
+ */
584
+ invalidRowCount: number;
585
+
586
+ /**
587
+ * `true` if this is a live mode resource else `false`.
588
+ */
589
+ live: boolean;
590
+
591
+ /**
592
+ * Additional notes about the import process.
593
+ */
594
+ notes: Array<MailingListImportUpdateResponse.Note>;
595
+
596
+ /**
597
+ * The organization that owns this import.
598
+ */
599
+ organization: string;
600
+
601
+ /**
602
+ * Count of contact verification statuses.
603
+ */
604
+ receiverStatusCount: MailingListImportUpdateResponse.ReceiverStatusCount;
605
+
606
+ /**
607
+ * Status of the mailing list import process.
608
+ */
609
+ status: 'validating' | 'completed' | 'changes_required';
610
+
611
+ /**
612
+ * The UTC time at which this resource was last updated.
613
+ */
614
+ updatedAt: string;
615
+
616
+ /**
617
+ * Number of valid rows processed from the file.
618
+ */
619
+ validRowCount: number;
620
+
621
+ /**
622
+ * An optional string describing this resource. Will be visible in the API and the
623
+ * dashboard.
624
+ */
625
+ description?: string;
626
+
627
+ /**
628
+ * See the section on Metadata.
629
+ */
630
+ metadata?: { [key: string]: unknown };
631
+
632
+ /**
633
+ * A temporary URL to download the processing report, available once the import is
634
+ * completed.
635
+ */
636
+ reportURL?: string;
637
+
638
+ /**
639
+ * Count of contact verification statuses.
640
+ */
641
+ senderStatusCount?: MailingListImportUpdateResponse.SenderStatusCount;
642
+ }
643
+
644
+ export namespace MailingListImportUpdateResponse {
645
+ /**
646
+ * Details of a specific error encountered during import processing.
647
+ */
648
+ export interface Error {
649
+ /**
650
+ * A human-readable message describing the error.
651
+ */
652
+ message: string;
653
+
654
+ /**
655
+ * Type of error encountered during import processing.
656
+ */
657
+ type:
658
+ | 'no_valid_contacts_error'
659
+ | 'multiple_countries_error'
660
+ | 'invalid_contact_count_error'
661
+ | 'internal_service_error';
662
+ }
663
+
664
+ /**
665
+ * The file object your controller returns: all the mappings plus a signed URL.
666
+ */
667
+ export interface File {
668
+ /**
669
+ * Type of file supported for mailing list imports.
670
+ */
671
+ fileType: 'csv';
672
+
673
+ /**
674
+ * Mapping of columns for receiver addresses. Contact fields to file columns.
675
+ * Possible Contact fields:
676
+ *
677
+ * - description
678
+ * - firstName
679
+ * - lastName
680
+ * - email
681
+ * - phoneNumber
682
+ * - companyName
683
+ * - addressLine1
684
+ * - addressLine2
685
+ * - jobTitle
686
+ * - city
687
+ * - postalOrZip
688
+ * - provinceOrState
689
+ * - countryCode
690
+ */
691
+ receiverAddressMapping: { [key: string]: string };
692
+
693
+ /**
694
+ * The signed URL your controller generates.
695
+ */
696
+ url: string;
697
+
698
+ /**
699
+ * Optional mapping of columns for receiver merge variables.
700
+ */
701
+ receiverMergeVariableMapping?: { [key: string]: string };
702
+
703
+ /**
704
+ * Optional mapping of columns for sender addresses.
705
+ */
706
+ senderAddressMapping?: { [key: string]: string };
707
+
708
+ /**
709
+ * Optional mapping of columns for sender merge variables.
710
+ */
711
+ senderMergeVariableMapping?: { [key: string]: string };
712
+ }
713
+
714
+ /**
715
+ * Details about a note in the import process.
716
+ */
717
+ export interface Note {
718
+ /**
719
+ * A human-readable message describing the note.
720
+ */
721
+ message: string;
722
+
723
+ /**
724
+ * Type of note attached to the import process.
725
+ */
726
+ type: 'truncated_test_file' | 'skipped_invalid_contacts';
727
+ }
728
+
729
+ /**
730
+ * Count of contact verification statuses.
731
+ */
732
+ export interface ReceiverStatusCount {
733
+ /**
734
+ * Number of contacts that were corrected during verification.
735
+ */
736
+ correctedCount: number;
737
+
738
+ /**
739
+ * Number of contacts that failed verification.
740
+ */
741
+ failedCount: number;
742
+
743
+ /**
744
+ * Number of contacts that were verified without changes.
745
+ */
746
+ verifiedCount: number;
747
+ }
748
+
749
+ /**
750
+ * Count of contact verification statuses.
751
+ */
752
+ export interface SenderStatusCount {
753
+ /**
754
+ * Number of contacts that were corrected during verification.
755
+ */
756
+ correctedCount: number;
757
+
758
+ /**
759
+ * Number of contacts that failed verification.
760
+ */
761
+ failedCount: number;
762
+
763
+ /**
764
+ * Number of contacts that were verified without changes.
765
+ */
766
+ verifiedCount: number;
767
+ }
768
+ }
769
+
770
+ /**
771
+ * Read-only view of a MailingListImport
772
+ */
773
+ export interface MailingListImportListResponse {
774
+ /**
775
+ * A unique ID prefixed with mailing*list_import*
776
+ */
777
+ id: string;
778
+
779
+ /**
780
+ * The UTC time at which this resource was created.
781
+ */
782
+ createdAt: string;
783
+
784
+ /**
785
+ * A list of processing errors encountered, if any. Present when status is
786
+ * 'changes_required'.
787
+ */
788
+ errors: Array<MailingListImportListResponse.Error>;
789
+
790
+ /**
791
+ * The file object your controller returns: all the mappings plus a signed URL.
792
+ */
793
+ file: MailingListImportListResponse.File;
794
+
795
+ /**
796
+ * Number of invalid rows found in the file.
797
+ */
798
+ invalidRowCount: number;
799
+
800
+ /**
801
+ * `true` if this is a live mode resource else `false`.
802
+ */
803
+ live: boolean;
804
+
805
+ /**
806
+ * Additional notes about the import process.
807
+ */
808
+ notes: Array<MailingListImportListResponse.Note>;
809
+
810
+ /**
811
+ * The organization that owns this import.
812
+ */
813
+ organization: string;
814
+
815
+ /**
816
+ * Count of contact verification statuses.
817
+ */
818
+ receiverStatusCount: MailingListImportListResponse.ReceiverStatusCount;
819
+
820
+ /**
821
+ * Status of the mailing list import process.
822
+ */
823
+ status: 'validating' | 'completed' | 'changes_required';
824
+
825
+ /**
826
+ * The UTC time at which this resource was last updated.
827
+ */
828
+ updatedAt: string;
829
+
830
+ /**
831
+ * Number of valid rows processed from the file.
832
+ */
833
+ validRowCount: number;
834
+
835
+ /**
836
+ * An optional string describing this resource. Will be visible in the API and the
837
+ * dashboard.
838
+ */
839
+ description?: string;
840
+
841
+ /**
842
+ * See the section on Metadata.
843
+ */
844
+ metadata?: { [key: string]: unknown };
845
+
846
+ /**
847
+ * A temporary URL to download the processing report, available once the import is
848
+ * completed.
849
+ */
850
+ reportURL?: string;
851
+
852
+ /**
853
+ * Count of contact verification statuses.
854
+ */
855
+ senderStatusCount?: MailingListImportListResponse.SenderStatusCount;
856
+ }
857
+
858
+ export namespace MailingListImportListResponse {
859
+ /**
860
+ * Details of a specific error encountered during import processing.
861
+ */
862
+ export interface Error {
863
+ /**
864
+ * A human-readable message describing the error.
865
+ */
866
+ message: string;
867
+
868
+ /**
869
+ * Type of error encountered during import processing.
870
+ */
871
+ type:
872
+ | 'no_valid_contacts_error'
873
+ | 'multiple_countries_error'
874
+ | 'invalid_contact_count_error'
875
+ | 'internal_service_error';
876
+ }
877
+
878
+ /**
879
+ * The file object your controller returns: all the mappings plus a signed URL.
880
+ */
881
+ export interface File {
882
+ /**
883
+ * Type of file supported for mailing list imports.
884
+ */
885
+ fileType: 'csv';
886
+
887
+ /**
888
+ * Mapping of columns for receiver addresses. Contact fields to file columns.
889
+ * Possible Contact fields:
890
+ *
891
+ * - description
892
+ * - firstName
893
+ * - lastName
894
+ * - email
895
+ * - phoneNumber
896
+ * - companyName
897
+ * - addressLine1
898
+ * - addressLine2
899
+ * - jobTitle
900
+ * - city
901
+ * - postalOrZip
902
+ * - provinceOrState
903
+ * - countryCode
904
+ */
905
+ receiverAddressMapping: { [key: string]: string };
906
+
907
+ /**
908
+ * The signed URL your controller generates.
909
+ */
910
+ url: string;
911
+
912
+ /**
913
+ * Optional mapping of columns for receiver merge variables.
914
+ */
915
+ receiverMergeVariableMapping?: { [key: string]: string };
916
+
917
+ /**
918
+ * Optional mapping of columns for sender addresses.
919
+ */
920
+ senderAddressMapping?: { [key: string]: string };
921
+
922
+ /**
923
+ * Optional mapping of columns for sender merge variables.
924
+ */
925
+ senderMergeVariableMapping?: { [key: string]: string };
926
+ }
927
+
928
+ /**
929
+ * Details about a note in the import process.
930
+ */
931
+ export interface Note {
932
+ /**
933
+ * A human-readable message describing the note.
934
+ */
935
+ message: string;
936
+
937
+ /**
938
+ * Type of note attached to the import process.
939
+ */
940
+ type: 'truncated_test_file' | 'skipped_invalid_contacts';
941
+ }
942
+
943
+ /**
944
+ * Count of contact verification statuses.
945
+ */
946
+ export interface ReceiverStatusCount {
947
+ /**
948
+ * Number of contacts that were corrected during verification.
949
+ */
950
+ correctedCount: number;
951
+
952
+ /**
953
+ * Number of contacts that failed verification.
954
+ */
955
+ failedCount: number;
956
+
957
+ /**
958
+ * Number of contacts that were verified without changes.
959
+ */
960
+ verifiedCount: number;
961
+ }
962
+
963
+ /**
964
+ * Count of contact verification statuses.
965
+ */
966
+ export interface SenderStatusCount {
967
+ /**
968
+ * Number of contacts that were corrected during verification.
969
+ */
970
+ correctedCount: number;
971
+
972
+ /**
973
+ * Number of contacts that failed verification.
974
+ */
975
+ failedCount: number;
976
+
977
+ /**
978
+ * Number of contacts that were verified without changes.
979
+ */
980
+ verifiedCount: number;
981
+ }
982
+ }
983
+
984
+ export interface MailingListImportDeleteResponse {
985
+ /**
986
+ * A unique ID prefixed with mailing*list_import*
987
+ */
988
+ id: string;
989
+
990
+ deleted: true;
991
+ }
992
+
993
+ export interface MailingListImportCreateParams {
994
+ /**
995
+ * The CSV file for this import.
996
+ */
997
+ file: string;
998
+
999
+ /**
1000
+ * Type of file supported for mailing list imports.
1001
+ */
1002
+ fileType: 'csv';
1003
+
1004
+ /**
1005
+ * Mapping of columns for receiver addresses.
1006
+ */
1007
+ receiverAddressMapping: { [key: string]: string };
1008
+
1009
+ /**
1010
+ * An optional string describing this resource. Will be visible in the API and the
1011
+ * dashboard.
1012
+ */
1013
+ description?: string;
1014
+
1015
+ /**
1016
+ * See the section on Metadata.
1017
+ */
1018
+ metadata?: { [key: string]: unknown };
1019
+
1020
+ /**
1021
+ * Optional mapping of columns for receiver merge variables.
1022
+ */
1023
+ receiverMergeVariableMapping?: { [key: string]: string };
1024
+
1025
+ /**
1026
+ * Optional mapping of columns for sender addresses. If this is present, then all
1027
+ * receivers should have a corresponding sender.
1028
+ */
1029
+ senderAddressMapping?: { [key: string]: string };
1030
+
1031
+ /**
1032
+ * Optional mapping of columns for sender merge variables.
1033
+ */
1034
+ senderMergeVariableMapping?: { [key: string]: string };
1035
+ }
1036
+
1037
+ export interface MailingListImportUpdateParams {
1038
+ /**
1039
+ * An optional description for the import. Set to `null` to remove the existing
1040
+ * description.
1041
+ */
1042
+ description?: string | null;
1043
+
1044
+ /**
1045
+ * Optional key-value data associated with the import. Set to `null` to remove
1046
+ * existing metadata.
1047
+ */
1048
+ metadata?: { [key: string]: string } | null;
1049
+ }
1050
+
1051
+ export interface MailingListImportListParams extends ListParams {
1052
+ /**
1053
+ * You can supply any string to help narrow down the list of resources. For
1054
+ * example, if you pass `"New York"` (quoted), it will return resources that have
1055
+ * that string present somewhere in their response. Alternatively, you can supply a
1056
+ * structured search query. See the documentation on `StructuredSearchQuery` for
1057
+ * more details.
1058
+ */
1059
+ search?: string;
1060
+ }
1061
+
1062
+ MailingListImports.MailingListImportListResponsesList = MailingListImportListResponsesList;
1063
+
1064
+ export declare namespace MailingListImports {
1065
+ export {
1066
+ type MailingListImportCreateResponse as MailingListImportCreateResponse,
1067
+ type MailingListImportRetrieveResponse as MailingListImportRetrieveResponse,
1068
+ type MailingListImportUpdateResponse as MailingListImportUpdateResponse,
1069
+ type MailingListImportListResponse as MailingListImportListResponse,
1070
+ type MailingListImportDeleteResponse as MailingListImportDeleteResponse,
1071
+ MailingListImportListResponsesList as MailingListImportListResponsesList,
1072
+ type MailingListImportCreateParams as MailingListImportCreateParams,
1073
+ type MailingListImportUpdateParams as MailingListImportUpdateParams,
1074
+ type MailingListImportListParams as MailingListImportListParams,
1075
+ };
1076
+ }