postgrid-node 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +201 -0
  3. package/README.md +346 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +914 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +882 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +113 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +97 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +144 -0
  87. package/index.d.ts +144 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +161 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +118 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +124 -0
  94. package/pagination.d.ts +24 -0
  95. package/pagination.d.ts.map +1 -0
  96. package/pagination.js +45 -0
  97. package/pagination.js.map +1 -0
  98. package/pagination.mjs +41 -0
  99. package/pagination.mjs.map +1 -0
  100. package/resource.d.ts +6 -0
  101. package/resource.d.ts.map +1 -0
  102. package/resource.js +11 -0
  103. package/resource.js.map +1 -0
  104. package/resource.mjs +7 -0
  105. package/resource.mjs.map +1 -0
  106. package/resources/bank-accounts.d.ts +285 -0
  107. package/resources/bank-accounts.d.ts.map +1 -0
  108. package/resources/bank-accounts.js +45 -0
  109. package/resources/bank-accounts.js.map +1 -0
  110. package/resources/bank-accounts.mjs +40 -0
  111. package/resources/bank-accounts.mjs.map +1 -0
  112. package/resources/boxes.d.ts +683 -0
  113. package/resources/boxes.d.ts.map +1 -0
  114. package/resources/boxes.js +54 -0
  115. package/resources/boxes.js.map +1 -0
  116. package/resources/boxes.mjs +49 -0
  117. package/resources/boxes.mjs.map +1 -0
  118. package/resources/campaigns.d.ts +644 -0
  119. package/resources/campaigns.d.ts.map +1 -0
  120. package/resources/campaigns.js +67 -0
  121. package/resources/campaigns.js.map +1 -0
  122. package/resources/campaigns.mjs +62 -0
  123. package/resources/campaigns.mjs.map +1 -0
  124. package/resources/cheques/cheques.d.ts +349 -0
  125. package/resources/cheques/cheques.d.ts.map +1 -0
  126. package/resources/cheques/cheques.js +95 -0
  127. package/resources/cheques/cheques.js.map +1 -0
  128. package/resources/cheques/cheques.mjs +67 -0
  129. package/resources/cheques/cheques.mjs.map +1 -0
  130. package/resources/cheques/index.d.ts +4 -0
  131. package/resources/cheques/index.d.ts.map +1 -0
  132. package/resources/cheques/index.js +12 -0
  133. package/resources/cheques/index.js.map +1 -0
  134. package/resources/cheques/index.mjs +5 -0
  135. package/resources/cheques/index.mjs.map +1 -0
  136. package/resources/cheques/url.d.ts +29 -0
  137. package/resources/cheques/url.d.ts.map +1 -0
  138. package/resources/cheques/url.js +20 -0
  139. package/resources/cheques/url.js.map +1 -0
  140. package/resources/cheques/url.mjs +16 -0
  141. package/resources/cheques/url.mjs.map +1 -0
  142. package/resources/cheques/with-deposit-ready-pdf.d.ts +13 -0
  143. package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -0
  144. package/resources/cheques/with-deposit-ready-pdf.js +18 -0
  145. package/resources/cheques/with-deposit-ready-pdf.js.map +1 -0
  146. package/resources/cheques/with-deposit-ready-pdf.mjs +14 -0
  147. package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -0
  148. package/resources/contacts.d.ts +295 -0
  149. package/resources/contacts.d.ts.map +1 -0
  150. package/resources/contacts.js +52 -0
  151. package/resources/contacts.js.map +1 -0
  152. package/resources/contacts.mjs +47 -0
  153. package/resources/contacts.mjs.map +1 -0
  154. package/resources/index.d.ts +12 -0
  155. package/resources/index.d.ts.map +1 -0
  156. package/resources/index.js +50 -0
  157. package/resources/index.js.map +1 -0
  158. package/resources/index.mjs +13 -0
  159. package/resources/index.mjs.map +1 -0
  160. package/resources/letters.d.ts +639 -0
  161. package/resources/letters.d.ts.map +1 -0
  162. package/resources/letters.js +55 -0
  163. package/resources/letters.js.map +1 -0
  164. package/resources/letters.mjs +50 -0
  165. package/resources/letters.mjs.map +1 -0
  166. package/resources/postcards.d.ts +346 -0
  167. package/resources/postcards.d.ts.map +1 -0
  168. package/resources/postcards.js +56 -0
  169. package/resources/postcards.js.map +1 -0
  170. package/resources/postcards.mjs +51 -0
  171. package/resources/postcards.mjs.map +1 -0
  172. package/resources/reports/exports.d.ts +207 -0
  173. package/resources/reports/exports.d.ts.map +1 -0
  174. package/resources/reports/exports.js +33 -0
  175. package/resources/reports/exports.js.map +1 -0
  176. package/resources/reports/exports.mjs +29 -0
  177. package/resources/reports/exports.mjs.map +1 -0
  178. package/resources/reports/index.d.ts +4 -0
  179. package/resources/reports/index.d.ts.map +1 -0
  180. package/resources/reports/index.js +12 -0
  181. package/resources/reports/index.js.map +1 -0
  182. package/resources/reports/index.mjs +5 -0
  183. package/resources/reports/index.mjs.map +1 -0
  184. package/resources/reports/reports.d.ts +245 -0
  185. package/resources/reports/reports.d.ts.map +1 -0
  186. package/resources/reports/reports.js +85 -0
  187. package/resources/reports/reports.js.map +1 -0
  188. package/resources/reports/reports.mjs +57 -0
  189. package/resources/reports/reports.mjs.map +1 -0
  190. package/resources/reports/samples.d.ts +81 -0
  191. package/resources/reports/samples.d.ts.map +1 -0
  192. package/resources/reports/samples.js +26 -0
  193. package/resources/reports/samples.js.map +1 -0
  194. package/resources/reports/samples.mjs +22 -0
  195. package/resources/reports/samples.mjs.map +1 -0
  196. package/resources/self-mailers.d.ts +622 -0
  197. package/resources/self-mailers.d.ts.map +1 -0
  198. package/resources/self-mailers.js +45 -0
  199. package/resources/self-mailers.js.map +1 -0
  200. package/resources/self-mailers.mjs +40 -0
  201. package/resources/self-mailers.mjs.map +1 -0
  202. package/resources/shared.d.ts +147 -0
  203. package/resources/shared.d.ts.map +1 -0
  204. package/resources/shared.js +4 -0
  205. package/resources/shared.js.map +1 -0
  206. package/resources/shared.mjs +3 -0
  207. package/resources/shared.mjs.map +1 -0
  208. package/resources/templates.d.ts +126 -0
  209. package/resources/templates.d.ts.map +1 -0
  210. package/resources/templates.js +46 -0
  211. package/resources/templates.js.map +1 -0
  212. package/resources/templates.mjs +41 -0
  213. package/resources/templates.mjs.map +1 -0
  214. package/shims/node.d.ts +30 -0
  215. package/shims/node.d.ts.map +1 -0
  216. package/shims/node.js +31 -0
  217. package/shims/node.js.map +1 -0
  218. package/shims/node.mjs +5 -0
  219. package/shims/node.mjs.map +1 -0
  220. package/shims/web.d.ts +26 -0
  221. package/shims/web.d.ts.map +1 -0
  222. package/shims/web.js +31 -0
  223. package/shims/web.js.map +1 -0
  224. package/shims/web.mjs +5 -0
  225. package/shims/web.mjs.map +1 -0
  226. package/src/_shims/MultipartBody.ts +9 -0
  227. package/src/_shims/README.md +46 -0
  228. package/src/_shims/auto/runtime-bun.ts +4 -0
  229. package/src/_shims/auto/runtime-node.ts +4 -0
  230. package/src/_shims/auto/runtime.ts +4 -0
  231. package/src/_shims/auto/types-node.ts +4 -0
  232. package/src/_shims/auto/types.d.ts +101 -0
  233. package/src/_shims/auto/types.js +3 -0
  234. package/src/_shims/auto/types.mjs +3 -0
  235. package/src/_shims/bun-runtime.ts +14 -0
  236. package/src/_shims/index.d.ts +81 -0
  237. package/src/_shims/index.js +13 -0
  238. package/src/_shims/index.mjs +7 -0
  239. package/src/_shims/manual-types.d.ts +12 -0
  240. package/src/_shims/manual-types.js +3 -0
  241. package/src/_shims/manual-types.mjs +3 -0
  242. package/src/_shims/node-runtime.ts +81 -0
  243. package/src/_shims/node-types.d.ts +42 -0
  244. package/src/_shims/node-types.js +3 -0
  245. package/src/_shims/node-types.mjs +3 -0
  246. package/src/_shims/registry.ts +67 -0
  247. package/src/_shims/web-runtime.ts +103 -0
  248. package/src/_shims/web-types.d.ts +83 -0
  249. package/src/_shims/web-types.js +3 -0
  250. package/src/_shims/web-types.mjs +3 -0
  251. package/src/core.ts +1208 -0
  252. package/src/error.ts +130 -0
  253. package/src/index.ts +428 -0
  254. package/src/lib/.keep +4 -0
  255. package/src/pagination.ts +69 -0
  256. package/src/resource.ts +11 -0
  257. package/src/resources/bank-accounts.ts +382 -0
  258. package/src/resources/boxes.ts +982 -0
  259. package/src/resources/campaigns.ts +853 -0
  260. package/src/resources/cheques/cheques.ts +493 -0
  261. package/src/resources/cheques/index.ts +12 -0
  262. package/src/resources/cheques/url.ts +37 -0
  263. package/src/resources/cheques/with-deposit-ready-pdf.ts +17 -0
  264. package/src/resources/contacts.ts +387 -0
  265. package/src/resources/index.ts +102 -0
  266. package/src/resources/letters.ts +870 -0
  267. package/src/resources/postcards.ts +548 -0
  268. package/src/resources/reports/exports.ts +272 -0
  269. package/src/resources/reports/index.ts +28 -0
  270. package/src/resources/reports/reports.ts +359 -0
  271. package/src/resources/reports/samples.ts +109 -0
  272. package/src/resources/self-mailers.ts +958 -0
  273. package/src/resources/shared.ts +182 -0
  274. package/src/resources/templates.ts +184 -0
  275. package/src/shims/node.ts +50 -0
  276. package/src/shims/web.ts +50 -0
  277. package/src/tsconfig.json +11 -0
  278. package/src/uploads.ts +255 -0
  279. package/src/version.ts +1 -0
  280. package/uploads.d.ts +75 -0
  281. package/uploads.d.ts.map +1 -0
  282. package/uploads.js +171 -0
  283. package/uploads.js.map +1 -0
  284. package/uploads.mjs +158 -0
  285. package/uploads.mjs.map +1 -0
  286. package/version.d.ts +2 -0
  287. package/version.d.ts.map +1 -0
  288. package/version.js +5 -0
  289. package/version.js.map +1 -0
  290. package/version.mjs +2 -0
  291. package/version.mjs.map +1 -0
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LettersList = exports.Letters = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ const core_1 = require("../core.js");
7
+ const pagination_1 = require("../pagination.js");
8
+ class Letters extends resource_1.APIResource {
9
+ /**
10
+ * Create a letter. Note that you can supply one of the following:
11
+ *
12
+ * - HTML content for the letter
13
+ * - A template ID for the letter
14
+ * - A URL or file for a PDF for the letter
15
+ * - Upload the aforementioned PDF file via a multipart form upload request
16
+ */
17
+ create(body, options) {
18
+ return this._client.post('/letters', { body, ...options });
19
+ }
20
+ /**
21
+ * Retrieve a letter by ID.
22
+ */
23
+ retrieve(id, options) {
24
+ return this._client.get(`/letters/${id}`, options);
25
+ }
26
+ list(query = {}, options) {
27
+ if ((0, core_1.isRequestOptions)(query)) {
28
+ return this.list({}, query);
29
+ }
30
+ return this._client.getAPIList('/letters', LettersList, { query, ...options });
31
+ }
32
+ /**
33
+ * Cancel a letter by ID. Note that this operation cannot be undone.
34
+ */
35
+ delete(id, options) {
36
+ return this._client.delete(`/letters/${id}`, options);
37
+ }
38
+ /**
39
+ * Retrieve a letter preview URL.
40
+ *
41
+ * This is only available for customers with our document management addon, which
42
+ * offers document generation and hosting capabilities. This endpoint has a much
43
+ * higher rate limit than the regular order retrieval endpoint, so it is suitable
44
+ * for customer-facing use-cases.
45
+ */
46
+ url(id, options) {
47
+ return this._client.get(`/letters/${id}/url`, options);
48
+ }
49
+ }
50
+ exports.Letters = Letters;
51
+ class LettersList extends pagination_1.List {
52
+ }
53
+ exports.LettersList = LettersList;
54
+ Letters.LettersList = LettersList;
55
+ //# sourceMappingURL=letters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letters.js","sourceRoot":"","sources":["../src/resources/letters.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAI3C,iDAAsD;AAEtD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAOD,IAAI,CACF,QAAgD,EAAE,EAClD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AArDD,0BAqDC;AAED,MAAa,WAAY,SAAQ,iBAAY;CAAG;AAAhD,kCAAgD;AA0xBhD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,50 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ import { isRequestOptions } from "../core.mjs";
4
+ import { List } from "../pagination.mjs";
5
+ export class Letters extends APIResource {
6
+ /**
7
+ * Create a letter. Note that you can supply one of the following:
8
+ *
9
+ * - HTML content for the letter
10
+ * - A template ID for the letter
11
+ * - A URL or file for a PDF for the letter
12
+ * - Upload the aforementioned PDF file via a multipart form upload request
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/letters', { body, ...options });
16
+ }
17
+ /**
18
+ * Retrieve a letter by ID.
19
+ */
20
+ retrieve(id, options) {
21
+ return this._client.get(`/letters/${id}`, options);
22
+ }
23
+ list(query = {}, options) {
24
+ if (isRequestOptions(query)) {
25
+ return this.list({}, query);
26
+ }
27
+ return this._client.getAPIList('/letters', LettersList, { query, ...options });
28
+ }
29
+ /**
30
+ * Cancel a letter by ID. Note that this operation cannot be undone.
31
+ */
32
+ delete(id, options) {
33
+ return this._client.delete(`/letters/${id}`, options);
34
+ }
35
+ /**
36
+ * Retrieve a letter preview URL.
37
+ *
38
+ * This is only available for customers with our document management addon, which
39
+ * offers document generation and hosting capabilities. This endpoint has a much
40
+ * higher rate limit than the regular order retrieval endpoint, so it is suitable
41
+ * for customer-facing use-cases.
42
+ */
43
+ url(id, options) {
44
+ return this._client.get(`/letters/${id}/url`, options);
45
+ }
46
+ }
47
+ export class LettersList extends List {
48
+ }
49
+ Letters.LettersList = LettersList;
50
+ //# sourceMappingURL=letters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letters.mjs","sourceRoot":"","sources":["../src/resources/letters.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAOD,IAAI,CACF,QAAgD,EAAE,EAClD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,IAAY;CAAG;AA0xBhD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,346 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ import * as ContactsAPI from "./contacts.js";
4
+ import * as Shared from "./shared.js";
5
+ import { List, type ListParams } from "../pagination.js";
6
+ export declare class Postcards extends APIResource {
7
+ /**
8
+ * Create a postcard. Note that you can supply one of the following:
9
+ *
10
+ * - HTML content for the front and back of the postcard
11
+ * - A template ID for the front and back of the postcard
12
+ * - A URL or file for a 2 page PDF where the first page is the front of the
13
+ * postcard and the second page is the back
14
+ * - Upload the aforementioned PDF file via a multipart form upload request
15
+ */
16
+ create(body: PostcardCreateParams, options?: Core.RequestOptions): Core.APIPromise<Postcard>;
17
+ /**
18
+ * Retrieve a postcard by ID.
19
+ */
20
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Postcard>;
21
+ /**
22
+ * Get a list of postcards.
23
+ */
24
+ list(query?: PostcardListParams, options?: Core.RequestOptions): Core.PagePromise<PostcardsList, Postcard>;
25
+ list(options?: Core.RequestOptions): Core.PagePromise<PostcardsList, Postcard>;
26
+ /**
27
+ * Cancel a postcard by ID. Note that this operation cannot be undone.
28
+ */
29
+ delete(id: string, options?: Core.RequestOptions): Core.APIPromise<Postcard>;
30
+ /**
31
+ * Retrieve a postcard preview URL.
32
+ *
33
+ * This is only available for customers with our document management addon, which
34
+ * offers document generation and hosting capabilities. This endpoint has a much
35
+ * higher rate limit than the regular order retrieval endpoint, so it is suitable
36
+ * for customer-facing use-cases.
37
+ */
38
+ url(id: string, options?: Core.RequestOptions): Core.APIPromise<PostcardURLResponse>;
39
+ }
40
+ export declare class PostcardsList extends List<Postcard> {
41
+ }
42
+ export interface Postcard {
43
+ /**
44
+ * A unique ID prefixed with postcard\_
45
+ */
46
+ id: string;
47
+ /**
48
+ * The UTC time at which this resource was created.
49
+ */
50
+ createdAt: string;
51
+ /**
52
+ * `true` if this is a live mode resource else `false`.
53
+ */
54
+ live: boolean;
55
+ /**
56
+ * The mailing class of this order. This determines the speed and cost of delivery.
57
+ * See `OrderMailingClass` for more details.
58
+ */
59
+ mailingClass: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
60
+ /**
61
+ * Always `postcard`.
62
+ */
63
+ object: 'postcard';
64
+ /**
65
+ * This order will transition from `ready` to `printing` on the day after this
66
+ * date. For example, if this is a date on Tuesday, the order will transition to
67
+ * `printing` on Wednesday at midnight eastern time.
68
+ */
69
+ sendDate: string;
70
+ /**
71
+ * Enum representing the supported postcard sizes.
72
+ */
73
+ size: '6x4' | '9x6' | '11x6';
74
+ /**
75
+ * See `OrderStatus` for more details on the status of this order.
76
+ */
77
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
78
+ /**
79
+ * The recipient of this order. This will be provided even if you delete the
80
+ * underlying contact.
81
+ */
82
+ to: ContactsAPI.Contact;
83
+ /**
84
+ * The UTC time at which this resource was last updated.
85
+ */
86
+ updatedAt: string;
87
+ /**
88
+ * The cancellation details of this order. Populated if the order has been
89
+ * cancelled.
90
+ */
91
+ cancellation?: Shared.Cancellation;
92
+ /**
93
+ * An optional string describing this resource. Will be visible in the API and the
94
+ * dashboard.
95
+ */
96
+ description?: string;
97
+ /**
98
+ * The contact information of the sender.
99
+ */
100
+ from?: ContactsAPI.Contact;
101
+ /**
102
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
103
+ */
104
+ imbDate?: string;
105
+ /**
106
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
107
+ * US-printed and US-destined orders. This is the most detailed way to track
108
+ * non-express/certified orders.
109
+ */
110
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
111
+ /**
112
+ * The most recent ZIP code of the USPS facility that the order has been processed
113
+ * through. Only populated when an `imbStatus` is present.
114
+ */
115
+ imbZIPCode?: string;
116
+ /**
117
+ * These will be merged with the variables in the template or HTML you create this
118
+ * order with. The keys in this object should match the variable names in the
119
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
120
+ * PDFs uploaded with the order.
121
+ */
122
+ mergeVariables?: Record<string, unknown>;
123
+ /**
124
+ * See the section on Metadata.
125
+ */
126
+ metadata?: Record<string, unknown>;
127
+ /**
128
+ * The tracking number of this order. Populated after an express/certified order
129
+ * has been processed for delivery.
130
+ */
131
+ trackingNumber?: string;
132
+ /**
133
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
134
+ * ensure that the order is correct before it is sent out because it shows what
135
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
136
+ * this field will be returned by all `GET` endpoints which produce this order.
137
+ *
138
+ * This URL is a signed link to the PDF preview. It will expire after a short
139
+ * period of time. If you need to access this URL after it has expired, you can
140
+ * regenerate it by calling the `GET` endpoint again.
141
+ */
142
+ url?: string;
143
+ }
144
+ export interface PostcardList {
145
+ data: Array<Postcard>;
146
+ limit: number;
147
+ object: 'list';
148
+ skip: number;
149
+ totalCount: number;
150
+ }
151
+ export interface PostcardURLResponse {
152
+ /**
153
+ * A unique ID prefixed with postcard\_
154
+ */
155
+ id: string;
156
+ object: string;
157
+ /**
158
+ * A signed URL linking to the order preview PDF. The link remains valid for 15
159
+ * minutes from the time of the API call.
160
+ */
161
+ url: string;
162
+ }
163
+ export type PostcardCreateParams = PostcardCreateParams.PostcardCreateWithHTML | PostcardCreateParams.PostcardCreateWithTemplate | PostcardCreateParams.PostcardCreateWithPdfurl | PostcardCreateParams.PostcardCreateWithPdfFile;
164
+ export declare namespace PostcardCreateParams {
165
+ interface PostcardCreateWithHTML {
166
+ /**
167
+ * The HTML content for the back of the postcard. You can supply _either_ this or
168
+ * `backTemplate` but not both.
169
+ */
170
+ backHTML: string;
171
+ /**
172
+ * The HTML content for the front of the postcard. You can supply _either_ this or
173
+ * `frontTemplate` but not both.
174
+ */
175
+ frontHTML: string;
176
+ /**
177
+ * Enum representing the supported postcard sizes.
178
+ */
179
+ size: '6x4' | '9x6' | '11x6';
180
+ /**
181
+ * The recipient of this order. You can either supply the contact information
182
+ * inline here or provide a contact ID. PostGrid will automatically deduplicate
183
+ * contacts regardless of whether you provide the information inline here or call
184
+ * the contact creation endpoint.
185
+ */
186
+ to: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
187
+ /**
188
+ * An optional string describing this resource. Will be visible in the API and the
189
+ * dashboard.
190
+ */
191
+ description?: string;
192
+ /**
193
+ * The contact information of the sender. You can pass contact information inline
194
+ * here just like you can for the `to`. Unlike other order types, the sender
195
+ * address is optional for postcards.
196
+ */
197
+ from?: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
198
+ /**
199
+ * The mailing class of this order. If not provided, automatically set to
200
+ * `first_class`.
201
+ */
202
+ mailingClass?: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
203
+ /**
204
+ * These will be merged with the variables in the template or HTML you create this
205
+ * order with. The keys in this object should match the variable names in the
206
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
207
+ * PDFs uploaded with the order.
208
+ */
209
+ mergeVariables?: Record<string, unknown>;
210
+ /**
211
+ * See the section on Metadata.
212
+ */
213
+ metadata?: Record<string, unknown>;
214
+ /**
215
+ * This order will transition from `ready` to `printing` on the day after this
216
+ * date. You can use this parameter to schedule orders for a future date.
217
+ */
218
+ sendDate?: string;
219
+ }
220
+ interface PostcardCreateWithTemplate {
221
+ /**
222
+ * The template ID for the back of the postcard. You can supply _either_ this or
223
+ * `backHTML` but not both.
224
+ */
225
+ backTemplate: string;
226
+ /**
227
+ * The template ID for the front of the postcard. You can supply _either_ this or
228
+ * `frontHTML` but not both.
229
+ */
230
+ frontTemplate: string;
231
+ }
232
+ interface PostcardCreateWithPdfurl {
233
+ /**
234
+ * A URL pointing to a 2 page PDF file. The first page is the front of the postcard
235
+ * and the second page is the back (where the address will be stamped on).
236
+ */
237
+ pdf: string;
238
+ /**
239
+ * Enum representing the supported postcard sizes.
240
+ */
241
+ size: '6x4' | '9x6' | '11x6';
242
+ /**
243
+ * The recipient of this order. You can either supply the contact information
244
+ * inline here or provide a contact ID. PostGrid will automatically deduplicate
245
+ * contacts regardless of whether you provide the information inline here or call
246
+ * the contact creation endpoint.
247
+ */
248
+ to: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
249
+ /**
250
+ * An optional string describing this resource. Will be visible in the API and the
251
+ * dashboard.
252
+ */
253
+ description?: string;
254
+ /**
255
+ * The contact information of the sender. You can pass contact information inline
256
+ * here just like you can for the `to`. Unlike other order types, the sender
257
+ * address is optional for postcards.
258
+ */
259
+ from?: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
260
+ /**
261
+ * The mailing class of this order. If not provided, automatically set to
262
+ * `first_class`.
263
+ */
264
+ mailingClass?: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
265
+ /**
266
+ * These will be merged with the variables in the template or HTML you create this
267
+ * order with. The keys in this object should match the variable names in the
268
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
269
+ * PDFs uploaded with the order.
270
+ */
271
+ mergeVariables?: Record<string, unknown>;
272
+ /**
273
+ * See the section on Metadata.
274
+ */
275
+ metadata?: Record<string, unknown>;
276
+ /**
277
+ * This order will transition from `ready` to `printing` on the day after this
278
+ * date. You can use this parameter to schedule orders for a future date.
279
+ */
280
+ sendDate?: string;
281
+ }
282
+ interface PostcardCreateWithPdfFile {
283
+ /**
284
+ * A 2 page PDF file. The first page is the front of the postcard and the second
285
+ * page is the back (where the address will be stamped on).
286
+ */
287
+ pdf: string;
288
+ /**
289
+ * Enum representing the supported postcard sizes.
290
+ */
291
+ size: '6x4' | '9x6' | '11x6';
292
+ /**
293
+ * The recipient of this order. You can either supply the contact information
294
+ * inline here or provide a contact ID. PostGrid will automatically deduplicate
295
+ * contacts regardless of whether you provide the information inline here or call
296
+ * the contact creation endpoint.
297
+ */
298
+ to: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
299
+ /**
300
+ * An optional string describing this resource. Will be visible in the API and the
301
+ * dashboard.
302
+ */
303
+ description?: string;
304
+ /**
305
+ * The contact information of the sender. You can pass contact information inline
306
+ * here just like you can for the `to`. Unlike other order types, the sender
307
+ * address is optional for postcards.
308
+ */
309
+ from?: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
310
+ /**
311
+ * The mailing class of this order. If not provided, automatically set to
312
+ * `first_class`.
313
+ */
314
+ mailingClass?: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
315
+ /**
316
+ * These will be merged with the variables in the template or HTML you create this
317
+ * order with. The keys in this object should match the variable names in the
318
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
319
+ * PDFs uploaded with the order.
320
+ */
321
+ mergeVariables?: Record<string, unknown>;
322
+ /**
323
+ * See the section on Metadata.
324
+ */
325
+ metadata?: Record<string, unknown>;
326
+ /**
327
+ * This order will transition from `ready` to `printing` on the day after this
328
+ * date. You can use this parameter to schedule orders for a future date.
329
+ */
330
+ sendDate?: string;
331
+ }
332
+ }
333
+ export interface PostcardListParams extends ListParams {
334
+ /**
335
+ * You can supply any string to help narrow down the list of resources. For
336
+ * example, if you pass `"New York"` (quoted), it will return resources that have
337
+ * that string present somewhere in their response. Alternatively, you can supply a
338
+ * structured search query. See the documentation on `StructuredSearchQuery` for
339
+ * more details.
340
+ */
341
+ search?: string;
342
+ }
343
+ export declare namespace Postcards {
344
+ export { type Postcard as Postcard, type PostcardList as PostcardList, type PostcardURLResponse as PostcardURLResponse, PostcardsList as PostcardsList, type PostcardCreateParams as PostcardCreateParams, type PostcardListParams as PostcardListParams, };
345
+ }
346
+ //# sourceMappingURL=postcards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postcards.d.ts","sourceRoot":"","sources":["../src/resources/postcards.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,WAAW,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAI5F;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAI9E;;OAEG;IACH,IAAI,CAAC,KAAK,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC;IAC1G,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC;IAW9E;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAI5E;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAA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ACpB,4BAA4B,GAC5B,2CAA2C,GAC3C,6BAA6B,GAC7B,2CAA2C,GAC3C,8BAA8B,GAC9B,6CAA6C,GAC7C,oBAAoB,GACpB,sBAAsB,GACtB,4BAA4B,GAC5B,uBAAuB,GACvB,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,yBAAyB,GACzB,sBAAsB,CAAC;QAE3B;;;;;WAKG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEzC;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEnC;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;CACF;AAED,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,aAAa,IAAI,aAAa,EAC9B,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PostcardsList = exports.Postcards = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ const core_1 = require("../core.js");
7
+ const pagination_1 = require("../pagination.js");
8
+ class Postcards extends resource_1.APIResource {
9
+ /**
10
+ * Create a postcard. Note that you can supply one of the following:
11
+ *
12
+ * - HTML content for the front and back of the postcard
13
+ * - A template ID for the front and back of the postcard
14
+ * - A URL or file for a 2 page PDF where the first page is the front of the
15
+ * postcard and the second page is the back
16
+ * - Upload the aforementioned PDF file via a multipart form upload request
17
+ */
18
+ create(body, options) {
19
+ return this._client.post('/postcards', { body, ...options });
20
+ }
21
+ /**
22
+ * Retrieve a postcard by ID.
23
+ */
24
+ retrieve(id, options) {
25
+ return this._client.get(`/postcards/${id}`, options);
26
+ }
27
+ list(query = {}, options) {
28
+ if ((0, core_1.isRequestOptions)(query)) {
29
+ return this.list({}, query);
30
+ }
31
+ return this._client.getAPIList('/postcards', PostcardsList, { query, ...options });
32
+ }
33
+ /**
34
+ * Cancel a postcard by ID. Note that this operation cannot be undone.
35
+ */
36
+ delete(id, options) {
37
+ return this._client.delete(`/postcards/${id}`, options);
38
+ }
39
+ /**
40
+ * Retrieve a postcard preview URL.
41
+ *
42
+ * This is only available for customers with our document management addon, which
43
+ * offers document generation and hosting capabilities. This endpoint has a much
44
+ * higher rate limit than the regular order retrieval endpoint, so it is suitable
45
+ * for customer-facing use-cases.
46
+ */
47
+ url(id, options) {
48
+ return this._client.get(`/postcards/${id}/url`, options);
49
+ }
50
+ }
51
+ exports.Postcards = Postcards;
52
+ class PostcardsList extends pagination_1.List {
53
+ }
54
+ exports.PostcardsList = PostcardsList;
55
+ Postcards.PostcardsList = PostcardsList;
56
+ //# sourceMappingURL=postcards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postcards.js","sourceRoot":"","sources":["../src/resources/postcards.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAI3C,iDAAsD;AAEtD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAOD,IAAI,CACF,QAAkD,EAAE,EACpD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAtDD,8BAsDC;AAED,MAAa,aAAc,SAAQ,iBAAc;CAAG;AAApD,sCAAoD;AAudpD,SAAS,CAAC,aAAa,GAAG,aAAa,CAAC"}
@@ -0,0 +1,51 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ import { isRequestOptions } from "../core.mjs";
4
+ import { List } from "../pagination.mjs";
5
+ export class Postcards extends APIResource {
6
+ /**
7
+ * Create a postcard. Note that you can supply one of the following:
8
+ *
9
+ * - HTML content for the front and back of the postcard
10
+ * - A template ID for the front and back of the postcard
11
+ * - A URL or file for a 2 page PDF where the first page is the front of the
12
+ * postcard and the second page is the back
13
+ * - Upload the aforementioned PDF file via a multipart form upload request
14
+ */
15
+ create(body, options) {
16
+ return this._client.post('/postcards', { body, ...options });
17
+ }
18
+ /**
19
+ * Retrieve a postcard by ID.
20
+ */
21
+ retrieve(id, options) {
22
+ return this._client.get(`/postcards/${id}`, options);
23
+ }
24
+ list(query = {}, options) {
25
+ if (isRequestOptions(query)) {
26
+ return this.list({}, query);
27
+ }
28
+ return this._client.getAPIList('/postcards', PostcardsList, { query, ...options });
29
+ }
30
+ /**
31
+ * Cancel a postcard by ID. Note that this operation cannot be undone.
32
+ */
33
+ delete(id, options) {
34
+ return this._client.delete(`/postcards/${id}`, options);
35
+ }
36
+ /**
37
+ * Retrieve a postcard preview URL.
38
+ *
39
+ * This is only available for customers with our document management addon, which
40
+ * offers document generation and hosting capabilities. This endpoint has a much
41
+ * higher rate limit than the regular order retrieval endpoint, so it is suitable
42
+ * for customer-facing use-cases.
43
+ */
44
+ url(id, options) {
45
+ return this._client.get(`/postcards/${id}/url`, options);
46
+ }
47
+ }
48
+ export class PostcardsList extends List {
49
+ }
50
+ Postcards.PostcardsList = PostcardsList;
51
+ //# sourceMappingURL=postcards.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postcards.mjs","sourceRoot":"","sources":["../src/resources/postcards.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAOD,IAAI,CACF,QAAkD,EAAE,EACpD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC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