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,67 @@
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.CampaignListResponsesList = exports.Campaigns = 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 Campaigns extends resource_1.APIResource {
9
+ /**
10
+ * Create a new campaign.
11
+ *
12
+ * A campaign links a mailing list with a specific mail piece profile (letter,
13
+ * postcard, cheque, or self-mailer) to send bulk mail. Upon creation, the campaign
14
+ * enters the `drafting` status while assets are validated.
15
+ */
16
+ create(body, options) {
17
+ return this._client.post('/campaigns', { body, ...options });
18
+ }
19
+ /**
20
+ * Retrieve a specific campaign by its ID.
21
+ */
22
+ retrieve(id, options) {
23
+ return this._client.get(`/campaigns/${id}`, options);
24
+ }
25
+ /**
26
+ * Update an existing campaign.
27
+ *
28
+ * Campaigns can only be updated if they are in the `draft` or `changes_required`
29
+ * status. Updating a campaign will trigger reprocessing and set its status back to
30
+ * `drafting`.
31
+ */
32
+ update(id, body, options) {
33
+ return this._client.post(`/campaigns/${id}`, { body, ...options });
34
+ }
35
+ list(query = {}, options) {
36
+ if ((0, core_1.isRequestOptions)(query)) {
37
+ return this.list({}, query);
38
+ }
39
+ return this._client.getAPIList('/campaigns', CampaignListResponsesList, { query, ...options });
40
+ }
41
+ /**
42
+ * Delete a campaign.
43
+ *
44
+ * Campaigns can only be deleted if they are in `draft`, `changes_required`, or
45
+ * `ready` status. This also permanently deletes associated resources. This
46
+ * operation cannot be undone.
47
+ */
48
+ delete(id, options) {
49
+ return this._client.delete(`/campaigns/${id}`, options);
50
+ }
51
+ /**
52
+ * Send a campaign for processing.
53
+ *
54
+ * This action transitions a campaign from the `draft` status to `creating_orders`.
55
+ * You can optionally specify a future `sendDate`. Once sent, the campaign cannot
56
+ * be updated.
57
+ */
58
+ send(id, body, options) {
59
+ return this._client.post(`/campaigns/${id}/send`, { body, ...options });
60
+ }
61
+ }
62
+ exports.Campaigns = Campaigns;
63
+ class CampaignListResponsesList extends pagination_1.List {
64
+ }
65
+ exports.CampaignListResponsesList = CampaignListResponsesList;
66
+ Campaigns.CampaignListResponsesList = CampaignListResponsesList;
67
+ //# sourceMappingURL=campaigns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../src/resources/campaigns.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAE3C,iDAAsD;AAEtD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;OAMG;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;IAED;;;;;;OAMG;IACH,MAAM,CACJ,EAAU,EACV,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAaD,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,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,EAAU,EACV,IAAwB,EACxB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AAhFD,8BAgFC;AAED,MAAa,yBAA0B,SAAQ,iBAA0B;CAAG;AAA5E,8DAA4E;AA2uB5E,SAAS,CAAC,yBAAyB,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1,62 @@
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 Campaigns extends APIResource {
6
+ /**
7
+ * Create a new campaign.
8
+ *
9
+ * A campaign links a mailing list with a specific mail piece profile (letter,
10
+ * postcard, cheque, or self-mailer) to send bulk mail. Upon creation, the campaign
11
+ * enters the `drafting` status while assets are validated.
12
+ */
13
+ create(body, options) {
14
+ return this._client.post('/campaigns', { body, ...options });
15
+ }
16
+ /**
17
+ * Retrieve a specific campaign by its ID.
18
+ */
19
+ retrieve(id, options) {
20
+ return this._client.get(`/campaigns/${id}`, options);
21
+ }
22
+ /**
23
+ * Update an existing campaign.
24
+ *
25
+ * Campaigns can only be updated if they are in the `draft` or `changes_required`
26
+ * status. Updating a campaign will trigger reprocessing and set its status back to
27
+ * `drafting`.
28
+ */
29
+ update(id, body, options) {
30
+ return this._client.post(`/campaigns/${id}`, { body, ...options });
31
+ }
32
+ list(query = {}, options) {
33
+ if (isRequestOptions(query)) {
34
+ return this.list({}, query);
35
+ }
36
+ return this._client.getAPIList('/campaigns', CampaignListResponsesList, { query, ...options });
37
+ }
38
+ /**
39
+ * Delete a campaign.
40
+ *
41
+ * Campaigns can only be deleted if they are in `draft`, `changes_required`, or
42
+ * `ready` status. This also permanently deletes associated resources. This
43
+ * operation cannot be undone.
44
+ */
45
+ delete(id, options) {
46
+ return this._client.delete(`/campaigns/${id}`, options);
47
+ }
48
+ /**
49
+ * Send a campaign for processing.
50
+ *
51
+ * This action transitions a campaign from the `draft` status to `creating_orders`.
52
+ * You can optionally specify a future `sendDate`. Once sent, the campaign cannot
53
+ * be updated.
54
+ */
55
+ send(id, body, options) {
56
+ return this._client.post(`/campaigns/${id}/send`, { body, ...options });
57
+ }
58
+ }
59
+ export class CampaignListResponsesList extends List {
60
+ }
61
+ Campaigns.CampaignListResponsesList = CampaignListResponsesList;
62
+ //# sourceMappingURL=campaigns.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"campaigns.mjs","sourceRoot":"","sources":["../src/resources/campaigns.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB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AC,CAAC;IAC1E,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,IAA0B;CAAG;AA2uB5E,SAAS,CAAC,yBAAyB,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1,349 @@
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 * as URLAPI from "./url.js";
6
+ import { URL, URLRetrieveResponse } from "./url.js";
7
+ import * as WithDepositReadyPdfAPI from "./with-deposit-ready-pdf.js";
8
+ import { WithDepositReadyPdf } from "./with-deposit-ready-pdf.js";
9
+ import { List, type ListParams } from "../../pagination.js";
10
+ export declare class Cheques extends APIResource {
11
+ url: URLAPI.URL;
12
+ withDepositReadyPdf: WithDepositReadyPdfAPI.WithDepositReadyPdf;
13
+ /**
14
+ * Create a cheque.
15
+ *
16
+ * This endpoint allows you to create a new cheque with the specified details.
17
+ *
18
+ * If you would like to create a digitalOnly cheque, the digitalOnly object with
19
+ * the watermark will need to be passed in. Feature is available on request, e-mail
20
+ * support@postgrid.com for access.
21
+ *
22
+ * Example request body:
23
+ *
24
+ * ```json
25
+ * {
26
+ * "from": "contact_123",
27
+ * "bankAccount": "bank_123",
28
+ * "amount": 1000,
29
+ * "currencyCode": "USD",
30
+ * "number": 123456,
31
+ * "size": "us_letter",
32
+ * "digitalOnly": {
33
+ * "watermark": "VOID"
34
+ * }
35
+ * }
36
+ * ```
37
+ */
38
+ create(body: ChequeCreateParams, options?: Core.RequestOptions): Core.APIPromise<Cheque>;
39
+ /**
40
+ * Retrieve a cheque by ID.
41
+ */
42
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Cheque>;
43
+ /**
44
+ * Get a list of cheques.
45
+ */
46
+ list(query?: ChequeListParams, options?: Core.RequestOptions): Core.PagePromise<ChequesList, Cheque>;
47
+ list(options?: Core.RequestOptions): Core.PagePromise<ChequesList, Cheque>;
48
+ /**
49
+ * Cancel a cheque by ID. Note that this operation cannot be undone.
50
+ */
51
+ cancel(id: string, options?: Core.RequestOptions): Core.APIPromise<Cheque>;
52
+ }
53
+ export declare class ChequesList extends List<Cheque> {
54
+ }
55
+ export interface Cheque {
56
+ /**
57
+ * A unique ID prefixed with cheque\_
58
+ */
59
+ id: string;
60
+ /**
61
+ * The amount of the cheque in cents.
62
+ */
63
+ amount: number;
64
+ /**
65
+ * The bank account (ID) associated with the cheque.
66
+ */
67
+ bankAccount: string;
68
+ /**
69
+ * The UTC time at which this resource was created.
70
+ */
71
+ createdAt: string;
72
+ /**
73
+ * The currency code of the cheque. This can be `USD` even if drawing from a
74
+ * Canadian bank account and vice versa. Defaults to the currency of the bank
75
+ * account country if not otherwise specified.
76
+ */
77
+ currencyCode: 'USD' | 'CAD';
78
+ /**
79
+ * The contact information of the sender.
80
+ */
81
+ from: ContactsAPI.Contact;
82
+ /**
83
+ * `true` if this is a live mode resource else `false`.
84
+ */
85
+ live: boolean;
86
+ /**
87
+ * The mailing class of this order. This determines the speed and cost of delivery.
88
+ * See `OrderMailingClass` for more details.
89
+ */
90
+ 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';
91
+ /**
92
+ * Always `cheque`.
93
+ */
94
+ object: 'cheque';
95
+ /**
96
+ * This order will transition from `ready` to `printing` on the day after this
97
+ * date. For example, if this is a date on Tuesday, the order will transition to
98
+ * `printing` on Wednesday at midnight eastern time.
99
+ */
100
+ sendDate: string;
101
+ /**
102
+ * Enum representing the supported cheque sizes.
103
+ */
104
+ size: 'us_letter' | 'us_legal';
105
+ /**
106
+ * See `OrderStatus` for more details on the status of this order.
107
+ */
108
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
109
+ /**
110
+ * The recipient of this order. This will be provided even if you delete the
111
+ * underlying contact.
112
+ */
113
+ to: ContactsAPI.Contact;
114
+ /**
115
+ * The UTC time at which this resource was last updated.
116
+ */
117
+ updatedAt: string;
118
+ /**
119
+ * The cancellation details of this order. Populated if the order has been
120
+ * cancelled.
121
+ */
122
+ cancellation?: Shared.Cancellation;
123
+ /**
124
+ * A link to the deposit-ready PDF for a digital-only cheque, returned if requested
125
+ * and available.
126
+ */
127
+ depositReadyPDFURL?: string;
128
+ /**
129
+ * An optional string describing this resource. Will be visible in the API and the
130
+ * dashboard.
131
+ */
132
+ description?: string;
133
+ /**
134
+ * The digitalOnly object contains data for digital-only cheques. A watermark must
135
+ * be provided.
136
+ */
137
+ digitalOnly?: Cheque.DigitalOnly;
138
+ /**
139
+ * The envelope of the cheque. If a custom envelope ID is not specified, defaults
140
+ * to `standard`.
141
+ */
142
+ envelope?: 'standard' | (string & {});
143
+ /**
144
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
145
+ */
146
+ imbDate?: string;
147
+ /**
148
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
149
+ * US-printed and US-destined orders. This is the most detailed way to track
150
+ * non-express/certified orders.
151
+ */
152
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
153
+ /**
154
+ * The most recent ZIP code of the USPS facility that the order has been processed
155
+ * through. Only populated when an `imbStatus` is present.
156
+ */
157
+ imbZIPCode?: string;
158
+ /**
159
+ * An optional logo URL for the cheque. This will be placed next to the recipient
160
+ * address at the top left corner of the cheque. This needs to be a public link to
161
+ * an image file (e.g. a PNG or JPEG file).
162
+ */
163
+ logoURL?: string;
164
+ /**
165
+ * The memo of the cheque.
166
+ */
167
+ memo?: string;
168
+ /**
169
+ * These will be merged with the variables in the template or HTML you create this
170
+ * order with. The keys in this object should match the variable names in the
171
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
172
+ * PDFs uploaded with the order.
173
+ */
174
+ mergeVariables?: Record<string, unknown>;
175
+ /**
176
+ * The message of the cheque.
177
+ */
178
+ message?: string;
179
+ /**
180
+ * See the section on Metadata.
181
+ */
182
+ metadata?: Record<string, unknown>;
183
+ /**
184
+ * The number of the cheque. If you don't provide this, it will automatically be
185
+ * set to an incrementing number starting from 1 across your entire account,
186
+ * ensuring that every cheque has a unique number.
187
+ */
188
+ number?: number;
189
+ /**
190
+ * The tracking number of this order. Populated after an express/certified order
191
+ * has been processed for delivery.
192
+ */
193
+ trackingNumber?: string;
194
+ /**
195
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
196
+ * ensure that the order is correct before it is sent out because it shows what
197
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
198
+ * this field will be returned by all `GET` endpoints which produce this order.
199
+ *
200
+ * This URL is a signed link to the PDF preview. It will expire after a short
201
+ * period of time. If you need to access this URL after it has expired, you can
202
+ * regenerate it by calling the `GET` endpoint again.
203
+ */
204
+ url?: string;
205
+ }
206
+ export declare namespace Cheque {
207
+ /**
208
+ * The digitalOnly object contains data for digital-only cheques. A watermark must
209
+ * be provided.
210
+ */
211
+ interface DigitalOnly {
212
+ /**
213
+ * Text to be displayed as a watermark on the digital cheque.
214
+ */
215
+ watermark: string;
216
+ }
217
+ }
218
+ export interface ChequeList {
219
+ data: Array<Cheque>;
220
+ limit: number;
221
+ object: 'list';
222
+ skip: number;
223
+ totalCount: number;
224
+ }
225
+ export interface ChequeCreateParams {
226
+ /**
227
+ * The amount of the cheque in cents.
228
+ */
229
+ amount: number;
230
+ /**
231
+ * The bank account (ID) associated with the cheque.
232
+ */
233
+ bankAccount: string;
234
+ /**
235
+ * The contact information of the sender. You can pass contact information inline
236
+ * here just like you can for the `to`.
237
+ */
238
+ from: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
239
+ /**
240
+ * The recipient of this order. You can either supply the contact information
241
+ * inline here or provide a contact ID. PostGrid will automatically deduplicate
242
+ * contacts regardless of whether you provide the information inline here or call
243
+ * the contact creation endpoint.
244
+ */
245
+ to: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
246
+ /**
247
+ * The currency code of the cheque. This will be set to the default currency of the
248
+ * bank account (`USD` for US bank accounts and `CAD` for Canadian bank accounts)
249
+ * if not provided. You can set this value to `USD` if you want to draw USD from a
250
+ * Canadian bank account or vice versa.
251
+ */
252
+ currencyCode?: 'USD' | 'CAD';
253
+ /**
254
+ * An optional string describing this resource. Will be visible in the API and the
255
+ * dashboard.
256
+ */
257
+ description?: string;
258
+ /**
259
+ * The digitalOnly object contains data for digital-only cheques. A watermark must
260
+ * be provided.
261
+ */
262
+ digitalOnly?: ChequeCreateParams.DigitalOnly;
263
+ /**
264
+ * The envelope of the cheque. If a custom envelope ID is not specified, defaults
265
+ * to `standard`.
266
+ */
267
+ envelope?: 'standard' | (string & {});
268
+ /**
269
+ * An optional logo URL for the cheque. This will be placed next to the recipient
270
+ * address at the top left corner of the cheque. This needs to be a public link to
271
+ * an image file (e.g. a PNG or JPEG file).
272
+ */
273
+ logoURL?: string;
274
+ /**
275
+ * The mailing class of this order. If not provided, automatically set to
276
+ * `first_class`.
277
+ */
278
+ 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';
279
+ /**
280
+ * The memo of the cheque.
281
+ */
282
+ memo?: string;
283
+ /**
284
+ * These will be merged with the variables in the template or HTML you create this
285
+ * order with. The keys in this object should match the variable names in the
286
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
287
+ * PDFs uploaded with the order.
288
+ */
289
+ mergeVariables?: Record<string, unknown>;
290
+ /**
291
+ * The message of the cheque.
292
+ */
293
+ message?: string;
294
+ /**
295
+ * See the section on Metadata.
296
+ */
297
+ metadata?: Record<string, unknown>;
298
+ /**
299
+ * The number of the cheque. If you don't provide this, it will automatically be
300
+ * set to an incrementing number starting from 1 across your entire account,
301
+ * ensuring that every cheque has a unique number.
302
+ */
303
+ number?: number;
304
+ /**
305
+ * Providing this inserts a blank page at the start of the cheque with the
306
+ * recipient you provide here. This leaves the cheque that follows intact, which
307
+ * means you can use this to intercept at cheque at the redirected address and then
308
+ * mail it forward to the final recipient yourself. One use case for this is
309
+ * signing cheques at your office before mailing them out yourself.
310
+ */
311
+ redirectTo?: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
312
+ /**
313
+ * This order will transition from `ready` to `printing` on the day after this
314
+ * date. You can use this parameter to schedule orders for a future date.
315
+ */
316
+ sendDate?: string;
317
+ /**
318
+ * Enum representing the supported cheque sizes.
319
+ */
320
+ size?: 'us_letter' | 'us_legal';
321
+ }
322
+ export declare namespace ChequeCreateParams {
323
+ /**
324
+ * The digitalOnly object contains data for digital-only cheques. A watermark must
325
+ * be provided.
326
+ */
327
+ interface DigitalOnly {
328
+ /**
329
+ * Text to be displayed as a watermark on the digital cheque.
330
+ */
331
+ watermark: string;
332
+ }
333
+ }
334
+ export interface ChequeListParams extends ListParams {
335
+ /**
336
+ * You can supply any string to help narrow down the list of resources. For
337
+ * example, if you pass `"New York"` (quoted), it will return resources that have
338
+ * that string present somewhere in their response. Alternatively, you can supply a
339
+ * structured search query. See the documentation on `StructuredSearchQuery` for
340
+ * more details.
341
+ */
342
+ search?: string;
343
+ }
344
+ export declare namespace Cheques {
345
+ export { type Cheque as Cheque, type ChequeList as ChequeList, ChequesList as ChequesList, type ChequeCreateParams as ChequeCreateParams, type ChequeListParams as ChequeListParams, };
346
+ export { URL as URL, type URLRetrieveResponse as URLRetrieveResponse };
347
+ export { WithDepositReadyPdf as WithDepositReadyPdf };
348
+ }
349
+ //# sourceMappingURL=cheques.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cheques.d.ts","sourceRoot":"","sources":["../../src/resources/cheques/cheques.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,qBAAa,OAAQ,SAAQ,WAAW;IACtC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;IAC/C,mBAAmB,EAAE,sBAAsB,CAAC,mBAAmB,CACA;IAE/D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAIxF;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC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,EAAE,CAAC;IAEvE,OAAO,EAAE,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACvD"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.ChequesList = exports.Cheques = void 0;
28
+ const resource_1 = require("../../resource.js");
29
+ const core_1 = require("../../core.js");
30
+ const URLAPI = __importStar(require("./url.js"));
31
+ const url_1 = require("./url.js");
32
+ const WithDepositReadyPdfAPI = __importStar(require("./with-deposit-ready-pdf.js"));
33
+ const with_deposit_ready_pdf_1 = require("./with-deposit-ready-pdf.js");
34
+ const pagination_1 = require("../../pagination.js");
35
+ class Cheques extends resource_1.APIResource {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.url = new URLAPI.URL(this._client);
39
+ this.withDepositReadyPdf = new WithDepositReadyPdfAPI.WithDepositReadyPdf(this._client);
40
+ }
41
+ /**
42
+ * Create a cheque.
43
+ *
44
+ * This endpoint allows you to create a new cheque with the specified details.
45
+ *
46
+ * If you would like to create a digitalOnly cheque, the digitalOnly object with
47
+ * the watermark will need to be passed in. Feature is available on request, e-mail
48
+ * support@postgrid.com for access.
49
+ *
50
+ * Example request body:
51
+ *
52
+ * ```json
53
+ * {
54
+ * "from": "contact_123",
55
+ * "bankAccount": "bank_123",
56
+ * "amount": 1000,
57
+ * "currencyCode": "USD",
58
+ * "number": 123456,
59
+ * "size": "us_letter",
60
+ * "digitalOnly": {
61
+ * "watermark": "VOID"
62
+ * }
63
+ * }
64
+ * ```
65
+ */
66
+ create(body, options) {
67
+ return this._client.post('/cheques', { body, ...options });
68
+ }
69
+ /**
70
+ * Retrieve a cheque by ID.
71
+ */
72
+ retrieve(id, options) {
73
+ return this._client.get(`/cheques/${id}`, options);
74
+ }
75
+ list(query = {}, options) {
76
+ if ((0, core_1.isRequestOptions)(query)) {
77
+ return this.list({}, query);
78
+ }
79
+ return this._client.getAPIList('/cheques', ChequesList, { query, ...options });
80
+ }
81
+ /**
82
+ * Cancel a cheque by ID. Note that this operation cannot be undone.
83
+ */
84
+ cancel(id, options) {
85
+ return this._client.delete(`/cheques/${id}`, options);
86
+ }
87
+ }
88
+ exports.Cheques = Cheques;
89
+ class ChequesList extends pagination_1.List {
90
+ }
91
+ exports.ChequesList = ChequesList;
92
+ Cheques.ChequesList = ChequesList;
93
+ Cheques.URL = url_1.URL;
94
+ Cheques.WithDepositReadyPdf = with_deposit_ready_pdf_1.WithDepositReadyPdf;
95
+ //# sourceMappingURL=cheques.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cheques.js","sourceRoot":"","sources":["../../src/resources/cheques/cheques.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAI9C,iDAAgC;AAChC,kCAAiD;AACjD,oFAAmE;AACnE,wEAA+D;AAC/D,oD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B,CAAC"}
@@ -0,0 +1,67 @@
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 * as URLAPI from "./url.mjs";
5
+ import { URL } from "./url.mjs";
6
+ import * as WithDepositReadyPdfAPI from "./with-deposit-ready-pdf.mjs";
7
+ import { WithDepositReadyPdf } from "./with-deposit-ready-pdf.mjs";
8
+ import { List } from "../../pagination.mjs";
9
+ export class Cheques extends APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.url = new URLAPI.URL(this._client);
13
+ this.withDepositReadyPdf = new WithDepositReadyPdfAPI.WithDepositReadyPdf(this._client);
14
+ }
15
+ /**
16
+ * Create a cheque.
17
+ *
18
+ * This endpoint allows you to create a new cheque with the specified details.
19
+ *
20
+ * If you would like to create a digitalOnly cheque, the digitalOnly object with
21
+ * the watermark will need to be passed in. Feature is available on request, e-mail
22
+ * support@postgrid.com for access.
23
+ *
24
+ * Example request body:
25
+ *
26
+ * ```json
27
+ * {
28
+ * "from": "contact_123",
29
+ * "bankAccount": "bank_123",
30
+ * "amount": 1000,
31
+ * "currencyCode": "USD",
32
+ * "number": 123456,
33
+ * "size": "us_letter",
34
+ * "digitalOnly": {
35
+ * "watermark": "VOID"
36
+ * }
37
+ * }
38
+ * ```
39
+ */
40
+ create(body, options) {
41
+ return this._client.post('/cheques', { body, ...options });
42
+ }
43
+ /**
44
+ * Retrieve a cheque by ID.
45
+ */
46
+ retrieve(id, options) {
47
+ return this._client.get(`/cheques/${id}`, options);
48
+ }
49
+ list(query = {}, options) {
50
+ if (isRequestOptions(query)) {
51
+ return this.list({}, query);
52
+ }
53
+ return this._client.getAPIList('/cheques', ChequesList, { query, ...options });
54
+ }
55
+ /**
56
+ * Cancel a cheque by ID. Note that this operation cannot be undone.
57
+ */
58
+ cancel(id, options) {
59
+ return this._client.delete(`/cheques/${id}`, options);
60
+ }
61
+ }
62
+ export class ChequesList extends List {
63
+ }
64
+ Cheques.ChequesList = ChequesList;
65
+ Cheques.URL = URL;
66
+ Cheques.WithDepositReadyPdf = WithDepositReadyPdf;
67
+ //# sourceMappingURL=cheques.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cheques.mjs","sourceRoot":"","sources":["../../src/resources/cheques/cheques.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,KAAK,MAAM;OACX,EAAE,GAAG,EAAuB;OAC5B,KAAK,sBAAsB;OAC3B,EAAE,mBAAmB,EAAE;OACvB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,wBAAmB,GACjB,IAAI,sBAAsB,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2DjE,CAAC;IAzDC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;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,KA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