@owlmeans/server-payment 0.1.22-rc.0 → 0.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +52 -54
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/server-payment/SKILL.md +272 -330
  4. package/agent-meta/skills/server-payment/parts/reference.md +3 -3
  5. package/build/access/types.d.ts +7 -16
  6. package/build/access/types.d.ts.map +1 -1
  7. package/build/access.d.ts.map +1 -1
  8. package/build/access.js +6 -8
  9. package/build/access.js.map +1 -1
  10. package/build/actions/resync.d.ts +3 -3
  11. package/build/actions/resync.js +5 -5
  12. package/build/actions/resync.js.map +1 -1
  13. package/build/actions/webhook.d.ts +4 -1
  14. package/build/actions/webhook.d.ts.map +1 -1
  15. package/build/actions/webhook.js +8 -4
  16. package/build/actions/webhook.js.map +1 -1
  17. package/build/bootstrap/types.d.ts +13 -7
  18. package/build/bootstrap/types.d.ts.map +1 -1
  19. package/build/bootstrap.d.ts +4 -4
  20. package/build/bootstrap.d.ts.map +1 -1
  21. package/build/bootstrap.js +19 -10
  22. package/build/bootstrap.js.map +1 -1
  23. package/build/catalogue/types.d.ts +3 -3
  24. package/build/catalogue/types.d.ts.map +1 -1
  25. package/build/catalogue.d.ts.map +1 -1
  26. package/build/catalogue.js +4 -8
  27. package/build/catalogue.js.map +1 -1
  28. package/build/checkout/types.d.ts +21 -0
  29. package/build/checkout/types.d.ts.map +1 -0
  30. package/build/{plugins/stripe → checkout}/types.js.map +1 -1
  31. package/build/checkout.d.ts +6 -0
  32. package/build/checkout.d.ts.map +1 -0
  33. package/build/checkout.js +374 -0
  34. package/build/checkout.js.map +1 -0
  35. package/build/config.d.ts +10 -16
  36. package/build/config.d.ts.map +1 -1
  37. package/build/config.js +18 -59
  38. package/build/config.js.map +1 -1
  39. package/build/consts.d.ts +3 -49
  40. package/build/consts.d.ts.map +1 -1
  41. package/build/consts.js +3 -61
  42. package/build/consts.js.map +1 -1
  43. package/build/consumer/cancellation/types.d.ts +6 -4
  44. package/build/consumer/cancellation/types.d.ts.map +1 -1
  45. package/build/consumer/cancellation.d.ts.map +1 -1
  46. package/build/consumer/cancellation.js +11 -5
  47. package/build/consumer/cancellation.js.map +1 -1
  48. package/build/consumer/capture/types.d.ts +8 -12
  49. package/build/consumer/capture/types.d.ts.map +1 -1
  50. package/build/consumer/capture.d.ts.map +1 -1
  51. package/build/consumer/capture.js +48 -53
  52. package/build/consumer/capture.js.map +1 -1
  53. package/build/consumer/index.d.ts +4 -0
  54. package/build/consumer/index.d.ts.map +1 -1
  55. package/build/consumer/index.js +2 -0
  56. package/build/consumer/index.js.map +1 -1
  57. package/build/consumer/reconcile.d.ts.map +1 -1
  58. package/build/consumer/reconcile.js +82 -72
  59. package/build/consumer/reconcile.js.map +1 -1
  60. package/build/consumer/records/types.d.ts +4 -4
  61. package/build/consumer/records/types.d.ts.map +1 -1
  62. package/build/consumer/records.d.ts.map +1 -1
  63. package/build/consumer/records.js +16 -13
  64. package/build/consumer/records.js.map +1 -1
  65. package/build/consumer/service.d.ts +2 -2
  66. package/build/consumer/service.d.ts.map +1 -1
  67. package/build/consumer/service.js +28 -21
  68. package/build/consumer/service.js.map +1 -1
  69. package/build/consumer/types.d.ts +1 -4
  70. package/build/consumer/types.d.ts.map +1 -1
  71. package/build/consumer/types.local.d.ts +1 -9
  72. package/build/consumer/types.local.d.ts.map +1 -1
  73. package/build/consumer/withdrawal/types.d.ts +14 -12
  74. package/build/consumer/withdrawal/types.d.ts.map +1 -1
  75. package/build/consumer/withdrawal.d.ts.map +1 -1
  76. package/build/consumer/withdrawal.js +55 -71
  77. package/build/consumer/withdrawal.js.map +1 -1
  78. package/build/index.d.ts +12 -6
  79. package/build/index.d.ts.map +1 -1
  80. package/build/index.js +7 -4
  81. package/build/index.js.map +1 -1
  82. package/build/paygate/providers.d.ts +13 -0
  83. package/build/paygate/providers.d.ts.map +1 -0
  84. package/build/paygate/providers.js +38 -0
  85. package/build/paygate/providers.js.map +1 -0
  86. package/build/paygate/registry.d.ts +6 -0
  87. package/build/paygate/registry.d.ts.map +1 -0
  88. package/build/paygate/registry.js +37 -0
  89. package/build/paygate/registry.js.map +1 -0
  90. package/build/paygate/types.d.ts +577 -0
  91. package/build/paygate/types.d.ts.map +1 -0
  92. package/build/{plugins/session → paygate}/types.js.map +1 -1
  93. package/build/plan/types.d.ts +6 -1
  94. package/build/plan/types.d.ts.map +1 -1
  95. package/build/plan.d.ts.map +1 -1
  96. package/build/plan.js +16 -2
  97. package/build/plan.js.map +1 -1
  98. package/build/plugins/checkout-policy/types.d.ts +5 -3
  99. package/build/plugins/checkout-policy/types.d.ts.map +1 -1
  100. package/build/plugins/checkout-policy.d.ts.map +1 -1
  101. package/build/plugins/checkout-policy.js +5 -3
  102. package/build/plugins/checkout-policy.js.map +1 -1
  103. package/build/plugins/consts.local.d.ts +8 -10
  104. package/build/plugins/consts.local.d.ts.map +1 -1
  105. package/build/plugins/consts.local.js +2 -19
  106. package/build/plugins/consts.local.js.map +1 -1
  107. package/build/plugins/customer-lock/types.d.ts +2 -2
  108. package/build/plugins/customer-lock/types.d.ts.map +1 -1
  109. package/build/plugins/customer-lock.js +2 -2
  110. package/build/plugins/customer-lock.js.map +1 -1
  111. package/build/plugins/estimate/cache.js +1 -1
  112. package/build/plugins/estimate/cache.js.map +1 -1
  113. package/build/plugins/estimate/types.d.ts +10 -10
  114. package/build/plugins/estimate/types.d.ts.map +1 -1
  115. package/build/plugins/estimate.d.ts.map +1 -1
  116. package/build/plugins/estimate.js +48 -122
  117. package/build/plugins/estimate.js.map +1 -1
  118. package/build/plugins/events/types.d.ts +17 -10
  119. package/build/plugins/events/types.d.ts.map +1 -1
  120. package/build/plugins/events.d.ts +6 -5
  121. package/build/plugins/events.d.ts.map +1 -1
  122. package/build/plugins/events.js +162 -173
  123. package/build/plugins/events.js.map +1 -1
  124. package/build/plugins/fx/types.d.ts +10 -21
  125. package/build/plugins/fx/types.d.ts.map +1 -1
  126. package/build/plugins/fx.d.ts +1 -1
  127. package/build/plugins/fx.d.ts.map +1 -1
  128. package/build/plugins/fx.js +17 -54
  129. package/build/plugins/fx.js.map +1 -1
  130. package/build/plugins/portal/types.d.ts +8 -37
  131. package/build/plugins/portal/types.d.ts.map +1 -1
  132. package/build/plugins/portal.d.ts.map +1 -1
  133. package/build/plugins/portal.js +38 -208
  134. package/build/plugins/portal.js.map +1 -1
  135. package/build/plugins/refunds/types.d.ts +11 -11
  136. package/build/plugins/refunds/types.d.ts.map +1 -1
  137. package/build/plugins/refunds.d.ts.map +1 -1
  138. package/build/plugins/refunds.js +14 -39
  139. package/build/plugins/refunds.js.map +1 -1
  140. package/build/plugins/snapshot/types.d.ts +11 -0
  141. package/build/plugins/snapshot/types.d.ts.map +1 -0
  142. package/build/plugins/snapshot/types.js +2 -0
  143. package/build/plugins/snapshot/types.js.map +1 -0
  144. package/build/plugins/snapshot.d.ts +4 -0
  145. package/build/plugins/snapshot.d.ts.map +1 -0
  146. package/build/plugins/snapshot.js +19 -0
  147. package/build/plugins/snapshot.js.map +1 -0
  148. package/build/plugins/subscriptions/types.d.ts +17 -17
  149. package/build/plugins/subscriptions/types.d.ts.map +1 -1
  150. package/build/plugins/subscriptions.d.ts +4 -4
  151. package/build/plugins/subscriptions.d.ts.map +1 -1
  152. package/build/plugins/subscriptions.js +69 -77
  153. package/build/plugins/subscriptions.js.map +1 -1
  154. package/build/plugins/types.local.d.ts +9 -43
  155. package/build/plugins/types.local.d.ts.map +1 -1
  156. package/build/plugins/webhook-manager/types.d.ts +15 -43
  157. package/build/plugins/webhook-manager/types.d.ts.map +1 -1
  158. package/build/plugins/webhook-manager.d.ts +3 -3
  159. package/build/plugins/webhook-manager.d.ts.map +1 -1
  160. package/build/plugins/webhook-manager.js +21 -199
  161. package/build/plugins/webhook-manager.js.map +1 -1
  162. package/build/protocol.d.ts +1 -1
  163. package/build/protocol.d.ts.map +1 -1
  164. package/build/protocol.js +1 -1
  165. package/build/protocol.js.map +1 -1
  166. package/build/service.d.ts +11 -11
  167. package/build/service.d.ts.map +1 -1
  168. package/build/service.js +59 -23
  169. package/build/service.js.map +1 -1
  170. package/build/sync/types.d.ts +17 -13
  171. package/build/sync/types.d.ts.map +1 -1
  172. package/build/sync.d.ts.map +1 -1
  173. package/build/sync.js +22 -122
  174. package/build/sync.js.map +1 -1
  175. package/build/types.d.ts +46 -101
  176. package/build/types.d.ts.map +1 -1
  177. package/build/utils/types.d.ts +0 -8
  178. package/build/utils/types.d.ts.map +1 -1
  179. package/build/utils.d.ts +1 -4
  180. package/build/utils.d.ts.map +1 -1
  181. package/build/utils.js +1 -15
  182. package/build/utils.js.map +1 -1
  183. package/package.json +20 -22
  184. package/src/access/types.ts +7 -16
  185. package/src/access.ts +7 -15
  186. package/src/actions/resync.ts +5 -5
  187. package/src/actions/webhook.ts +8 -4
  188. package/src/bootstrap/types.ts +13 -7
  189. package/src/bootstrap.ts +23 -13
  190. package/src/catalogue/types.ts +3 -3
  191. package/src/catalogue.ts +4 -8
  192. package/src/checkout/types.ts +21 -0
  193. package/src/checkout.ts +414 -0
  194. package/src/config.ts +19 -66
  195. package/src/consts.ts +3 -69
  196. package/src/consumer/cancellation/types.ts +6 -4
  197. package/src/consumer/cancellation.ts +13 -7
  198. package/src/consumer/capture/types.ts +8 -12
  199. package/src/consumer/capture.ts +50 -59
  200. package/src/consumer/index.ts +4 -0
  201. package/src/consumer/reconcile.ts +69 -68
  202. package/src/consumer/records/types.ts +4 -4
  203. package/src/consumer/records.ts +19 -14
  204. package/src/consumer/service.ts +35 -22
  205. package/src/consumer/types.local.ts +1 -8
  206. package/src/consumer/types.ts +1 -4
  207. package/src/consumer/withdrawal/types.ts +14 -12
  208. package/src/consumer/withdrawal.ts +61 -77
  209. package/src/index.ts +12 -6
  210. package/src/paygate/providers.ts +48 -0
  211. package/src/paygate/registry.ts +53 -0
  212. package/src/paygate/types.ts +640 -0
  213. package/src/plan/types.ts +6 -1
  214. package/src/plan.ts +21 -3
  215. package/src/plugins/checkout-policy/types.ts +5 -3
  216. package/src/plugins/checkout-policy.ts +6 -5
  217. package/src/plugins/consts.local.ts +2 -26
  218. package/src/plugins/customer-lock/types.ts +2 -2
  219. package/src/plugins/customer-lock.ts +2 -2
  220. package/src/plugins/estimate/cache.ts +1 -1
  221. package/src/plugins/estimate/types.ts +10 -10
  222. package/src/plugins/estimate.ts +52 -128
  223. package/src/plugins/events/types.ts +17 -9
  224. package/src/plugins/events.ts +172 -190
  225. package/src/plugins/fx/types.ts +10 -23
  226. package/src/plugins/fx.ts +28 -64
  227. package/src/plugins/portal/types.ts +8 -38
  228. package/src/plugins/portal.ts +48 -229
  229. package/src/plugins/refunds/types.ts +11 -11
  230. package/src/plugins/refunds.ts +16 -40
  231. package/src/plugins/snapshot/types.ts +11 -0
  232. package/src/plugins/snapshot.ts +22 -0
  233. package/src/plugins/subscriptions/types.ts +17 -17
  234. package/src/plugins/subscriptions.ts +81 -81
  235. package/src/plugins/types.local.ts +9 -33
  236. package/src/plugins/webhook-manager/types.ts +15 -43
  237. package/src/plugins/webhook-manager.ts +24 -220
  238. package/src/protocol.ts +1 -1
  239. package/src/service.ts +66 -30
  240. package/src/sync/types.ts +17 -13
  241. package/src/sync.ts +25 -143
  242. package/src/types.ts +47 -97
  243. package/src/utils/types.ts +0 -9
  244. package/src/utils.ts +2 -20
  245. package/tests/capabilities.spec.ts +219 -0
  246. package/tests/entitlement.spec.ts +4 -4
  247. package/tests/gate-handlers.spec.ts +6 -6
  248. package/tests/gate.spec.ts +2 -2
  249. package/tests/grants.spec.ts +2 -2
  250. package/tests/internal-plan.spec.ts +2 -2
  251. package/tests/limit-gate.spec.ts +2 -2
  252. package/tests/paygates.spec.ts +132 -0
  253. package/tests/protocol.spec.ts +4 -5
  254. package/tests/usage.spec.ts +2 -2
  255. package/tests/webhook.spec.ts +137 -0
  256. package/build/plugins/session/types.d.ts +0 -34
  257. package/build/plugins/session/types.d.ts.map +0 -1
  258. package/build/plugins/session.d.ts +0 -4
  259. package/build/plugins/session.d.ts.map +0 -1
  260. package/build/plugins/session.js +0 -71
  261. package/build/plugins/session.js.map +0 -1
  262. package/build/plugins/status.d.ts +0 -8
  263. package/build/plugins/status.d.ts.map +0 -1
  264. package/build/plugins/status.js +0 -21
  265. package/build/plugins/status.js.map +0 -1
  266. package/build/plugins/stripe/types.d.ts +0 -20
  267. package/build/plugins/stripe/types.d.ts.map +0 -1
  268. package/build/plugins/stripe.d.ts +0 -6
  269. package/build/plugins/stripe.d.ts.map +0 -1
  270. package/build/plugins/stripe.js +0 -518
  271. package/build/plugins/stripe.js.map +0 -1
  272. package/src/plugins/session/types.ts +0 -30
  273. package/src/plugins/session.ts +0 -86
  274. package/src/plugins/status.ts +0 -22
  275. package/src/plugins/stripe/types.ts +0 -20
  276. package/src/plugins/stripe.ts +0 -571
  277. package/tests/checkout-consumer.spec.ts +0 -366
  278. package/tests/checkout-locks.spec.ts +0 -161
  279. package/tests/checkout-plugins.spec.ts +0 -164
  280. package/tests/checkout.spec.ts +0 -313
  281. package/tests/consumer-events.spec.ts +0 -215
  282. package/tests/consumer-fixtures.ts +0 -141
  283. package/tests/consumer-ops.spec.ts +0 -361
  284. package/tests/consumer-rights.integration.spec.ts +0 -147
  285. package/tests/consumer-rights.spec.ts +0 -606
  286. package/tests/context.ts +0 -110
  287. package/tests/estimate.spec.ts +0 -350
  288. package/tests/events.spec.ts +0 -367
  289. package/tests/fake-stripe.ts +0 -1004
  290. package/tests/gateway-options.spec.ts +0 -180
  291. package/tests/portal.spec.ts +0 -202
  292. package/tests/sync.spec.ts +0 -114
  293. package/tests/usage.integration.spec.ts +0 -165
  294. package/tests/webhook-manager.spec.ts +0 -149
  295. /package/build/{plugins/session → checkout}/types.js +0 -0
  296. /package/build/{plugins/stripe → paygate}/types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/subscriptions/types.ts"],"names":[],"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M,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/D"}
