@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.
- package/README.md +30 -28
- package/dist/client.d.ts +15 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -10
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/events.d.ts +51 -7
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +3 -3
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +13 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +51 -7
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +10 -1
- package/dist/provider.js.map +1 -1
- package/dist/providers/index.d.ts +2 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/{zazu → manza}/adapter.d.ts +15 -15
- package/dist/providers/manza/adapter.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/adapter.js +24 -24
- package/dist/providers/manza/adapter.js.map +1 -0
- package/dist/providers/manza/client.d.ts +76 -0
- package/dist/providers/manza/client.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/client.js +9 -9
- package/dist/providers/manza/client.js.map +1 -0
- package/dist/providers/{zazu → manza}/config.d.ts +21 -21
- package/dist/providers/manza/config.d.ts.map +1 -0
- package/dist/providers/manza/config.js +99 -0
- package/dist/providers/manza/config.js.map +1 -0
- package/dist/providers/{zazu → manza}/correlation.d.ts +7 -7
- package/dist/providers/manza/correlation.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/correlation.js +22 -22
- package/dist/providers/manza/correlation.js.map +1 -0
- package/dist/providers/manza/index.d.ts +19 -0
- package/dist/providers/manza/index.d.ts.map +1 -0
- package/dist/providers/manza/index.js +24 -0
- package/dist/providers/manza/index.js.map +1 -0
- package/dist/providers/manza/maps.d.ts +36 -0
- package/dist/providers/manza/maps.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/maps.js +4 -4
- package/dist/providers/manza/maps.js.map +1 -0
- package/dist/providers/{zazu → manza}/secrets.d.ts +15 -15
- package/dist/providers/manza/secrets.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/secrets.js +13 -13
- package/dist/providers/manza/secrets.js.map +1 -0
- package/dist/providers/{zazu → manza}/types.d.ts +65 -65
- package/dist/providers/manza/types.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/types.js +3 -3
- package/dist/providers/manza/types.js.map +1 -0
- package/dist/providers/{zazu → manza}/webhooks.d.ts +19 -19
- package/dist/providers/manza/webhooks.d.ts.map +1 -0
- package/dist/providers/{zazu → manza}/webhooks.js +57 -46
- package/dist/providers/manza/webhooks.js.map +1 -0
- package/dist/providers/mock.js +3 -3
- package/dist/providers/stripe/adapter.d.ts +28 -0
- package/dist/providers/stripe/adapter.d.ts.map +1 -0
- package/dist/providers/stripe/adapter.js +192 -0
- package/dist/providers/stripe/adapter.js.map +1 -0
- package/dist/providers/stripe/client.d.ts +26 -0
- package/dist/providers/stripe/client.d.ts.map +1 -0
- package/dist/providers/stripe/client.js +84 -0
- package/dist/providers/stripe/client.js.map +1 -0
- package/dist/providers/stripe/config.d.ts +28 -0
- package/dist/providers/stripe/config.d.ts.map +1 -0
- package/dist/providers/stripe/config.js +33 -0
- package/dist/providers/stripe/config.js.map +1 -0
- package/dist/providers/stripe/index.d.ts +13 -0
- package/dist/providers/stripe/index.d.ts.map +1 -0
- package/dist/providers/stripe/index.js +16 -0
- package/dist/providers/stripe/index.js.map +1 -0
- package/dist/providers/stripe/maps.d.ts +165 -0
- package/dist/providers/stripe/maps.d.ts.map +1 -0
- package/dist/providers/stripe/maps.js +179 -0
- package/dist/providers/stripe/maps.js.map +1 -0
- package/dist/providers/stripe/webhooks.d.ts +34 -0
- package/dist/providers/stripe/webhooks.d.ts.map +1 -0
- package/dist/providers/stripe/webhooks.js +123 -0
- package/dist/providers/stripe/webhooks.js.map +1 -0
- package/dist/providers/zazu.d.ts +9 -0
- package/dist/providers/zazu.d.ts.map +1 -0
- package/dist/providers/zazu.js +8 -0
- package/dist/providers/zazu.js.map +1 -0
- package/dist/types.d.ts +139 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/package.json +15 -7
- package/dist/providers/zazu/adapter.d.ts.map +0 -1
- package/dist/providers/zazu/adapter.js.map +0 -1
- package/dist/providers/zazu/client.d.ts +0 -76
- package/dist/providers/zazu/client.d.ts.map +0 -1
- package/dist/providers/zazu/client.js.map +0 -1
- package/dist/providers/zazu/config.d.ts.map +0 -1
- package/dist/providers/zazu/config.js +0 -90
- package/dist/providers/zazu/config.js.map +0 -1
- package/dist/providers/zazu/correlation.d.ts.map +0 -1
- package/dist/providers/zazu/correlation.js.map +0 -1
- package/dist/providers/zazu/index.d.ts +0 -19
- package/dist/providers/zazu/index.d.ts.map +0 -1
- package/dist/providers/zazu/index.js +0 -22
- package/dist/providers/zazu/index.js.map +0 -1
- package/dist/providers/zazu/maps.d.ts +0 -36
- package/dist/providers/zazu/maps.d.ts.map +0 -1
- package/dist/providers/zazu/maps.js.map +0 -1
- package/dist/providers/zazu/secrets.d.ts.map +0 -1
- package/dist/providers/zazu/secrets.js.map +0 -1
- package/dist/providers/zazu/types.d.ts.map +0 -1
- package/dist/providers/zazu/types.js.map +0 -1
- package/dist/providers/zazu/webhooks.d.ts.map +0 -1
- package/dist/providers/zazu/webhooks.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @venturekit/billing —
|
|
2
|
+
* @venturekit/billing — Manza credential resolution from AWS Secrets Manager
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Manza needs three secrets: the API key, the default account id, and the
|
|
5
5
|
* webhook signing secret. In a deployed stage all three live in ONE
|
|
6
6
|
* Secrets Manager entry holding JSON:
|
|
7
7
|
*
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
12
|
* VentureKit provisions that entry as a placeholder when a project
|
|
13
|
-
* declares a `billing` intent with `provider: '
|
|
14
|
-
* as `
|
|
13
|
+
* declares a `billing` intent with `provider: 'manza'`, and injects its ARN
|
|
14
|
+
* as `MANZA_SECRET_ARN`. A DevOps engineer populates the real values after
|
|
15
15
|
* the first deploy — the app never sees them at build time.
|
|
16
16
|
*
|
|
17
17
|
* One entry rather than three: it matches the federated-IdP precedent in
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* Reading a secret is async, but `ProviderFactory` is a synchronous
|
|
25
25
|
* contract (`createProvider` returns a `PaymentProvider`, not a promise) and
|
|
26
|
-
* `
|
|
26
|
+
* `resolveManzaConfig` is sync. Rather than make config resolution async —
|
|
27
27
|
* which would be viral all the way up through the registry — a config field
|
|
28
28
|
* may hold a **resolver function**. The adapter awaits it at the point of
|
|
29
29
|
* use and the result is cached for the lifetime of the container, so a warm
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
* `createSecretsTokenResolver` in `@venturekit/notify`.
|
|
32
32
|
*/
|
|
33
33
|
/** Lazily produces a secret value. Resolved at the point of use. */
|
|
34
|
-
export type
|
|
34
|
+
export type ManzaSecretResolver = () => Promise<string>;
|
|
35
35
|
/**
|
|
36
36
|
* A config value that is either present up front or fetched on demand.
|
|
37
37
|
* Plain strings keep local development and tests trivial.
|
|
38
38
|
*/
|
|
39
|
-
export type
|
|
40
|
-
/** Field names carried by the
|
|
41
|
-
export type
|
|
42
|
-
export interface
|
|
39
|
+
export type ManzaSecretValue = string | ManzaSecretResolver;
|
|
40
|
+
/** Field names carried by the Manza Secrets Manager entry. */
|
|
41
|
+
export type ManzaSecretField = 'apiKey' | 'accountId' | 'webhookSecret';
|
|
42
|
+
export interface ManzaSecretsResolverOptions {
|
|
43
43
|
/** ARN (or name) of the Secrets Manager entry. */
|
|
44
44
|
secretArn: string;
|
|
45
45
|
/** AWS region. Defaults to `AWS_REGION`. */
|
|
@@ -53,7 +53,7 @@ export interface ZazuSecretsResolverOptions {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Build per-field resolvers backed by a single, shared, cached read of the
|
|
56
|
-
*
|
|
56
|
+
* Manza secret.
|
|
57
57
|
*
|
|
58
58
|
* All three resolvers share one in-flight promise, so an adapter that
|
|
59
59
|
* needs the API key and the account id for the same request performs
|
|
@@ -61,17 +61,17 @@ export interface ZazuSecretsResolverOptions {
|
|
|
61
61
|
* a transient Secrets Manager error would otherwise poison the container
|
|
62
62
|
* for its whole lifetime.
|
|
63
63
|
*/
|
|
64
|
-
export declare function
|
|
64
|
+
export declare function createManzaSecretsResolver(options: ManzaSecretsResolverOptions): Record<ManzaSecretField, ManzaSecretResolver>;
|
|
65
65
|
/**
|
|
66
66
|
* Await a config value that may be a literal or a resolver.
|
|
67
67
|
*
|
|
68
|
-
* Memoising happens inside the resolver (see `
|
|
68
|
+
* Memoising happens inside the resolver (see `createManzaSecretsResolver`),
|
|
69
69
|
* so this stays a thin adapter over both shapes.
|
|
70
70
|
*/
|
|
71
|
-
export declare function resolveSecretValue(value:
|
|
71
|
+
export declare function resolveSecretValue(value: ManzaSecretValue): Promise<string>;
|
|
72
72
|
/**
|
|
73
73
|
* Await an optional config value, preserving "not configured" as
|
|
74
74
|
* `undefined` rather than collapsing it to an empty string.
|
|
75
75
|
*/
|
|
76
|
-
export declare function resolveOptionalSecretValue(value:
|
|
76
|
+
export declare function resolveOptionalSecretValue(value: ManzaSecretValue | undefined): Promise<string | undefined>;
|
|
77
77
|
//# sourceMappingURL=secrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/providers/manza/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,mBAAmB,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,CAAC;AA8BxE,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACzF;AAoBD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,2BAA2B,GAAG,MAAM,CACtF,gBAAgB,EAChB,mBAAmB,CACpB,CA6DA;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEjF;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @venturekit/billing —
|
|
2
|
+
* @venturekit/billing — Manza credential resolution from AWS Secrets Manager
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Manza needs three secrets: the API key, the default account id, and the
|
|
5
5
|
* webhook signing secret. In a deployed stage all three live in ONE
|
|
6
6
|
* Secrets Manager entry holding JSON:
|
|
7
7
|
*
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
12
|
* VentureKit provisions that entry as a placeholder when a project
|
|
13
|
-
* declares a `billing` intent with `provider: '
|
|
14
|
-
* as `
|
|
13
|
+
* declares a `billing` intent with `provider: 'manza'`, and injects its ARN
|
|
14
|
+
* as `MANZA_SECRET_ARN`. A DevOps engineer populates the real values after
|
|
15
15
|
* the first deploy — the app never sees them at build time.
|
|
16
16
|
*
|
|
17
17
|
* One entry rather than three: it matches the federated-IdP precedent in
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* Reading a secret is async, but `ProviderFactory` is a synchronous
|
|
25
25
|
* contract (`createProvider` returns a `PaymentProvider`, not a promise) and
|
|
26
|
-
* `
|
|
26
|
+
* `resolveManzaConfig` is sync. Rather than make config resolution async —
|
|
27
27
|
* which would be viral all the way up through the registry — a config field
|
|
28
28
|
* may hold a **resolver function**. The adapter awaits it at the point of
|
|
29
29
|
* use and the result is cached for the lifetime of the container, so a warm
|
|
@@ -46,11 +46,11 @@ function isUnpopulated(value) {
|
|
|
46
46
|
}
|
|
47
47
|
/** The remedy, spelled out so an operator can paste it. */
|
|
48
48
|
function populateHint(secretArn, field) {
|
|
49
|
-
return (`
|
|
49
|
+
return (`Manza secret '${field}' is not populated in ${secretArn}. ` +
|
|
50
50
|
`A DevOps engineer must set the real values after deploy:\n` +
|
|
51
51
|
` aws secretsmanager put-secret-value --secret-id ${secretArn} \\\n` +
|
|
52
52
|
` --secret-string '{"apiKey":"sk_live_…","accountId":"acc_…","webhookSecret":"whsec_…"}'\n` +
|
|
53
|
-
`For local development set
|
|
53
|
+
`For local development set MANZA_API_KEY / MANZA_ACCOUNT_ID / MANZA_WEBHOOK_SECRET instead.`);
|
|
54
54
|
}
|
|
55
55
|
/** Default implementation: one `GetSecretValue` against Secrets Manager. */
|
|
56
56
|
async function fetchFromSecretsManager(secretArn, region) {
|
|
@@ -63,7 +63,7 @@ async function fetchFromSecretsManager(secretArn, region) {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Build per-field resolvers backed by a single, shared, cached read of the
|
|
66
|
-
*
|
|
66
|
+
* Manza secret.
|
|
67
67
|
*
|
|
68
68
|
* All three resolvers share one in-flight promise, so an adapter that
|
|
69
69
|
* needs the API key and the account id for the same request performs
|
|
@@ -71,7 +71,7 @@ async function fetchFromSecretsManager(secretArn, region) {
|
|
|
71
71
|
* a transient Secrets Manager error would otherwise poison the container
|
|
72
72
|
* for its whole lifetime.
|
|
73
73
|
*/
|
|
74
|
-
export function
|
|
74
|
+
export function createManzaSecretsResolver(options) {
|
|
75
75
|
const { secretArn, region } = options;
|
|
76
76
|
const read = options.fetchSecretString ?? fetchFromSecretsManager;
|
|
77
77
|
let inFlight = null;
|
|
@@ -81,7 +81,7 @@ export function createZazuSecretsResolver(options) {
|
|
|
81
81
|
inFlight = (async () => {
|
|
82
82
|
const raw = await read(secretArn, region);
|
|
83
83
|
if (raw === undefined || raw.trim() === '') {
|
|
84
|
-
throw new MissingConfigError('
|
|
84
|
+
throw new MissingConfigError('manzaSecret', `Secrets Manager entry ${secretArn} is empty. ` +
|
|
85
85
|
`Populate it with {"apiKey","accountId","webhookSecret"}.`);
|
|
86
86
|
}
|
|
87
87
|
let parsed;
|
|
@@ -89,11 +89,11 @@ export function createZazuSecretsResolver(options) {
|
|
|
89
89
|
parsed = JSON.parse(raw);
|
|
90
90
|
}
|
|
91
91
|
catch {
|
|
92
|
-
throw new MissingConfigError('
|
|
92
|
+
throw new MissingConfigError('manzaSecret', `Secrets Manager entry ${secretArn} is not valid JSON. ` +
|
|
93
93
|
`Expected {"apiKey":"…","accountId":"…","webhookSecret":"…"}.`);
|
|
94
94
|
}
|
|
95
95
|
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
96
|
-
throw new MissingConfigError('
|
|
96
|
+
throw new MissingConfigError('manzaSecret', `Secrets Manager entry ${secretArn} must be a JSON object, ` +
|
|
97
97
|
`got ${Array.isArray(parsed) ? 'an array' : typeof parsed}.`);
|
|
98
98
|
}
|
|
99
99
|
return parsed;
|
|
@@ -126,7 +126,7 @@ export function createZazuSecretsResolver(options) {
|
|
|
126
126
|
/**
|
|
127
127
|
* Await a config value that may be a literal or a resolver.
|
|
128
128
|
*
|
|
129
|
-
* Memoising happens inside the resolver (see `
|
|
129
|
+
* Memoising happens inside the resolver (see `createManzaSecretsResolver`),
|
|
130
130
|
* so this stays a thin adapter over both shapes.
|
|
131
131
|
*/
|
|
132
132
|
export async function resolveSecretValue(value) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../src/providers/manza/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAcrD;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEzC,6EAA6E;AAC7E,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;QACnB,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,YAAY,CAAC,SAAiB,EAAE,KAAuB;IAC9D,OAAO,CACL,iBAAiB,KAAK,yBAAyB,SAAS,IAAI;QAC5D,4DAA4D;QAC5D,qDAAqD,SAAS,OAAO;QACrE,8FAA8F;QAC9F,4FAA4F,CAC7F,CAAC;AACJ,CAAC;AAeD,4EAA4E;AAC5E,KAAK,UAAU,uBAAuB,CACpC,SAAiB,EACjB,MAAe;IAEf,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAK3D,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,oBAAoB,CAAC;QAC1C,MAAM,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;KACzC,CAAC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GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAChD,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @venturekit/billing —
|
|
2
|
+
* @venturekit/billing — Manza raw API types
|
|
3
3
|
*
|
|
4
|
-
* These interfaces mirror the wire format of the
|
|
4
|
+
* These interfaces mirror the wire format of the Manza REST API exactly
|
|
5
5
|
* (see https://staging.zazu.ma/docs). They are intentionally separate
|
|
6
6
|
* from the domain types in `../../types.ts`: the `maps.ts` module is the
|
|
7
|
-
* only place that converts between the two, so a change in the
|
|
7
|
+
* only place that converts between the two, so a change in the Manza API
|
|
8
8
|
* never leaks into the rest of the application.
|
|
9
9
|
*
|
|
10
10
|
* Amounts are decimal strings (`"1500.000"`); timestamps are ISO 8601.
|
|
11
11
|
*/
|
|
12
12
|
/** Compact account projection embedded in payment links and transactions. */
|
|
13
|
-
export interface
|
|
13
|
+
export interface ManzaAccountProjection {
|
|
14
14
|
id: string;
|
|
15
15
|
name: string;
|
|
16
16
|
currency_code: string;
|
|
17
17
|
rib?: string;
|
|
18
18
|
}
|
|
19
|
-
export type
|
|
19
|
+
export type ManzaAccountStatus = 'open' | 'closed' | 'frozen';
|
|
20
20
|
/** Full account object from `GET /api/accounts`. */
|
|
21
|
-
export interface
|
|
21
|
+
export interface ManzaAccount {
|
|
22
22
|
id: string;
|
|
23
23
|
name: string;
|
|
24
|
-
status:
|
|
24
|
+
status: ManzaAccountStatus;
|
|
25
25
|
currency_code: string;
|
|
26
26
|
balance?: string;
|
|
27
27
|
rib?: string;
|
|
@@ -29,7 +29,7 @@ export interface ZazuAccount {
|
|
|
29
29
|
updated_at: string;
|
|
30
30
|
}
|
|
31
31
|
/** Ledger entry from `GET /api/accounts/:account_id/transactions`. */
|
|
32
|
-
export interface
|
|
32
|
+
export interface ManzaAccountTransaction {
|
|
33
33
|
id: string;
|
|
34
34
|
account_id: string;
|
|
35
35
|
operation: 'credit' | 'debit';
|
|
@@ -47,10 +47,10 @@ export interface ZazuAccountTransaction {
|
|
|
47
47
|
value_date?: string;
|
|
48
48
|
created_at: string;
|
|
49
49
|
updated_at: string;
|
|
50
|
-
account?:
|
|
50
|
+
account?: ManzaAccountProjection;
|
|
51
51
|
}
|
|
52
|
-
export type
|
|
53
|
-
export interface
|
|
52
|
+
export type ManzaCheckoutSessionStatus = 'open' | 'processing' | 'complete' | 'expired';
|
|
53
|
+
export interface ManzaCheckoutTransaction {
|
|
54
54
|
id: string;
|
|
55
55
|
status: string;
|
|
56
56
|
amount: string;
|
|
@@ -73,9 +73,9 @@ export interface ZazuCheckoutTransaction {
|
|
|
73
73
|
* here even though a `GET /api/checkout_sessions/:id` always returns them.
|
|
74
74
|
* See https://staging.zazu.ma/docs/webhooks.
|
|
75
75
|
*/
|
|
76
|
-
export interface
|
|
76
|
+
export interface ManzaCheckoutSession {
|
|
77
77
|
id: string;
|
|
78
|
-
status:
|
|
78
|
+
status: ManzaCheckoutSessionStatus;
|
|
79
79
|
amount: string;
|
|
80
80
|
currency_code: string;
|
|
81
81
|
/** Absent on webhook payloads. */
|
|
@@ -89,10 +89,10 @@ export interface ZazuCheckoutSession {
|
|
|
89
89
|
/** Absent on webhook payloads. */
|
|
90
90
|
expires_at?: string;
|
|
91
91
|
completed_at?: string | null;
|
|
92
|
-
transaction?:
|
|
92
|
+
transaction?: ManzaCheckoutTransaction | null;
|
|
93
93
|
created_at: string;
|
|
94
94
|
}
|
|
95
|
-
export interface
|
|
95
|
+
export interface ManzaCreateCheckoutSessionBody {
|
|
96
96
|
account_id: string;
|
|
97
97
|
amount: string;
|
|
98
98
|
success_url: string;
|
|
@@ -102,8 +102,8 @@ export interface ZazuCreateCheckoutSessionBody {
|
|
|
102
102
|
description?: string;
|
|
103
103
|
expires_at?: string;
|
|
104
104
|
}
|
|
105
|
-
export type
|
|
106
|
-
export type
|
|
105
|
+
export type ManzaPaymentLinkType = 'single' | 'multi';
|
|
106
|
+
export type ManzaPaymentLinkStatus = 'active' | 'paid' | 'expired' | 'cancelled';
|
|
107
107
|
/**
|
|
108
108
|
* A payment link as returned by the REST API **or** as projected into a
|
|
109
109
|
* `payment_link.paid` webhook. The webhook payload omits `url`,
|
|
@@ -111,11 +111,11 @@ export type ZazuPaymentLinkStatus = 'active' | 'paid' | 'expired' | 'cancelled';
|
|
|
111
111
|
* optionality from the REST resource.
|
|
112
112
|
* See https://staging.zazu.ma/docs/webhooks.
|
|
113
113
|
*/
|
|
114
|
-
export interface
|
|
114
|
+
export interface ManzaPaymentLink {
|
|
115
115
|
id: string;
|
|
116
116
|
slug: string;
|
|
117
|
-
status:
|
|
118
|
-
link_type:
|
|
117
|
+
status: ManzaPaymentLinkStatus;
|
|
118
|
+
link_type: ManzaPaymentLinkType;
|
|
119
119
|
amount: string;
|
|
120
120
|
currency_code: string;
|
|
121
121
|
/** Only present on webhook payloads. */
|
|
@@ -131,7 +131,7 @@ export interface ZazuPaymentLink {
|
|
|
131
131
|
url?: string;
|
|
132
132
|
invoice_id?: string | null;
|
|
133
133
|
/** Absent on webhook payloads. */
|
|
134
|
-
account?:
|
|
134
|
+
account?: ManzaAccountProjection;
|
|
135
135
|
client_reference_id?: string;
|
|
136
136
|
customer_email?: string;
|
|
137
137
|
customer_id?: string;
|
|
@@ -140,17 +140,17 @@ export interface ZazuPaymentLink {
|
|
|
140
140
|
/** Absent on webhook payloads. */
|
|
141
141
|
updated_at?: string;
|
|
142
142
|
}
|
|
143
|
-
export interface
|
|
143
|
+
export interface ManzaCreatePaymentLinkBody {
|
|
144
144
|
account_id: string;
|
|
145
145
|
amount: string;
|
|
146
146
|
description?: string;
|
|
147
147
|
payment_reference?: string;
|
|
148
|
-
link_type?:
|
|
148
|
+
link_type?: ManzaPaymentLinkType;
|
|
149
149
|
redirect_url?: string;
|
|
150
150
|
expires_at?: string;
|
|
151
151
|
max_payments?: number;
|
|
152
152
|
}
|
|
153
|
-
export interface
|
|
153
|
+
export interface ManzaBillingAddress {
|
|
154
154
|
street: string;
|
|
155
155
|
street2?: string;
|
|
156
156
|
city: string;
|
|
@@ -158,7 +158,7 @@ export interface ZazuBillingAddress {
|
|
|
158
158
|
country: string;
|
|
159
159
|
country_code: string;
|
|
160
160
|
}
|
|
161
|
-
export interface
|
|
161
|
+
export interface ManzaCustomer {
|
|
162
162
|
id: string;
|
|
163
163
|
customer_type: 'individual' | 'business';
|
|
164
164
|
person_name?: string;
|
|
@@ -168,12 +168,12 @@ export interface ZazuCustomer {
|
|
|
168
168
|
phone?: string;
|
|
169
169
|
tax_id?: string;
|
|
170
170
|
ice_number?: string;
|
|
171
|
-
billing_address?:
|
|
171
|
+
billing_address?: ManzaBillingAddress;
|
|
172
172
|
invoices_count?: number;
|
|
173
173
|
created_at: string;
|
|
174
174
|
updated_at: string;
|
|
175
175
|
}
|
|
176
|
-
export interface
|
|
176
|
+
export interface ManzaInvoiceItem {
|
|
177
177
|
id?: string;
|
|
178
178
|
description: string;
|
|
179
179
|
quantity: number;
|
|
@@ -182,7 +182,7 @@ export interface ZazuInvoiceItem {
|
|
|
182
182
|
amount: string;
|
|
183
183
|
position?: number;
|
|
184
184
|
}
|
|
185
|
-
export interface
|
|
185
|
+
export interface ManzaInvoiceDiscount {
|
|
186
186
|
id?: string;
|
|
187
187
|
description?: string;
|
|
188
188
|
discount_type: 'percentage' | 'fixed';
|
|
@@ -190,11 +190,11 @@ export interface ZazuInvoiceDiscount {
|
|
|
190
190
|
amount: string;
|
|
191
191
|
position?: number;
|
|
192
192
|
}
|
|
193
|
-
export type
|
|
194
|
-
export interface
|
|
193
|
+
export type ManzaInvoiceStatus = 'draft' | 'pending_approval' | 'approved' | 'sent' | 'paid' | 'overdue' | 'cancelled';
|
|
194
|
+
export interface ManzaInvoice {
|
|
195
195
|
id: string;
|
|
196
196
|
number: string;
|
|
197
|
-
status:
|
|
197
|
+
status: ManzaInvoiceStatus;
|
|
198
198
|
currency_code: string;
|
|
199
199
|
subtotal: string;
|
|
200
200
|
discount_total: string;
|
|
@@ -211,41 +211,41 @@ export interface ZazuInvoice {
|
|
|
211
211
|
credit_note?: boolean;
|
|
212
212
|
sent_at?: string;
|
|
213
213
|
paid_at?: string;
|
|
214
|
-
customer:
|
|
215
|
-
billing_address?:
|
|
216
|
-
items:
|
|
217
|
-
discounts:
|
|
214
|
+
customer: ManzaCustomer;
|
|
215
|
+
billing_address?: ManzaBillingAddress;
|
|
216
|
+
items: ManzaInvoiceItem[];
|
|
217
|
+
discounts: ManzaInvoiceDiscount[];
|
|
218
218
|
payment_link_url?: string;
|
|
219
219
|
created_at: string;
|
|
220
220
|
updated_at: string;
|
|
221
221
|
}
|
|
222
|
-
export interface
|
|
222
|
+
export interface ManzaCreateInvoiceItem {
|
|
223
223
|
description: string;
|
|
224
224
|
quantity: number;
|
|
225
225
|
unit_price: string;
|
|
226
226
|
tax_rate?: string;
|
|
227
227
|
position?: number;
|
|
228
228
|
}
|
|
229
|
-
export interface
|
|
229
|
+
export interface ManzaCreateInvoiceDiscount {
|
|
230
230
|
description?: string;
|
|
231
231
|
discount_type: 'percentage' | 'fixed';
|
|
232
232
|
value: string;
|
|
233
233
|
position?: number;
|
|
234
234
|
}
|
|
235
|
-
export interface
|
|
235
|
+
export interface ManzaCreateInvoiceBody {
|
|
236
236
|
customer_id: string;
|
|
237
237
|
issue_date: string;
|
|
238
238
|
due_date: string;
|
|
239
239
|
currency_code?: string;
|
|
240
|
-
items:
|
|
241
|
-
discounts?:
|
|
240
|
+
items: ManzaCreateInvoiceItem[];
|
|
241
|
+
discounts?: ManzaCreateInvoiceDiscount[];
|
|
242
242
|
delivery_date?: string;
|
|
243
243
|
reference?: string;
|
|
244
244
|
notes?: string;
|
|
245
245
|
payment_terms?: string;
|
|
246
246
|
send_to_email?: string;
|
|
247
247
|
}
|
|
248
|
-
export interface
|
|
248
|
+
export interface ManzaBillingAddressBody {
|
|
249
249
|
street: string;
|
|
250
250
|
street2?: string;
|
|
251
251
|
city: string;
|
|
@@ -253,7 +253,7 @@ export interface ZazuBillingAddressBody {
|
|
|
253
253
|
country: string;
|
|
254
254
|
country_code: string;
|
|
255
255
|
}
|
|
256
|
-
export interface
|
|
256
|
+
export interface ManzaCreateCustomerBody {
|
|
257
257
|
customer_type?: 'individual' | 'business';
|
|
258
258
|
person_name?: string;
|
|
259
259
|
company_name?: string;
|
|
@@ -261,12 +261,12 @@ export interface ZazuCreateCustomerBody {
|
|
|
261
261
|
phone?: string;
|
|
262
262
|
tax_id?: string;
|
|
263
263
|
ice_number?: string;
|
|
264
|
-
billing_address?:
|
|
264
|
+
billing_address?: ManzaBillingAddressBody;
|
|
265
265
|
}
|
|
266
|
-
export type
|
|
267
|
-
export interface
|
|
266
|
+
export type ManzaTransferStatus = 'requested' | 'processing' | 'completed' | 'failed';
|
|
267
|
+
export interface ManzaTransfer {
|
|
268
268
|
id: string;
|
|
269
|
-
status:
|
|
269
|
+
status: ManzaTransferStatus;
|
|
270
270
|
amount: string;
|
|
271
271
|
currency_code: string;
|
|
272
272
|
payment_reference?: string;
|
|
@@ -281,7 +281,7 @@ export interface ZazuTransfer {
|
|
|
281
281
|
created_at: string;
|
|
282
282
|
updated_at: string;
|
|
283
283
|
}
|
|
284
|
-
export interface
|
|
284
|
+
export interface ManzaCreateTransferBody {
|
|
285
285
|
account_id: string;
|
|
286
286
|
amount: string;
|
|
287
287
|
beneficiary_id?: string;
|
|
@@ -291,56 +291,56 @@ export interface ZazuCreateTransferBody {
|
|
|
291
291
|
payment_reference?: string;
|
|
292
292
|
internal_notes?: string;
|
|
293
293
|
}
|
|
294
|
-
export interface
|
|
294
|
+
export interface ManzaCursorPage<T> {
|
|
295
295
|
data: T[];
|
|
296
296
|
has_more: boolean;
|
|
297
297
|
next_cursor?: string | null;
|
|
298
298
|
}
|
|
299
|
-
export type
|
|
300
|
-
export interface
|
|
299
|
+
export type ManzaWebhookEndpointStatus = 'active' | 'disabled';
|
|
300
|
+
export interface ManzaWebhookEndpoint {
|
|
301
301
|
id: string;
|
|
302
302
|
url: string;
|
|
303
303
|
description?: string | null;
|
|
304
304
|
events: string[];
|
|
305
|
-
status:
|
|
305
|
+
status: ManzaWebhookEndpointStatus;
|
|
306
306
|
disabled_at?: string | null;
|
|
307
307
|
last_succeeded_at?: string | null;
|
|
308
308
|
created_at: string;
|
|
309
309
|
updated_at: string;
|
|
310
310
|
}
|
|
311
311
|
/** Create / regenerate_secret responses include the secret exactly once. */
|
|
312
|
-
export interface
|
|
312
|
+
export interface ManzaWebhookEndpointWithSecret extends ManzaWebhookEndpoint {
|
|
313
313
|
signing_secret: string;
|
|
314
314
|
}
|
|
315
|
-
export interface
|
|
315
|
+
export interface ManzaCreateWebhookEndpointBody {
|
|
316
316
|
url: string;
|
|
317
317
|
events: string[];
|
|
318
318
|
description?: string;
|
|
319
319
|
}
|
|
320
|
-
export interface
|
|
320
|
+
export interface ManzaUpdateWebhookEndpointBody {
|
|
321
321
|
url?: string;
|
|
322
322
|
events?: string[];
|
|
323
323
|
description?: string;
|
|
324
324
|
}
|
|
325
|
-
export interface
|
|
325
|
+
export interface ManzaTestWebhookEndpointResponse {
|
|
326
326
|
delivery_id: string;
|
|
327
327
|
status: string;
|
|
328
328
|
}
|
|
329
|
-
export interface
|
|
329
|
+
export interface ManzaWebhookHeaders {
|
|
330
330
|
'content-type'?: string;
|
|
331
331
|
'user-agent'?: string;
|
|
332
|
-
'x-
|
|
333
|
-
'x-
|
|
334
|
-
'x-
|
|
335
|
-
'x-
|
|
336
|
-
'x-
|
|
332
|
+
'x-manza-signature'?: string;
|
|
333
|
+
'x-manza-timestamp'?: string;
|
|
334
|
+
'x-manza-event'?: string;
|
|
335
|
+
'x-manza-event-id'?: string;
|
|
336
|
+
'x-manza-delivery-id'?: string;
|
|
337
337
|
}
|
|
338
|
-
export interface
|
|
338
|
+
export interface ManzaWebhookPayload {
|
|
339
339
|
event: string;
|
|
340
340
|
created_at: string;
|
|
341
341
|
data: {
|
|
342
|
-
checkout_session?:
|
|
343
|
-
payment_link?:
|
|
342
|
+
checkout_session?: ManzaCheckoutSession;
|
|
343
|
+
payment_link?: ManzaPaymentLink;
|
|
344
344
|
transfer?: {
|
|
345
345
|
id: string;
|
|
346
346
|
amount: string;
|
|
@@ -353,7 +353,7 @@ export interface ZazuWebhookPayload {
|
|
|
353
353
|
};
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
-
export interface
|
|
356
|
+
export interface ManzaErrorBody {
|
|
357
357
|
type?: string;
|
|
358
358
|
message?: string;
|
|
359
359
|
param?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/manza/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9D,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,sEAAsE;AACtE,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;I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AAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @venturekit/billing —
|
|
2
|
+
* @venturekit/billing — Manza raw API types
|
|
3
3
|
*
|
|
4
|
-
* These interfaces mirror the wire format of the
|
|
4
|
+
* These interfaces mirror the wire format of the Manza REST API exactly
|
|
5
5
|
* (see https://staging.zazu.ma/docs). They are intentionally separate
|
|
6
6
|
* from the domain types in `../../types.ts`: the `maps.ts` module is the
|
|
7
|
-
* only place that converts between the two, so a change in the
|
|
7
|
+
* only place that converts between the two, so a change in the Manza API
|
|
8
8
|
* never leaks into the rest of the application.
|
|
9
9
|
*
|
|
10
10
|
* Amounts are decimal strings (`"1500.000"`); timestamps are ISO 8601.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/providers/manza/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|