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,30 @@
1
+ export { FileUpload, type SignedUpload, type FileUploadAttributes } from './file-upload';
2
+ export { BaseResource, OrgResource } from './base';
3
+ export * from './letters/letters';
4
+ export * from './letters/types';
5
+ export * from './letters/response';
6
+ export * from './batches/batches';
7
+ export * from './batches/types';
8
+ export * from './batches/response';
9
+ export * from './batches/enums';
10
+ export * from './ebills/ebills';
11
+ export * from './ebills/types';
12
+ export * from './ebills/response';
13
+ export * from './emails/emails';
14
+ export * from './emails/types';
15
+ export * from './emails/response';
16
+ export * from './webhooks/webhooks';
17
+ export * from './webhooks/types';
18
+ export * from './webhooks/response';
19
+ export * from './webhooks/enums';
20
+ export * from './events/letter-events';
21
+ export * from './events/batch-events';
22
+ export * from './events/ebill-events';
23
+ export * from './events/email-events';
24
+ export * from './events/response';
25
+ export * from './organisations/organisations';
26
+ export * from './organisations/response';
27
+ export * from './users/users';
28
+ export * from './users/user-associations';
29
+ export * from './users/response';
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AAGzC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.OrgResource = exports.BaseResource = exports.FileUpload = void 0;
18
+ var file_upload_1 = require("./file-upload");
19
+ Object.defineProperty(exports, "FileUpload", { enumerable: true, get: function () { return file_upload_1.FileUpload; } });
20
+ var base_1 = require("./base");
21
+ Object.defineProperty(exports, "BaseResource", { enumerable: true, get: function () { return base_1.BaseResource; } });
22
+ Object.defineProperty(exports, "OrgResource", { enumerable: true, get: function () { return base_1.OrgResource; } });
23
+ // letters
24
+ __exportStar(require("./letters/letters"), exports);
25
+ __exportStar(require("./letters/types"), exports);
26
+ __exportStar(require("./letters/response"), exports);
27
+ // batches
28
+ __exportStar(require("./batches/batches"), exports);
29
+ __exportStar(require("./batches/types"), exports);
30
+ __exportStar(require("./batches/response"), exports);
31
+ __exportStar(require("./batches/enums"), exports);
32
+ // ebills
33
+ __exportStar(require("./ebills/ebills"), exports);
34
+ __exportStar(require("./ebills/types"), exports);
35
+ __exportStar(require("./ebills/response"), exports);
36
+ // emails
37
+ __exportStar(require("./emails/emails"), exports);
38
+ __exportStar(require("./emails/types"), exports);
39
+ __exportStar(require("./emails/response"), exports);
40
+ // webhooks
41
+ __exportStar(require("./webhooks/webhooks"), exports);
42
+ __exportStar(require("./webhooks/types"), exports);
43
+ __exportStar(require("./webhooks/response"), exports);
44
+ __exportStar(require("./webhooks/enums"), exports);
45
+ // events
46
+ __exportStar(require("./events/letter-events"), exports);
47
+ __exportStar(require("./events/batch-events"), exports);
48
+ __exportStar(require("./events/ebill-events"), exports);
49
+ __exportStar(require("./events/email-events"), exports);
50
+ __exportStar(require("./events/response"), exports);
51
+ // organisations
52
+ __exportStar(require("./organisations/organisations"), exports);
53
+ __exportStar(require("./organisations/response"), exports);
54
+ // users
55
+ __exportStar(require("./users/users"), exports);
56
+ __exportStar(require("./users/user-associations"), exports);
57
+ __exportStar(require("./users/response"), exports);
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAyF;AAAhF,yGAAA,UAAU,OAAA;AACnB,+BAAmD;AAA1C,oGAAA,YAAY,OAAA;AAAE,mGAAA,WAAW,OAAA;AAElC,UAAU;AACV,oDAAkC;AAClC,kDAAgC;AAChC,qDAAmC;AAEnC,UAAU;AACV,oDAAkC;AAClC,kDAAgC;AAChC,qDAAmC;AACnC,kDAAgC;AAEhC,SAAS;AACT,kDAAgC;AAChC,iDAA+B;AAC/B,oDAAkC;AAElC,SAAS;AACT,kDAAgC;AAChC,iDAA+B;AAC/B,oDAAkC;AAElC,WAAW;AACX,sDAAoC;AACpC,mDAAiC;AACjC,sDAAoC;AACpC,mDAAiC;AAEjC,SAAS;AACT,yDAAuC;AACvC,wDAAsC;AACtC,wDAAsC;AACtC,wDAAsC;AACtC,oDAAkC;AAElC,gBAAgB;AAChB,gEAA8C;AAC9C,2DAAyC;AAEzC,QAAQ;AACR,gDAA8B;AAC9B,4DAA0C;AAC1C,mDAAiC"}
@@ -0,0 +1,18 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ import { PaperType } from '../../common/enums';
4
+ import { LetterCreateOptions, LetterUploadOptions, LetterSendOptions, LetterPriceOptions } from './types';
5
+ export declare class Letters extends OrgResource {
6
+ getDetails(letterId: string, params?: Record<string, string>): Promise<PingenResponse>;
7
+ getCollection(params?: Record<string, string>): Promise<PingenResponse>;
8
+ uploadAndCreate(opts: LetterUploadOptions): Promise<PingenResponse>;
9
+ create(opts: LetterCreateOptions): Promise<PingenResponse>;
10
+ private createValidated;
11
+ send(opts: LetterSendOptions): Promise<PingenResponse>;
12
+ cancel(letterId: string): Promise<PingenResponse>;
13
+ delete(letterId: string): Promise<PingenResponse>;
14
+ edit(letterId: string, paperTypes: PaperType[]): Promise<PingenResponse>;
15
+ getFile(letterId: string): Promise<string>;
16
+ calculatePrice(opts: LetterPriceOptions): Promise<PingenResponse>;
17
+ }
18
+ //# sourceMappingURL=letters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letters.d.ts","sourceRoot":"","sources":["../../../src/resources/letters/letters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAiB1G,qBAAa,OAAQ,SAAQ,WAAW;IACtC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAItF,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIvE,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAKnE,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAK1D,OAAO,CAAC,eAAe;IAkBvB,IAAI,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAetD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIjD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIjD,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAOxE,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1C,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;CAelE"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Letters = void 0;
4
+ const errors_1 = require("../../errors");
5
+ const base_1 = require("../base");
6
+ const payload_1 = require("../../utils/payload");
7
+ const object_1 = require("../../utils/object");
8
+ function validateAutoSend(opts) {
9
+ if (!opts.autoSend) {
10
+ return;
11
+ }
12
+ if (!opts.deliveryProduct) {
13
+ throw new errors_1.ValidationError('deliveryProduct', 'deliveryProduct is required when autoSend is true');
14
+ }
15
+ if (!opts.printMode) {
16
+ throw new errors_1.ValidationError('printMode', 'printMode is required when autoSend is true');
17
+ }
18
+ if (!opts.printSpectrum) {
19
+ throw new errors_1.ValidationError('printSpectrum', 'printSpectrum is required when autoSend is true');
20
+ }
21
+ }
22
+ class Letters extends base_1.OrgResource {
23
+ getDetails(letterId, params) {
24
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/letters/${letterId}`, params);
25
+ }
26
+ getCollection(params) {
27
+ return this.requestor.get(`/organisations/${this.orgId}/deliveries/letters`, params);
28
+ }
29
+ uploadAndCreate(opts) {
30
+ validateAutoSend(opts);
31
+ return this.uploadAndCall(opts, (rest) => this.createValidated(rest));
32
+ }
33
+ create(opts) {
34
+ validateAutoSend(opts);
35
+ return this.createValidated(opts);
36
+ }
37
+ createValidated(opts) {
38
+ const attributes = (0, object_1.definedOnly)({
39
+ file_original_name: opts.fileOriginalName,
40
+ file_url: opts.fileUrl,
41
+ file_url_signature: opts.fileSignature,
42
+ address_position: opts.addressPosition,
43
+ auto_send: opts.autoSend,
44
+ delivery_product: opts.deliveryProduct,
45
+ print_mode: opts.printMode,
46
+ print_spectrum: opts.printSpectrum,
47
+ meta_data: opts.metaData,
48
+ });
49
+ return this.requestor.post(`/organisations/${this.orgId}/deliveries/letters`, (0, payload_1.buildJsonApi)({ type: 'letters', attributes, relationships: opts.preset?.toValue() }));
50
+ }
51
+ send(opts) {
52
+ return this.requestor.patch(`/organisations/${this.orgId}/deliveries/letters/${opts.letterId}/send`, (0, payload_1.buildJsonApi)({
53
+ type: 'letters',
54
+ id: opts.letterId,
55
+ attributes: {
56
+ delivery_product: opts.deliveryProduct,
57
+ print_mode: opts.printMode,
58
+ print_spectrum: opts.printSpectrum,
59
+ },
60
+ }));
61
+ }
62
+ cancel(letterId) {
63
+ return this.requestor.patch(`/organisations/${this.orgId}/deliveries/letters/${letterId}/cancel`);
64
+ }
65
+ delete(letterId) {
66
+ return this.requestor.delete(`/organisations/${this.orgId}/deliveries/letters/${letterId}`);
67
+ }
68
+ edit(letterId, paperTypes) {
69
+ return this.requestor.patch(`/organisations/${this.orgId}/deliveries/letters/${letterId}`, (0, payload_1.buildJsonApi)({ type: 'letters', id: letterId, attributes: { paper_types: paperTypes } }));
70
+ }
71
+ getFile(letterId) {
72
+ return this.requestor.stream(`/organisations/${this.orgId}/deliveries/letters/${letterId}/file`);
73
+ }
74
+ calculatePrice(opts) {
75
+ return this.requestor.post(`/organisations/${this.orgId}/deliveries/letters/price-calculator`, (0, payload_1.buildJsonApi)({
76
+ type: 'letter_price_calculator',
77
+ attributes: {
78
+ country: opts.country,
79
+ paper_types: opts.paperTypes,
80
+ print_mode: opts.printMode,
81
+ print_spectrum: opts.printSpectrum,
82
+ delivery_product: opts.deliveryProduct,
83
+ },
84
+ }));
85
+ }
86
+ }
87
+ exports.Letters = Letters;
88
+ //# sourceMappingURL=letters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letters.js","sourceRoot":"","sources":["../../../src/resources/letters/letters.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,35 @@
1
+ import { RelationshipItem, RelationshipMany } from '../../common/relationships';
2
+ export interface FontInfo {
3
+ name: string;
4
+ is_embedded: boolean;
5
+ }
6
+ export interface LetterAttributes {
7
+ status?: string;
8
+ file_original_name?: string;
9
+ file_pages?: number;
10
+ address?: string;
11
+ address_position?: string;
12
+ country?: string;
13
+ delivery_product?: string;
14
+ print_mode?: string;
15
+ print_spectrum?: string;
16
+ price_currency?: string;
17
+ price_value?: number;
18
+ paper_types?: string[];
19
+ fonts?: FontInfo[];
20
+ source?: string;
21
+ tracking_number?: string;
22
+ submitted_at?: string;
23
+ created_at?: string;
24
+ updated_at?: string;
25
+ }
26
+ export interface LetterRelationships {
27
+ organisation?: RelationshipItem;
28
+ events?: RelationshipMany;
29
+ batch?: RelationshipItem;
30
+ }
31
+ export interface LetterPriceAttributes {
32
+ currency?: string;
33
+ price?: number;
34
+ }
35
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/letters/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEhF,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -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/letters/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,61 @@
1
+ import { AddressPosition, DeliveryProduct, PrintMode, PrintSpectrum, PaperType } from '../../common/enums';
2
+ import { PresetRelationship } from '../../common/preset';
3
+ export interface LetterRecipient {
4
+ name: string;
5
+ street?: string;
6
+ pobox?: string;
7
+ number?: string;
8
+ zip: string;
9
+ city: string;
10
+ country: string;
11
+ }
12
+ export interface LetterSender {
13
+ name: string;
14
+ street?: string;
15
+ pobox?: string;
16
+ number?: string;
17
+ zip: string;
18
+ city: string;
19
+ country: string;
20
+ }
21
+ export interface LetterMetaData {
22
+ recipient: LetterRecipient;
23
+ sender: LetterSender;
24
+ }
25
+ export interface LetterCreateOptions {
26
+ fileUrl: string;
27
+ fileSignature: string;
28
+ fileOriginalName: string;
29
+ addressPosition: AddressPosition;
30
+ autoSend: boolean;
31
+ deliveryProduct?: DeliveryProduct;
32
+ printMode?: PrintMode;
33
+ printSpectrum?: PrintSpectrum;
34
+ metaData?: LetterMetaData;
35
+ preset?: PresetRelationship;
36
+ }
37
+ export interface LetterUploadOptions {
38
+ filePath: string;
39
+ fileOriginalName: string;
40
+ addressPosition: AddressPosition;
41
+ autoSend: boolean;
42
+ deliveryProduct?: DeliveryProduct;
43
+ printMode?: PrintMode;
44
+ printSpectrum?: PrintSpectrum;
45
+ metaData?: LetterMetaData;
46
+ preset?: PresetRelationship;
47
+ }
48
+ export interface LetterSendOptions {
49
+ letterId: string;
50
+ deliveryProduct: DeliveryProduct;
51
+ printMode: PrintMode;
52
+ printSpectrum: PrintSpectrum;
53
+ }
54
+ export interface LetterPriceOptions {
55
+ country: string;
56
+ paperTypes: PaperType[];
57
+ printMode: PrintMode;
58
+ printSpectrum: PrintSpectrum;
59
+ deliveryProduct: DeliveryProduct;
60
+ }
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/letters/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;CAClC"}
@@ -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/letters/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { BaseResource } from '../base';
3
+ export declare class Organisations extends BaseResource {
4
+ getDetails(orgId: string, params?: Record<string, string>): Promise<PingenResponse>;
5
+ getCollection(params?: Record<string, string>): Promise<PingenResponse>;
6
+ }
7
+ //# sourceMappingURL=organisations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organisations.d.ts","sourceRoot":"","sources":["../../../src/resources/organisations/organisations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qBAAa,aAAc,SAAQ,YAAY;IAC7C,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAInF,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGxE"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Organisations = void 0;
4
+ const base_1 = require("../base");
5
+ class Organisations extends base_1.BaseResource {
6
+ getDetails(orgId, params) {
7
+ return this.requestor.get(`/organisations/${orgId}`, params);
8
+ }
9
+ getCollection(params) {
10
+ return this.requestor.get('/organisations', params);
11
+ }
12
+ }
13
+ exports.Organisations = Organisations;
14
+ //# sourceMappingURL=organisations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organisations.js","sourceRoot":"","sources":["../../../src/resources/organisations/organisations.ts"],"names":[],"mappings":";;;AACA,kCAAuC;AAEvC,MAAa,aAAc,SAAQ,mBAAY;IAC7C,UAAU,CAAC,KAAa,EAAE,MAA+B;QACvD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,aAAa,CAAC,MAA+B;QAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;CACF;AARD,sCAQC"}
@@ -0,0 +1,24 @@
1
+ import { RelationshipMany } from '../../common/relationships';
2
+ export interface OrganisationAttributes {
3
+ name?: string;
4
+ status?: string;
5
+ plan?: string;
6
+ billing_mode?: string;
7
+ billing_currency?: string;
8
+ billing_balance?: number;
9
+ missing_credits?: number;
10
+ edition?: string;
11
+ default_country?: string;
12
+ default_address_position?: string;
13
+ data_retention_addresses?: number;
14
+ data_retention_pdf?: number;
15
+ limits_monthly_letters_count?: number;
16
+ color?: string;
17
+ flags?: string[];
18
+ created_at?: string;
19
+ updated_at?: string;
20
+ }
21
+ export interface OrganisationRelationships {
22
+ associations?: RelationshipMany;
23
+ }
24
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/organisations/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC"}
@@ -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/organisations/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { RelationshipItem } from '../../common/relationships';
2
+ export interface UserAttributes {
3
+ first_name?: string;
4
+ last_name?: string;
5
+ email?: string;
6
+ language?: string;
7
+ status?: string;
8
+ edition?: string;
9
+ created_at?: string;
10
+ updated_at?: string;
11
+ }
12
+ export interface UserAssociationAttributes {
13
+ role?: string;
14
+ created_at?: string;
15
+ updated_at?: string;
16
+ }
17
+ export interface UserAssociationRelationships {
18
+ organisation?: RelationshipItem;
19
+ user?: RelationshipItem;
20
+ }
21
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/users/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB"}
@@ -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/users/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { BaseResource } from '../base';
3
+ export declare class UserAssociations extends BaseResource {
4
+ getCollection(params?: Record<string, string>): Promise<PingenResponse>;
5
+ }
6
+ //# sourceMappingURL=user-associations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-associations.d.ts","sourceRoot":"","sources":["../../../src/resources/users/user-associations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGxE"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserAssociations = void 0;
4
+ const base_1 = require("../base");
5
+ class UserAssociations extends base_1.BaseResource {
6
+ getCollection(params) {
7
+ return this.requestor.get('/user/associations', params);
8
+ }
9
+ }
10
+ exports.UserAssociations = UserAssociations;
11
+ //# sourceMappingURL=user-associations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-associations.js","sourceRoot":"","sources":["../../../src/resources/users/user-associations.ts"],"names":[],"mappings":";;;AACA,kCAAuC;AAEvC,MAAa,gBAAiB,SAAQ,mBAAY;IAChD,aAAa,CAAC,MAA+B;QAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;CACF;AAJD,4CAIC"}
@@ -0,0 +1,6 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { BaseResource } from '../base';
3
+ export declare class Users extends BaseResource {
4
+ getDetails(params?: Record<string, string>): Promise<PingenResponse>;
5
+ }
6
+ //# sourceMappingURL=users.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/resources/users/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qBAAa,KAAM,SAAQ,YAAY;IACrC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGrE"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Users = void 0;
4
+ const base_1 = require("../base");
5
+ class Users extends base_1.BaseResource {
6
+ getDetails(params) {
7
+ return this.requestor.get('/user', params);
8
+ }
9
+ }
10
+ exports.Users = Users;
11
+ //# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/resources/users/users.ts"],"names":[],"mappings":";;;AACA,kCAAuC;AAEvC,MAAa,KAAM,SAAQ,mBAAY;IACrC,UAAU,CAAC,MAA+B;QACxC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,sBAIC"}
@@ -0,0 +1,8 @@
1
+ export declare enum WebhookEventCategory {
2
+ Issues = "issues",
3
+ Sent = "sent",
4
+ Undeliverable = "undeliverable",
5
+ Delivered = "delivered",
6
+ ChannelSubscriptions = "channel_subscriptions"
7
+ }
8
+ //# sourceMappingURL=enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/resources/webhooks/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,oBAAoB,0BAA0B;CAC/C"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookEventCategory = void 0;
4
+ var WebhookEventCategory;
5
+ (function (WebhookEventCategory) {
6
+ WebhookEventCategory["Issues"] = "issues";
7
+ WebhookEventCategory["Sent"] = "sent";
8
+ WebhookEventCategory["Undeliverable"] = "undeliverable";
9
+ WebhookEventCategory["Delivered"] = "delivered";
10
+ WebhookEventCategory["ChannelSubscriptions"] = "channel_subscriptions";
11
+ })(WebhookEventCategory || (exports.WebhookEventCategory = WebhookEventCategory = {}));
12
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/resources/webhooks/enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,uDAA+B,CAAA;IAC/B,+CAAuB,CAAA;IACvB,sEAA8C,CAAA;AAChD,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B"}
@@ -0,0 +1,8 @@
1
+ export interface WebhookAttributes {
2
+ event_category?: string;
3
+ url?: string;
4
+ signing_key?: string;
5
+ created_at?: string;
6
+ updated_at?: string;
7
+ }
8
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/resources/webhooks/response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -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/webhooks/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { WebhookEventCategory } from './enums';
2
+ export interface WebhookCreateOptions {
3
+ eventCategory: WebhookEventCategory;
4
+ url: string;
5
+ signingKey: string;
6
+ }
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,oBAAoB,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -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/webhooks/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { PingenResponse } from '../../common/response';
2
+ import { OrgResource } from '../base';
3
+ import { WebhookCreateOptions } from './types';
4
+ export declare class Webhooks extends OrgResource {
5
+ getDetails(webhookId: string, params?: Record<string, string>): Promise<PingenResponse>;
6
+ getCollection(params?: Record<string, string>): Promise<PingenResponse>;
7
+ create(opts: WebhookCreateOptions): Promise<PingenResponse>;
8
+ delete(webhookId: string): Promise<PingenResponse>;
9
+ }
10
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/resources/webhooks/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,qBAAa,QAAS,SAAQ,WAAW;IACvC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIvF,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIvE,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAU3D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAGnD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Webhooks = void 0;
4
+ const base_1 = require("../base");
5
+ const payload_1 = require("../../utils/payload");
6
+ class Webhooks extends base_1.OrgResource {
7
+ getDetails(webhookId, params) {
8
+ return this.requestor.get(`/organisations/${this.orgId}/webhooks/${webhookId}`, params);
9
+ }
10
+ getCollection(params) {
11
+ return this.requestor.get(`/organisations/${this.orgId}/webhooks`, params);
12
+ }
13
+ create(opts) {
14
+ return this.requestor.post(`/organisations/${this.orgId}/webhooks`, (0, payload_1.buildJsonApi)({
15
+ type: 'webhooks',
16
+ attributes: { event_category: opts.eventCategory, url: opts.url, signing_key: opts.signingKey },
17
+ }));
18
+ }
19
+ delete(webhookId) {
20
+ return this.requestor.delete(`/organisations/${this.orgId}/webhooks/${webhookId}`);
21
+ }
22
+ }
23
+ exports.Webhooks = Webhooks;
24
+ //# sourceMappingURL=webhooks.js.map