@@ -1,6 +1,6 @@
1
1
  import type { Context as ApiContext } from '@owlmeans/server-api';
2
- import type { StripeSubscriptionsHelper } from './subscriptions/types.js';
3
- export declare const makeStripeSubscriptionsHelper: (ctx: ApiContext) => StripeSubscriptionsHelper;
4
- /** The Stripe subscriptions of a context — one per context. */
5
- export declare const stripeSubscriptionsOf: (target: ApiContext<import("@owlmeans/server-api").Config>) => StripeSubscriptionsHelper;
2
+ import type { PaygateSubscriptionsHelper } from './subscriptions/types.js';
3
+ export declare const makePaygateSubscriptionsHelper: (ctx: ApiContext) => PaygateSubscriptionsHelper;
4
+ /** The paygate subscriptions of a context — one per context. */
5
+ export declare const paygateSubscriptionsOf: (target: ApiContext<import("@owlmeans/server-api").Config>) => PaygateSubscriptionsHelper;
6
6
  //# sourceMappingURL=subscriptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/plugins/subscriptions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAIjE,OAAO,KAAK,EAAgB,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AA2BvF,eAAO,MAAM,6BAA6B,QAAS,UAAU,KAAG,yBA8J/D,CAAA;AAED,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,0FAAoD,CAAA"}
