pingen2-sdk-js 0.1.2

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 (223) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +415 -0
  3. package/dist/client.d.ts +30 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +72 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/common/enums/address-position.d.ts +5 -0
  8. package/dist/common/enums/address-position.d.ts.map +1 -0
  9. package/dist/common/enums/address-position.js +9 -0
  10. package/dist/common/enums/address-position.js.map +1 -0
  11. package/dist/common/enums/delivery-product.d.ts +8 -0
  12. package/dist/common/enums/delivery-product.d.ts.map +1 -0
  13. package/dist/common/enums/delivery-product.js +12 -0
  14. package/dist/common/enums/delivery-product.js.map +1 -0
  15. package/dist/common/enums/index.d.ts +6 -0
  16. package/dist/common/enums/index.d.ts.map +1 -0
  17. package/dist/common/enums/index.js +14 -0
  18. package/dist/common/enums/index.js.map +1 -0
  19. package/dist/common/enums/paper-type.d.ts +7 -0
  20. package/dist/common/enums/paper-type.d.ts.map +1 -0
  21. package/dist/common/enums/paper-type.js +11 -0
  22. package/dist/common/enums/paper-type.js.map +1 -0
  23. package/dist/common/enums/print-mode.d.ts +5 -0
  24. package/dist/common/enums/print-mode.d.ts.map +1 -0
  25. package/dist/common/enums/print-mode.js +9 -0
  26. package/dist/common/enums/print-mode.js.map +1 -0
  27. package/dist/common/enums/print-spectrum.d.ts +5 -0
  28. package/dist/common/enums/print-spectrum.d.ts.map +1 -0
  29. package/dist/common/enums/print-spectrum.js +9 -0
  30. package/dist/common/enums/print-spectrum.js.map +1 -0
  31. package/dist/common/index.d.ts +8 -0
  32. package/dist/common/index.d.ts.map +1 -0
  33. package/dist/common/index.js +24 -0
  34. package/dist/common/index.js.map +1 -0
  35. package/dist/common/json-api.d.ts +37 -0
  36. package/dist/common/json-api.d.ts.map +1 -0
  37. package/dist/common/json-api.js +3 -0
  38. package/dist/common/json-api.js.map +1 -0
  39. package/dist/common/preset.d.ts +13 -0
  40. package/dist/common/preset.d.ts.map +1 -0
  41. package/dist/common/preset.js +20 -0
  42. package/dist/common/preset.js.map +1 -0
  43. package/dist/common/relationships.d.ts +20 -0
  44. package/dist/common/relationships.d.ts.map +1 -0
  45. package/dist/common/relationships.js +3 -0
  46. package/dist/common/relationships.js.map +1 -0
  47. package/dist/common/response.d.ts +12 -0
  48. package/dist/common/response.d.ts.map +1 -0
  49. package/dist/common/response.js +77 -0
  50. package/dist/common/response.js.map +1 -0
  51. package/dist/common/typed-response.d.ts +29 -0
  52. package/dist/common/typed-response.d.ts.map +1 -0
  53. package/dist/common/typed-response.js +3 -0
  54. package/dist/common/typed-response.js.map +1 -0
  55. package/dist/common/webhook-event.d.ts +34 -0
  56. package/dist/common/webhook-event.d.ts.map +1 -0
  57. package/dist/common/webhook-event.js +3 -0
  58. package/dist/common/webhook-event.js.map +1 -0
  59. package/dist/constants.d.ts +10 -0
  60. package/dist/constants.d.ts.map +1 -0
  61. package/dist/constants.js +16 -0
  62. package/dist/constants.js.map +1 -0
  63. package/dist/errors.d.ts +50 -0
  64. package/dist/errors.d.ts.map +1 -0
  65. package/dist/errors.js +115 -0
  66. package/dist/errors.js.map +1 -0
  67. package/dist/index.d.ts +12 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +61 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/oauth.d.ts +17 -0
  72. package/dist/oauth.d.ts.map +1 -0
  73. package/dist/oauth.js +68 -0
  74. package/dist/oauth.js.map +1 -0
  75. package/dist/requestor.d.ts +28 -0
  76. package/dist/requestor.d.ts.map +1 -0
  77. package/dist/requestor.js +163 -0
  78. package/dist/requestor.js.map +1 -0
  79. package/dist/resources/base.d.ts +19 -0
  80. package/dist/resources/base.d.ts.map +1 -0
  81. package/dist/resources/base.js +40 -0
  82. package/dist/resources/base.js.map +1 -0
  83. package/dist/resources/batches/batches.d.ts +15 -0
  84. package/dist/resources/batches/batches.d.ts.map +1 -0
  85. package/dist/resources/batches/batches.js +68 -0
  86. package/dist/resources/batches/batches.js.map +1 -0
  87. package/dist/resources/batches/enums.d.ts +39 -0
  88. package/dist/resources/batches/enums.d.ts.map +1 -0
  89. package/dist/resources/batches/enums.js +44 -0
  90. package/dist/resources/batches/enums.js.map +1 -0
  91. package/dist/resources/batches/response.d.ts +27 -0
  92. package/dist/resources/batches/response.d.ts.map +1 -0
  93. package/dist/resources/batches/response.js +3 -0
  94. package/dist/resources/batches/response.js.map +1 -0
  95. package/dist/resources/batches/types.d.ts +41 -0
  96. package/dist/resources/batches/types.d.ts.map +1 -0
  97. package/dist/resources/batches/types.js +3 -0
  98. package/dist/resources/batches/types.js.map +1 -0
  99. package/dist/resources/ebills/ebills.d.ts +13 -0
  100. package/dist/resources/ebills/ebills.d.ts.map +1 -0
  101. package/dist/resources/ebills/ebills.js +38 -0
  102. package/dist/resources/ebills/ebills.js.map +1 -0
  103. package/dist/resources/ebills/response.d.ts +27 -0
  104. package/dist/resources/ebills/response.d.ts.map +1 -0
  105. package/dist/resources/ebills/response.js +3 -0
  106. package/dist/resources/ebills/response.js.map +1 -0
  107. package/dist/resources/ebills/types.d.ts +23 -0
  108. package/dist/resources/ebills/types.d.ts.map +1 -0
  109. package/dist/resources/ebills/types.js +3 -0
  110. package/dist/resources/ebills/types.js.map +1 -0
  111. package/dist/resources/emails/emails.d.ts +13 -0
  112. package/dist/resources/emails/emails.d.ts.map +1 -0
  113. package/dist/resources/emails/emails.js +38 -0
  114. package/dist/resources/emails/emails.js.map +1 -0
  115. package/dist/resources/emails/response.d.ts +24 -0
  116. package/dist/resources/emails/response.d.ts.map +1 -0
  117. package/dist/resources/emails/response.js +3 -0
  118. package/dist/resources/emails/response.js.map +1 -0
  119. package/dist/resources/emails/types.d.ts +26 -0
  120. package/dist/resources/emails/types.d.ts.map +1 -0
  121. package/dist/resources/emails/types.js +3 -0
  122. package/dist/resources/emails/types.js.map +1 -0
  123. package/dist/resources/events/batch-events.d.ts +6 -0
  124. package/dist/resources/events/batch-events.d.ts.map +1 -0
  125. package/dist/resources/events/batch-events.js +11 -0
  126. package/dist/resources/events/batch-events.js.map +1 -0
  127. package/dist/resources/events/ebill-events.d.ts +6 -0
  128. package/dist/resources/events/ebill-events.d.ts.map +1 -0
  129. package/dist/resources/events/ebill-events.js +11 -0
  130. package/dist/resources/events/ebill-events.js.map +1 -0
  131. package/dist/resources/events/email-events.d.ts +6 -0
  132. package/dist/resources/events/email-events.d.ts.map +1 -0
  133. package/dist/resources/events/email-events.js +11 -0
  134. package/dist/resources/events/email-events.js.map +1 -0
  135. package/dist/resources/events/letter-events.d.ts +11 -0
  136. package/dist/resources/events/letter-events.d.ts.map +1 -0
  137. package/dist/resources/events/letter-events.js +26 -0
  138. package/dist/resources/events/letter-events.js.map +1 -0
  139. package/dist/resources/events/response.d.ts +20 -0
  140. package/dist/resources/events/response.d.ts.map +1 -0
  141. package/dist/resources/events/response.js +3 -0
  142. package/dist/resources/events/response.js.map +1 -0
  143. package/dist/resources/file-upload.d.ts +17 -0
  144. package/dist/resources/file-upload.d.ts.map +1 -0
  145. package/dist/resources/file-upload.js +24 -0
  146. package/dist/resources/file-upload.js.map +1 -0
  147. package/dist/resources/index.d.ts +30 -0
  148. package/dist/resources/index.d.ts.map +1 -0
  149. package/dist/resources/index.js +58 -0
  150. package/dist/resources/index.js.map +1 -0
  151. package/dist/resources/letters/letters.d.ts +18 -0
  152. package/dist/resources/letters/letters.d.ts.map +1 -0
  153. package/dist/resources/letters/letters.js +88 -0
  154. package/dist/resources/letters/letters.js.map +1 -0
  155. package/dist/resources/letters/response.d.ts +35 -0
  156. package/dist/resources/letters/response.d.ts.map +1 -0
  157. package/dist/resources/letters/response.js +3 -0
  158. package/dist/resources/letters/response.js.map +1 -0
  159. package/dist/resources/letters/types.d.ts +61 -0
  160. package/dist/resources/letters/types.d.ts.map +1 -0
  161. package/dist/resources/letters/types.js +3 -0
  162. package/dist/resources/letters/types.js.map +1 -0
  163. package/dist/resources/organisations/organisations.d.ts +7 -0
  164. package/dist/resources/organisations/organisations.d.ts.map +1 -0
  165. package/dist/resources/organisations/organisations.js +14 -0
  166. package/dist/resources/organisations/organisations.js.map +1 -0
  167. package/dist/resources/organisations/response.d.ts +24 -0
  168. package/dist/resources/organisations/response.d.ts.map +1 -0
  169. package/dist/resources/organisations/response.js +3 -0
  170. package/dist/resources/organisations/response.js.map +1 -0
  171. package/dist/resources/users/response.d.ts +21 -0
  172. package/dist/resources/users/response.d.ts.map +1 -0
  173. package/dist/resources/users/response.js +3 -0
  174. package/dist/resources/users/response.js.map +1 -0
  175. package/dist/resources/users/user-associations.d.ts +6 -0
  176. package/dist/resources/users/user-associations.d.ts.map +1 -0
  177. package/dist/resources/users/user-associations.js +11 -0
  178. package/dist/resources/users/user-associations.js.map +1 -0
  179. package/dist/resources/users/users.d.ts +6 -0
  180. package/dist/resources/users/users.d.ts.map +1 -0
  181. package/dist/resources/users/users.js +11 -0
  182. package/dist/resources/users/users.js.map +1 -0
  183. package/dist/resources/webhooks/enums.d.ts +8 -0
  184. package/dist/resources/webhooks/enums.d.ts.map +1 -0
  185. package/dist/resources/webhooks/enums.js +12 -0
  186. package/dist/resources/webhooks/enums.js.map +1 -0
  187. package/dist/resources/webhooks/response.d.ts +8 -0
  188. package/dist/resources/webhooks/response.d.ts.map +1 -0
  189. package/dist/resources/webhooks/response.js +3 -0
  190. package/dist/resources/webhooks/response.js.map +1 -0
  191. package/dist/resources/webhooks/types.d.ts +7 -0
  192. package/dist/resources/webhooks/types.d.ts.map +1 -0
  193. package/dist/resources/webhooks/types.js +3 -0
  194. package/dist/resources/webhooks/types.js.map +1 -0
  195. package/dist/resources/webhooks/webhooks.d.ts +10 -0
  196. package/dist/resources/webhooks/webhooks.d.ts.map +1 -0
  197. package/dist/resources/webhooks/webhooks.js +24 -0
  198. package/dist/resources/webhooks/webhooks.js.map +1 -0
  199. package/dist/utils/headers.d.ts +2 -0
  200. package/dist/utils/headers.d.ts.map +1 -0
  201. package/dist/utils/headers.js +13 -0
  202. package/dist/utils/headers.js.map +1 -0
  203. package/dist/utils/idempotency.d.ts +2 -0
  204. package/dist/utils/idempotency.d.ts.map +1 -0
  205. package/dist/utils/idempotency.js +8 -0
  206. package/dist/utils/idempotency.js.map +1 -0
  207. package/dist/utils/object.d.ts +2 -0
  208. package/dist/utils/object.d.ts.map +1 -0
  209. package/dist/utils/object.js +17 -0
  210. package/dist/utils/object.js.map +1 -0
  211. package/dist/utils/payload.d.ts +8 -0
  212. package/dist/utils/payload.d.ts.map +1 -0
  213. package/dist/utils/payload.js +20 -0
  214. package/dist/utils/payload.js.map +1 -0
  215. package/dist/utils/retry.d.ts +6 -0
  216. package/dist/utils/retry.d.ts.map +1 -0
  217. package/dist/utils/retry.js +45 -0
  218. package/dist/utils/retry.js.map +1 -0
  219. package/dist/webhook.d.ts +7 -0
  220. package/dist/webhook.d.ts.map +1 -0
  221. package/dist/webhook.js +25 -0
  222. package/dist/webhook.js.map +1 -0
  223. package/package.json +56 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/resources/batches/enums.ts"],"names":[],"mappings":";;;AA2CA,gEAEC;AA3CD,IAAY,SAiBX;AAjBD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,oCAAuB,CAAA;IACvB,mCAAsB,CAAA;IACtB,4BAAe,CAAA;IACf,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,uCAA0B,CAAA;IAC1B,2CAA8B,CAAA;IAC9B,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;IACrB,wCAA2B,CAAA;IAC3B,kCAAqB,CAAA;IACrB,oCAAuB,CAAA;IACvB,4BAAe,CAAA;IACf,4BAAe,CAAA;AACjB,CAAC,EAjBW,SAAS,yBAAT,SAAS,QAiBpB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,2BAAW,CAAA;AACb,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,qCAAwB,CAAA;AAC1B,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,yCAAwB,CAAA;IACxB,uCAAsB,CAAA;AACxB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAOD,SAAgB,0BAA0B,CAAC,OAAe,EAAE,eAAgC;IAC1F,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;AACxD,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { RelationshipItem, RelationshipMany } from '../../common/relationships';
