@xyo-network/rebilly-payment-card-authorization-plugin 2.94.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 (208) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +13 -0
  3. package/dist/browser/Api/PaymentCardToken/Request.d.cts +88 -0
  4. package/dist/browser/Api/PaymentCardToken/Request.d.cts.map +1 -0
  5. package/dist/browser/Api/PaymentCardToken/Request.d.mts +88 -0
  6. package/dist/browser/Api/PaymentCardToken/Request.d.mts.map +1 -0
  7. package/dist/browser/Api/PaymentCardToken/Request.d.ts +88 -0
  8. package/dist/browser/Api/PaymentCardToken/Request.d.ts.map +1 -0
  9. package/dist/browser/Api/PaymentCardToken/Response.d.cts +70 -0
  10. package/dist/browser/Api/PaymentCardToken/Response.d.cts.map +1 -0
  11. package/dist/browser/Api/PaymentCardToken/Response.d.mts +70 -0
  12. package/dist/browser/Api/PaymentCardToken/Response.d.mts.map +1 -0
  13. package/dist/browser/Api/PaymentCardToken/Response.d.ts +70 -0
  14. package/dist/browser/Api/PaymentCardToken/Response.d.ts.map +1 -0
  15. package/dist/browser/Api/PaymentCardToken/index.d.cts +3 -0
  16. package/dist/browser/Api/PaymentCardToken/index.d.cts.map +1 -0
  17. package/dist/browser/Api/PaymentCardToken/index.d.mts +3 -0
  18. package/dist/browser/Api/PaymentCardToken/index.d.mts.map +1 -0
  19. package/dist/browser/Api/PaymentCardToken/index.d.ts +3 -0
  20. package/dist/browser/Api/PaymentCardToken/index.d.ts.map +1 -0
  21. package/dist/browser/Api/index.d.cts +2 -0
  22. package/dist/browser/Api/index.d.cts.map +1 -0
  23. package/dist/browser/Api/index.d.mts +2 -0
  24. package/dist/browser/Api/index.d.mts.map +1 -0
  25. package/dist/browser/Api/index.d.ts +2 -0
  26. package/dist/browser/Api/index.d.ts.map +1 -0
  27. package/dist/browser/Config.d.cts +11 -0
  28. package/dist/browser/Config.d.cts.map +1 -0
  29. package/dist/browser/Config.d.mts +11 -0
  30. package/dist/browser/Config.d.mts.map +1 -0
  31. package/dist/browser/Config.d.ts +11 -0
  32. package/dist/browser/Config.d.ts.map +1 -0
  33. package/dist/browser/Params.d.cts +7 -0
  34. package/dist/browser/Params.d.cts.map +1 -0
  35. package/dist/browser/Params.d.mts +7 -0
  36. package/dist/browser/Params.d.mts.map +1 -0
  37. package/dist/browser/Params.d.ts +7 -0
  38. package/dist/browser/Params.d.ts.map +1 -0
  39. package/dist/browser/RebillyProviderSettings/RebillyApiSettings.d.cts +17 -0
  40. package/dist/browser/RebillyProviderSettings/RebillyApiSettings.d.cts.map +1 -0
  41. package/dist/browser/RebillyProviderSettings/RebillyApiSettings.d.mts +17 -0
  42. package/dist/browser/RebillyProviderSettings/RebillyApiSettings.d.mts.map +1 -0
  43. package/dist/browser/RebillyProviderSettings/RebillyApiSettings.d.ts +17 -0
  44. package/dist/browser/RebillyProviderSettings/RebillyApiSettings.d.ts.map +1 -0
  45. package/dist/browser/RebillyProviderSettings/RebillyAuthSettings.d.cts +15 -0
  46. package/dist/browser/RebillyProviderSettings/RebillyAuthSettings.d.cts.map +1 -0
  47. package/dist/browser/RebillyProviderSettings/RebillyAuthSettings.d.mts +15 -0
  48. package/dist/browser/RebillyProviderSettings/RebillyAuthSettings.d.mts.map +1 -0
  49. package/dist/browser/RebillyProviderSettings/RebillyAuthSettings.d.ts +15 -0
  50. package/dist/browser/RebillyProviderSettings/RebillyAuthSettings.d.ts.map +1 -0
  51. package/dist/browser/RebillyProviderSettings/RebillyOrganizationSettings.d.cts +10 -0
  52. package/dist/browser/RebillyProviderSettings/RebillyOrganizationSettings.d.cts.map +1 -0
  53. package/dist/browser/RebillyProviderSettings/RebillyOrganizationSettings.d.mts +10 -0
  54. package/dist/browser/RebillyProviderSettings/RebillyOrganizationSettings.d.mts.map +1 -0
  55. package/dist/browser/RebillyProviderSettings/RebillyOrganizationSettings.d.ts +10 -0
  56. package/dist/browser/RebillyProviderSettings/RebillyOrganizationSettings.d.ts.map +1 -0
  57. package/dist/browser/RebillyProviderSettings/index.d.cts +4 -0
  58. package/dist/browser/RebillyProviderSettings/index.d.cts.map +1 -0
  59. package/dist/browser/RebillyProviderSettings/index.d.mts +4 -0
  60. package/dist/browser/RebillyProviderSettings/index.d.mts.map +1 -0
  61. package/dist/browser/RebillyProviderSettings/index.d.ts +4 -0
  62. package/dist/browser/RebillyProviderSettings/index.d.ts.map +1 -0
  63. package/dist/browser/Schema.d.cts +3 -0
  64. package/dist/browser/Schema.d.cts.map +1 -0
  65. package/dist/browser/Schema.d.mts +3 -0
  66. package/dist/browser/Schema.d.mts.map +1 -0
  67. package/dist/browser/Schema.d.ts +3 -0
  68. package/dist/browser/Schema.d.ts.map +1 -0
  69. package/dist/browser/Sentinel.d.cts +45 -0
  70. package/dist/browser/Sentinel.d.cts.map +1 -0
  71. package/dist/browser/Sentinel.d.mts +45 -0
  72. package/dist/browser/Sentinel.d.mts.map +1 -0
  73. package/dist/browser/Sentinel.d.ts +45 -0
  74. package/dist/browser/Sentinel.d.ts.map +1 -0
  75. package/dist/browser/index.cjs +151 -0
  76. package/dist/browser/index.cjs.map +1 -0
  77. package/dist/browser/index.d.cts +5 -0
  78. package/dist/browser/index.d.cts.map +1 -0
  79. package/dist/browser/index.d.mts +5 -0
  80. package/dist/browser/index.d.mts.map +1 -0
  81. package/dist/browser/index.d.ts +5 -0
  82. package/dist/browser/index.d.ts.map +1 -0
  83. package/dist/browser/index.js +128 -0
  84. package/dist/browser/index.js.map +1 -0
  85. package/dist/browser/util/index.d.cts +2 -0
  86. package/dist/browser/util/index.d.cts.map +1 -0
  87. package/dist/browser/util/index.d.mts +2 -0
  88. package/dist/browser/util/index.d.mts.map +1 -0
  89. package/dist/browser/util/index.d.ts +2 -0
  90. package/dist/browser/util/index.d.ts.map +1 -0
  91. package/dist/browser/util/toTokenRequest.d.cts +10 -0
  92. package/dist/browser/util/toTokenRequest.d.cts.map +1 -0
  93. package/dist/browser/util/toTokenRequest.d.mts +10 -0
  94. package/dist/browser/util/toTokenRequest.d.mts.map +1 -0
  95. package/dist/browser/util/toTokenRequest.d.ts +10 -0
  96. package/dist/browser/util/toTokenRequest.d.ts.map +1 -0
  97. package/dist/node/Api/PaymentCardToken/Request.d.cts +88 -0
  98. package/dist/node/Api/PaymentCardToken/Request.d.cts.map +1 -0
  99. package/dist/node/Api/PaymentCardToken/Request.d.mts +88 -0
  100. package/dist/node/Api/PaymentCardToken/Request.d.mts.map +1 -0
  101. package/dist/node/Api/PaymentCardToken/Request.d.ts +88 -0
  102. package/dist/node/Api/PaymentCardToken/Request.d.ts.map +1 -0
  103. package/dist/node/Api/PaymentCardToken/Response.d.cts +70 -0
  104. package/dist/node/Api/PaymentCardToken/Response.d.cts.map +1 -0
  105. package/dist/node/Api/PaymentCardToken/Response.d.mts +70 -0
  106. package/dist/node/Api/PaymentCardToken/Response.d.mts.map +1 -0
  107. package/dist/node/Api/PaymentCardToken/Response.d.ts +70 -0
  108. package/dist/node/Api/PaymentCardToken/Response.d.ts.map +1 -0
  109. package/dist/node/Api/PaymentCardToken/index.d.cts +3 -0
  110. package/dist/node/Api/PaymentCardToken/index.d.cts.map +1 -0
  111. package/dist/node/Api/PaymentCardToken/index.d.mts +3 -0
  112. package/dist/node/Api/PaymentCardToken/index.d.mts.map +1 -0
  113. package/dist/node/Api/PaymentCardToken/index.d.ts +3 -0
  114. package/dist/node/Api/PaymentCardToken/index.d.ts.map +1 -0
  115. package/dist/node/Api/index.d.cts +2 -0
  116. package/dist/node/Api/index.d.cts.map +1 -0
  117. package/dist/node/Api/index.d.mts +2 -0
  118. package/dist/node/Api/index.d.mts.map +1 -0
  119. package/dist/node/Api/index.d.ts +2 -0
  120. package/dist/node/Api/index.d.ts.map +1 -0
  121. package/dist/node/Config.d.cts +11 -0
  122. package/dist/node/Config.d.cts.map +1 -0
  123. package/dist/node/Config.d.mts +11 -0
  124. package/dist/node/Config.d.mts.map +1 -0
  125. package/dist/node/Config.d.ts +11 -0
  126. package/dist/node/Config.d.ts.map +1 -0
  127. package/dist/node/Params.d.cts +7 -0
  128. package/dist/node/Params.d.cts.map +1 -0
  129. package/dist/node/Params.d.mts +7 -0
  130. package/dist/node/Params.d.mts.map +1 -0
  131. package/dist/node/Params.d.ts +7 -0
  132. package/dist/node/Params.d.ts.map +1 -0
  133. package/dist/node/RebillyProviderSettings/RebillyApiSettings.d.cts +17 -0
  134. package/dist/node/RebillyProviderSettings/RebillyApiSettings.d.cts.map +1 -0
  135. package/dist/node/RebillyProviderSettings/RebillyApiSettings.d.mts +17 -0
  136. package/dist/node/RebillyProviderSettings/RebillyApiSettings.d.mts.map +1 -0
  137. package/dist/node/RebillyProviderSettings/RebillyApiSettings.d.ts +17 -0
  138. package/dist/node/RebillyProviderSettings/RebillyApiSettings.d.ts.map +1 -0
  139. package/dist/node/RebillyProviderSettings/RebillyAuthSettings.d.cts +15 -0
  140. package/dist/node/RebillyProviderSettings/RebillyAuthSettings.d.cts.map +1 -0
  141. package/dist/node/RebillyProviderSettings/RebillyAuthSettings.d.mts +15 -0
  142. package/dist/node/RebillyProviderSettings/RebillyAuthSettings.d.mts.map +1 -0
  143. package/dist/node/RebillyProviderSettings/RebillyAuthSettings.d.ts +15 -0
  144. package/dist/node/RebillyProviderSettings/RebillyAuthSettings.d.ts.map +1 -0
  145. package/dist/node/RebillyProviderSettings/RebillyOrganizationSettings.d.cts +10 -0
  146. package/dist/node/RebillyProviderSettings/RebillyOrganizationSettings.d.cts.map +1 -0
  147. package/dist/node/RebillyProviderSettings/RebillyOrganizationSettings.d.mts +10 -0
  148. package/dist/node/RebillyProviderSettings/RebillyOrganizationSettings.d.mts.map +1 -0
  149. package/dist/node/RebillyProviderSettings/RebillyOrganizationSettings.d.ts +10 -0
  150. package/dist/node/RebillyProviderSettings/RebillyOrganizationSettings.d.ts.map +1 -0
  151. package/dist/node/RebillyProviderSettings/index.d.cts +4 -0
  152. package/dist/node/RebillyProviderSettings/index.d.cts.map +1 -0
  153. package/dist/node/RebillyProviderSettings/index.d.mts +4 -0
  154. package/dist/node/RebillyProviderSettings/index.d.mts.map +1 -0
  155. package/dist/node/RebillyProviderSettings/index.d.ts +4 -0
  156. package/dist/node/RebillyProviderSettings/index.d.ts.map +1 -0
  157. package/dist/node/Schema.d.cts +3 -0
  158. package/dist/node/Schema.d.cts.map +1 -0
  159. package/dist/node/Schema.d.mts +3 -0
  160. package/dist/node/Schema.d.mts.map +1 -0
  161. package/dist/node/Schema.d.ts +3 -0
  162. package/dist/node/Schema.d.ts.map +1 -0
  163. package/dist/node/Sentinel.d.cts +45 -0
  164. package/dist/node/Sentinel.d.cts.map +1 -0
  165. package/dist/node/Sentinel.d.mts +45 -0
  166. package/dist/node/Sentinel.d.mts.map +1 -0
  167. package/dist/node/Sentinel.d.ts +45 -0
  168. package/dist/node/Sentinel.d.ts.map +1 -0
  169. package/dist/node/index.cjs +158 -0
  170. package/dist/node/index.cjs.map +1 -0
  171. package/dist/node/index.d.cts +5 -0
  172. package/dist/node/index.d.cts.map +1 -0
  173. package/dist/node/index.d.mts +5 -0
  174. package/dist/node/index.d.mts.map +1 -0
  175. package/dist/node/index.d.ts +5 -0
  176. package/dist/node/index.d.ts.map +1 -0
  177. package/dist/node/index.js +129 -0
  178. package/dist/node/index.js.map +1 -0
  179. package/dist/node/util/index.d.cts +2 -0
  180. package/dist/node/util/index.d.cts.map +1 -0
  181. package/dist/node/util/index.d.mts +2 -0
  182. package/dist/node/util/index.d.mts.map +1 -0
  183. package/dist/node/util/index.d.ts +2 -0
  184. package/dist/node/util/index.d.ts.map +1 -0
  185. package/dist/node/util/toTokenRequest.d.cts +10 -0
  186. package/dist/node/util/toTokenRequest.d.cts.map +1 -0
  187. package/dist/node/util/toTokenRequest.d.mts +10 -0
  188. package/dist/node/util/toTokenRequest.d.mts.map +1 -0
  189. package/dist/node/util/toTokenRequest.d.ts +10 -0
  190. package/dist/node/util/toTokenRequest.d.ts.map +1 -0
  191. package/package.json +71 -0
  192. package/src/Api/PaymentCardToken/Request.ts +238 -0
  193. package/src/Api/PaymentCardToken/Response.ts +73 -0
  194. package/src/Api/PaymentCardToken/index.ts +2 -0
  195. package/src/Api/index.ts +1 -0
  196. package/src/Config.ts +18 -0
  197. package/src/Params.ts +12 -0
  198. package/src/RebillyProviderSettings/RebillyApiSettings.ts +23 -0
  199. package/src/RebillyProviderSettings/RebillyAuthSettings.ts +15 -0
  200. package/src/RebillyProviderSettings/RebillyOrganizationSettings.ts +9 -0
  201. package/src/RebillyProviderSettings/index.ts +3 -0
  202. package/src/Schema.ts +2 -0
  203. package/src/Sentinel.ts +117 -0
  204. package/src/index.ts +4 -0
  205. package/src/util/index.ts +1 -0
  206. package/src/util/toTokenRequest.ts +24 -0
  207. package/typedoc.json +5 -0
  208. package/xy.config.ts +14 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RebillyOrganizationSettings.d.ts","sourceRoot":"","sources":["../../../src/RebillyProviderSettings/RebillyOrganizationSettings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,4 @@
