postgrid-node 0.5.0 → 0.6.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.
Files changed (422) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/LICENSE +1 -1
  3. package/README.md +13 -10
  4. package/client.d.mts +30 -10
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +30 -10
  7. package/client.d.ts.map +1 -1
  8. package/client.js +56 -10
  9. package/client.js.map +1 -1
  10. package/client.mjs +57 -11
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/internal/types.d.mts +6 -6
  19. package/internal/types.d.mts.map +1 -1
  20. package/internal/types.d.ts +6 -6
  21. package/internal/types.d.ts.map +1 -1
  22. package/internal/utils/env.js +2 -2
  23. package/internal/utils/env.js.map +1 -1
  24. package/internal/utils/env.mjs +2 -2
  25. package/internal/utils/env.mjs.map +1 -1
  26. package/internal/utils/log.d.mts.map +1 -1
  27. package/internal/utils/log.d.ts.map +1 -1
  28. package/internal/utils/log.js +3 -2
  29. package/internal/utils/log.js.map +1 -1
  30. package/internal/utils/log.mjs +3 -2
  31. package/internal/utils/log.mjs.map +1 -1
  32. package/internal/utils/query.d.mts +5 -0
  33. package/internal/utils/query.d.mts.map +1 -0
  34. package/internal/utils/query.d.ts +5 -0
  35. package/internal/utils/query.d.ts.map +1 -0
  36. package/internal/utils/query.js +23 -0
  37. package/internal/utils/query.js.map +1 -0
  38. package/internal/utils/query.mjs +20 -0
  39. package/internal/utils/query.mjs.map +1 -0
  40. package/internal/utils.d.mts +1 -0
  41. package/internal/utils.d.ts +1 -0
  42. package/internal/utils.js +1 -0
  43. package/internal/utils.js.map +1 -1
  44. package/internal/utils.mjs +1 -0
  45. package/package.json +7 -1
  46. package/resources/address-verification.d.mts +1689 -15
  47. package/resources/address-verification.d.mts.map +1 -1
  48. package/resources/address-verification.d.ts +1689 -15
  49. package/resources/address-verification.d.ts.map +1 -1
  50. package/resources/address-verification.js +200 -0
  51. package/resources/address-verification.js.map +1 -1
  52. package/resources/address-verification.mjs +200 -0
  53. package/resources/address-verification.mjs.map +1 -1
  54. package/resources/index.d.mts +3 -3
  55. package/resources/index.d.mts.map +1 -1
  56. package/resources/index.d.ts +3 -3
  57. package/resources/index.d.ts.map +1 -1
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +1 -1
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/intl-address-verification.d.mts +956 -35
  62. package/resources/intl-address-verification.d.mts.map +1 -1
  63. package/resources/intl-address-verification.d.ts +956 -35
  64. package/resources/intl-address-verification.d.ts.map +1 -1
  65. package/resources/intl-address-verification.js +121 -27
  66. package/resources/intl-address-verification.js.map +1 -1
  67. package/resources/intl-address-verification.mjs +121 -27
  68. package/resources/intl-address-verification.mjs.map +1 -1
  69. package/resources/print-mail/boxes.d.mts +995 -0
  70. package/resources/print-mail/boxes.d.mts.map +1 -0
  71. package/resources/print-mail/boxes.d.ts +995 -0
  72. package/resources/print-mail/boxes.d.ts.map +1 -0
  73. package/resources/print-mail/boxes.js +103 -0
  74. package/resources/print-mail/boxes.js.map +1 -0
  75. package/resources/print-mail/boxes.mjs +99 -0
  76. package/resources/print-mail/boxes.mjs.map +1 -0
  77. package/resources/print-mail/campaigns.d.mts +923 -34
  78. package/resources/print-mail/campaigns.d.mts.map +1 -1
  79. package/resources/print-mail/campaigns.d.ts +923 -34
  80. package/resources/print-mail/campaigns.d.ts.map +1 -1
  81. package/resources/print-mail/campaigns.js +10 -3
  82. package/resources/print-mail/campaigns.js.map +1 -1
  83. package/resources/print-mail/campaigns.mjs +10 -3
  84. package/resources/print-mail/campaigns.mjs.map +1 -1
  85. package/resources/print-mail/cheques.d.mts +35 -5
  86. package/resources/print-mail/cheques.d.mts.map +1 -1
  87. package/resources/print-mail/cheques.d.ts +35 -5
  88. package/resources/print-mail/cheques.d.ts.map +1 -1
  89. package/resources/print-mail/cheques.js +32 -0
  90. package/resources/print-mail/cheques.js.map +1 -1
  91. package/resources/print-mail/cheques.mjs +32 -0
  92. package/resources/print-mail/cheques.mjs.map +1 -1
  93. package/resources/print-mail/contacts.d.mts +138 -3
  94. package/resources/print-mail/contacts.d.mts.map +1 -1
  95. package/resources/print-mail/contacts.d.ts +138 -3
  96. package/resources/print-mail/contacts.d.ts.map +1 -1
  97. package/resources/print-mail/contacts.js.map +1 -1
  98. package/resources/print-mail/contacts.mjs.map +1 -1
  99. package/resources/print-mail/index.d.mts +12 -7
  100. package/resources/print-mail/index.d.mts.map +1 -1
  101. package/resources/print-mail/index.d.ts +12 -7
  102. package/resources/print-mail/index.d.ts.map +1 -1
  103. package/resources/print-mail/index.js +15 -5
  104. package/resources/print-mail/index.js.map +1 -1
  105. package/resources/print-mail/index.mjs +6 -1
  106. package/resources/print-mail/index.mjs.map +1 -1
  107. package/resources/print-mail/letters.d.mts +36 -6
  108. package/resources/print-mail/letters.d.mts.map +1 -1
  109. package/resources/print-mail/letters.d.ts +36 -6
  110. package/resources/print-mail/letters.d.ts.map +1 -1
  111. package/resources/print-mail/letters.js +32 -0
  112. package/resources/print-mail/letters.js.map +1 -1
  113. package/resources/print-mail/letters.mjs +32 -0
  114. package/resources/print-mail/letters.mjs.map +1 -1
  115. package/resources/print-mail/mailing-list-imports.d.mts +5 -1
  116. package/resources/print-mail/mailing-list-imports.d.mts.map +1 -1
  117. package/resources/print-mail/mailing-list-imports.d.ts +5 -1
  118. package/resources/print-mail/mailing-list-imports.d.ts.map +1 -1
  119. package/resources/print-mail/mailing-list-imports.js +4 -0
  120. package/resources/print-mail/mailing-list-imports.js.map +1 -1
  121. package/resources/print-mail/mailing-list-imports.mjs +4 -0
  122. package/resources/print-mail/mailing-list-imports.mjs.map +1 -1
  123. package/resources/print-mail/mailing-lists.d.mts +5 -1
  124. package/resources/print-mail/mailing-lists.d.mts.map +1 -1
  125. package/resources/print-mail/mailing-lists.d.ts +5 -1
  126. package/resources/print-mail/mailing-lists.d.ts.map +1 -1
  127. package/resources/print-mail/mailing-lists.js +4 -0
  128. package/resources/print-mail/mailing-lists.js.map +1 -1
  129. package/resources/print-mail/mailing-lists.mjs +4 -0
  130. package/resources/print-mail/mailing-lists.mjs.map +1 -1
  131. package/resources/print-mail/postcards.d.mts +63 -13
  132. package/resources/print-mail/postcards.d.mts.map +1 -1
  133. package/resources/print-mail/postcards.d.ts +63 -13
  134. package/resources/print-mail/postcards.d.ts.map +1 -1
  135. package/resources/print-mail/postcards.js +33 -0
  136. package/resources/print-mail/postcards.js.map +1 -1
  137. package/resources/print-mail/postcards.mjs +33 -0
  138. package/resources/print-mail/postcards.mjs.map +1 -1
  139. package/resources/print-mail/print-mail.d.mts +42 -159
  140. package/resources/print-mail/print-mail.d.mts.map +1 -1
  141. package/resources/print-mail/print-mail.d.ts +42 -159
  142. package/resources/print-mail/print-mail.d.ts.map +1 -1
  143. package/resources/print-mail/print-mail.js +36 -16
  144. package/resources/print-mail/print-mail.js.map +1 -1
  145. package/resources/print-mail/print-mail.mjs +36 -16
  146. package/resources/print-mail/print-mail.mjs.map +1 -1
  147. package/resources/print-mail/reports/exports.d.mts +7 -0
  148. package/resources/print-mail/reports/exports.d.mts.map +1 -1
  149. package/resources/print-mail/reports/exports.d.ts +7 -0
  150. package/resources/print-mail/reports/exports.d.ts.map +1 -1
  151. package/resources/print-mail/reports/exports.js +7 -0
  152. package/resources/print-mail/reports/exports.js.map +1 -1
  153. package/resources/print-mail/reports/exports.mjs +7 -0
  154. package/resources/print-mail/reports/exports.mjs.map +1 -1
  155. package/resources/print-mail/reports/reports.d.mts +7 -0
  156. package/resources/print-mail/reports/reports.d.mts.map +1 -1
  157. package/resources/print-mail/reports/reports.d.ts +7 -0
  158. package/resources/print-mail/reports/reports.d.ts.map +1 -1
  159. package/resources/print-mail/reports/reports.js +7 -0
  160. package/resources/print-mail/reports/reports.js.map +1 -1
  161. package/resources/print-mail/reports/reports.mjs +7 -0
  162. package/resources/print-mail/reports/reports.mjs.map +1 -1
  163. package/resources/print-mail/reports/samples.d.mts +7 -0
  164. package/resources/print-mail/reports/samples.d.mts.map +1 -1
  165. package/resources/print-mail/reports/samples.d.ts +7 -0
  166. package/resources/print-mail/reports/samples.d.ts.map +1 -1
  167. package/resources/print-mail/reports/samples.js +7 -0
  168. package/resources/print-mail/reports/samples.js.map +1 -1
  169. package/resources/print-mail/reports/samples.mjs +7 -0
  170. package/resources/print-mail/reports/samples.mjs.map +1 -1
  171. package/resources/print-mail/self-mailers.d.mts +25 -12
  172. package/resources/print-mail/self-mailers.d.mts.map +1 -1
  173. package/resources/print-mail/self-mailers.d.ts +25 -12
  174. package/resources/print-mail/self-mailers.d.ts.map +1 -1
  175. package/resources/print-mail/self-mailers.js +17 -0
  176. package/resources/print-mail/self-mailers.js.map +1 -1
  177. package/resources/print-mail/self-mailers.mjs +17 -0
  178. package/resources/print-mail/self-mailers.mjs.map +1 -1
  179. package/resources/print-mail/snap-packs.d.mts +1060 -0
  180. package/resources/print-mail/snap-packs.d.mts.map +1 -0
  181. package/resources/print-mail/snap-packs.d.ts +1060 -0
  182. package/resources/print-mail/snap-packs.d.ts.map +1 -0
  183. package/resources/print-mail/snap-packs.js +117 -0
  184. package/resources/print-mail/snap-packs.js.map +1 -0
  185. package/resources/print-mail/snap-packs.mjs +113 -0
  186. package/resources/print-mail/snap-packs.mjs.map +1 -0
  187. package/resources/print-mail/sub-organizations.d.mts +29 -17
  188. package/resources/print-mail/sub-organizations.d.mts.map +1 -1
  189. package/resources/print-mail/sub-organizations.d.ts +29 -17
  190. package/resources/print-mail/sub-organizations.d.ts.map +1 -1
  191. package/resources/print-mail/sub-organizations.js +26 -14
  192. package/resources/print-mail/sub-organizations.js.map +1 -1
  193. package/resources/print-mail/sub-organizations.mjs +26 -14
  194. package/resources/print-mail/sub-organizations.mjs.map +1 -1
  195. package/resources/print-mail/targeted-list-builds/filters.d.mts +92 -0
  196. package/resources/print-mail/targeted-list-builds/filters.d.mts.map +1 -0
  197. package/resources/print-mail/targeted-list-builds/filters.d.ts +92 -0
  198. package/resources/print-mail/targeted-list-builds/filters.d.ts.map +1 -0
  199. package/resources/print-mail/targeted-list-builds/filters.js +60 -0
  200. package/resources/print-mail/targeted-list-builds/filters.js.map +1 -0
  201. package/resources/print-mail/targeted-list-builds/filters.mjs +56 -0
  202. package/resources/print-mail/targeted-list-builds/filters.mjs.map +1 -0
  203. package/resources/print-mail/targeted-list-builds/index.d.mts +3 -0
  204. package/resources/print-mail/targeted-list-builds/index.d.mts.map +1 -0
  205. package/resources/print-mail/targeted-list-builds/index.d.ts +3 -0
  206. package/resources/print-mail/targeted-list-builds/index.d.ts.map +1 -0
  207. package/resources/print-mail/targeted-list-builds/index.js +9 -0
  208. package/resources/print-mail/targeted-list-builds/index.js.map +1 -0
  209. package/resources/print-mail/targeted-list-builds/index.mjs +4 -0
  210. package/resources/print-mail/targeted-list-builds/index.mjs.map +1 -0
  211. package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.mts +1633 -0
  212. package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.mts.map +1 -0
  213. package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.ts +1633 -0
  214. package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.ts.map +1 -0
  215. package/resources/print-mail/targeted-list-builds/targeted-list-builds.js +154 -0
  216. package/resources/print-mail/targeted-list-builds/targeted-list-builds.js.map +1 -0
  217. package/resources/print-mail/targeted-list-builds/targeted-list-builds.mjs +149 -0
  218. package/resources/print-mail/targeted-list-builds/targeted-list-builds.mjs.map +1 -0
  219. package/resources/print-mail/targeted-list-builds.d.mts +2 -0
  220. package/resources/print-mail/targeted-list-builds.d.mts.map +1 -0
  221. package/resources/print-mail/targeted-list-builds.d.ts +2 -0
  222. package/resources/print-mail/targeted-list-builds.d.ts.map +1 -0
  223. package/resources/print-mail/targeted-list-builds.js +6 -0
  224. package/resources/print-mail/targeted-list-builds.js.map +1 -0
  225. package/resources/print-mail/targeted-list-builds.mjs +3 -0
  226. package/resources/print-mail/targeted-list-builds.mjs.map +1 -0
  227. package/resources/print-mail/template-editor-sessions.d.mts +355 -0
  228. package/resources/print-mail/template-editor-sessions.d.mts.map +1 -0
  229. package/resources/print-mail/template-editor-sessions.d.ts +355 -0
  230. package/resources/print-mail/template-editor-sessions.d.ts.map +1 -0
  231. package/resources/print-mail/template-editor-sessions.js +78 -0
  232. package/resources/print-mail/template-editor-sessions.js.map +1 -0
  233. package/resources/print-mail/template-editor-sessions.mjs +74 -0
  234. package/resources/print-mail/template-editor-sessions.mjs.map +1 -0
  235. package/resources/print-mail/trackers.d.mts +409 -0
  236. package/resources/print-mail/trackers.d.mts.map +1 -0
  237. package/resources/print-mail/trackers.d.ts +409 -0
  238. package/resources/print-mail/trackers.d.ts.map +1 -0
  239. package/resources/print-mail/trackers.js +116 -0
  240. package/resources/print-mail/trackers.js.map +1 -0
  241. package/resources/print-mail/trackers.mjs +112 -0
  242. package/resources/print-mail/trackers.mjs.map +1 -0
  243. package/resources/print-mail/virtual-mailboxes/index.d.mts +3 -0
  244. package/resources/print-mail/virtual-mailboxes/index.d.mts.map +1 -0
  245. package/resources/print-mail/virtual-mailboxes/index.d.ts +3 -0
  246. package/resources/print-mail/virtual-mailboxes/index.d.ts.map +1 -0
  247. package/resources/print-mail/virtual-mailboxes/index.js +9 -0
  248. package/resources/print-mail/virtual-mailboxes/index.js.map +1 -0
  249. package/resources/print-mail/virtual-mailboxes/index.mjs +4 -0
  250. package/resources/print-mail/virtual-mailboxes/index.mjs.map +1 -0
  251. package/resources/print-mail/virtual-mailboxes/items.d.mts +235 -0
  252. package/resources/print-mail/virtual-mailboxes/items.d.mts.map +1 -0
  253. package/resources/print-mail/virtual-mailboxes/items.d.ts +235 -0
  254. package/resources/print-mail/virtual-mailboxes/items.d.ts.map +1 -0
  255. package/resources/print-mail/virtual-mailboxes/items.js +69 -0
  256. package/resources/print-mail/virtual-mailboxes/items.js.map +1 -0
  257. package/resources/print-mail/virtual-mailboxes/items.mjs +65 -0
  258. package/resources/print-mail/virtual-mailboxes/items.mjs.map +1 -0
  259. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.mts +334 -0
  260. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.mts.map +1 -0
  261. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.ts +334 -0
  262. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.ts.map +1 -0
  263. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.js +92 -0
  264. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.js.map +1 -0
  265. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.mjs +87 -0
  266. package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.mjs.map +1 -0
  267. package/resources/print-mail/virtual-mailboxes.d.mts +2 -0
  268. package/resources/print-mail/virtual-mailboxes.d.mts.map +1 -0
  269. package/resources/print-mail/virtual-mailboxes.d.ts +2 -0
  270. package/resources/print-mail/virtual-mailboxes.d.ts.map +1 -0
  271. package/resources/print-mail/{order-profiles.js → virtual-mailboxes.js} +2 -2
  272. package/resources/print-mail/virtual-mailboxes.js.map +1 -0
  273. package/resources/print-mail/virtual-mailboxes.mjs +3 -0
  274. package/resources/print-mail/virtual-mailboxes.mjs.map +1 -0
  275. package/src/client.ts +116 -26
  276. package/src/internal/parse.ts +6 -0
  277. package/src/internal/types.ts +6 -8
  278. package/src/internal/utils/env.ts +2 -2
  279. package/src/internal/utils/log.ts +2 -1
  280. package/src/internal/utils/query.ts +23 -0
  281. package/src/internal/utils.ts +1 -0
  282. package/src/resources/address-verification.ts +2190 -24
  283. package/src/resources/index.ts +24 -5
  284. package/src/resources/intl-address-verification.ts +1219 -43
  285. package/src/resources/print-mail/boxes.ts +1324 -0
  286. package/src/resources/print-mail/campaigns.ts +1449 -59
  287. package/src/resources/print-mail/cheques.ts +42 -4
  288. package/src/resources/print-mail/contacts.ts +167 -4
  289. package/src/resources/print-mail/index.ts +79 -4
  290. package/src/resources/print-mail/letters.ts +43 -5
  291. package/src/resources/print-mail/mailing-list-imports.ts +5 -1
  292. package/src/resources/print-mail/mailing-lists.ts +5 -1
  293. package/src/resources/print-mail/postcards.ts +74 -12
  294. package/src/resources/print-mail/print-mail.ts +245 -239
  295. package/src/resources/print-mail/reports/exports.ts +7 -0
  296. package/src/resources/print-mail/reports/reports.ts +7 -0
  297. package/src/resources/print-mail/reports/samples.ts +7 -0
  298. package/src/resources/print-mail/self-mailers.ts +28 -12
  299. package/src/resources/print-mail/snap-packs.ts +1484 -0
  300. package/src/resources/print-mail/sub-organizations.ts +35 -23
  301. package/src/resources/print-mail/targeted-list-builds/filters.ts +113 -0
  302. package/src/resources/print-mail/targeted-list-builds/index.ts +16 -0
  303. package/src/resources/print-mail/targeted-list-builds/targeted-list-builds.ts +2158 -0
  304. package/{resources/print-mail/order-profiles.mjs → src/resources/print-mail/targeted-list-builds.ts} +2 -2
  305. package/src/resources/print-mail/template-editor-sessions.ts +435 -0
  306. package/src/resources/print-mail/trackers.ts +513 -0
  307. package/src/resources/print-mail/virtual-mailboxes/index.ts +22 -0
  308. package/src/resources/print-mail/virtual-mailboxes/items.ts +296 -0
  309. package/src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts +434 -0
  310. package/src/resources/print-mail/{order-profiles.ts → virtual-mailboxes.ts} +1 -1
  311. package/src/version.ts +1 -1
  312. package/version.d.mts +1 -1
  313. package/version.d.ts +1 -1
  314. package/version.js +1 -1
  315. package/version.mjs +1 -1
  316. package/internal/qs/formats.d.mts +0 -7
  317. package/internal/qs/formats.d.mts.map +0 -1
  318. package/internal/qs/formats.d.ts +0 -7
  319. package/internal/qs/formats.d.ts.map +0 -1
  320. package/internal/qs/formats.js +0 -13
  321. package/internal/qs/formats.js.map +0 -1
  322. package/internal/qs/formats.mjs +0 -9
  323. package/internal/qs/formats.mjs.map +0 -1
  324. package/internal/qs/index.d.mts +0 -10
  325. package/internal/qs/index.d.mts.map +0 -1
  326. package/internal/qs/index.d.ts +0 -10
  327. package/internal/qs/index.d.ts.map +0 -1
  328. package/internal/qs/index.js +0 -14
  329. package/internal/qs/index.js.map +0 -1
  330. package/internal/qs/index.mjs +0 -10
  331. package/internal/qs/index.mjs.map +0 -1
  332. package/internal/qs/stringify.d.mts +0 -3
  333. package/internal/qs/stringify.d.mts.map +0 -1
  334. package/internal/qs/stringify.d.ts +0 -3
  335. package/internal/qs/stringify.d.ts.map +0 -1
  336. package/internal/qs/stringify.js +0 -277
  337. package/internal/qs/stringify.js.map +0 -1
  338. package/internal/qs/stringify.mjs +0 -274
  339. package/internal/qs/stringify.mjs.map +0 -1
  340. package/internal/qs/types.d.mts +0 -57
  341. package/internal/qs/types.d.mts.map +0 -1
  342. package/internal/qs/types.d.ts +0 -57
  343. package/internal/qs/types.d.ts.map +0 -1
  344. package/internal/qs/types.js +0 -3
  345. package/internal/qs/types.js.map +0 -1
  346. package/internal/qs/types.mjs +0 -2
  347. package/internal/qs/types.mjs.map +0 -1
  348. package/internal/qs/utils.d.mts +0 -15
  349. package/internal/qs/utils.d.mts.map +0 -1
  350. package/internal/qs/utils.d.ts +0 -15
  351. package/internal/qs/utils.d.ts.map +0 -1
  352. package/internal/qs/utils.js +0 -230
  353. package/internal/qs/utils.js.map +0 -1
  354. package/internal/qs/utils.mjs +0 -217
  355. package/internal/qs/utils.mjs.map +0 -1
  356. package/resources/print-mail/order-profiles/cheques.d.mts +0 -387
  357. package/resources/print-mail/order-profiles/cheques.d.mts.map +0 -1
  358. package/resources/print-mail/order-profiles/cheques.d.ts +0 -387
  359. package/resources/print-mail/order-profiles/cheques.d.ts.map +0 -1
  360. package/resources/print-mail/order-profiles/cheques.js +0 -98
  361. package/resources/print-mail/order-profiles/cheques.js.map +0 -1
  362. package/resources/print-mail/order-profiles/cheques.mjs +0 -94
  363. package/resources/print-mail/order-profiles/cheques.mjs.map +0 -1
  364. package/resources/print-mail/order-profiles/index.d.mts +0 -6
  365. package/resources/print-mail/order-profiles/index.d.mts.map +0 -1
  366. package/resources/print-mail/order-profiles/index.d.ts +0 -6
  367. package/resources/print-mail/order-profiles/index.d.ts.map +0 -1
  368. package/resources/print-mail/order-profiles/index.js +0 -15
  369. package/resources/print-mail/order-profiles/index.js.map +0 -1
  370. package/resources/print-mail/order-profiles/index.mjs +0 -7
  371. package/resources/print-mail/order-profiles/index.mjs.map +0 -1
  372. package/resources/print-mail/order-profiles/letters.d.mts +0 -324
  373. package/resources/print-mail/order-profiles/letters.d.mts.map +0 -1
  374. package/resources/print-mail/order-profiles/letters.d.ts +0 -324
  375. package/resources/print-mail/order-profiles/letters.d.ts.map +0 -1
  376. package/resources/print-mail/order-profiles/letters.js +0 -105
  377. package/resources/print-mail/order-profiles/letters.js.map +0 -1
  378. package/resources/print-mail/order-profiles/letters.mjs +0 -101
  379. package/resources/print-mail/order-profiles/letters.mjs.map +0 -1
  380. package/resources/print-mail/order-profiles/order-profiles.d.mts +0 -22
  381. package/resources/print-mail/order-profiles/order-profiles.d.mts.map +0 -1
  382. package/resources/print-mail/order-profiles/order-profiles.d.ts +0 -22
  383. package/resources/print-mail/order-profiles/order-profiles.d.ts.map +0 -1
  384. package/resources/print-mail/order-profiles/order-profiles.js +0 -29
  385. package/resources/print-mail/order-profiles/order-profiles.js.map +0 -1
  386. package/resources/print-mail/order-profiles/order-profiles.mjs +0 -24
  387. package/resources/print-mail/order-profiles/order-profiles.mjs.map +0 -1
  388. package/resources/print-mail/order-profiles/postcards.d.mts +0 -254
  389. package/resources/print-mail/order-profiles/postcards.d.mts.map +0 -1
  390. package/resources/print-mail/order-profiles/postcards.d.ts +0 -254
  391. package/resources/print-mail/order-profiles/postcards.d.ts.map +0 -1
  392. package/resources/print-mail/order-profiles/postcards.js +0 -97
  393. package/resources/print-mail/order-profiles/postcards.js.map +0 -1
  394. package/resources/print-mail/order-profiles/postcards.mjs +0 -93
  395. package/resources/print-mail/order-profiles/postcards.mjs.map +0 -1
  396. package/resources/print-mail/order-profiles/self-mailers.d.mts +0 -259
  397. package/resources/print-mail/order-profiles/self-mailers.d.mts.map +0 -1
  398. package/resources/print-mail/order-profiles/self-mailers.d.ts +0 -259
  399. package/resources/print-mail/order-profiles/self-mailers.d.ts.map +0 -1
  400. package/resources/print-mail/order-profiles/self-mailers.js +0 -95
  401. package/resources/print-mail/order-profiles/self-mailers.js.map +0 -1
  402. package/resources/print-mail/order-profiles/self-mailers.mjs +0 -91
  403. package/resources/print-mail/order-profiles/self-mailers.mjs.map +0 -1
  404. package/resources/print-mail/order-profiles.d.mts +0 -2
  405. package/resources/print-mail/order-profiles.d.mts.map +0 -1
  406. package/resources/print-mail/order-profiles.d.ts +0 -2
  407. package/resources/print-mail/order-profiles.d.ts.map +0 -1
  408. package/resources/print-mail/order-profiles.js.map +0 -1
  409. package/resources/print-mail/order-profiles.mjs.map +0 -1
  410. package/src/internal/qs/LICENSE.md +0 -13
  411. package/src/internal/qs/README.md +0 -3
  412. package/src/internal/qs/formats.ts +0 -10
  413. package/src/internal/qs/index.ts +0 -13
  414. package/src/internal/qs/stringify.ts +0 -385
  415. package/src/internal/qs/types.ts +0 -71
  416. package/src/internal/qs/utils.ts +0 -265
  417. package/src/resources/print-mail/order-profiles/cheques.ts +0 -589
  418. package/src/resources/print-mail/order-profiles/index.ts +0 -47
  419. package/src/resources/print-mail/order-profiles/letters.ts +0 -489
  420. package/src/resources/print-mail/order-profiles/order-profiles.ts +0 -113
  421. package/src/resources/print-mail/order-profiles/postcards.ts +0 -404
  422. package/src/resources/print-mail/order-profiles/self-mailers.ts +0 -415