2
+ export interface BatchAttributes {
3
+ name?: string;
4
+ icon?: string;
5
+ status?: string;
6
+ file_original_name?: string;
7
+ letter_count?: number;
8
+ address_position?: string;
9
+ price_currency?: string;
10
+ price_value?: number;
11
+ print_mode?: string;
12
+ print_spectrum?: string;
13
+ source?: string;
14
+ submitted_at?: string;
15
+ created_at?: string;
16
+ updated_at?: string;
17
+ }
18
+ export interface BatchRelationships {
19
+ organisation?: RelationshipItem;
20
+ events?: RelationshipMany;
21
+ }
22
+ export interface BatchStatisticsAttributes {
23
+ letter_validating?: number;
24
+ letter_groups?: unknown[];
25
+ letter_countries?: unknown[];
26
+ }
27
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/batches/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/resources/batches/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import { AddressPosition, PrintMode, PrintSpectrum } from '../../common/enums';
2
+ import { PresetRelationship } from '../../common/preset';
3
+ import { BatchIcon, GroupingType, SplitType, SplitPosition, BatchDeliveryProduct } from './enums';
4
+ export interface BatchCreateOptions {
5
+ fileUrl: string;
6
+ fileSignature: string;
7
+ name: string;
8
+ icon: BatchIcon;
9
+ fileOriginalName: string;
10
+ addressPosition: AddressPosition;
11
+ groupingType: GroupingType;
12
+ splitType: SplitType;
13
+ splitSize?: number;
14
+ splitSeparator?: string;
15
+ splitPosition?: SplitPosition;
16
+ preset?: PresetRelationship;
17
+ }
18
+ export interface BatchUploadOptions {
19
+ filePath: string;
20
+ name: string;
21
+ icon: BatchIcon;
22
+ fileOriginalName: string;
23
+ addressPosition: AddressPosition;
24
+ groupingType: GroupingType;
25
+ splitType: SplitType;
26
+ splitSize?: number;
27
+ splitSeparator?: string;
28
+ splitPosition?: SplitPosition;
29
+ preset?: PresetRelationship;
30
+ }
31
+ export interface BatchSendOptions {
32
+ batchId: string;
33
+ deliveryProducts: BatchDeliveryProduct[];
34
+ printMode: PrintMode;
35
+ printSpectrum: PrintSpectrum;
36
+ }
37
+ export interface BatchEditOptions {
38
+ name?: string;
39
+ icon?: BatchIcon;
40
+ }
41
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/batches/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElG,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;CAC9B;AAID,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/resources/batches/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ import { EbillCreateOptions, EbillUploadOptions } from './types';
4
+ export declare class Ebills extends OrgResource {
5
+ getDetails(ebillId: string, params?: Record<string, string>): Promise<PingenResponse>;
6
+ getCollection(params?: Record<string, string>): Promise<PingenResponse>;
7
+ uploadAndCreate(opts: EbillUploadOptions): Promise<PingenResponse>;
8
+ create(opts: EbillCreateOptions): Promise<PingenResponse>;
9
+ cancel(ebillId: string): Promise<PingenResponse>;
10
+ delete(ebillId: string): Promise<PingenResponse>;
11
+ getFile(ebillId: string): Promise<string>;
12
+ }
13
+ //# sourceMappingURL=ebills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ebills.d.ts","sourceRoot":"","sources":["../../../src/resources/ebills/ebills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEjE,qBAAa,MAAO,SAAQ,WAAW;IACrC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIrF,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIvE,eAAe,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlE,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IAczD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhD,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG1C"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Ebills = void 0;
4
+ const base_1 = require("../base");
5
+ const payload_1 = require("../../utils/payload");
6
+ const object_1 = require("../../utils/object");
7
+ class Ebills extends base_1.OrgResource {
8
+ getDetails(ebillId, params) {
9
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/ebills/${ebillId}`, params);
10
+ }
11
+ getCollection(params) {
12
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/ebills`, params);
13
+ }
14
+ uploadAndCreate(opts) {
15
+ return this.uploadAndCall(opts, (rest) => this.create(rest));
16
+ }
17
+ create(opts) {
18
+ const attributes = (0, object_1.definedOnly)({
19
+ file_original_name: opts.fileOriginalName,
20
+ file_url: opts.fileUrl,
21
+ file_url_signature: opts.fileSignature,
22
+ auto_send: opts.autoSend,
23
+ meta_data: opts.metaData,
24
+ });
25
+ return this.requestor.post(`/organisations/${this.orgId}/deliveries/ebills`, (0, payload_1.buildJsonApi)({ type: 'ebills', attributes, relationships: opts.preset?.toValue() }));
26
+ }
27
+ cancel(ebillId) {
28
+ return this.requestor.patch(`/organisations/${this.orgId}/deliveries/ebills/${ebillId}/cancel`);
29
+ }
30
+ delete(ebillId) {
31
+ return this.requestor.delete(`/organisations/${this.orgId}/deliveries/ebills/${ebillId}`);
32
+ }
33
+ getFile(ebillId) {
34
+ return this.requestor.stream(`/organisations/${this.orgId}/deliveries/ebills/${ebillId}/file`);
35
+ }
36
+ }
37
+ exports.Ebills = Ebills;
38
+ //# sourceMappingURL=ebills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ebills.js","sourceRoot":"","sources":["../../../src/resources/ebills/ebills.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AACtC,iDAAmD;AACnD,+CAAiD;AAGjD,MAAa,MAAO,SAAQ,kBAAW;IACrC,UAAU,CAAC,OAAe,EAAE,MAA+B;QACzD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IACjG,CAAC;IAED,aAAa,CAAC,MAA+B;QAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACtF,CAAC;IAED,eAAe,CAAC,IAAwB;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,IAAwB;QAC7B,MAAM,UAAU,GAAG,IAAA,oBAAW,EAAC;YAC7B,kBAAkB,EAAE,IAAI,CAAC,gBAAgB;YACzC,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,kBAAkB,EAAE,IAAI,CAAC,aAAa;YACtC,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,SAAS,EAAE,IAAI,CAAC,QAAQ;SACzB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CACxB,kBAAkB,IAAI,CAAC,KAAK,oBAAoB,EAChD,IAAA,sBAAY,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,SAAS,CAAC,CAAC;IAClG,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,OAAO,CAAC,CAAC;IACjG,CAAC;CACF;AAtCD,wBAsCC"}
@@ -0,0 +1,27 @@
1
+ import { RelationshipItem, RelationshipMany } from '../../common/relationships';
2
+ export interface EbillAttributes {
3
+ status?: string;
4
+ file_original_name?: string;
5
+ file_pages?: number;
6
+ recipient_identifier?: string;
7
+ recipient_address?: string;
8
+ invoice_number?: string;
9
+ invoice_date?: string;
10
+ invoice_due_date?: string;
11
+ invoice_value?: number;
12
+ invoice_currency?: string;
13
+ invoice_iban?: string;
14
+ invoice_address?: string;
15
+ invoice_reference?: string;
16
+ price_currency?: string;
17
+ price_value?: number;
18
+ source?: string;
19
+ submitted_at?: string;
20
+ created_at?: string;
21
+ updated_at?: string;
22
+ }
23
+ export interface EbillRelationships {
24
+ organisation?: RelationshipItem;
25
+ events?: RelationshipMany;
26
+ }
27
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/ebills/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/resources/ebills/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { PresetRelationship } from '../../common/preset';
2
+ export interface EbillMetaData {
3
+ invoice_number: string;
4
+ invoice_date: string;
5
+ invoice_due_date: string;
6
+ recipient_identifier: string;
7
+ }
8
+ export interface EbillCreateOptions {
9
+ fileUrl: string;
10
+ fileSignature: string;
11
+ fileOriginalName: string;
12
+ autoSend: boolean;
13
+ metaData?: EbillMetaData;
14
+ preset?: PresetRelationship;
15
+ }
16
+ export interface EbillUploadOptions {
17
+ filePath: string;
18
+ fileOriginalName: string;
19
+ autoSend: boolean;
20
+ metaData?: EbillMetaData;
21
+ preset?: PresetRelationship;
22
+ }
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/ebills/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/resources/ebills/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ import { EmailCreateOptions, EmailUploadOptions } from './types';
4
+ export declare class Emails extends OrgResource {
5
+ getDetails(emailId: string, params?: Record<string, string>): Promise<PingenResponse>;
6
+ getCollection(params?: Record<string, string>): Promise<PingenResponse>;
7
+ uploadAndCreate(opts: EmailUploadOptions): Promise<PingenResponse>;
8
+ create(opts: EmailCreateOptions): Promise<PingenResponse>;
9
+ cancel(emailId: string): Promise<PingenResponse>;
10
+ delete(emailId: string): Promise<PingenResponse>;
11
+ getFile(emailId: string): Promise<string>;
12
+ }
13
+ //# sourceMappingURL=emails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.d.ts","sourceRoot":"","sources":["../../../src/resources/emails/emails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEjE,qBAAa,MAAO,SAAQ,WAAW;IACrC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIrF,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIvE,eAAe,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlE,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IAczD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhD,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG1C"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Emails = void 0;
4
+ const base_1 = require("../base");
5
+ const payload_1 = require("../../utils/payload");
6
+ const object_1 = require("../../utils/object");
7
+ class Emails extends base_1.OrgResource {
8
+ getDetails(emailId, params) {
9
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/emails/${emailId}`, params);
10
+ }
11
+ getCollection(params) {
12
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/emails`, params);
13
+ }
14
+ uploadAndCreate(opts) {
15
+ return this.uploadAndCall(opts, (rest) => this.create(rest));
16
+ }
17
+ create(opts) {
18
+ const attributes = (0, object_1.definedOnly)({
19
+ file_original_name: opts.fileOriginalName,
20
+ file_url: opts.fileUrl,
21
+ file_url_signature: opts.fileSignature,
22
+ auto_send: opts.autoSend,
23
+ meta_data: opts.metaData,
24
+ });
25
+ return this.requestor.post(`/organisations/${this.orgId}/deliveries/emails`, (0, payload_1.buildJsonApi)({ type: 'emails', attributes, relationships: opts.preset?.toValue() }));
26
+ }
27
+ cancel(emailId) {
28
+ return this.requestor.patch(`/organisations/${this.orgId}/deliveries/emails/${emailId}/cancel`);
29
+ }
30
+ delete(emailId) {
31
+ return this.requestor.delete(`/organisations/${this.orgId}/deliveries/emails/${emailId}`);
32
+ }
33
+ getFile(emailId) {
34
+ return this.requestor.stream(`/organisations/${this.orgId}/deliveries/emails/${emailId}/file`);
35
+ }
36
+ }
37
+ exports.Emails = Emails;
38
+ //# sourceMappingURL=emails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.js","sourceRoot":"","sources":["../../../src/resources/emails/emails.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AACtC,iDAAmD;AACnD,+CAAiD;AAGjD,MAAa,MAAO,SAAQ,kBAAW;IACrC,UAAU,CAAC,OAAe,EAAE,MAA+B;QACzD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IACjG,CAAC;IAED,aAAa,CAAC,MAA+B;QAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACtF,CAAC;IAED,eAAe,CAAC,IAAwB;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,IAAwB;QAC7B,MAAM,UAAU,GAAG,IAAA,oBAAW,EAAC;YAC7B,kBAAkB,EAAE,IAAI,CAAC,gBAAgB;YACzC,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,kBAAkB,EAAE,IAAI,CAAC,aAAa;YACtC,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,SAAS,EAAE,IAAI,CAAC,QAAQ;SACzB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CACxB,kBAAkB,IAAI,CAAC,KAAK,oBAAoB,EAChD,IAAA,sBAAY,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,SAAS,CAAC,CAAC;IAClG,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,OAAO,CAAC,CAAC;IACjG,CAAC;CACF;AAtCD,wBAsCC"}
@@ -0,0 +1,24 @@
1
+ import { RelationshipItem, RelationshipMany } from '../../common/relationships';
2
+ import { EmailMetaData } from './types';
3
+ export interface EmailAttributes {
4
+ status?: string;
5
+ file_original_name?: string;
6
+ file_pages?: number;
7
+ file_url?: string;
8
+ file_url_signature?: string;
9
+ auto_send?: boolean;
10
+ meta_data?: EmailMetaData;
11
+ recipient_identifier?: string;
12
+ price_currency?: string;
13
+ price_value?: number;
14
+ source?: string;
15
+ submitted_at?: string;
16
+ created_at?: string;
17
+ updated_at?: string;
18
+ }
19
+ export interface EmailRelationships {
20
+ organisation?: RelationshipItem;
21
+ events?: RelationshipMany;
22
+ preset?: RelationshipItem;
23
+ }
24
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/emails/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/resources/emails/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { PresetRelationship } from '../../common/preset';
2
+ export interface EmailMetaData {
3
+ sender_name: string;
4
+ recipient_email: string;
5
+ recipient_name: string;
6
+ reply_email: string;
7
+ reply_name: string;
8
+ subject: string;
9
+ content: string;
10
+ }
11
+ export interface EmailCreateOptions {
12
+ fileUrl: string;
13
+ fileSignature: string;
14
+ fileOriginalName: string;
15
+ autoSend: boolean;
16
+ metaData?: EmailMetaData;
17
+ preset?: PresetRelationship;
18
+ }
19
+ export interface EmailUploadOptions {
20
+ filePath: string;
21
+ fileOriginalName: string;
22
+ autoSend: boolean;
23
+ metaData?: EmailMetaData;
24
+ preset?: PresetRelationship;
25
+ }
26
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/emails/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/resources/emails/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ export declare class BatchEvents extends OrgResource {
4
+ getCollection(batchId: string, params?: Record<string, string>): Promise<PingenResponse>;
5
+ }
6
+ //# sourceMappingURL=batch-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-events.d.ts","sourceRoot":"","sources":["../../../src/resources/events/batch-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGzF"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BatchEvents = void 0;
4
+ const base_1 = require("../base");
5
+ class BatchEvents extends base_1.OrgResource {
6
+ getCollection(batchId, params) {
7
+ return this.requestor.get(`/organisations/${this.orgId}/batches/${batchId}/events`, params);
8
+ }
9
+ }
10
+ exports.BatchEvents = BatchEvents;
11
+ //# sourceMappingURL=batch-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-events.js","sourceRoot":"","sources":["../../../src/resources/events/batch-events.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AAEtC,MAAa,WAAY,SAAQ,kBAAW;IAC1C,aAAa,CAAC,OAAe,EAAE,MAA+B;QAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,YAAY,OAAO,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9F,CAAC;CACF;AAJD,kCAIC"}
@@ -0,0 +1,6 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ export declare class EbillEvents extends OrgResource {
4
+ getCollection(ebillId: string, params?: Record<string, string>): Promise<PingenResponse>;
5
+ }
6
+ //# sourceMappingURL=ebill-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ebill-events.d.ts","sourceRoot":"","sources":["../../../src/resources/events/ebill-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGzF"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EbillEvents = void 0;
4
+ const base_1 = require("../base");
5
+ class EbillEvents extends base_1.OrgResource {
6
+ getCollection(ebillId, params) {
7
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/ebills/${ebillId}/events`, params);
8
+ }
9
+ }
10
+ exports.EbillEvents = EbillEvents;
11
+ //# sourceMappingURL=ebill-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ebill-events.js","sourceRoot":"","sources":["../../../src/resources/events/ebill-events.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AAEtC,MAAa,WAAY,SAAQ,kBAAW;IAC1C,aAAa,CAAC,OAAe,EAAE,MAA+B;QAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,SAAS,EAAE,MAAM,CAAC,CAAC;IACxG,CAAC;CACF;AAJD,kCAIC"}
@@ -0,0 +1,6 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ export declare class EmailEvents extends OrgResource {
4
+ getCollection(emailId: string, params?: Record<string, string>): Promise<PingenResponse>;
5
+ }
6
+ //# sourceMappingURL=email-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-events.d.ts","sourceRoot":"","sources":["../../../src/resources/events/email-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGzF"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailEvents = void 0;
4
+ const base_1 = require("../base");
5
+ class EmailEvents extends base_1.OrgResource {
6
+ getCollection(emailId, params) {
7
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/emails/${emailId}/events`, params);
8
+ }
9
+ }
10
+ exports.EmailEvents = EmailEvents;
11
+ //# sourceMappingURL=email-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-events.js","sourceRoot":"","sources":["../../../src/resources/events/email-events.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AAEtC,MAAa,WAAY,SAAQ,kBAAW;IAC1C,aAAa,CAAC,OAAe,EAAE,MAA+B;QAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,sBAAsB,OAAO,SAAS,EAAE,MAAM,CAAC,CAAC;IACxG,CAAC;CACF;AAJD,kCAIC"}
@@ -0,0 +1,11 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ export declare class LetterEvents extends OrgResource {
4
+ getCollection(letterId: string, params?: Record<string, string>): Promise<PingenResponse>;
5
+ getIssueCollection(params?: Record<string, string>): Promise<PingenResponse>;
6
+ getUndeliverableCollection(params?: Record<string, string>): Promise<PingenResponse>;
7
+ getDeliveredCollection(params?: Record<string, string>): Promise<PingenResponse>;
8
+ getSentCollection(params?: Record<string, string>): Promise<PingenResponse>;
9
+ private eventsFeed;
10
+ }
11
+ //# sourceMappingURL=letter-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letter-events.d.ts","sourceRoot":"","sources":["../../../src/resources/events/letter-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,qBAAa,YAAa,SAAQ,WAAW;IAC3C,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIzF,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAI5E,0BAA0B,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIpF,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhF,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAI3E,OAAO,CAAC,UAAU;CAGnB"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LetterEvents = void 0;
4
+ const base_1 = require("../base");
5
+ class LetterEvents extends base_1.OrgResource {
6
+ getCollection(letterId, params) {
7
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/letters/${letterId}/events`, params);
8
+ }
9
+ getIssueCollection(params) {
10
+ return this.eventsFeed('issues', params);
11
+ }
12
+ getUndeliverableCollection(params) {
13
+ return this.eventsFeed('undeliverable', params);
14
+ }
15
+ getDeliveredCollection(params) {
16
+ return this.eventsFeed('delivered', params);
17
+ }
18
+ getSentCollection(params) {
19
+ return this.eventsFeed('sent', params);
20
+ }
21
+ eventsFeed(feed, params) {
22
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/letters/events/${feed}`, params);
23
+ }
24
+ }
25
+ exports.LetterEvents = LetterEvents;
26
+ //# sourceMappingURL=letter-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letter-events.js","sourceRoot":"","sources":["../../../src/resources/events/letter-events.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AAEtC,MAAa,YAAa,SAAQ,kBAAW;IAC3C,aAAa,CAAC,QAAgB,EAAE,MAA+B;QAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,uBAAuB,QAAQ,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1G,CAAC;IAED,kBAAkB,CAAC,MAA+B;QAChD,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,0BAA0B,CAAC,MAA+B;QACxD,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,sBAAsB,CAAC,MAA+B;QACpD,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,iBAAiB,CAAC,MAA+B;QAC/C,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAEO,UAAU,CAAC,IAAY,EAAE,MAA+B;QAC9D,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,8BAA8B,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IACtG,CAAC;CACF;AAxBD,oCAwBC"}
@@ -0,0 +1,20 @@
1
+ import { RelationshipItem } from '../../common/relationships';
2
+ export interface EventAttributes {
3
+ code?: string;
4
+ name?: string;
5
+ description?: string;
6
+ producer?: string;
7
+ location?: string;
8
+ has_image?: boolean;
9
+ data?: unknown[];
10
+ emitted_at?: string;
11
+ created_at?: string;
12
+ updated_at?: string;
13
+ }
14
+ export interface EventRelationships {
15
+ letter?: RelationshipItem;
16
+ batch?: RelationshipItem;
17
+ ebill?: RelationshipItem;
18
+ email?: RelationshipItem;
19
+ }
20
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/events/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/resources/events/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { ApiRequestor } from '../requestor';
2
+ export interface FileUploadAttributes {
3
+ url?: string;
4
+ url_signature?: string;
5
+ expires_at?: string;
6
+ }
7
+ export interface SignedUpload {
8
+ url: string;
9
+ signature: string;
10
+ }
11
+ export declare class FileUpload {
12
+ private readonly requestor;
13
+ constructor(requestor: ApiRequestor);
14
+ requestFileUpload(): Promise<SignedUpload>;
15
+ putFile(filePath: string, fileUrl: string): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=file-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/resources/file-upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,YAAY;IAE9C,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC;IAehD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1D"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileUpload = void 0;
4
+ const errors_1 = require("../errors");
5
+ class FileUpload {
6
+ constructor(requestor) {
7
+ this.requestor = requestor;
8
+ }
9
+ async requestFileUpload() {
10
+ const res = await this.requestor.get('/file-upload');
11
+ const { url, url_signature } = res.toResource().attributes;
12
+ // The /file-upload endpoint MUST return both fields — if it doesn't we want to fail loudly
13
+ // here instead of silently propagating `undefined` into the subsequent create() payload.
14
+ if (!url || !url_signature) {
15
+ throw new errors_1.PingenError('Pingen /file-upload returned a response missing url or url_signature.', res.statusCode, res.data);
16
+ }
17
+ return { url, signature: url_signature };
18
+ }
19
+ putFile(filePath, fileUrl) {
20
+ return this.requestor.put(fileUrl, filePath);
21
+ }
22
+ }
23
+ exports.FileUpload = FileUpload;
24
+ //# sourceMappingURL=file-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload.js","sourceRoot":"","sources":["../../src/resources/file-upload.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AAcxC,MAAa,UAAU;IACrB,YAA6B,SAAuB;QAAvB,cAAS,GAAT,SAAS,CAAc;IAAG,CAAC;IAExD,KAAK,CAAC,iBAAiB;QACrB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACrD,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,UAAU,EAAwB,CAAC,UAAU,CAAC;QACjF,2FAA2F;QAC3F,yFAAyF;QACzF,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3B,MAAM,IAAI,oBAAW,CACnB,uEAAuE,EACvE,GAAG,CAAC,UAAU,EACd,GAAG,CAAC,IAAI,CACT,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,OAAe;QACvC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF;AArBD,gCAqBC"}