@venturekit/billing 0.0.48 → 0.0.51

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 (115) hide show
  1. package/README.md +30 -28
  2. package/dist/client.d.ts +15 -8
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +21 -10
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +1 -1
  7. package/dist/errors.js +1 -1
  8. package/dist/events.d.ts +51 -7
  9. package/dist/events.d.ts.map +1 -1
  10. package/dist/events.js +3 -3
  11. package/dist/events.js.map +1 -1
  12. package/dist/index.d.ts +13 -11
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +10 -8
  15. package/dist/index.js.map +1 -1
  16. package/dist/provider.d.ts +51 -7
  17. package/dist/provider.d.ts.map +1 -1
  18. package/dist/provider.js +10 -1
  19. package/dist/provider.js.map +1 -1
  20. package/dist/providers/index.d.ts +2 -1
  21. package/dist/providers/index.d.ts.map +1 -1
  22. package/dist/providers/index.js +2 -1
  23. package/dist/providers/index.js.map +1 -1
  24. package/dist/providers/{zazu → manza}/adapter.d.ts +15 -15
  25. package/dist/providers/manza/adapter.d.ts.map +1 -0
  26. package/dist/providers/{zazu → manza}/adapter.js +24 -24
  27. package/dist/providers/manza/adapter.js.map +1 -0
  28. package/dist/providers/manza/client.d.ts +76 -0
  29. package/dist/providers/manza/client.d.ts.map +1 -0
  30. package/dist/providers/{zazu → manza}/client.js +9 -9
  31. package/dist/providers/manza/client.js.map +1 -0
  32. package/dist/providers/{zazu → manza}/config.d.ts +21 -21
  33. package/dist/providers/manza/config.d.ts.map +1 -0
  34. package/dist/providers/manza/config.js +99 -0
  35. package/dist/providers/manza/config.js.map +1 -0
  36. package/dist/providers/{zazu → manza}/correlation.d.ts +7 -7
  37. package/dist/providers/manza/correlation.d.ts.map +1 -0
  38. package/dist/providers/{zazu → manza}/correlation.js +22 -22
  39. package/dist/providers/manza/correlation.js.map +1 -0
  40. package/dist/providers/manza/index.d.ts +19 -0
  41. package/dist/providers/manza/index.d.ts.map +1 -0
  42. package/dist/providers/manza/index.js +24 -0
  43. package/dist/providers/manza/index.js.map +1 -0
  44. package/dist/providers/manza/maps.d.ts +36 -0
  45. package/dist/providers/manza/maps.d.ts.map +1 -0
  46. package/dist/providers/{zazu → manza}/maps.js +4 -4
  47. package/dist/providers/manza/maps.js.map +1 -0
  48. package/dist/providers/{zazu → manza}/secrets.d.ts +15 -15
  49. package/dist/providers/manza/secrets.d.ts.map +1 -0
  50. package/dist/providers/{zazu → manza}/secrets.js +13 -13
  51. package/dist/providers/manza/secrets.js.map +1 -0
  52. package/dist/providers/{zazu → manza}/types.d.ts +65 -65
  53. package/dist/providers/manza/types.d.ts.map +1 -0
  54. package/dist/providers/{zazu → manza}/types.js +3 -3
  55. package/dist/providers/manza/types.js.map +1 -0
  56. package/dist/providers/{zazu → manza}/webhooks.d.ts +19 -19
  57. package/dist/providers/manza/webhooks.d.ts.map +1 -0
  58. package/dist/providers/{zazu → manza}/webhooks.js +57 -46
  59. package/dist/providers/manza/webhooks.js.map +1 -0
  60. package/dist/providers/mock.js +3 -3
  61. package/dist/providers/stripe/adapter.d.ts +28 -0
  62. package/dist/providers/stripe/adapter.d.ts.map +1 -0
  63. package/dist/providers/stripe/adapter.js +192 -0
  64. package/dist/providers/stripe/adapter.js.map +1 -0
  65. package/dist/providers/stripe/client.d.ts +26 -0
  66. package/dist/providers/stripe/client.d.ts.map +1 -0
  67. package/dist/providers/stripe/client.js +84 -0
  68. package/dist/providers/stripe/client.js.map +1 -0
  69. package/dist/providers/stripe/config.d.ts +28 -0
  70. package/dist/providers/stripe/config.d.ts.map +1 -0
  71. package/dist/providers/stripe/config.js +33 -0
  72. package/dist/providers/stripe/config.js.map +1 -0
  73. package/dist/providers/stripe/index.d.ts +13 -0
  74. package/dist/providers/stripe/index.d.ts.map +1 -0
  75. package/dist/providers/stripe/index.js +16 -0
  76. package/dist/providers/stripe/index.js.map +1 -0
  77. package/dist/providers/stripe/maps.d.ts +165 -0
  78. package/dist/providers/stripe/maps.d.ts.map +1 -0
  79. package/dist/providers/stripe/maps.js +179 -0
  80. package/dist/providers/stripe/maps.js.map +1 -0
  81. package/dist/providers/stripe/webhooks.d.ts +34 -0
  82. package/dist/providers/stripe/webhooks.d.ts.map +1 -0
  83. package/dist/providers/stripe/webhooks.js +123 -0
  84. package/dist/providers/stripe/webhooks.js.map +1 -0
  85. package/dist/providers/zazu.d.ts +9 -0
  86. package/dist/providers/zazu.d.ts.map +1 -0
  87. package/dist/providers/zazu.js +8 -0
  88. package/dist/providers/zazu.js.map +1 -0
  89. package/dist/types.d.ts +139 -15
  90. package/dist/types.d.ts.map +1 -1
  91. package/dist/types.js +2 -2
  92. package/package.json +15 -7
  93. package/dist/providers/zazu/adapter.d.ts.map +0 -1
  94. package/dist/providers/zazu/adapter.js.map +0 -1
  95. package/dist/providers/zazu/client.d.ts +0 -76
  96. package/dist/providers/zazu/client.d.ts.map +0 -1
  97. package/dist/providers/zazu/client.js.map +0 -1
  98. package/dist/providers/zazu/config.d.ts.map +0 -1
  99. package/dist/providers/zazu/config.js +0 -90
  100. package/dist/providers/zazu/config.js.map +0 -1
  101. package/dist/providers/zazu/correlation.d.ts.map +0 -1
  102. package/dist/providers/zazu/correlation.js.map +0 -1
  103. package/dist/providers/zazu/index.d.ts +0 -19
  104. package/dist/providers/zazu/index.d.ts.map +0 -1
  105. package/dist/providers/zazu/index.js +0 -22
  106. package/dist/providers/zazu/index.js.map +0 -1
  107. package/dist/providers/zazu/maps.d.ts +0 -36
  108. package/dist/providers/zazu/maps.d.ts.map +0 -1
  109. package/dist/providers/zazu/maps.js.map +0 -1
  110. package/dist/providers/zazu/secrets.d.ts.map +0 -1
  111. package/dist/providers/zazu/secrets.js.map +0 -1
  112. package/dist/providers/zazu/types.d.ts.map +0 -1
  113. package/dist/providers/zazu/types.js.map +0 -1
  114. package/dist/providers/zazu/webhooks.d.ts.map +0 -1
  115. package/dist/providers/zazu/webhooks.js.map +0 -1