@@ -0,0 +1,1324 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ContactsAPI from './contacts';
5
+ import { APIPromise } from '../../core/api-promise';
6
+ import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
9
+
10
+ export class Boxes extends APIResource {
11
+ /**
12
+ * This endpoint allows you to create a box containing up to 100 cheques. A Box is
13
+ * mailed to a single destination.
14
+ *
15
+ * To create a box. You must specify:
16
+ *
17
+ * - `to`: The recipient (contact or contact ID)
18
+ * - `from`: The sender (contact or contact ID)
19
+ * - `cheques`: An array of cheques to go in the box
20
+ *
21
+ * For each cheque You must specify:
22
+ *
23
+ * - `to`: The recipient (contact or contact ID)
24
+ * - `from`: The sender (contact or contact ID)
25
+ * - `bankAccount`: The bank account ID
26
+ * - `amount`: The amount to be sent
27
+ * - `number`: The cheque number
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const box = await client.printMail.boxes.create({
32
+ * cheques: [
33
+ * {
34
+ * from: 'contact_456',
35
+ * to: 'contact_123',
36
+ * bankAccount: 'bank_abc',
37
+ * amount: 5000,
38
+ * number: 1042,
39
+ * },
40
+ * ],
41
+ * from: 'contact_456',
42
+ * to: 'contact_123',
43
+ * });
44
+ * ```
45
+ */
46
+ create(body: BoxCreateParams, options?: RequestOptions): APIPromise<BoxCreateResponse> {
47
+ return this._client.post('/print-mail/v1/boxes', { body, ...options });
48
+ }
49
+
50
+ /**
51
+ * Retrieve a box by ID.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const box = await client.printMail.boxes.retrieve('id');
56
+ * ```
57
+ */
58
+ retrieve(id: string, options?: RequestOptions): APIPromise<BoxRetrieveResponse> {
59
+ return this._client.get(path`/print-mail/v1/boxes/${id}`, options);
60
+ }
61
+
62
+ /**
63
+ * List all boxes.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // Automatically fetches more pages as needed.
68
+ * for await (const boxListResponse of client.printMail.boxes.list()) {
69
+ * // ...
70
+ * }
71
+ * ```
72
+ */
73
+ list(
74
+ query: BoxListParams | null | undefined = {},
75
+ options?: RequestOptions,
76
+ ): PagePromise<BoxListResponsesSkipLimit, BoxListResponse> {
77
+ return this._client.getAPIList('/print-mail/v1/boxes', SkipLimit<BoxListResponse>, { query, ...options });
78
+ }
79
+
80
+ /**
81
+ * Cancel a box by ID (cannot be undone).
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const box = await client.printMail.boxes.delete('id');
86
+ * ```
87
+ */
88
+ delete(id: string, options?: RequestOptions): APIPromise<BoxDeleteResponse> {
89
+ return this._client.delete(path`/print-mail/v1/boxes/${id}`, options);
90
+ }
91
+
92
+ /**
93
+ * Progresses a box's `status` to the next stage. This is only available in test
94
+ * mode and can be used to simulate how a live order would progress through the
95
+ * different statuses.
96
+ *
97
+ * Note: this will fail with an `invalid_progression_error` if the status is one of
98
+ * `completed` or `cancelled`.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const response = await client.printMail.boxes.progressions(
103
+ * 'id',
104
+ * );
105
+ * ```
106
+ */
107
+ progressions(id: string, options?: RequestOptions): APIPromise<BoxProgressionsResponse> {
108
+ return this._client.post(path`/print-mail/v1/boxes/${id}/progressions`, options);
109
+ }
110
+ }
111
+
112
+ export type BoxListResponsesSkipLimit = SkipLimit<BoxListResponse>;
113
+
114
+ export interface BoxCreateResponse {
115
+ /**
116
+ * A unique ID prefixed with box\_
117
+ */
118
+ id: string;
119
+
120
+ /**
121
+ * The cheques inside this box (in read mode).
122
+ */
123
+ cheques: Array<BoxCreateResponse.Cheque>;
124
+
125
+ /**
126
+ * The UTC time at which this resource was created.
127
+ */
128
+ createdAt: string;
129
+
130
+ /**
131
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
132
+ */
133
+ from: ContactsAPI.Contact;
134
+
135
+ /**
136
+ * `true` if this is a live mode resource else `false`.
137
+ */
138
+ live: boolean;
139
+
140
+ /**
141
+ * The mailing class of this order. This determines the speed and cost of delivery.
142
+ * See `OrderMailingClass` for more details.
143
+ */
144
+ mailingClass:
145
+ | 'first_class'
146
+ | 'standard_class'
147
+ | 'express'
148
+ | 'certified'
149
+ | 'certified_return_receipt'
150
+ | 'registered'
151
+ | 'usps_first_class'
152
+ | 'usps_standard_class'
153
+ | 'usps_eddm'
154
+ | 'usps_express_2_day'
155
+ | 'usps_express_3_day'
156
+ | 'usps_first_class_certified'
157
+ | 'usps_first_class_certified_return_receipt'
158
+ | 'usps_first_class_registered'
159
+ | 'usps_express_3_day_signature_confirmation'
160
+ | 'usps_express_3_day_certified'
161
+ | 'usps_express_3_day_certified_return_receipt'
162
+ | 'ca_post_lettermail'
163
+ | 'ca_post_personalized'
164
+ | 'ca_post_neighbourhood_mail'
165
+ | 'ups_express_overnight'
166
+ | 'ups_express_2_day'
167
+ | 'ups_express_3_day'
168
+ | 'royal_mail_first_class'
169
+ | 'royal_mail_second_class'
170
+ | 'au_post_second_class';
171
+
172
+ /**
173
+ * Always "box".
174
+ */
175
+ object: 'box';
176
+
177
+ /**
178
+ * This order will transition from `ready` to `printing` on the day after this
179
+ * date. For example, if this is a date on Tuesday, the order will transition to
180
+ * `printing` on Wednesday at midnight eastern time.
181
+ */
182
+ sendDate: string;
183
+
184
+ /**
185
+ * See `OrderStatus` for more details on the status of this order.
186
+ */
187
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
188
+
189
+ /**
190
+ * The recipient of this order. This will be provided even if you delete the
191
+ * underlying contact.
192
+ */
193
+ to: ContactsAPI.Contact;
194
+
195
+ /**
196
+ * The UTC time at which this resource was last updated.
197
+ */
198
+ updatedAt: string;
199
+
200
+ /**
201
+ * The cancellation details of this order. Populated if the order has been
202
+ * cancelled.
203
+ */
204
+ cancellation?: BoxCreateResponse.Cancellation;
205
+
206
+ /**
207
+ * An optional string describing this resource. Will be visible in the API and the
208
+ * dashboard.
209
+ */
210
+ description?: string;
211
+
212
+ /**
213
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
214
+ */
215
+ imbDate?: string;
216
+
217
+ /**
218
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
219
+ * US-printed and US-destined orders. This is the most detailed way to track
220
+ * non-express/certified orders.
221
+ */
222
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
223
+
224
+ /**
225
+ * The most recent ZIP code of the USPS facility that the order has been processed
226
+ * through. Only populated when an `imbStatus` is present.
227
+ */
228
+ imbZIPCode?: string;
229
+
230
+ /**
231
+ * These will be merged with the variables in the template or HTML you create this
232
+ * order with. The keys in this object should match the variable names in the
233
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
234
+ * PDFs uploaded with the order.
235
+ */
236
+ mergeVariables?: { [key: string]: unknown };
237
+
238
+ /**
239
+ * See the section on Metadata.
240
+ */
241
+ metadata?: { [key: string]: unknown };
242
+
243
+ /**
244
+ * The tracking number of this order. Populated after an express/certified order
245
+ * has been processed for delivery.
246
+ */
247
+ trackingNumber?: string;
248
+
249
+ /**
250
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
251
+ * ensure that the order is correct before it is sent out because it shows what
252
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
253
+ * this field will be returned by all `GET` endpoints which produce this order.
254
+ *
255
+ * This URL is a signed link to the PDF preview. It will expire after a short
256
+ * period of time. If you need to access this URL after it has expired, you can
257
+ * regenerate it by calling the `GET` endpoint again.
258
+ */
259
+ url?: string;
260
+ }
261
+
262
+ export namespace BoxCreateResponse {
263
+ export interface Cheque {
264
+ /**
265
+ * The amount on the cheque.
266
+ */
267
+ amount: number;
268
+
269
+ /**
270
+ * The bank account (ID or reference) from which the cheque amount is drawn.
271
+ */
272
+ bankAccount: string;
273
+
274
+ from: ContactsAPI.Contact;
275
+
276
+ /**
277
+ * The cheque number.
278
+ */
279
+ number: number;
280
+
281
+ to: ContactsAPI.Contact;
282
+
283
+ /**
284
+ * A URL to a logo for the cheque (optional).
285
+ */
286
+ logoURL?: string;
287
+
288
+ /**
289
+ * The memo text on the cheque (optional).
290
+ */
291
+ memo?: string;
292
+
293
+ /**
294
+ * A set of dynamic merge variables for customizing the cheque or accompanying
295
+ * documents (optional).
296
+ */
297
+ mergeVariables?: { [key: string]: unknown };
298
+
299
+ /**
300
+ * An optional message template to be printed on or with the cheque.
301
+ */
302
+ messageTemplate?: string;
303
+ }
304
+
305
+ /**
306
+ * The cancellation details of this order. Populated if the order has been
307
+ * cancelled.
308
+ */
309
+ export interface Cancellation {
310
+ /**
311
+ * The reason for the cancellation.
312
+ */
313
+ reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
314
+
315
+ /**
316
+ * The user ID who cancelled the order.
317
+ */
318
+ cancelledByUser?: string;
319
+
320
+ /**
321
+ * An optional note provided by the user who cancelled the order.
322
+ */
323
+ note?: string;
324
+ }
325
+ }
326
+
327
+ export interface BoxRetrieveResponse {
328
+ /**
329
+ * A unique ID prefixed with box\_
330
+ */
331
+ id: string;
332
+
333
+ /**
334
+ * The cheques inside this box (in read mode).
335
+ */
336
+ cheques: Array<BoxRetrieveResponse.Cheque>;
337
+
338
+ /**
339
+ * The UTC time at which this resource was created.
340
+ */
341
+ createdAt: string;
342
+
343
+ /**
344
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
345
+ */
346
+ from: ContactsAPI.Contact;
347
+
348
+ /**
349
+ * `true` if this is a live mode resource else `false`.
350
+ */
351
+ live: boolean;
352
+
353
+ /**
354
+ * The mailing class of this order. This determines the speed and cost of delivery.
355
+ * See `OrderMailingClass` for more details.
356
+ */
357
+ mailingClass:
358
+ | 'first_class'
359
+ | 'standard_class'
360
+ | 'express'
361
+ | 'certified'
362
+ | 'certified_return_receipt'
363
+ | 'registered'
364
+ | 'usps_first_class'
365
+ | 'usps_standard_class'
366
+ | 'usps_eddm'
367
+ | 'usps_express_2_day'
368
+ | 'usps_express_3_day'
369
+ | 'usps_first_class_certified'
370
+ | 'usps_first_class_certified_return_receipt'
371
+ | 'usps_first_class_registered'
372
+ | 'usps_express_3_day_signature_confirmation'
373
+ | 'usps_express_3_day_certified'
374
+ | 'usps_express_3_day_certified_return_receipt'
375
+ | 'ca_post_lettermail'
376
+ | 'ca_post_personalized'
377
+ | 'ca_post_neighbourhood_mail'
378
+ | 'ups_express_overnight'
379
+ | 'ups_express_2_day'
380
+ | 'ups_express_3_day'
381
+ | 'royal_mail_first_class'
382
+ | 'royal_mail_second_class'
383
+ | 'au_post_second_class';
384
+
385
+ /**
386
+ * Always "box".
387
+ */
388
+ object: 'box';
389
+
390
+ /**
391
+ * This order will transition from `ready` to `printing` on the day after this
392
+ * date. For example, if this is a date on Tuesday, the order will transition to
393
+ * `printing` on Wednesday at midnight eastern time.
394
+ */
395
+ sendDate: string;
396
+
397
+ /**
398
+ * See `OrderStatus` for more details on the status of this order.
399
+ */
400
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
401
+
402
+ /**
403
+ * The recipient of this order. This will be provided even if you delete the
404
+ * underlying contact.
405
+ */
406
+ to: ContactsAPI.Contact;
407
+
408
+ /**
409
+ * The UTC time at which this resource was last updated.
410
+ */
411
+ updatedAt: string;
412
+
413
+ /**
414
+ * The cancellation details of this order. Populated if the order has been
415
+ * cancelled.
416
+ */
417
+ cancellation?: BoxRetrieveResponse.Cancellation;
418
+
419
+ /**
420
+ * An optional string describing this resource. Will be visible in the API and the
421
+ * dashboard.
422
+ */
423
+ description?: string;
424
+
425
+ /**
426
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
427
+ */
428
+ imbDate?: string;
429
+
430
+ /**
431
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
432
+ * US-printed and US-destined orders. This is the most detailed way to track
433
+ * non-express/certified orders.
434
+ */
435
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
436
+
437
+ /**
438
+ * The most recent ZIP code of the USPS facility that the order has been processed
439
+ * through. Only populated when an `imbStatus` is present.
440
+ */
441
+ imbZIPCode?: string;
442
+
443
+ /**
444
+ * These will be merged with the variables in the template or HTML you create this
445
+ * order with. The keys in this object should match the variable names in the
446
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
447
+ * PDFs uploaded with the order.
448
+ */
449
+ mergeVariables?: { [key: string]: unknown };
450
+
451
+ /**
452
+ * See the section on Metadata.
453
+ */
454
+ metadata?: { [key: string]: unknown };
455
+
456
+ /**
457
+ * The tracking number of this order. Populated after an express/certified order
458
+ * has been processed for delivery.
459
+ */
460
+ trackingNumber?: string;
461
+
462
+ /**
463
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
464
+ * ensure that the order is correct before it is sent out because it shows what
465
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
466
+ * this field will be returned by all `GET` endpoints which produce this order.
467
+ *
468
+ * This URL is a signed link to the PDF preview. It will expire after a short
469
+ * period of time. If you need to access this URL after it has expired, you can
470
+ * regenerate it by calling the `GET` endpoint again.
471
+ */
472
+ url?: string;
473
+ }
474
+
475
+ export namespace BoxRetrieveResponse {
476
+ export interface Cheque {
477
+ /**
478
+ * The amount on the cheque.
479
+ */
480
+ amount: number;
481
+
482
+ /**
483
+ * The bank account (ID or reference) from which the cheque amount is drawn.
484
+ */
485
+ bankAccount: string;
486
+
487
+ from: ContactsAPI.Contact;
488
+
489
+ /**
490
+ * The cheque number.
491
+ */
492
+ number: number;
493
+
494
+ to: ContactsAPI.Contact;
495
+
496
+ /**
497
+ * A URL to a logo for the cheque (optional).
498
+ */
499
+ logoURL?: string;
500
+
501
+ /**
502
+ * The memo text on the cheque (optional).
503
+ */
504
+ memo?: string;
505
+
506
+ /**
507
+ * A set of dynamic merge variables for customizing the cheque or accompanying
508
+ * documents (optional).
509
+ */
510
+ mergeVariables?: { [key: string]: unknown };
511
+
512
+ /**
513
+ * An optional message template to be printed on or with the cheque.
514
+ */
515
+ messageTemplate?: string;
516
+ }
517
+
518
+ /**
519
+ * The cancellation details of this order. Populated if the order has been
520
+ * cancelled.
521
+ */
522
+ export interface Cancellation {
523
+ /**
524
+ * The reason for the cancellation.
525
+ */
526
+ reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
527
+
528
+ /**
529
+ * The user ID who cancelled the order.
530
+ */
531
+ cancelledByUser?: string;
532
+
533
+ /**
534
+ * An optional note provided by the user who cancelled the order.
535
+ */
536
+ note?: string;
537
+ }
538
+ }
539
+
540
+ export interface BoxListResponse {
541
+ /**
542
+ * A unique ID prefixed with box\_
543
+ */
544
+ id: string;
545
+
546
+ /**
547
+ * The cheques inside this box (in read mode).
548
+ */
549
+ cheques: Array<BoxListResponse.Cheque>;
550
+
551
+ /**
552
+ * The UTC time at which this resource was created.
553
+ */
554
+ createdAt: string;
555
+
556
+ /**
557
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
558
+ */
559
+ from: ContactsAPI.Contact;
560
+
561
+ /**
562
+ * `true` if this is a live mode resource else `false`.
563
+ */
564
+ live: boolean;
565
+
566
+ /**
567
+ * The mailing class of this order. This determines the speed and cost of delivery.
568
+ * See `OrderMailingClass` for more details.
569
+ */
570
+ mailingClass:
571
+ | 'first_class'
572
+ | 'standard_class'
573
+ | 'express'
574
+ | 'certified'
575
+ | 'certified_return_receipt'
576
+ | 'registered'
577
+ | 'usps_first_class'
578
+ | 'usps_standard_class'
579
+ | 'usps_eddm'
580
+ | 'usps_express_2_day'
581
+ | 'usps_express_3_day'
582
+ | 'usps_first_class_certified'
583
+ | 'usps_first_class_certified_return_receipt'
584
+ | 'usps_first_class_registered'
585
+ | 'usps_express_3_day_signature_confirmation'
586
+ | 'usps_express_3_day_certified'
587
+ | 'usps_express_3_day_certified_return_receipt'
588
+ | 'ca_post_lettermail'
589
+ | 'ca_post_personalized'
590
+ | 'ca_post_neighbourhood_mail'
591
+ | 'ups_express_overnight'
592
+ | 'ups_express_2_day'
593
+ | 'ups_express_3_day'
594
+ | 'royal_mail_first_class'
595
+ | 'royal_mail_second_class'
596
+ | 'au_post_second_class';
597
+
598
+ /**
599
+ * Always "box".
600
+ */
601
+ object: 'box';
602
+
603
+ /**
604
+ * This order will transition from `ready` to `printing` on the day after this
605
+ * date. For example, if this is a date on Tuesday, the order will transition to
606
+ * `printing` on Wednesday at midnight eastern time.
607
+ */
608
+ sendDate: string;
609
+
610
+ /**
611
+ * See `OrderStatus` for more details on the status of this order.
612
+ */
613
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
614
+
615
+ /**
616
+ * The recipient of this order. This will be provided even if you delete the
617
+ * underlying contact.
618
+ */
619
+ to: ContactsAPI.Contact;
620
+
621
+ /**
622
+ * The UTC time at which this resource was last updated.
623
+ */
624
+ updatedAt: string;
625
+
626
+ /**
627
+ * The cancellation details of this order. Populated if the order has been
628
+ * cancelled.
629
+ */
630
+ cancellation?: BoxListResponse.Cancellation;
631
+
632
+ /**
633
+ * An optional string describing this resource. Will be visible in the API and the
634
+ * dashboard.
635
+ */
636
+ description?: string;
637
+
638
+ /**
639
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
640
+ */
641
+ imbDate?: string;
642
+
643
+ /**
644
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
645
+ * US-printed and US-destined orders. This is the most detailed way to track
646
+ * non-express/certified orders.
647
+ */
648
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
649
+
650
+ /**
651
+ * The most recent ZIP code of the USPS facility that the order has been processed
652
+ * through. Only populated when an `imbStatus` is present.
653
+ */
654
+ imbZIPCode?: string;
655
+
656
+ /**
657
+ * These will be merged with the variables in the template or HTML you create this
658
+ * order with. The keys in this object should match the variable names in the
659
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
660
+ * PDFs uploaded with the order.
661
+ */
662
+ mergeVariables?: { [key: string]: unknown };
663
+
664
+ /**
665
+ * See the section on Metadata.
666
+ */
667
+ metadata?: { [key: string]: unknown };
668
+
669
+ /**
670
+ * The tracking number of this order. Populated after an express/certified order
671
+ * has been processed for delivery.
672
+ */
673
+ trackingNumber?: string;
674
+
675
+ /**
676
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
677
+ * ensure that the order is correct before it is sent out because it shows what
678
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
679
+ * this field will be returned by all `GET` endpoints which produce this order.
680
+ *
681
+ * This URL is a signed link to the PDF preview. It will expire after a short
682
+ * period of time. If you need to access this URL after it has expired, you can
683
+ * regenerate it by calling the `GET` endpoint again.
684
+ */
685
+ url?: string;
686
+ }
687
+
688
+ export namespace BoxListResponse {
689
+ export interface Cheque {
690
+ /**
691
+ * The amount on the cheque.
692
+ */
693
+ amount: number;
694
+
695
+ /**
696
+ * The bank account (ID or reference) from which the cheque amount is drawn.
697
+ */
698
+ bankAccount: string;
699
+
700
+ from: ContactsAPI.Contact;
701
+
702
+ /**
703
+ * The cheque number.
704
+ */
705
+ number: number;
706
+
707
+ to: ContactsAPI.Contact;
708
+
709
+ /**
710
+ * A URL to a logo for the cheque (optional).
711
+ */
712
+ logoURL?: string;
713
+
714
+ /**
715
+ * The memo text on the cheque (optional).
716
+ */
717
+ memo?: string;
718
+
719
+ /**
720
+ * A set of dynamic merge variables for customizing the cheque or accompanying
721
+ * documents (optional).
722
+ */
723
+ mergeVariables?: { [key: string]: unknown };
724
+
725
+ /**
726
+ * An optional message template to be printed on or with the cheque.
727
+ */
728
+ messageTemplate?: string;
729
+ }
730
+
731
+ /**
732
+ * The cancellation details of this order. Populated if the order has been
733
+ * cancelled.
734
+ */
735
+ export interface Cancellation {
736
+ /**
737
+ * The reason for the cancellation.
738
+ */
739
+ reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
740
+
741
+ /**
742
+ * The user ID who cancelled the order.
743
+ */
744
+ cancelledByUser?: string;
745
+
746
+ /**
747
+ * An optional note provided by the user who cancelled the order.
748
+ */
749
+ note?: string;
750
+ }
751
+ }
752
+
753
+ export interface BoxDeleteResponse {
754
+ /**
755
+ * A unique ID prefixed with box\_
756
+ */
757
+ id: string;
758
+
759
+ /**
760
+ * The cheques inside this box (in read mode).
761
+ */
762
+ cheques: Array<BoxDeleteResponse.Cheque>;
763
+
764
+ /**
765
+ * The UTC time at which this resource was created.
766
+ */
767
+ createdAt: string;
768
+
769
+ /**
770
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
771
+ */
772
+ from: ContactsAPI.Contact;
773
+
774
+ /**
775
+ * `true` if this is a live mode resource else `false`.
776
+ */
777
+ live: boolean;
778
+
779
+ /**
780
+ * The mailing class of this order. This determines the speed and cost of delivery.
781
+ * See `OrderMailingClass` for more details.
782
+ */
783
+ mailingClass:
784
+ | 'first_class'
785
+ | 'standard_class'
786
+ | 'express'
787
+ | 'certified'
788
+ | 'certified_return_receipt'
789
+ | 'registered'
790
+ | 'usps_first_class'
791
+ | 'usps_standard_class'
792
+ | 'usps_eddm'
793
+ | 'usps_express_2_day'
794
+ | 'usps_express_3_day'
795
+ | 'usps_first_class_certified'
796
+ | 'usps_first_class_certified_return_receipt'
797
+ | 'usps_first_class_registered'
798
+ | 'usps_express_3_day_signature_confirmation'
799
+ | 'usps_express_3_day_certified'
800
+ | 'usps_express_3_day_certified_return_receipt'
801
+ | 'ca_post_lettermail'
802
+ | 'ca_post_personalized'
803
+ | 'ca_post_neighbourhood_mail'
804
+ | 'ups_express_overnight'
805
+ | 'ups_express_2_day'
806
+ | 'ups_express_3_day'
807
+ | 'royal_mail_first_class'
808
+ | 'royal_mail_second_class'
809
+ | 'au_post_second_class';
810
+
811
+ /**
812
+ * Always "box".
813
+ */
814
+ object: 'box';
815
+
816
+ /**
817
+ * This order will transition from `ready` to `printing` on the day after this
818
+ * date. For example, if this is a date on Tuesday, the order will transition to
819
+ * `printing` on Wednesday at midnight eastern time.
820
+ */
821
+ sendDate: string;
822
+
823
+ /**
824
+ * See `OrderStatus` for more details on the status of this order.
825
+ */
826
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
827
+
828
+ /**
829
+ * The recipient of this order. This will be provided even if you delete the
830
+ * underlying contact.
831
+ */
832
+ to: ContactsAPI.Contact;
833
+
834
+ /**
835
+ * The UTC time at which this resource was last updated.
836
+ */
837
+ updatedAt: string;
838
+
839
+ /**
840
+ * The cancellation details of this order. Populated if the order has been
841
+ * cancelled.
842
+ */
843
+ cancellation?: BoxDeleteResponse.Cancellation;
844
+
845
+ /**
846
+ * An optional string describing this resource. Will be visible in the API and the
847
+ * dashboard.
848
+ */
849
+ description?: string;
850
+
851
+ /**
852
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
853
+ */
854
+ imbDate?: string;
855
+
856
+ /**
857
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
858
+ * US-printed and US-destined orders. This is the most detailed way to track
859
+ * non-express/certified orders.
860
+ */
861
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
862
+
863
+ /**
864
+ * The most recent ZIP code of the USPS facility that the order has been processed
865
+ * through. Only populated when an `imbStatus` is present.
866
+ */
867
+ imbZIPCode?: string;
868
+
869
+ /**
870
+ * These will be merged with the variables in the template or HTML you create this
871
+ * order with. The keys in this object should match the variable names in the
872
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
873
+ * PDFs uploaded with the order.
874
+ */
875
+ mergeVariables?: { [key: string]: unknown };
876
+
877
+ /**
878
+ * See the section on Metadata.
879
+ */
880
+ metadata?: { [key: string]: unknown };
881
+
882
+ /**
883
+ * The tracking number of this order. Populated after an express/certified order
884
+ * has been processed for delivery.
885
+ */
886
+ trackingNumber?: string;
887
+
888
+ /**
889
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
890
+ * ensure that the order is correct before it is sent out because it shows what
891
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
892
+ * this field will be returned by all `GET` endpoints which produce this order.
893
+ *
894
+ * This URL is a signed link to the PDF preview. It will expire after a short
895
+ * period of time. If you need to access this URL after it has expired, you can
896
+ * regenerate it by calling the `GET` endpoint again.
897
+ */
898
+ url?: string;
899
+ }
900
+
901
+ export namespace BoxDeleteResponse {
902
+ export interface Cheque {
903
+ /**
904
+ * The amount on the cheque.
905
+ */
906
+ amount: number;
907
+
908
+ /**
909
+ * The bank account (ID or reference) from which the cheque amount is drawn.
910
+ */
911
+ bankAccount: string;
912
+
913
+ from: ContactsAPI.Contact;
914
+
915
+ /**
916
+ * The cheque number.
917
+ */
918
+ number: number;
919
+
920
+ to: ContactsAPI.Contact;
921
+
922
+ /**
923
+ * A URL to a logo for the cheque (optional).
924
+ */
925
+ logoURL?: string;
926
+
927
+ /**
928
+ * The memo text on the cheque (optional).
929
+ */
930
+ memo?: string;
931
+
932
+ /**
933
+ * A set of dynamic merge variables for customizing the cheque or accompanying
934
+ * documents (optional).
935
+ */
936
+ mergeVariables?: { [key: string]: unknown };
937
+
938
+ /**
939
+ * An optional message template to be printed on or with the cheque.
940
+ */
941
+ messageTemplate?: string;
942
+ }
943
+
944
+ /**
945
+ * The cancellation details of this order. Populated if the order has been
946
+ * cancelled.
947
+ */
948
+ export interface Cancellation {
949
+ /**
950
+ * The reason for the cancellation.
951
+ */
952
+ reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
953
+
954
+ /**
955
+ * The user ID who cancelled the order.
956
+ */
957
+ cancelledByUser?: string;
958
+
959
+ /**
960
+ * An optional note provided by the user who cancelled the order.
961
+ */
962
+ note?: string;
963
+ }
964
+ }
965
+
966
+ export interface BoxProgressionsResponse {
967
+ /**
968
+ * A unique ID prefixed with box\_
969
+ */
970
+ id: string;
971
+
972
+ /**
973
+ * The cheques inside this box (in read mode).
974
+ */
975
+ cheques: Array<BoxProgressionsResponse.Cheque>;
976
+
977
+ /**
978
+ * The UTC time at which this resource was created.
979
+ */
980
+ createdAt: string;
981
+
982
+ /**
983
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
984
+ */
985
+ from: ContactsAPI.Contact;
986
+
987
+ /**
988
+ * `true` if this is a live mode resource else `false`.
989
+ */
990
+ live: boolean;
991
+
992
+ /**
993
+ * The mailing class of this order. This determines the speed and cost of delivery.
994
+ * See `OrderMailingClass` for more details.
995
+ */
996
+ mailingClass:
997
+ | 'first_class'
998
+ | 'standard_class'
999
+ | 'express'
1000
+ | 'certified'
1001
+ | 'certified_return_receipt'
1002
+ | 'registered'
1003
+ | 'usps_first_class'
1004
+ | 'usps_standard_class'
1005
+ | 'usps_eddm'
1006
+ | 'usps_express_2_day'
1007
+ | 'usps_express_3_day'
1008
+ | 'usps_first_class_certified'
1009
+ | 'usps_first_class_certified_return_receipt'
1010
+ | 'usps_first_class_registered'
1011
+ | 'usps_express_3_day_signature_confirmation'
1012
+ | 'usps_express_3_day_certified'
1013
+ | 'usps_express_3_day_certified_return_receipt'
1014
+ | 'ca_post_lettermail'
1015
+ | 'ca_post_personalized'
1016
+ | 'ca_post_neighbourhood_mail'
1017
+ | 'ups_express_overnight'
1018
+ | 'ups_express_2_day'
1019
+ | 'ups_express_3_day'
1020
+ | 'royal_mail_first_class'
1021
+ | 'royal_mail_second_class'
1022
+ | 'au_post_second_class';
1023
+
1024
+ /**
1025
+ * Always "box".
1026
+ */
1027
+ object: 'box';
1028
+
1029
+ /**
1030
+ * This order will transition from `ready` to `printing` on the day after this
1031
+ * date. For example, if this is a date on Tuesday, the order will transition to
1032
+ * `printing` on Wednesday at midnight eastern time.
1033
+ */
1034
+ sendDate: string;
1035
+
1036
+ /**
1037
+ * See `OrderStatus` for more details on the status of this order.
1038
+ */
1039
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
1040
+
1041
+ /**
1042
+ * The recipient of this order. This will be provided even if you delete the
1043
+ * underlying contact.
1044
+ */
1045
+ to: ContactsAPI.Contact;
1046
+
1047
+ /**
1048
+ * The UTC time at which this resource was last updated.
1049
+ */
1050
+ updatedAt: string;
1051
+
1052
+ /**
1053
+ * The cancellation details of this order. Populated if the order has been
1054
+ * cancelled.
1055
+ */
1056
+ cancellation?: BoxProgressionsResponse.Cancellation;
1057
+
1058
+ /**
1059
+ * An optional string describing this resource. Will be visible in the API and the
1060
+ * dashboard.
1061
+ */
1062
+ description?: string;
1063
+
1064
+ /**
1065
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
1066
+ */
1067
+ imbDate?: string;
1068
+
1069
+ /**
1070
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
1071
+ * US-printed and US-destined orders. This is the most detailed way to track
1072
+ * non-express/certified orders.
1073
+ */
1074
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
1075
+
1076
+ /**
1077
+ * The most recent ZIP code of the USPS facility that the order has been processed
1078
+ * through. Only populated when an `imbStatus` is present.
1079
+ */
1080
+ imbZIPCode?: string;
1081
+
1082
+ /**
1083
+ * These will be merged with the variables in the template or HTML you create this
1084
+ * order with. The keys in this object should match the variable names in the
1085
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
1086
+ * PDFs uploaded with the order.
1087
+ */
1088
+ mergeVariables?: { [key: string]: unknown };
1089
+
1090
+ /**
1091
+ * See the section on Metadata.
1092
+ */
1093
+ metadata?: { [key: string]: unknown };
1094
+
1095
+ /**
1096
+ * The tracking number of this order. Populated after an express/certified order
1097
+ * has been processed for delivery.
1098
+ */
1099
+ trackingNumber?: string;
1100
+
1101
+ /**
1102
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
1103
+ * ensure that the order is correct before it is sent out because it shows what
1104
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
1105
+ * this field will be returned by all `GET` endpoints which produce this order.
1106
+ *
1107
+ * This URL is a signed link to the PDF preview. It will expire after a short
1108
+ * period of time. If you need to access this URL after it has expired, you can
1109
+ * regenerate it by calling the `GET` endpoint again.
1110
+ */
1111
+ url?: string;
1112
+ }
1113
+
1114
+ export namespace BoxProgressionsResponse {
1115
+ export interface Cheque {
1116
+ /**
1117
+ * The amount on the cheque.
1118
+ */
1119
+ amount: number;
1120
+
1121
+ /**
1122
+ * The bank account (ID or reference) from which the cheque amount is drawn.
1123
+ */
1124
+ bankAccount: string;
1125
+
1126
+ from: ContactsAPI.Contact;
1127
+
1128
+ /**
1129
+ * The cheque number.
1130
+ */
1131
+ number: number;
1132
+
1133
+ to: ContactsAPI.Contact;
1134
+
1135
+ /**
1136
+ * A URL to a logo for the cheque (optional).
1137
+ */
1138
+ logoURL?: string;
1139
+
1140
+ /**
1141
+ * The memo text on the cheque (optional).
1142
+ */
1143
+ memo?: string;
1144
+
1145
+ /**
1146
+ * A set of dynamic merge variables for customizing the cheque or accompanying
1147
+ * documents (optional).
1148
+ */
1149
+ mergeVariables?: { [key: string]: unknown };
1150
+
1151
+ /**
1152
+ * An optional message template to be printed on or with the cheque.
1153
+ */
1154
+ messageTemplate?: string;
1155
+ }
1156
+
1157
+ /**
1158
+ * The cancellation details of this order. Populated if the order has been
1159
+ * cancelled.
1160
+ */
1161
+ export interface Cancellation {
1162
+ /**
1163
+ * The reason for the cancellation.
1164
+ */
1165
+ reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
1166
+
1167
+ /**
1168
+ * The user ID who cancelled the order.
1169
+ */
1170
+ cancelledByUser?: string;
1171
+
1172
+ /**
1173
+ * An optional note provided by the user who cancelled the order.
1174
+ */
1175
+ note?: string;
1176
+ }
1177
+ }
1178
+
1179
+ export interface BoxCreateParams {
1180
+ /**
1181
+ * The cheques to be mailed in the box. Only 100 cheques can be included in a box
1182
+ * at a time.
1183
+ */
1184
+ cheques: Array<BoxCreateParams.Cheque>;
1185
+
1186
+ /**
1187
+ * The 'from' (sender) of the entire box. Accepts inline ContactCreate or a
1188
+ * contactID.
1189
+ */
1190
+ from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string;
1191
+
1192
+ /**
1193
+ * The recipient of this order. You can either supply the contact information
1194
+ * inline here or provide a contact ID. PostGrid will automatically deduplicate
1195
+ * contacts regardless of whether you provide the information inline here or call
1196
+ * the contact creation endpoint.
1197
+ */
1198
+ to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string;
1199
+
1200
+ /**
1201
+ * An optional string describing this resource. Will be visible in the API and the
1202
+ * dashboard.
1203
+ */
1204
+ description?: string;
1205
+
1206
+ /**
1207
+ * The mailing class of this order. If not provided, automatically set to
1208
+ * `first_class`.
1209
+ */
1210
+ mailingClass?:
1211
+ | 'first_class'
1212
+ | 'standard_class'
1213
+ | 'express'
1214
+ | 'certified'
1215
+ | 'certified_return_receipt'
1216
+ | 'registered'
1217
+ | 'usps_first_class'
1218
+ | 'usps_standard_class'
1219
+ | 'usps_eddm'
1220
+ | 'usps_express_2_day'
1221
+ | 'usps_express_3_day'
1222
+ | 'usps_first_class_certified'
1223
+ | 'usps_first_class_certified_return_receipt'
1224
+ | 'usps_first_class_registered'
1225
+ | 'usps_express_3_day_signature_confirmation'
1226
+ | 'usps_express_3_day_certified'
1227
+ | 'usps_express_3_day_certified_return_receipt'
1228
+ | 'ca_post_lettermail'
1229
+ | 'ca_post_personalized'
1230
+ | 'ca_post_neighbourhood_mail'
1231
+ | 'ups_express_overnight'
1232
+ | 'ups_express_2_day'
1233
+ | 'ups_express_3_day'
1234
+ | 'royal_mail_first_class'
1235
+ | 'royal_mail_second_class'
1236
+ | 'au_post_second_class';
1237
+
1238
+ /**
1239
+ * These will be merged with the variables in the template or HTML you create this
1240
+ * order with. The keys in this object should match the variable names in the
1241
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
1242
+ * PDFs uploaded with the order.
1243
+ */
1244
+ mergeVariables?: { [key: string]: unknown };
1245
+
1246
+ /**
1247
+ * See the section on Metadata.
1248
+ */
1249
+ metadata?: { [key: string]: unknown };
1250
+
1251
+ /**
1252
+ * This order will transition from `ready` to `printing` on the day after this
1253
+ * date. You can use this parameter to schedule orders for a future date.
1254
+ */
1255
+ sendDate?: string;
1256
+ }
1257
+
1258
+ export namespace BoxCreateParams {
1259
+ export interface Cheque {
1260
+ /**
1261
+ * The amount on the cheque.
1262
+ */
1263
+ amount: number;
1264
+
1265
+ /**
1266
+ * The bank account (ID or reference) from which the cheque amount is drawn.
1267
+ */
1268
+ bankAccount: string;
1269
+
1270
+ from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string;
1271
+
1272
+ /**
1273
+ * The cheque number.
1274
+ */
1275
+ number: number;
1276
+
1277
+ to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string;
1278
+
1279
+ /**
1280
+ * A URL to a logo for the cheque (optional).
1281
+ */
1282
+ logoURL?: string;
1283
+
1284
+ /**
1285
+ * The memo text on the cheque (optional).
1286
+ */
1287
+ memo?: string;
1288
+
1289
+ /**
1290
+ * A set of dynamic merge variables for customizing the cheque or accompanying
1291
+ * documents (optional).
1292
+ */
1293
+ mergeVariables?: { [key: string]: unknown };
1294
+
1295
+ /**
1296
+ * An optional message template to be printed on or with the cheque.
1297
+ */
1298
+ messageTemplate?: string;
1299
+ }
1300
+ }
1301
+
1302
+ export interface BoxListParams extends SkipLimitParams {
1303
+ /**
1304
+ * You can supply any string to help narrow down the list of resources. For
1305
+ * example, if you pass `"New York"` (quoted), it will return resources that have
1306
+ * that string present somewhere in their response. Alternatively, you can supply a
1307
+ * structured search query. See the documentation on `StructuredSearchQuery` for
1308
+ * more details.
1309
+ */
1310
+ search?: string;
1311
+ }
1312
+
1313
+ export declare namespace Boxes {
1314
+ export {
1315
+ type BoxCreateResponse as BoxCreateResponse,
1316
+ type BoxRetrieveResponse as BoxRetrieveResponse,
1317
+ type BoxListResponse as BoxListResponse,
1318
+ type BoxDeleteResponse as BoxDeleteResponse,
1319
+ type BoxProgressionsResponse as BoxProgressionsResponse,
1320
+ type BoxListResponsesSkipLimit as BoxListResponsesSkipLimit,
1321
+ type BoxCreateParams as BoxCreateParams,
1322
+ type BoxListParams as BoxListParams,
1323
+ };
1324
+ }