1
+ {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/plugins/subscriptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAIjE,OAAO,KAAK,EAAgB,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAcxF,eAAO,MAAM,8BAA8B,QAAS,UAAU,KAAG,0BA4KhE,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,2FAAqD,CAAA"}
@@ -1,6 +1,5 @@
1
- import { SubscriptionStatus, TERMINAL_STATUSES } from '@owlmeans/payment';
1
+ import { INTERNAL_PAYGATE, SubscriptionStatus, TERMINAL_STATUSES } from '@owlmeans/payment';
2
2
  import { memoHelper } from '@owlmeans/context';
3
- import { STRIPE_PAYGATE_ALIAS } from '../consts.js';
4
3
  import { log } from '../log.js';
5
4
  import { RESYNC_PAGE } from './consts.local.js';
6
5
  import { paymentAccessOf } from '../access.js';
@@ -8,29 +7,19 @@ import { paymentUtils } from '../utils.js';
8
7
  import { catalogueOf } from '../catalogue.js';
9
8
  import { planHelper } from '../plan.js';
10
9
  import { subscriptionCommitOf } from '../commit.js';
10
+ import { paygatesOf } from '../paygate/registry.js';
11
11
  import { customerLockHelper } from './customer-lock.js';
12
- import { mapStatus } from './status.js';
13
12
  import { captureOf } from '../consumer/capture.js';
14
- const isPaused = (subscription) => subscription.status === 'paused'
15
- || (subscription.pause_collection != null && (subscription.status === 'active' || subscription.status === 'trialing'));
16
- /**
17
- * The current period. Top-level on the API version the client is pinned to; read through a narrow
18
- * accessor because later versions move it onto the subscription items.
19
- */
20
- const periodOf = (subscription) => {
21
- const typed = subscription;
22
- return { start: paymentUtils.dateOf(typed.current_period_start), end: paymentUtils.dateOf(typed.current_period_end) };
23
- };
24
13
  const secondsFloor = (at) => new Date(Math.floor(at.getTime() / 1000) * 1000);
25
- export const makeStripeSubscriptionsHelper = (ctx) => {
14
+ export const makePaygateSubscriptionsHelper = (ctx) => {
26
15
  const access = paymentAccessOf(ctx);
27
- const applySubscription = async (subscription, opts) => {
16
+ const applySubscription = async (paygate, subscription, opts) => {
28
17
  const metadata = subscription.metadata ?? {};
29
- const customerId = paymentUtils.idOf(subscription.customer);
30
- const previous = await access.subscriptions().byExternalId(subscription.id, STRIPE_PAYGATE_ALIAS);
18
+ const customerId = subscription.customerId;
19
+ const previous = await access.subscriptions().byExternalId(subscription.id, paygate.id);
31
20
  let entityId = metadata.entityId ?? previous?.entityId;
32
21
  if (entityId == null && customerId != null) {
33
- entityId = (await access.paygateCustomers().loadByPgId(customerId, STRIPE_PAYGATE_ALIAS))?.entityId ?? undefined;
22
+ entityId = (await access.paygateCustomers().loadByPgId(customerId, paygate.id))?.entityId ?? undefined;
34
23
  }
35
24
  if (entityId == null) {
36
25
  log.warn('Subscription belongs to no known entity; ignored', { subscriptionId: subscription.id });
@@ -40,23 +29,21 @@ export const makeStripeSubscriptionsHelper = (ctx) => {
40
29
  return { record: previous, change: null, updated: false };
41
30
  }
42
31
  const now = new Date();
43
- const syncedAt = opts.eventCreated != null ? new Date(opts.eventCreated * 1000) : secondsFloor(now);
32
+ const syncedAt = opts.eventCreated ?? secondsFloor(now);
44
33
  if (opts.eventCreated != null && previous?.syncedAt != null
45
34
  && syncedAt.getTime() < new Date(previous.syncedAt).getTime()) {
46
35
  return { record: previous, change: null, updated: false };
47
36
  }
48
- const item = subscription.items?.data?.[0];
49
- // A price recreated by `sync.ts` (an opposite `tax_behavior`) loses its lookup key; its sku
50
- // metadata survives, so a subscription switched to it in the portal still resolves its plan.
51
- const planSku = item?.price?.lookup_key ?? item?.price?.metadata?.sku ?? metadata.planSku ?? previous?.planSku;
37
+ // A price recreated by the catalogue sync (an opposite tax behavior) may lose its lookup key; the
38
+ // paygate still names its plan, so a subscription switched to it in the portal resolves its plan.
39
+ const planSku = subscription.planSku ?? metadata.planSku ?? previous?.planSku;
52
40
  if (planSku == null) {
53
41
  log.warn('Subscription names no plan; ignored', { subscriptionId: subscription.id });
54
42
  return { record: previous, change: null, updated: false };
55
43
  }
56
44
  const plan = await catalogueOf(ctx).findPlan(planSku);
57
45
  const productSku = plan?.productSku ?? previous?.productSku ?? metadata.productSku ?? planSku;
58
- const paused = opts.forced == null && isPaused(subscription);
59
- const period = periodOf(subscription);
46
+ const paused = opts.forced == null && subscription.paused;
60
47
  const terminal = opts.forced != null && TERMINAL_STATUSES.includes(opts.forced);
61
48
  const next = paymentUtils.compact({
62
49
  ...(previous ?? {}),
@@ -64,24 +51,24 @@ export const makeStripeSubscriptionsHelper = (ctx) => {
64
51
  planSku,
65
52
  productSku,
66
53
  service: metadata.service ?? previous?.service ?? productSku,
67
- paygate: STRIPE_PAYGATE_ALIAS,
54
+ paygate: paygate.id,
68
55
  externalId: subscription.id,
69
- itemId: item?.id,
70
- priceId: item?.price?.id,
71
- status: opts.forced ?? mapStatus(subscription),
72
- externalStatus: subscription.status,
56
+ itemId: subscription.itemId,
57
+ priceId: subscription.priceId,
58
+ status: opts.forced ?? subscription.status,
59
+ externalStatus: subscription.externalStatus,
73
60
  rank: plan != null ? planHelper.planRank(plan) : previous?.rank ?? 0,
74
- periodStart: period.start,
75
- periodEnd: period.end,
76
- cancelAtPeriodEnd: subscription.cancel_at_period_end === true,
77
- canceledAt: paymentUtils.dateOf(subscription.canceled_at),
78
- endedAt: paymentUtils.dateOf(subscription.ended_at) ?? (terminal ? previous?.endedAt ?? now : undefined),
61
+ periodStart: subscription.periodStart,
62
+ periodEnd: subscription.periodEnd,
63
+ cancelAtPeriodEnd: subscription.cancelAtPeriodEnd === true,
64
+ canceledAt: subscription.canceledAt,
65
+ endedAt: subscription.endedAt ?? (terminal ? previous?.endedAt ?? now : undefined),
79
66
  pausedAt: paused ? previous?.pausedAt ?? now : undefined,
80
- trialEnd: paymentUtils.dateOf(subscription.trial_end),
81
- latestInvoiceId: opts.invoiceId ?? paymentUtils.idOf(subscription.latest_invoice) ?? previous?.latestInvoiceId,
67
+ trialEnd: subscription.trialEnd,
68
+ latestInvoiceId: opts.invoiceId ?? subscription.latestInvoiceId ?? previous?.latestInvoiceId,
82
69
  customerId,
83
70
  currency: subscription.currency?.toLowerCase() ?? previous?.currency,
84
- createdAt: previous?.createdAt ?? paymentUtils.dateOf(subscription.created) ?? now,
71
+ createdAt: previous?.createdAt ?? subscription.createdAt ?? now,
85
72
  updatedAt: now,
86
73
  syncedAt,
87
74
  });
@@ -91,24 +78,14 @@ export const makeStripeSubscriptionsHelper = (ctx) => {
91
78
  // The first invoice is a purchase: its window exists before an observer grants the bundle.
92
79
  beforePropagate: async (record, change) => {
93
80
  if (change === 'created') {
94
- await captureOf(ctx).captureSubscriptionPurchase(opts.stripe ?? null, subscription, record);
81
+ await captureOf(ctx).captureSubscriptionPurchase(paygate, subscription, record);
95
82
  }
96
83
  },
97
84
  });
98
85
  };
99
- const retrieveSubscription = async (stripe, id) => {
100
- try {
101
- return await stripe.subscriptions.retrieve(id);
102
- }
103
- catch (error) {
104
- if (paymentUtils.isMissingObject(error)) {
105
- return null;
106
- }
107
- throw error;
108
- }
109
- };
110
- const cancelMissing = async (externalId) => {
111
- const previous = await access.subscriptions().byExternalId(externalId, STRIPE_PAYGATE_ALIAS);
86
+ const retrieveSubscription = async (paygate, id) => paygate.subscriptions != null ? await paygate.subscriptions.retrieve(id) : null;
87
+ const cancelMissing = async (paygate, externalId) => {
88
+ const previous = await access.subscriptions().byExternalId(externalId, paygate.id);
112
89
  if (previous == null || TERMINAL_STATUSES.includes(previous.status)) {
113
90
  return { record: previous, change: null, updated: false };
114
91
  }
@@ -118,52 +95,67 @@ export const makeStripeSubscriptionsHelper = (ctx) => {
118
95
  syncedAt: secondsFloor(now),
119
96
  });
120
97
  };
121
- const resyncStripeSubscription = async (stripe, ref) => {
122
- const ids = new Set();
98
+ /** A registered paygate that keeps subscriptions, or `null`. */
99
+ const subscribingPaygate = (id) => {
100
+ const paygate = id != null ? paygatesOf(ctx).find(id) : null;
101
+ return paygate?.subscriptions != null ? paygate : null;
102
+ };
103
+ const resyncOne = async (paygate, id) => {
104
+ const subscription = await retrieveSubscription(paygate, id);
105
+ const result = await customerLockHelper.withCustomerLock(paygate.id, subscription?.customerId, async () => subscription != null
106
+ ? await applySubscription(paygate, subscription, { source: 'resync' })
107
+ : await cancelMissing(paygate, id));
108
+ return result.updated;
109
+ };
110
+ const resyncSubscription = async (ref) => {
111
+ const targets = new Map();
112
+ const add = (paygate, id) => {
113
+ if (paygate != null && !targets.has(`${paygate.id}:${id}`)) {
114
+ targets.set(`${paygate.id}:${id}`, { paygate, id });
115
+ }
116
+ };
123
117
  if (ref.subscriptionId != null) {
124
- ids.add(ref.subscriptionId);
118
+ const row = ref.paygate == null
119
+ ? await access.subscriptions().load({ externalId: ref.subscriptionId, paygate: { $ne: INTERNAL_PAYGATE } })
120
+ : null;
121
+ add(subscribingPaygate(ref.paygate ?? row?.paygate)
122
+ ?? (ref.paygate == null && row == null ? paygatesOf(ctx).all().find(paygate => paygate.subscriptions != null) ?? null : null), ref.subscriptionId);
125
123
  }
126
124
  if (ref.entityId != null) {
127
- const { items } = await access.subscriptions().list({ entityId: ref.entityId, paygate: STRIPE_PAYGATE_ALIAS }, { size: 0 });
128
- items.forEach(row => ids.add(row.externalId));
125
+ const { items } = await access.subscriptions().list({ entityId: ref.entityId, paygate: ref.paygate ?? { $ne: INTERNAL_PAYGATE } }, { size: 0 });
126
+ items.forEach(row => { add(subscribingPaygate(row.paygate), row.externalId); });
129
127
  }
130
128
  let updated = 0;
131
- for (const id of ids) {
132
- const subscription = await retrieveSubscription(stripe, id);
133
- const customerId = subscription != null ? paymentUtils.idOf(subscription.customer) : undefined;
134
- const result = await customerLockHelper.withCustomerLock(customerId, async () => subscription != null
135
- ? await applySubscription(subscription, { source: 'resync', stripe })
136
- : await cancelMissing(id));
137
- if (result.updated) {
129
+ for (const { paygate, id } of targets.values()) {
130
+ if (await resyncOne(paygate, id)) {
138
131
  updated++;
139
132
  }
140
133
  }
141
134
  return updated;
142
135
  };
143
- const resyncStripeSubscriptions = async (stripe) => {
144
- const ids = [];
136
+ const resyncAll = async () => {
137
+ const rows = [];
145
138
  for (let page = 0;; page++) {
146
- const { items } = await access.subscriptions().list({ paygate: STRIPE_PAYGATE_ALIAS, status: { $nin: [...TERMINAL_STATUSES] } }, { size: RESYNC_PAGE, page, sort: ['createdAt'] });
147
- ids.push(...items.map(row => row.externalId));
139
+ const { items } = await access.subscriptions().list({ paygate: { $ne: INTERNAL_PAYGATE }, status: { $nin: [...TERMINAL_STATUSES] } }, { size: RESYNC_PAGE, page, sort: ['createdAt'] });
140
+ rows.push(...items);
148
141
  if (items.length < RESYNC_PAGE) {
149
142
  break;
150
143
  }
151
144
  }
145
+ const targets = rows.filter(row => subscribingPaygate(row.paygate) != null);
152
146
  let updated = 0;
153
- for (const subscriptionId of ids) {
147
+ for (const row of targets) {
154
148
  try {
155
- updated += await resyncStripeSubscription(stripe, { subscriptionId });
149
+ updated += await resyncSubscription({ subscriptionId: row.externalId, paygate: row.paygate });
156
150
  }
157
151
  catch (error) {
158
- log.error('Subscription resync failed', { subscriptionId, error });
152
+ log.error('Subscription resync failed', { subscriptionId: row.externalId, paygate: row.paygate, error });
159
153
  }
160
154
  }
161
- return { scanned: ids.length, updated };
162
- };
163
- return {
164
- applySubscription, retrieveSubscription, cancelMissing, resyncStripeSubscription, resyncStripeSubscriptions,
155
+ return { scanned: targets.length, updated };
165
156
  };
157
+ return { applySubscription, retrieveSubscription, cancelMissing, resyncSubscription, resyncAll };
166
158
  };
167
- /** The Stripe subscriptions of a context — one per context. */
168
- export const stripeSubscriptionsOf = memoHelper.oncePer(makeStripeSubscriptionsHelper);
159
+ /** The paygate subscriptions of a context — one per context. */
160
+ export const paygateSubscriptionsOf = memoHelper.oncePer(makePaygateSubscriptionsHelper);
169
161
  //# sourceMappingURL=subscriptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/plugins/subscriptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAGnD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM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AAE,kBAAkB,EAAE,SAAS,EAAE,CAAA;AAClG,CAAC,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAA"}
@@ -1,39 +1,18 @@
1
- import type Stripe from 'stripe';
2
- import type { BillingProfileView, ConsumerRegion, ConsumerRightsPolicy } from '@owlmeans/payment';
1
+ import type { BillingProfileView, ConsumerRegion, ConsumerRightsPolicy, TaxEstimate } from '@owlmeans/payment';
2
+ import type { FxQuote } from '../paygate/types.js';
3
3
  export interface CacheEntry<T> {
4
4
  value: T;
5
5
  expiresAt: number;
6
6
  }
7
- export type TaxOutcome = {
8
- ok: true;
9
- calculation: Stripe.Tax.Calculation;
10
- } | {
11
- ok: false;
12
- code?: string;
13
- };
7
+ /** A cached tax answer: the estimate, or `null` when the paygate could not place the buyer. */
8
+ export type TaxOutcome = TaxEstimate | null;
14
9
  export type FxOutcome = {
15
10
  currency: string;
16
11
  exchangeRate: number;
17
12
  fxFeeRate?: number;
18
13
  } | null;
19
- export interface FxQuoteResponse {
20
- rates?: Record<string, {
21
- exchange_rate?: number;
22
- rate_details?: {
23
- base_rate?: number;
24
- fx_fee_rate?: number;
25
- reference_rate?: number;
26
- };
27
- }>;
28
- }
29
- export type ConfigurationParams = Stripe.BillingPortal.ConfigurationCreateParams;
30
- export type Claim = 'ours' | 'foreign' | 'unclaimed';
31
- export interface CheckoutOptionsFlags {
32
- /** The billing country is locked and the saved customer address carries it: never overwrite it. */
33
- locked?: boolean;
34
- /** Adaptive Pricing is allowed on this session (the charge currency is the settlement currency). */
35
- adaptive?: boolean;
36
- }
14
+ /** The quotes one run (a catalogue sync) shares, by `<from>:<to>`. */
15
+ export type FxQuoteCache = Map<string, Promise<FxQuote | null>>;
37
16
  /** What the consumer-rights policy makes of this checkout's buyer. */
38
17
  export interface BuyerContext {
39
18
  policy: ConsumerRightsPolicy | null;
@@ -45,26 +24,13 @@ export interface BuyerContext {
45
24
  /** `null`: the policy names no region currencies — the legacy settlement behaviour. */
46
25
  chargeCurrency: string | null;
47
26
  /**
48
- * Checkout keeps the saved customer address (tax follows it, nothing typed at Stripe moves it): a
49
- * locked profile, or a `stripe.lockCustomerCountry` pin, whose country it carries — tax-locatable.
27
+ * Checkout keeps the saved customer address (tax follows it, nothing typed at the paygate moves
28
+ * it): a locked profile, or a pinned customer country, whose country it carries — tax-locatable.
50
29
  */
51
30
  addressLocked: boolean;
52
- /** The address is held by `stripe.lockCustomerCountry`: the first completed purchase locks THIS country. */
31
+ /** The address is held by the paygate's customer country lock: the first completed purchase locks THIS country. */
53
32
  countryPinned: boolean;
54
33
  }
55
- export interface StripeErrorShape {
56
- type?: string;
57
- rawType?: string;
58
- code?: string;
59
- param?: string;
60
- message?: string;
61
- raw?: {
62
- type?: string;
63
- code?: string;
64
- param?: string;
65
- message?: string;
66
- };
67
- }
68
34
  export interface WebhookRequest {
69
35
  original?: {
70
36
  rawBody?: string | Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"types.local.d.ts","sourceRoot":"","sources":["../../src/plugins/types.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAEjG,MAAM,WAAW,UAAU,CAAC,CAAC;IAAI,KAAK,EAAE,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE;AAE9D,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzG,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAA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kB,GAAG,IAAI,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,cAAc,GAAG,IAAI,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,uFAAuF;IACvF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAA;IACtB,mHAAmH;IACnH,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;CACvD"}
@@ -1,62 +1,34 @@
1
- import type Stripe from 'stripe';
2
1
  import type { CommonServiceRoute } from '@owlmeans/route';
3
2
  import type { PaymentWebhookRecord } from '../../types.js';
3
+ import type { Paygate, PaygateDeployment } from '../../paygate/types.js';
4
4
  export interface EnsureWebhookOptions {
5
5
  /** Verify the stored endpoint still exists even when nothing changed locally. */
6
6
  force?: boolean;
7
7
  }
8
- /** A deployment's Stripe webhook: where it is served, the managed endpoint, its secrets and its deliveries. */
8
+ /** A deployment's paygate webhooks: where they are served, the managed endpoints and their deliveries. */
9
9
  export interface WebhookHelper {
10
10
  /** The alias whose host and base form the webhook URL: the gateway's `webhookService`, else `cfg.service`. */
11
11
  webhookServiceOf: () => string;
12
- /** The key this deployment's Stripe rows are stored under: the gateway's `owner`, else `cfg.service`. */
12
+ /** The key this deployment's paygate rows are stored under: the gateway's `owner`, else `cfg.service`. */
13
13
  gatewayOwnerOf: () => string;
14
14
  /** @throws WebhookSetupError('service:<alias>') when the webhook service is not declared in `cfg.services`. */
15
15
  webhookRouteOf: (alias?: string) => CommonServiceRoute;
16
- /** This deployment's public webhook URL for a paygate, on the webhook service's host and base. */
17
- webhookUrlOf: (paygate?: string) => string;
16
+ /** This deployment's public webhook URL for a paygate (`/<base>/webhook/<paygate>`), on the webhook service's host and base. */
17
+ webhookUrlOf: (paygate: string) => string;
18
+ /** The deployment a paygate keeps its endpoint and portal configuration for: the owner and the webhook URL. */
19
+ deploymentOf: (paygate: string) => PaygateDeployment;
18
20
  /**
19
- * Keep exactly one Stripe webhook endpoint for this deployment at its own URL, subscribed to
20
- * `WEBHOOK_EVENTS` on the client's API version, and persist its signing secret — which Stripe
21
- * returns only when an endpoint is created.
22
- *
23
- * A deployment's identity is its webhook URL (`webhookUrlOf`: the `webhookService` alias's host and
24
- * base); its rows are keyed by the gateway's `owner` (`gatewayOwnerOf`). Several deployments of one
25
- * application may share a Stripe account — a test-mode account commonly serves every non-production
26
- * deployment — each with its own database and URL, so a deployment deletes only the endpoints its
27
- * own `payment-webhook` rows name.
28
- *
29
- * - A URL Stripe cannot deliver to (not https, a loopback or dotless host) is skipped.
30
- * - An unchanged `{ url, apiVersion, events }` fingerprint makes no paygate call at all.
31
- * - `force` first verifies the stored endpoint still exists; one deleted from outside loses its row
32
- * and is created again.
33
- * - Changed events on the same API version update the endpoint in place.
34
- * - A changed API version (create-only on an endpoint) deletes and recreates it.
35
- * - An endpoint already at this exact URL that no row names is replaced: its secret is unknown here.
36
- * - A row of this paygate and owner at another URL is a URL this deployment has left — a moved host,
37
- * or a new `webhookService`: once the endpoint at the current URL is in place, the endpoint that
38
- * row names is deleted (already gone is fine), then the row.
39
- * - An endpoint at another URL that no row of this deployment names belongs to another deployment
40
- * and is never deleted — whatever its metadata says.
41
- * - Replicas racing to persist one row: the endpoint created last is the live one.
42
- * - A created endpoint carries `{ owlmeans: 'payment', service: <owner> }` metadata and the
43
- * `owlmeans:<owner>` description for operators.
44
- */
45
- ensureWebhookEndpoint: (stripe: Stripe, opts?: EnsureWebhookOptions) => Promise<PaymentWebhookRecord | null>;
46
- /**
47
- * The secrets a Stripe signature may be verified with, in order: the configured file secret (an
48
- * override), then the one stored for the managed endpoint — the newest row of the gateway's `owner`,
49
- * so a process receiving the webhook finds the secret whichever process of the owner stored it.
21
+ * Keep the paygate's webhook endpoint for this deployment at its own URL
22
+ * (`paygate.webhook.ensureEndpoint`). A deployment's identity is its webhook URL; its rows carry the
23
+ * gateway's `owner`. A URL a paygate cannot deliver to (not https, a loopback or dotless host) is
24
+ * skipped, and so is a paygate without `webhook`.
50
25
  */
51
- stripeWebhookSecrets: () => Promise<string[]>;
52
- /** The secret a Stripe signature is verified with. @throws WebhookSetupError('secret') */
53
- stripeWebhookSecret: () => Promise<string>;
26
+ ensureWebhookEndpoint: (paygate: Paygate, opts?: EnsureWebhookOptions) => Promise<PaymentWebhookRecord | null>;
54
27
  /**
55
- * Verify a Stripe webhook against the configured override secret, then the managed endpoint's
56
- * stored one, and dispatch it.
28
+ * Verify a delivery with the paygate (against the owner's secrets) and apply its events in order.
57
29
  *
58
- * @throws PaygateSignatureError | WebhookSetupError('secret')
30
+ * @throws PaygateError('capability:webhook') | PaygateSignatureError | WebhookSetupError('secret')
59
31
  */
60
- handleStripeWebhook: (stripe: Stripe, request: unknown) => Promise<void>;
32
+ handleDelivery: (paygate: Paygate, request: unknown) => Promise<void>;
61
33
  }
62
34
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/webhook-manager/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,+GAA+G;AAC/G,MAAM,WAAW,aAAa;IAC5B,8GAA8G;I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cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,kBAAkB,CAAA;IACtD,gIAAgI;IAChI,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IACzC,+GAA+G;IAC/G,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,iBAAiB,CAAA;IACpD;;;;;OAKG;IACH,qBAAqB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAA;IAC9G;;;;OAIG;IACH,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE"}
@@ -1,8 +1,8 @@
1
1
  import type { Context as ApiContext } from '@owlmeans/server-api';
2
2
  import type { WebhookHelper } from './webhook-manager/types.js';
3
3
  export declare const makeWebhookHelper: (ctx: ApiContext) => WebhookHelper;
4
- /** The webhook endpoint of a context — one per context. */
4
+ /** The paygate webhooks of a context — one per context. */
5
5
  export declare const webhookOf: (target: ApiContext<import("@owlmeans/server-api").Config>) => WebhookHelper;
6
- /** @deprecated compat:factory-refactor — use `webhookOf(ctx).webhookUrlOf(…)` */
7
- export declare const webhookUrlOf: (ctx: ApiContext, paygate?: string) => string;
6
+ /** @deprecated compat:factory-refactor — use `webhookOf(ctx).webhookUrlOf(paygate)` */
7
+ export declare const webhookUrlOf: (ctx: ApiContext, paygate: string) => string;
8
8
  //# sourceMappingURL=webhook-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-manager.d.ts","sourceRoot":"","sources":["../../src/plugins/webhook-manager.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAOjE,OAAO,KAAK,EAAwB,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAiCrF,eAAO,MAAM,iBAAiB,QAAS,UAAU,KAAG,aA2OnD,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,SAAS,8EAAwC,CAAA;AAE9D,iFAAiF;AACjF,eAAO,MAAM,YAAY,QAAS,UAAU,YAAW,MAAM,KAA0B,MACjD,CAAA"}
1
+ {"version":3,"file":"webhook-manager.d.ts","sourceRoot":"","sources":["../../src/plugins/webhook-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAKjE,OAAO,KAAK,EAAwB,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAyBrF,eAAO,MAAM,iBAAiB,QAAS,UAAU,KAAG,aAoDnD,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,SAAS,8EAAwC,CAAA;AAE9D,uFAAuF;AACvF,eAAO,MAAM,YAAY,QAAS,UAAU,WAAW,MAAM,KAAG,MAA8C,CAAA"}