@@ -1,27 +1,27 @@
1
1
  /**
2
- * @venturekit/billing — Zazu configuration
2
+ * @venturekit/billing — Manza configuration
3
3
  *
4
- * Zazu config is self-contained in the provider module (mirrors how
4
+ * Manza config is self-contained in the provider module (mirrors how
5
5
  * `@venturekit/notify` keeps `SesEmailProviderConfig` inside its
6
- * provider file). Values resolve from the `ZAZU_*` environment variables
6
+ * provider file). Values resolve from the `MANZA_*` environment variables
7
7
  * by default, with explicit overrides accepted — secrets never live in
8
8
  * source code.
9
9
  */
10
- import { type ZazuSecretValue } from './secrets.js';
11
- export interface ZazuConfig {
10
+ import { type ManzaSecretValue } from './secrets.js';
11
+ export interface ManzaConfig {
12
12
  /**
13
- * Zazu API key (Bearer token). Required.
13
+ * Manza API key (Bearer token). Required.
14
14
  *
15
15
  * May be a resolver function, in which case the key is fetched from
16
16
  * AWS Secrets Manager on first use and cached — see `./secrets.ts`.
17
17
  */
18
- apiKey: ZazuSecretValue;
19
- /** Base URL — production by default, staging via `ZAZU_BASE_URL`. */
18
+ apiKey: ManzaSecretValue;
19
+ /** Base URL — production by default, staging via `MANZA_BASE_URL`. */
20
20
  baseUrl: string;
21
21
  /**
22
- * Default funding/destination account id, from `ZAZU_ACCOUNT_ID`.
22
+ * Default funding/destination account id, from `MANZA_ACCOUNT_ID`.
23
23
  *
24
- * Zazu requires `account_id` to create a checkout session, a payment
24
+ * Manza requires `account_id` to create a checkout session, a payment
25
25
  * link, or a transfer, but for most applications it is a deployment
26
26
  * property rather than a per-payment one — so it lives here instead of
27
27
  * on every call. Individual calls may still override it, which is what
@@ -30,13 +30,13 @@ export interface ZazuConfig {
30
30
  *
31
31
  * May be a resolver function (see `apiKey`).
32
32
  */
33
- accountId?: ZazuSecretValue;
33
+ accountId?: ManzaSecretValue;
34
34
  /**
35
35
  * Webhook endpoint signing secret (for signature verification).
36
36
  *
37
37
  * May be a resolver function (see `apiKey`).
38
38
  */
39
- webhookSecret?: ZazuSecretValue;
39
+ webhookSecret?: ManzaSecretValue;
40
40
  /** Optional request timeout override (ms). */
41
41
  timeoutMs?: number;
42
42
  /**
@@ -51,20 +51,20 @@ export interface ZazuConfig {
51
51
  webhookToleranceSeconds?: number;
52
52
  /**
53
53
  * ARN of the AWS Secrets Manager entry holding
54
- * `{apiKey, accountId, webhookSecret}`, from `ZAZU_SECRET_ARN`.
54
+ * `{apiKey, accountId, webhookSecret}`, from `MANZA_SECRET_ARN`.
55
55
  *
56
56
  * VentureKit provisions this secret and injects the ARN when a project
57
- * declares a `billing` intent with `provider: 'zazu'`. It is the
58
- * lowest-precedence source: an explicit value or a `ZAZU_*` env var
57
+ * declares a `billing` intent with `provider: 'manza'`. It is the
58
+ * lowest-precedence source: an explicit value or a `MANZA_*` env var
59
59
  * always wins, which is what keeps local development free of any AWS
60
60
  * dependency. See `./secrets.ts`.
61
61
  */
62
62
  secretArn?: string;
63
63
  }
64
64
  /**
65
- * Resolve Zazu config from explicit values, falling back to the
66
- * `ZAZU_API_KEY` / `ZAZU_BASE_URL` / `ZAZU_ACCOUNT_ID` /
67
- * `ZAZU_WEBHOOK_SECRET` / `ZAZU_WEBHOOK_TOLERANCE_SECONDS` environment
65
+ * Resolve Manza config from explicit values, falling back to the
66
+ * `MANZA_API_KEY` / `MANZA_BASE_URL` / `MANZA_ACCOUNT_ID` /
67
+ * `MANZA_WEBHOOK_SECRET` / `MANZA_WEBHOOK_TOLERANCE_SECONDS` environment
68
68
  * variables. Throws {@link MissingConfigError} if the API key cannot be
69
69
  * determined.
70
70
  *
@@ -74,10 +74,10 @@ export interface ZazuConfig {
74
74
  * where a useful hint can name both remedies.
75
75
  *
76
76
  * Each of the three credentials resolves independently, in order:
77
- * explicit value → `ZAZU_*` env var → the Secrets Manager entry named by
78
- * `ZAZU_SECRET_ARN`. Nothing is fetched here: the Secrets Manager path
77
+ * explicit value → `MANZA_*` env var (or its deprecated `ZAZU_*` name) → the Secrets Manager entry named by
78
+ * `MANZA_SECRET_ARN`. Nothing is fetched here: the Secrets Manager path
79
79
  * installs a lazy resolver that runs on first use, so constructing an
80
80
  * adapter stays synchronous and free of I/O.
81
81
  */
82
- export declare function resolveZazuConfig(input?: Partial<ZazuConfig>): ZazuConfig;
82
+ export declare function resolveManzaConfig(input?: Partial<ManzaConfig>): ManzaConfig;
83
83
  //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/providers/manza/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6CD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAmC5E"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @venturekit/billing — Manza configuration
3
+ *
4
+ * Manza config is self-contained in the provider module (mirrors how
5
+ * `@venturekit/notify` keeps `SesEmailProviderConfig` inside its
6
+ * provider file). Values resolve from the `MANZA_*` environment variables
7
+ * by default, with explicit overrides accepted — secrets never live in
8
+ * source code.
9
+ */
10
+ import { MissingConfigError } from '../../errors.js';
11
+ import { createManzaSecretsResolver } from './secrets.js';
12
+ /**
13
+ * Default API host: Morocco production.
14
+ *
15
+ * Zazu became Manza, and its API moved (Manza's notice to integrators):
16
+ *
17
+ * - production: `zazu.ma/api` → `ma.manza.finance/api`
18
+ * - staging: `staging.zazu.ma/api` → `ma.manza.dev/api`
19
+ *
20
+ * Defaulting to production means a deploy that forgets `MANZA_BASE_URL`
21
+ * fails loudly on a bad key rather than silently settling live traffic
22
+ * against staging. Staging (`https://ma.manza.dev`) is opt-in via
23
+ * `MANZA_BASE_URL` — test there first, as the notice asks.
24
+ *
25
+ * Two caveats worth knowing before overriding:
26
+ * - **South Africa** is a different host. The notice did not announce a
27
+ * new one, so it is still the Zazu host: set `MANZA_BASE_URL` to
28
+ * `https://zazu.africa`. There is no auto-detection.
29
+ * - This is the **API** host, not the checkout domain. Hosted payment
30
+ * links and checkout sessions come back in the response `url` (still
31
+ * `pay.zazu.ma` at the time of the rename); they are never built from
32
+ * this value.
33
+ */
34
+ const DEFAULT_BASE_URL = 'https://ma.manza.finance';
35
+ /**
36
+ * A `MANZA_*` setting, else its deprecated `ZAZU_*` name — so a deployment
37
+ * configured before the rename keeps working until its variables move.
38
+ */
39
+ function env(name) {
40
+ return process.env[`MANZA_${name}`] ?? process.env[`ZAZU_${name}`];
41
+ }
42
+ /**
43
+ * Parse a positive-integer env var, ignoring blank and non-numeric
44
+ * values so a typo falls back to the documented default rather than
45
+ * silently disabling a check.
46
+ */
47
+ function numberFromEnv(raw) {
48
+ if (raw === undefined || raw.trim() === '')
49
+ return undefined;
50
+ const value = Number(raw);
51
+ return Number.isFinite(value) && value >= 0 ? value : undefined;
52
+ }
53
+ /**
54
+ * Resolve Manza config from explicit values, falling back to the
55
+ * `MANZA_API_KEY` / `MANZA_BASE_URL` / `MANZA_ACCOUNT_ID` /
56
+ * `MANZA_WEBHOOK_SECRET` / `MANZA_WEBHOOK_TOLERANCE_SECONDS` environment
57
+ * variables. Throws {@link MissingConfigError} if the API key cannot be
58
+ * determined.
59
+ *
60
+ * `accountId` is deliberately NOT required here: an application that
61
+ * always passes an explicit account per call is valid, so the check
62
+ * happens at the call site (see `requireAccountId` in `./adapter.ts`)
63
+ * where a useful hint can name both remedies.
64
+ *
65
+ * Each of the three credentials resolves independently, in order:
66
+ * explicit value → `MANZA_*` env var (or its deprecated `ZAZU_*` name) → the Secrets Manager entry named by
67
+ * `MANZA_SECRET_ARN`. Nothing is fetched here: the Secrets Manager path
68
+ * installs a lazy resolver that runs on first use, so constructing an
69
+ * adapter stays synchronous and free of I/O.
70
+ */
71
+ export function resolveManzaConfig(input) {
72
+ const secretArn = input?.secretArn ?? env('SECRET_ARN');
73
+ // One resolver set per adapter, so all three fields share a single
74
+ // cached GetSecretValue call rather than one apiece.
75
+ const fromSecret = secretArn ? createManzaSecretsResolver({ secretArn }) : undefined;
76
+ const apiKey = input?.apiKey ?? env('API_KEY') ?? fromSecret?.apiKey;
77
+ const baseUrl = input?.baseUrl ?? env('BASE_URL') ?? DEFAULT_BASE_URL;
78
+ const accountId = input?.accountId ?? env('ACCOUNT_ID') ?? fromSecret?.accountId;
79
+ const webhookSecret = input?.webhookSecret ?? env('WEBHOOK_SECRET') ?? fromSecret?.webhookSecret;
80
+ const webhookToleranceSeconds = input?.webhookToleranceSeconds ??
81
+ numberFromEnv(env('WEBHOOK_TOLERANCE_SECONDS'));
82
+ if (!apiKey) {
83
+ throw new MissingConfigError('apiKey', 'Set MANZA_API_KEY, pass { apiKey } to createManzaAdapter, or set ' +
84
+ 'MANZA_SECRET_ARN to a Secrets Manager entry containing it. ' +
85
+ "VentureKit provisions that secret when a project declares a billing " +
86
+ "intent with provider: 'manza'.");
87
+ }
88
+ return {
89
+ apiKey,
90
+ baseUrl,
91
+ accountId,
92
+ webhookSecret,
93
+ timeoutMs: input?.timeoutMs,
94
+ maxRetries: input?.maxRetries,
95
+ webhookToleranceSeconds,
96
+ secretArn,
97
+ };
98
+ }
99
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":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,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC;IACtE,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,GAAG,CAAC,YAAY,CAAC,IAAI,UAAU,EAAE,SAAS,CAAC;IACjF,MAAM,aAAa,GACjB,KAAK,EAAE,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC,IAAI,UAAU,EAAE,aAAa,CAAC;IAC7E,MAAM,uBAAuB,GAC3B,KAAK,EAAE,uBAAuB;QAC9B,aAAa,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAElD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,kBAAkB,CAC1B,QAAQ,EACR,mEAAmE;YACjE,6DAA6D;YAC7D,sEAAsE;YACtE,gCAAgC,CACnC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM;QACN,OAAO;QACP,SAAS;QACT,aAAa;QACb,SAAS,EAAE,KAAK,EAAE,SAAS;QAC3B,UAAU,EAAE,KAAK,EAAE,UAAU;QAC7B,uBAAuB;QACvB,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @venturekit/billing — Zazu correlation transport
2
+ * @venturekit/billing — Manza correlation transport
3
3
  *
4
- * Zazu carries the caller's identifiers on three different channels, one
4
+ * Manza carries the caller's identifiers on three different channels, one
5
5
  * per flow. This module is the single place that knows which is which,
6
6
  * so the adapter and the webhook parser cannot disagree:
7
7
  *
@@ -11,7 +11,7 @@
11
11
  * | payment link | `client_reference_id` URL query param | no |
12
12
  * | transfer | `payment_reference` in the body | no |
13
13
  *
14
- * The asymmetry is Zazu's, not ours. Payment links accept only four
14
+ * The asymmetry is Manza's, not ours. Payment links accept only four
15
15
  * whitelisted query parameters (`client_reference_id`, `customer_email`,
16
16
  * `customer_id`, `customer_name`) and **silently ignore** everything
17
17
  * else, so passing metadata there would vanish without an error. We
@@ -24,8 +24,8 @@ import type { CorrelationFlow, CorrelationRef, CorrelationSupport } from '../../
24
24
  * collision is rejected rather than silently overwritten.
25
25
  */
26
26
  export declare const CORRELATION_REFERENCE_KEY = "vk_reference";
27
- export declare const ZAZU_CORRELATION_SUPPORT: Record<CorrelationFlow, CorrelationSupport>;
28
- export declare function zazuCorrelationSupport(flow: CorrelationFlow): CorrelationSupport;
27
+ export declare const MANZA_CORRELATION_SUPPORT: Record<CorrelationFlow, CorrelationSupport>;
28
+ export declare function manzaCorrelationSupport(flow: CorrelationFlow): CorrelationSupport;
29
29
  /**
30
30
  * Build the `metadata` map for `POST /api/checkout_sessions`, folding the
31
31
  * caller's reference in under {@link CORRELATION_REFERENCE_KEY}.
@@ -40,7 +40,7 @@ export declare function decodeCheckoutCorrelation(metadata: Record<string, strin
40
40
  /**
41
41
  * Attach the caller's reference to a payment link's hosted URL.
42
42
  *
43
- * Zazu stores whitelisted query parameters with the payment and echoes
43
+ * Manza stores whitelisted query parameters with the payment and echoes
44
44
  * them on `payment_link.paid`, so the correlation lives on the URL rather
45
45
  * than in the create body. The customer must therefore be sent to the
46
46
  * URL this returns.
@@ -55,7 +55,7 @@ export declare function decodePaymentLinkCorrelation(clientReferenceId: string |
55
55
  /**
56
56
  * Resolve the `payment_reference` to send for a transfer.
57
57
  *
58
- * Zazu echoes only `payment_reference` on `transfer.executed`, so
58
+ * Manza echoes only `payment_reference` on `transfer.executed`, so
59
59
  * correlation and the business reference compete for one field. Setting
60
60
  * both is rejected rather than silently preferring one.
61
61
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correlation.d.ts","sourceRoot":"","sources":["../../../src/providers/manza/correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AAUxD,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAIjF,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,kBAAkB,CAIjF;AAmCD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,cAAc,GAAG,SAAS,GACtC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAqBpC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,GAClD,cAAc,GAAG,IAAI,CAUvB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,WAAW,EAAE,cAAc,GAAG,SAAS,GACtC,MAAM,GAAG,SAAS,CAqBpB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC3C,cAAc,GAAG,IAAI,CAGvB;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,WAAW,EAAE,cAAc,GAAG,SAAS,GACtC,MAAM,GAAG,SAAS,CAapB;AAED,8DAA8D;AAC9D,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,cAAc,GAAG,IAAI,CAGvB"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @venturekit/billing — Zazu correlation transport
2
+ * @venturekit/billing — Manza correlation transport
3
3
  *
4
- * Zazu carries the caller's identifiers on three different channels, one
4
+ * Manza carries the caller's identifiers on three different channels, one
5
5
  * per flow. This module is the single place that knows which is which,
6
6
  * so the adapter and the webhook parser cannot disagree:
7
7
  *
@@ -11,7 +11,7 @@
11
11
  * | payment link | `client_reference_id` URL query param | no |
12
12
  * | transfer | `payment_reference` in the body | no |
13
13
  *
14
- * The asymmetry is Zazu's, not ours. Payment links accept only four
14
+ * The asymmetry is Manza's, not ours. Payment links accept only four
15
15
  * whitelisted query parameters (`client_reference_id`, `customer_email`,
16
16
  * `customer_id`, `customer_name`) and **silently ignore** everything
17
17
  * else, so passing metadata there would vanish without an error. We
@@ -25,41 +25,41 @@ import { InvalidCorrelationError, UnsupportedCorrelationError, } from '../../err
25
25
  * collision is rejected rather than silently overwritten.
26
26
  */
27
27
  export const CORRELATION_REFERENCE_KEY = 'vk_reference';
28
- /** Documented Zazu metadata limits (checkout sessions). */
28
+ /** Documented Manza metadata limits (checkout sessions). */
29
29
  const MAX_METADATA_KEYS = 50;
30
30
  const MAX_VALUE_LENGTH = 500;
31
31
  const KEY_PATTERN = /^[A-Za-z0-9_]+$/;
32
- /** Query parameter Zazu echoes as a top-level `payment_link.paid` field. */
32
+ /** Query parameter Manza echoes as a top-level `payment_link.paid` field. */
33
33
  const CLIENT_REFERENCE_PARAM = 'client_reference_id';
34
- export const ZAZU_CORRELATION_SUPPORT = {
34
+ export const MANZA_CORRELATION_SUPPORT = {
35
35
  checkoutSession: { reference: true, metadata: true, channel: 'metadata' },
36
36
  paymentLink: { reference: true, metadata: false, channel: 'urlQuery' },
37
37
  transfer: { reference: true, metadata: false, channel: 'paymentReference' },
38
38
  };
39
- export function zazuCorrelationSupport(flow) {
40
- return (ZAZU_CORRELATION_SUPPORT[flow] ?? { reference: false, metadata: false, channel: 'none' });
39
+ export function manzaCorrelationSupport(flow) {
40
+ return (MANZA_CORRELATION_SUPPORT[flow] ?? { reference: false, metadata: false, channel: 'none' });
41
41
  }
42
42
  /**
43
- * Validate a metadata map against Zazu's documented limits. Runs locally
43
+ * Validate a metadata map against Manza's documented limits. Runs locally
44
44
  * so a violation names the offending key instead of arriving as an opaque
45
45
  * 422 after the request.
46
46
  */
47
47
  function assertValidMetadata(metadata, budget) {
48
48
  const keys = Object.keys(metadata);
49
49
  if (keys.length > budget) {
50
- throw new InvalidCorrelationError(`Zazu accepts at most ${MAX_METADATA_KEYS} metadata keys; received ${keys.length} ` +
50
+ throw new InvalidCorrelationError(`Manza accepts at most ${MAX_METADATA_KEYS} metadata keys; received ${keys.length} ` +
51
51
  `with ${MAX_METADATA_KEYS - budget} reserved for the correlation reference.`);
52
52
  }
53
53
  for (const key of keys) {
54
54
  if (!KEY_PATTERN.test(key)) {
55
- throw new InvalidCorrelationError(`Invalid Zazu metadata key "${key}": only letters, numbers, and underscores are allowed.`);
55
+ throw new InvalidCorrelationError(`Invalid Manza metadata key "${key}": only letters, numbers, and underscores are allowed.`);
56
56
  }
57
57
  const value = metadata[key];
58
58
  if (typeof value !== 'string') {
59
- throw new InvalidCorrelationError(`Zazu metadata value for "${key}" must be a string.`);
59
+ throw new InvalidCorrelationError(`Manza metadata value for "${key}" must be a string.`);
60
60
  }
61
61
  if (value.length > MAX_VALUE_LENGTH) {
62
- throw new InvalidCorrelationError(`Zazu metadata value for "${key}" is ${value.length} characters; the limit is ${MAX_VALUE_LENGTH}.`);
62
+ throw new InvalidCorrelationError(`Manza metadata value for "${key}" is ${value.length} characters; the limit is ${MAX_VALUE_LENGTH}.`);
63
63
  }
64
64
  }
65
65
  }
@@ -76,7 +76,7 @@ export function encodeCheckoutCorrelation(correlation) {
76
76
  'reference. Rename it to avoid losing one of the two values.');
77
77
  }
78
78
  if (correlation.reference.length > MAX_VALUE_LENGTH) {
79
- throw new InvalidCorrelationError(`Correlation reference is ${correlation.reference.length} characters; Zazu stores it ` +
79
+ throw new InvalidCorrelationError(`Correlation reference is ${correlation.reference.length} characters; Manza stores it ` +
80
80
  `as a metadata value, limited to ${MAX_VALUE_LENGTH}.`);
81
81
  }
82
82
  // One key is spent on the reference, so the caller's budget is 49.
@@ -104,7 +104,7 @@ export function decodeCheckoutCorrelation(metadata) {
104
104
  /**
105
105
  * Attach the caller's reference to a payment link's hosted URL.
106
106
  *
107
- * Zazu stores whitelisted query parameters with the payment and echoes
107
+ * Manza stores whitelisted query parameters with the payment and echoes
108
108
  * them on `payment_link.paid`, so the correlation lives on the URL rather
109
109
  * than in the create body. The customer must therefore be sent to the
110
110
  * URL this returns.
@@ -114,7 +114,7 @@ export function attachPaymentLinkCorrelation(url, correlation) {
114
114
  return url;
115
115
  assertNoMetadata('paymentLink', correlation);
116
116
  if (!url) {
117
- throw new InvalidCorrelationError('Zazu returned a payment link without a URL, so the correlation reference could ' +
117
+ throw new InvalidCorrelationError('Manza returned a payment link without a URL, so the correlation reference could ' +
118
118
  'not be attached. Refusing to return a link that would lose it.');
119
119
  }
120
120
  try {
@@ -123,7 +123,7 @@ export function attachPaymentLinkCorrelation(url, correlation) {
123
123
  return parsed.toString();
124
124
  }
125
125
  catch {
126
- throw new InvalidCorrelationError(`Zazu returned an unparseable payment link URL ("${url}"), so the correlation ` +
126
+ throw new InvalidCorrelationError(`Manza returned an unparseable payment link URL ("${url}"), so the correlation ` +
127
127
  'reference could not be attached.');
128
128
  }
129
129
  }
@@ -140,7 +140,7 @@ export function decodePaymentLinkCorrelation(clientReferenceId) {
140
140
  /**
141
141
  * Resolve the `payment_reference` to send for a transfer.
142
142
  *
143
- * Zazu echoes only `payment_reference` on `transfer.executed`, so
143
+ * Manza echoes only `payment_reference` on `transfer.executed`, so
144
144
  * correlation and the business reference compete for one field. Setting
145
145
  * both is rejected rather than silently preferring one.
146
146
  */
@@ -149,7 +149,7 @@ export function encodeTransferCorrelation(paymentReference, correlation) {
149
149
  return paymentReference;
150
150
  assertNoMetadata('transfer', correlation);
151
151
  if (paymentReference !== undefined && paymentReference !== correlation.reference) {
152
- throw new UnsupportedCorrelationError('transfer', 'Zazu echoes only `payment_reference` on transfer.executed, so `paymentReference` ' +
152
+ throw new UnsupportedCorrelationError('transfer', 'Manza echoes only `payment_reference` on transfer.executed, so `paymentReference` ' +
153
153
  'and `correlation.reference` cannot both be set. Use `correlation.reference` — ' +
154
154
  'it travels on the same field and is returned on the event.');
155
155
  }
@@ -162,15 +162,15 @@ export function decodeTransferCorrelation(paymentReference) {
162
162
  return { reference: paymentReference };
163
163
  }
164
164
  /**
165
- * Reject metadata on the flows whose channel is a single string. Zazu
165
+ * Reject metadata on the flows whose channel is a single string. Manza
166
166
  * drops unknown fields without erroring, so this must fail before the
167
167
  * request rather than at webhook time.
168
168
  */
169
169
  function assertNoMetadata(flow, correlation) {
170
170
  const metadata = correlation.metadata;
171
171
  if (metadata && Object.keys(metadata).length > 0) {
172
- const support = zazuCorrelationSupport(flow);
173
- throw new UnsupportedCorrelationError(flow, `Zazu carries this flow's correlation via ${support.channel}, which holds a single ` +
172
+ const support = manzaCorrelationSupport(flow);
173
+ throw new UnsupportedCorrelationError(flow, `Manza carries this flow's correlation via ${support.channel}, which holds a single ` +
174
174
  'value, so `correlation.metadata` cannot be round-tripped. Store the extra ' +
175
175
  'fields against `correlation.reference` in your own record instead.');
176
176
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correlation.js","sourceRoot":"","sources":["../../../src/providers/manza/correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAOzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,cAAc,CAAC;AAExD,4DAA4D;AAC5D,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,6EAA6E;AAC7E,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,yBAAyB,GAAgD;IACpF,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;IACzE,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU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IAAI,gBAAgB,KAAK,WAAW,CAAC,SAAS,EAAE,CAAC;QACjF,MAAM,IAAI,2BAA2B,CACnC,UAAU,EACV,oFAAoF;YAClF,gFAAgF;YAChF,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,SAAS,CAAC;AAC/B,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,yBAAyB,CACvC,gBAA2C;IAE3C,IAAI,OAAO,gBAAgB,KAAK,QAAQ,IAAI,gBAAgB,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACjF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,IAAqB,EAAE,WAA2B;IAC1E,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IACtC,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,IAAI,2BAA2B,CACnC,IAAI,EACJ,6CAA6C,OAAO,CAAC,OAAO,yBAAyB;YACnF,4EAA4E;YAC5E,oEAAoE,CACvE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @venturekit/billing — Manza provider barrel
3
+ *
4
+ * Re-exports the Manza adapter, HTTP client, webhook helpers, config
5
+ * resolver, and raw types so consumers can import either via the package
6
+ * barrel or the `@venturekit/billing/providers/manza` subpath (mirrors
7
+ * the `@venturekit/notify/providers/*` layout).
8
+ *
9
+ * Importing this module self-registers the provider under the name
10
+ * `'manza'` so it becomes available to `createProvider('manza', …)` and
11
+ * the env-based client helpers.
12
+ */
13
+ export { createManzaAdapter, type ManzaAdapter } from './adapter.js';
14
+ export { createManzaHttpClient, type ManzaHttpClient } from './client.js';
15
+ export { resolveManzaConfig, type ManzaConfig } from './config.js';
16
+ export { createManzaSecretsResolver, resolveSecretValue, resolveOptionalSecretValue, type ManzaSecretResolver, type ManzaSecretValue, type ManzaSecretField, type ManzaSecretsResolverOptions, } from './secrets.js';
17
+ export { verifyManzaSignature, parseManzaWebhook, handleManzaWebhook, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type HandleManzaWebhookOptions, } from './webhooks.js';
18
+ export * from './types.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/manza/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,GACjC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iCAAiC,EACjC,KAAK,yBAAyB,GAC/B,MAAM,eAAe,CAAC;AACvB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @venturekit/billing — Manza provider barrel
3
+ *
4
+ * Re-exports the Manza adapter, HTTP client, webhook helpers, config
5
+ * resolver, and raw types so consumers can import either via the package
6
+ * barrel or the `@venturekit/billing/providers/manza` subpath (mirrors
7
+ * the `@venturekit/notify/providers/*` layout).
8
+ *
9
+ * Importing this module self-registers the provider under the name
10
+ * `'manza'` so it becomes available to `createProvider('manza', …)` and
11
+ * the env-based client helpers.
12
+ */
13
+ import { registerProvider } from '../../provider.js';
14
+ import { createManzaAdapter } from './adapter.js';
15
+ registerProvider('manza', (cfg) => createManzaAdapter(cfg));
16
+ /** @deprecated The provider's former name — resolves to the same adapter. */
17
+ registerProvider('zazu', (cfg) => createManzaAdapter(cfg));
18
+ export { createManzaAdapter } from './adapter.js';
19
+ export { createManzaHttpClient } from './client.js';
20
+ export { resolveManzaConfig } from './config.js';
21
+ export { createManzaSecretsResolver, resolveSecretValue, resolveOptionalSecretValue, } from './secrets.js';
22
+ export { verifyManzaSignature, parseManzaWebhook, handleManzaWebhook, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, } from './webhooks.js';
23
+ export * from './types.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/manza/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,gBAAgB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAuC,CAAC,CAAC,CAAC;AAChG,6EAA6E;AAC7E,gBAAgB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAuC,CAAC,CAAC,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAqB,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAwB,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAoB,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,GAK3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iCAAiC,GAElC,MAAM,eAAe,CAAC;AACvB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @venturekit/billing — Manza ↔ domain mappers
3
+ *
4
+ * The single boundary between Manza's wire format (`./types.ts`) and the
5
+ * provider-agnostic domain types (`../../types.ts`). Every adapter
6
+ * method calls into here to convert a response or build a request body.
7
+ * If the Manza API changes, only this file needs updating.
8
+ */
9
+ import type { Account, AccountTransaction, CheckoutSession, CheckoutTransaction, CreateCheckoutSessionInput, CreateCustomerInput, CreateInvoiceInput, CreatePaymentLinkInput, CreateTransferInput, CreateWebhookEndpointInput, Customer, Invoice, Money, PaymentLink, Transfer, UpdateCustomerInput, UpdateWebhookEndpointInput, WebhookEndpoint, WebhookEndpointWithSecret } from '../../types.js';
10
+ import type { ManzaAccount, ManzaAccountTransaction, ManzaCheckoutSession, ManzaCreateCheckoutSessionBody, ManzaCreateCustomerBody, ManzaCreateInvoiceBody, ManzaCreatePaymentLinkBody, ManzaCreateTransferBody, ManzaCreateWebhookEndpointBody, ManzaCustomer, ManzaInvoice, ManzaPaymentLink, ManzaTransfer, ManzaUpdateWebhookEndpointBody, ManzaWebhookEndpoint, ManzaWebhookEndpointWithSecret } from './types.js';
11
+ export declare function money(amount: string, currency: string): Money;
12
+ export declare function nullToUndefined<T>(v: T | null | undefined): T | undefined;
13
+ export declare function mapCheckoutSession(raw: ManzaCheckoutSession): CheckoutSession;
14
+ export declare function mapCheckoutTransaction(raw: NonNullable<ManzaCheckoutSession['transaction']>): CheckoutTransaction;
15
+ export declare function mapCreateCheckoutSessionBody(input: CreateCheckoutSessionInput & {
16
+ accountId: string;
17
+ }): ManzaCreateCheckoutSessionBody;
18
+ export declare function mapPaymentLink(raw: ManzaPaymentLink): PaymentLink;
19
+ export declare function mapCreatePaymentLinkBody(input: CreatePaymentLinkInput & {
20
+ accountId: string;
21
+ }): ManzaCreatePaymentLinkBody;
22
+ export declare function mapCustomer(raw: ManzaCustomer): Customer;
23
+ export declare function mapInvoice(raw: ManzaInvoice): Invoice;
24
+ export declare function mapCreateInvoiceBody(input: CreateInvoiceInput): ManzaCreateInvoiceBody;
25
+ export declare function mapTransfer(raw: ManzaTransfer): Transfer;
26
+ export declare function mapCreateTransferBody(input: CreateTransferInput & {
27
+ accountId: string;
28
+ }): ManzaCreateTransferBody;
29
+ export declare function mapCreateCustomerBody(input: CreateCustomerInput | UpdateCustomerInput): ManzaCreateCustomerBody;
30
+ export declare function mapAccount(raw: ManzaAccount): Account;
31
+ export declare function mapAccountTransaction(raw: ManzaAccountTransaction): AccountTransaction;
32
+ export declare function mapWebhookEndpoint(raw: ManzaWebhookEndpoint): WebhookEndpoint;
33
+ export declare function mapWebhookEndpointWithSecret(raw: ManzaWebhookEndpointWithSecret): WebhookEndpointWithSecret;
34
+ export declare function mapCreateWebhookEndpointBody(input: CreateWebhookEndpointInput): ManzaCreateWebhookEndpointBody;
35
+ export declare function mapUpdateWebhookEndpointBody(input: UpdateWebhookEndpointInput): ManzaUpdateWebhookEndpointBody;
36
+ //# sourceMappingURL=maps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/providers/manza/maps.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EACV,OAAO,EAEP,kBAAkB,EAClB,eAAe,EAEf,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,EAC1B,QAAQ,EACR,OAAO,EAGP,KAAK,EACL,WAAW,EAGX,QAAQ,EAER,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EAEf,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EAEvB,oBAAoB,EACpB,8BAA8B,EAC9B,uBAAuB,EACvB,sBAAsB,EAGtB,0BAA0B,EAC1B,uBAAuB,EACvB,8BAA8B,EAC9B,aAAa,EACb,YAAY,EAGZ,gBAAgB,EAChB,aAAa,EACb,8BA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AE,YAAY,GAAG,OAAO,CAWrD;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,uBAAuB,GAAG,kBAAkB,CAqBtF;AAWD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,oBAAoB,GAAG,eAAe,CAY7E;AAED,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,8BAA8B,GAClC,yBAAyB,CAE3B;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,0BAA0B,GAChC,8BAA8B,CAOhC;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,0BAA0B,GAChC,8BAA8B,CAMhC"}
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @venturekit/billing — Zazu ↔ domain mappers
2
+ * @venturekit/billing — Manza ↔ domain mappers
3
3
  *
4
- * The single boundary between Zazu's wire format (`./types.ts`) and the
4
+ * The single boundary between Manza's wire format (`./types.ts`) and the
5
5
  * provider-agnostic domain types (`../../types.ts`). Every adapter
6
6
  * method calls into here to convert a response or build a request body.
7
- * If the Zazu API changes, only this file needs updating.
7
+ * If the Manza API changes, only this file needs updating.
8
8
  */
9
9
  import { encodeCheckoutCorrelation, encodeTransferCorrelation, } from './correlation.js';
10
10
  // ---------------------------------------------------------------------------
@@ -111,7 +111,7 @@ export function mapPaymentLink(raw) {
111
111
  invoiceId: nullToUndefined(raw.invoice_id),
112
112
  // `account` is absent from `payment_link.paid` payloads. Dereferencing
113
113
  // it unguarded threw a TypeError on every such delivery, which the
114
- // caller could only surface as a 500 — so Zazu retried for ~28h and
114
+ // caller could only surface as a 500 — so Manza retried for ~28h and
115
115
  // the payment was never fulfilled.
116
116
  account: raw.account
117
117
  ? {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maps.js","sourceRoot":"","sources":["../../../src/providers/manza/maps.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAsD1B,8EAA8E;AAC9E,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