1
+ export * from './RebillyApiSettings';
2
+ export * from './RebillyAuthSettings';
3
+ export * from './RebillyOrganizationSettings';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RebillyProviderSettings/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './RebillyApiSettings';
2
+ export * from './RebillyAuthSettings';
3
+ export * from './RebillyOrganizationSettings';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RebillyProviderSettings/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './RebillyApiSettings';
2
+ export * from './RebillyAuthSettings';
3
+ export * from './RebillyOrganizationSettings';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RebillyProviderSettings/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const RebillyPaymentCardAuthorizationSentinelSchema = "network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly";
2
+ export type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6CAA6C,gFAAgF,CAAA;AAC1I,MAAM,MAAM,6CAA6C,GAAG,OAAO,6CAA6C,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const RebillyPaymentCardAuthorizationSentinelSchema = "network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly";
2
+ export type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6CAA6C,gFAAgF,CAAA;AAC1I,MAAM,MAAM,6CAA6C,GAAG,OAAO,6CAA6C,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const RebillyPaymentCardAuthorizationSentinelSchema = "network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly";
2
+ export type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6CAA6C,gFAAgF,CAAA;AAC1I,MAAM,MAAM,6CAA6C,GAAG,OAAO,6CAA6C,CAAA"}
@@ -0,0 +1,45 @@
1
+ import { AxiosRequestConfig } from '@xylabs/axios';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
4
+ import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
5
+ import { RebillyPaymentCardAuthorizationSentinelParams } from './Params';
6
+ export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
7
+ static configSchemas: string[];
8
+ static defaultConfigSchema: string;
9
+ protected _apiRoot: string | undefined;
10
+ protected _domain: string | undefined;
11
+ protected _headers: AxiosRequestConfig['headers'] | undefined;
12
+ protected _organizationId: string | undefined;
13
+ protected _publishableApiKey: string | undefined;
14
+ protected _tokenEndpoint: string | undefined;
15
+ /**
16
+ * The Rebilly Organization API root endpoint
17
+ */
18
+ protected get apiRoot(): string;
19
+ /**
20
+ * The Rebilly domain
21
+ */
22
+ protected get domain(): string;
23
+ /**
24
+ * The headers to be included in the request for each request
25
+ */
26
+ protected get headers(): AxiosRequestConfig['headers'];
27
+ /**
28
+ * True if the environment is sandbox (testing), false otherwise
29
+ */
30
+ protected get isSandboxEnvironment(): boolean;
31
+ /**
32
+ * The Rebilly organization ID
33
+ */
34
+ protected get organizationId(): string;
35
+ /**
36
+ * The Rebilly Publishable API key
37
+ */
38
+ protected get publishableApiKey(): string;
39
+ /**
40
+ * The Rebilly Organization token creation endpoint
41
+ */
42
+ protected get tokenEndpoint(): string;
43
+ reportHandler(payloads?: Payload[]): Promise<Payload[]>;
44
+ }
45
+ //# sourceMappingURL=Sentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,kBAAkB,EAAkB,MAAM,eAAe,CAAA;AAG7E,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAIvF,OAAO,EAAE,6CAA6C,EAAE,MAAM,UAAU,CAAA;AASxE,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAExD;;OAEG;IACH,SAAS,KAAK,OAAO,WAGpB;IAED;;OAEG;IACH,SAAS,KAAK,MAAM,WAGnB;IAED;;OAEG;IACH,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAED;;OAEG;IACH,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAED;;OAEG;IACH,SAAS,KAAK,cAAc,WAO3B;IAED;;OAEG;IACH,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAED;;OAEG;IACH,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
@@ -0,0 +1,45 @@
1
+ import { AxiosRequestConfig } from '@xylabs/axios';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
4
+ import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
5
+ import { RebillyPaymentCardAuthorizationSentinelParams } from './Params';
6
+ export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
7
+ static configSchemas: string[];
8
+ static defaultConfigSchema: string;
9
+ protected _apiRoot: string | undefined;
10
+ protected _domain: string | undefined;
11
+ protected _headers: AxiosRequestConfig['headers'] | undefined;
12
+ protected _organizationId: string | undefined;
13
+ protected _publishableApiKey: string | undefined;
14
+ protected _tokenEndpoint: string | undefined;
15
+ /**
16
+ * The Rebilly Organization API root endpoint
17
+ */
18
+ protected get apiRoot(): string;
19
+ /**
20
+ * The Rebilly domain
21
+ */
22
+ protected get domain(): string;
23
+ /**
24
+ * The headers to be included in the request for each request
25
+ */
26
+ protected get headers(): AxiosRequestConfig['headers'];
27
+ /**
28
+ * True if the environment is sandbox (testing), false otherwise
29
+ */
30
+ protected get isSandboxEnvironment(): boolean;
31
+ /**
32
+ * The Rebilly organization ID
33
+ */
34
+ protected get organizationId(): string;
35
+ /**
36
+ * The Rebilly Publishable API key
37
+ */
38
+ protected get publishableApiKey(): string;
39
+ /**
40
+ * The Rebilly Organization token creation endpoint
41
+ */
42
+ protected get tokenEndpoint(): string;
43
+ reportHandler(payloads?: Payload[]): Promise<Payload[]>;
44
+ }
45
+ //# sourceMappingURL=Sentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,kBAAkB,EAAkB,MAAM,eAAe,CAAA;AAG7E,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAIvF,OAAO,EAAE,6CAA6C,EAAE,MAAM,UAAU,CAAA;AASxE,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAExD;;OAEG;IACH,SAAS,KAAK,OAAO,WAGpB;IAED;;OAEG;IACH,SAAS,KAAK,MAAM,WAGnB;IAED;;OAEG;IACH,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAED;;OAEG;IACH,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAED;;OAEG;IACH,SAAS,KAAK,cAAc,WAO3B;IAED;;OAEG;IACH,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAED;;OAEG;IACH,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
@@ -0,0 +1,45 @@
1
+ import { AxiosRequestConfig } from '@xylabs/axios';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
4
+ import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
5
+ import { RebillyPaymentCardAuthorizationSentinelParams } from './Params';
6
+ export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
7
+ static configSchemas: string[];
8
+ static defaultConfigSchema: string;
9
+ protected _apiRoot: string | undefined;
10
+ protected _domain: string | undefined;
11
+ protected _headers: AxiosRequestConfig['headers'] | undefined;
12
+ protected _organizationId: string | undefined;
13
+ protected _publishableApiKey: string | undefined;
14
+ protected _tokenEndpoint: string | undefined;
15
+ /**
16
+ * The Rebilly Organization API root endpoint
17
+ */
18
+ protected get apiRoot(): string;
19
+ /**
20
+ * The Rebilly domain
21
+ */
22
+ protected get domain(): string;
23
+ /**
24
+ * The headers to be included in the request for each request
25
+ */
26
+ protected get headers(): AxiosRequestConfig['headers'];
27
+ /**
28
+ * True if the environment is sandbox (testing), false otherwise
29
+ */
30
+ protected get isSandboxEnvironment(): boolean;
31
+ /**
32
+ * The Rebilly organization ID
33
+ */
34
+ protected get organizationId(): string;
35
+ /**
36
+ * The Rebilly Publishable API key
37
+ */
38
+ protected get publishableApiKey(): string;
39
+ /**
40
+ * The Rebilly Organization token creation endpoint
41
+ */
42
+ protected get tokenEndpoint(): string;
43
+ reportHandler(payloads?: Payload[]): Promise<Payload[]>;
44
+ }
45
+ //# sourceMappingURL=Sentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,kBAAkB,EAAkB,MAAM,eAAe,CAAA;AAG7E,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAIvF,OAAO,EAAE,6CAA6C,EAAE,MAAM,UAAU,CAAA;AASxE,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAExD;;OAEG;IACH,SAAS,KAAK,OAAO,WAGpB;IAED;;OAEG;IACH,SAAS,KAAK,MAAM,WAGnB;IAED;;OAEG;IACH,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAED;;OAEG;IACH,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAED;;OAEG;IACH,SAAS,KAAK,cAAc,WAO3B;IAED;;OAEG;IACH,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAED;;OAEG;IACH,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ RebillyPaymentCardAuthorizationSentinel: () => RebillyPaymentCardAuthorizationSentinel,
24
+ RebillyPaymentCardAuthorizationSentinelConfigSchema: () => RebillyPaymentCardAuthorizationSentinelConfigSchema,
25
+ RebillyPaymentCardAuthorizationSentinelSchema: () => RebillyPaymentCardAuthorizationSentinelSchema
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+
29
+ // src/Schema.ts
30
+ var RebillyPaymentCardAuthorizationSentinelSchema = "network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly";
31
+
32
+ // src/Config.ts
33
+ var RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`;
34
+
35
+ // src/Sentinel.ts
36
+ var import_assert = require("@xylabs/assert");
37
+ var import_axios = require("@xylabs/axios");
38
+ var import_id_payload_plugin = require("@xyo-network/id-payload-plugin");
39
+ var import_payload_builder = require("@xyo-network/payload-builder");
40
+ var import_payment_payload_plugins = require("@xyo-network/payment-payload-plugins");
41
+ var import_sentinel_abstract = require("@xyo-network/sentinel-abstract");
42
+
43
+ // src/util/toTokenRequest.ts
44
+ var toTokenRequest = (paymentCard, billingAddress) => {
45
+ const { cvv, expMonth, expYear, cardNumber } = paymentCard;
46
+ const { schema: _, ...fields } = billingAddress;
47
+ return {
48
+ billingAddress: { ...fields },
49
+ method: "payment-card",
50
+ paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber }
51
+ };
52
+ };
53
+
54
+ // src/Sentinel.ts
55
+ var removePrefix = (str, prefix) => {
56
+ const regex = new RegExp(`^${prefix}`);
57
+ return str.replace(regex, "");
58
+ };
59
+ var moduleName = "RebillyPaymentCardAuthorizationSentinel";
60
+ var RebillyPaymentCardAuthorizationSentinel = class extends import_sentinel_abstract.AbstractSentinel {
61
+ static configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema];
62
+ static defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema;
63
+ _apiRoot = void 0;
64
+ _domain = void 0;
65
+ _headers = void 0;
66
+ _organizationId = void 0;
67
+ _publishableApiKey = void 0;
68
+ _tokenEndpoint = void 0;
69
+ /**
70
+ * The Rebilly Organization API root endpoint
71
+ */
72
+ get apiRoot() {
73
+ if (!this._apiRoot)
74
+ this._apiRoot = `${this.domain}/organizations/${this.organizationId}`;
75
+ return this._apiRoot;
76
+ }
77
+ /**
78
+ * The Rebilly domain
79
+ */
80
+ get domain() {
81
+ if (!this._domain)
82
+ this._domain = (0, import_assert.assertEx)(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`);
83
+ return this._domain;
84
+ }
85
+ /**
86
+ * The headers to be included in the request for each request
87
+ */
88
+ get headers() {
89
+ if (!this._headers)
90
+ this._headers = { Authorization: this.publishableApiKey };
91
+ return this._headers;
92
+ }
93
+ /**
94
+ * True if the environment is sandbox (testing), false otherwise
95
+ */
96
+ get isSandboxEnvironment() {
97
+ return this.domain.includes("sandbox");
98
+ }
99
+ /**
100
+ * The Rebilly organization ID
101
+ */
102
+ get organizationId() {
103
+ if (!this._organizationId)
104
+ this._organizationId = removePrefix(
105
+ (0, import_assert.assertEx)(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),
106
+ "org_"
107
+ );
108
+ return this._organizationId;
109
+ }
110
+ /**
111
+ * The Rebilly Publishable API key
112
+ */
113
+ get publishableApiKey() {
114
+ if (!this._publishableApiKey)
115
+ this._publishableApiKey = (0, import_assert.assertEx)(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`);
116
+ return this._publishableApiKey;
117
+ }
118
+ /**
119
+ * The Rebilly Organization token creation endpoint
120
+ */
121
+ get tokenEndpoint() {
122
+ if (!this._tokenEndpoint)
123
+ this._tokenEndpoint = `${this.apiRoot}/tokens`;
124
+ return this._tokenEndpoint;
125
+ }
126
+ async reportHandler(payloads) {
127
+ var _a, _b;
128
+ await this.started("throw");
129
+ const results = [];
130
+ if (!payloads || payloads.length === 0)
131
+ return results;
132
+ const paymentCard = payloads == null ? void 0 : payloads.find(import_payment_payload_plugins.isPaymentCard);
133
+ if (!paymentCard)
134
+ return results;
135
+ const billingAddress = payloads == null ? void 0 : payloads.find(import_payment_payload_plugins.isBillingAddress);
136
+ if (!billingAddress)
137
+ return results;
138
+ const axios = new import_axios.AxiosJson({ headers: this.headers });
139
+ try {
140
+ const data = toTokenRequest(paymentCard, billingAddress);
141
+ const response = await axios.post(this.tokenEndpoint, data);
142
+ (0, import_assert.assertEx)(response.status === import_axios.HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`);
143
+ const token = response.data;
144
+ const sources = await import_payload_builder.PayloadBuilder.dataHashes([paymentCard, billingAddress]);
145
+ results.push({ salt: token.id, schema: import_id_payload_plugin.IdSchema, sources });
146
+ } catch (error) {
147
+ (_b = (_a = this.logger) == null ? void 0 : _a.error) == null ? void 0 : _b.call(_a, `${moduleName}: Error creating payment token: ${error}`);
148
+ }
149
+ return results;
150
+ }
151
+ };
152
+ // Annotate the CommonJS export names for ESM import in node:
153
+ 0 && (module.exports = {
154
+ RebillyPaymentCardAuthorizationSentinel,
155
+ RebillyPaymentCardAuthorizationSentinelConfigSchema,
156
+ RebillyPaymentCardAuthorizationSentinelSchema
157
+ });
158
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export * from './Config'\nexport * from './Params'\nexport * from './Schema'\nexport * from './Sentinel'\n","export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyApiDomainSettings } from './RebillyProviderSettings'\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\n Partial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson, AxiosRequestConfig, HttpStatusCode } from '@xylabs/axios'\nimport { IdPayload, IdSchema } from '@xyo-network/id-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\n\nimport { CreateTokenResponse } from './Api'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config'\nimport { RebillyPaymentCardAuthorizationSentinelParams } from './Params'\nimport { toTokenRequest } from './util'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<IdPayload>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const token = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({ salt: token.id, schema: IdSchema, sources })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport { CreatePaymentTokenRequest } from '../Api'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const { cvv, expMonth, expYear, cardNumber } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber },\n }\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,5 @@
1
+ export * from './Config';
2
+ export * from './Params';
3
+ export * from './Schema';
4
+ export * from './Sentinel';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './Config';
2
+ export * from './Params';
3
+ export * from './Schema';
4
+ export * from './Sentinel';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './Config';
2
+ export * from './Params';
3
+ export * from './Schema';
4
+ export * from './Sentinel';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
@@ -0,0 +1,129 @@
1
+ // src/Schema.ts
2
+ var RebillyPaymentCardAuthorizationSentinelSchema = "network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly";
3
+
4
+ // src/Config.ts
5
+ var RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`;
6
+
7
+ // src/Sentinel.ts
8
+ import { assertEx } from "@xylabs/assert";
9
+ import { AxiosJson, HttpStatusCode } from "@xylabs/axios";
10
+ import { IdSchema } from "@xyo-network/id-payload-plugin";
11
+ import { PayloadBuilder } from "@xyo-network/payload-builder";
12
+ import { isBillingAddress, isPaymentCard } from "@xyo-network/payment-payload-plugins";
13
+ import { AbstractSentinel } from "@xyo-network/sentinel-abstract";
14
+
15
+ // src/util/toTokenRequest.ts
16
+ var toTokenRequest = (paymentCard, billingAddress) => {
17
+ const { cvv, expMonth, expYear, cardNumber } = paymentCard;
18
+ const { schema: _, ...fields } = billingAddress;
19
+ return {
20
+ billingAddress: { ...fields },
21
+ method: "payment-card",
22
+ paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber }
23
+ };
24
+ };
25
+
26
+ // src/Sentinel.ts
27
+ var removePrefix = (str, prefix) => {
28
+ const regex = new RegExp(`^${prefix}`);
29
+ return str.replace(regex, "");
30
+ };
31
+ var moduleName = "RebillyPaymentCardAuthorizationSentinel";
32
+ var RebillyPaymentCardAuthorizationSentinel = class extends AbstractSentinel {
33
+ static configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema];
34
+ static defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema;
35
+ _apiRoot = void 0;
36
+ _domain = void 0;
37
+ _headers = void 0;
38
+ _organizationId = void 0;
39
+ _publishableApiKey = void 0;
40
+ _tokenEndpoint = void 0;
41
+ /**
42
+ * The Rebilly Organization API root endpoint
43
+ */
44
+ get apiRoot() {
45
+ if (!this._apiRoot)
46
+ this._apiRoot = `${this.domain}/organizations/${this.organizationId}`;
47
+ return this._apiRoot;
48
+ }
49
+ /**
50
+ * The Rebilly domain
51
+ */
52
+ get domain() {
53
+ if (!this._domain)
54
+ this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`);
55
+ return this._domain;
56
+ }
57
+ /**
58
+ * The headers to be included in the request for each request
59
+ */
60
+ get headers() {
61
+ if (!this._headers)
62
+ this._headers = { Authorization: this.publishableApiKey };
63
+ return this._headers;
64
+ }
65
+ /**
66
+ * True if the environment is sandbox (testing), false otherwise
67
+ */
68
+ get isSandboxEnvironment() {
69
+ return this.domain.includes("sandbox");
70
+ }
71
+ /**
72
+ * The Rebilly organization ID
73
+ */
74
+ get organizationId() {
75
+ if (!this._organizationId)
76
+ this._organizationId = removePrefix(
77
+ assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),
78
+ "org_"
79
+ );
80
+ return this._organizationId;
81
+ }
82
+ /**
83
+ * The Rebilly Publishable API key
84
+ */
85
+ get publishableApiKey() {
86
+ if (!this._publishableApiKey)
87
+ this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`);
88
+ return this._publishableApiKey;
89
+ }
90
+ /**
91
+ * The Rebilly Organization token creation endpoint
92
+ */
93
+ get tokenEndpoint() {
94
+ if (!this._tokenEndpoint)
95
+ this._tokenEndpoint = `${this.apiRoot}/tokens`;
96
+ return this._tokenEndpoint;
97
+ }
98
+ async reportHandler(payloads) {
99
+ var _a, _b;
100
+ await this.started("throw");
101
+ const results = [];
102
+ if (!payloads || payloads.length === 0)
103
+ return results;
104
+ const paymentCard = payloads == null ? void 0 : payloads.find(isPaymentCard);
105
+ if (!paymentCard)
106
+ return results;
107
+ const billingAddress = payloads == null ? void 0 : payloads.find(isBillingAddress);
108
+ if (!billingAddress)
109
+ return results;
110
+ const axios = new AxiosJson({ headers: this.headers });
111
+ try {
112
+ const data = toTokenRequest(paymentCard, billingAddress);
113
+ const response = await axios.post(this.tokenEndpoint, data);
114
+ assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`);
115
+ const token = response.data;
116
+ const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress]);
117
+ results.push({ salt: token.id, schema: IdSchema, sources });
118
+ } catch (error) {
119
+ (_b = (_a = this.logger) == null ? void 0 : _a.error) == null ? void 0 : _b.call(_a, `${moduleName}: Error creating payment token: ${error}`);
120
+ }
121
+ return results;
122
+ }
123
+ };
124
+ export {
125
+ RebillyPaymentCardAuthorizationSentinel,
126
+ RebillyPaymentCardAuthorizationSentinelConfigSchema,
127
+ RebillyPaymentCardAuthorizationSentinelSchema
128
+ };
129
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyApiDomainSettings } from './RebillyProviderSettings'\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\n Partial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson, AxiosRequestConfig, HttpStatusCode } from '@xylabs/axios'\nimport { IdPayload, IdSchema } from '@xyo-network/id-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\n\nimport { CreateTokenResponse } from './Api'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config'\nimport { RebillyPaymentCardAuthorizationSentinelParams } from './Params'\nimport { toTokenRequest } from './util'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<IdPayload>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const token = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({ salt: token.id, schema: IdSchema, sources })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport { CreatePaymentTokenRequest } from '../Api'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const { cvv, expMonth, expYear, cardNumber } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber },\n }\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from './toTokenRequest';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './toTokenRequest';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './toTokenRequest';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins';
2
+ import { CreatePaymentTokenRequest } from '../Api';
3
+ /**
4
+ * Converts a payment card and billing address to a token request
5
+ * @param paymentCard The payment card
6
+ * @param billingAddress The billing address
7
+ * @returns The token request
8
+ */
9
+ export declare const toTokenRequest: (paymentCard: PaymentCard, billingAddress: BillingAddress) => CreatePaymentTokenRequest;
10
+ //# sourceMappingURL=toTokenRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toTokenRequest.d.ts","sourceRoot":"","sources":["../../../src/util/toTokenRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAA;AAElD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,gBAAiB,WAAW,kBAAkB,cAAc,KAAG,yBAazF,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins';
2
+ import { CreatePaymentTokenRequest } from '../Api';
3
+ /**
4
+ * Converts a payment card and billing address to a token request
5
+ * @param paymentCard The payment card
6
+ * @param billingAddress The billing address
7
+ * @returns The token request
8
+ */
9
+ export declare const toTokenRequest: (paymentCard: PaymentCard, billingAddress: BillingAddress) => CreatePaymentTokenRequest;
10
+ //# sourceMappingURL=toTokenRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toTokenRequest.d.ts","sourceRoot":"","sources":["../../../src/util/toTokenRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAA;AAElD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,gBAAiB,WAAW,kBAAkB,cAAc,KAAG,yBAazF,CAAA"}