@arnaudjnn/billing-tools 0.55.0 → 0.57.0
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/dist/adapters/workos-org.d.ts +2 -0
- package/dist/adapters/workos-org.d.ts.map +1 -1
- package/dist/adapters/workos-org.js +4 -0
- package/dist/adapters/workos-org.js.map +1 -1
- package/dist/allowance.d.ts +81 -0
- package/dist/allowance.d.ts.map +1 -0
- package/dist/allowance.js +130 -0
- package/dist/allowance.js.map +1 -0
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +4 -0
- package/dist/billing.js.map +1 -1
- package/dist/doctor.d.ts +11 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +109 -0
- package/dist/doctor.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/metering.d.ts +38 -14
- package/dist/metering.d.ts.map +1 -1
- package/dist/metering.js +65 -42
- package/dist/metering.js.map +1 -1
- package/dist/plan-model.d.ts +395 -0
- package/dist/plan-model.d.ts.map +1 -0
- package/dist/plan-model.js +342 -0
- package/dist/plan-model.js.map +1 -0
- package/dist/plans.d.ts +25 -53
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +55 -34
- package/dist/plans.js.map +1 -1
- package/dist/pricing.d.ts +130 -0
- package/dist/pricing.d.ts.map +1 -0
- package/dist/pricing.js +260 -0
- package/dist/pricing.js.map +1 -0
- package/dist/sync.d.ts +3 -16
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +45 -26
- package/dist/sync.js.map +1 -1
- package/dist/tax-ids.d.ts +26 -0
- package/dist/tax-ids.d.ts.map +1 -0
- package/dist/tax-ids.js +50 -0
- package/dist/tax-ids.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/tax-id-types.d.ts +10 -0
- package/dist/ui/tax-id-types.d.ts.map +1 -0
- package/dist/ui/tax-id-types.js +140 -0
- package/dist/ui/tax-id-types.js.map +1 -0
- package/dist/usage-ledger.d.ts +87 -0
- package/dist/usage-ledger.d.ts.map +1 -0
- package/dist/usage-ledger.js +117 -0
- package/dist/usage-ledger.js.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Which allowance paid for a call. */
|
|
2
|
+
export type FundingSource =
|
|
3
|
+
/** The org-wide included window. */
|
|
4
|
+
"pool"
|
|
5
|
+
/** The caller's seat pack. */
|
|
6
|
+
| "pack"
|
|
7
|
+
/** Prepaid balance — the only one that moves money. */
|
|
8
|
+
| "wallet";
|
|
9
|
+
export interface UsageEvent {
|
|
10
|
+
orgId: string;
|
|
11
|
+
customerId: string;
|
|
12
|
+
action: string;
|
|
13
|
+
cost: number;
|
|
14
|
+
funded: FundingSource;
|
|
15
|
+
caller?: {
|
|
16
|
+
kind: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Epoch ms. Defaults to now. */
|
|
20
|
+
at?: number;
|
|
21
|
+
/** Makes a retry a no-op where the backing store supports it. */
|
|
22
|
+
idempotencyKey?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface UsageQuery {
|
|
25
|
+
orgId: string;
|
|
26
|
+
customerId: string;
|
|
27
|
+
/** Epoch ms, inclusive. */
|
|
28
|
+
start: number;
|
|
29
|
+
/** Epoch ms, exclusive. Omit for "up to now". */
|
|
30
|
+
end?: number;
|
|
31
|
+
filter?: {
|
|
32
|
+
callerKind?: string;
|
|
33
|
+
callerId?: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface UsageLedger {
|
|
37
|
+
record(event: UsageEvent): Promise<void>;
|
|
38
|
+
/** Summed cost in [start, end). */
|
|
39
|
+
total(query: UsageQuery): Promise<number>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The ledger this library has always had: the debits themselves.
|
|
43
|
+
*
|
|
44
|
+
* `record` is a no-op — `deductTokens` already wrote the row — and `total` is
|
|
45
|
+
* `usageSince`. Correct and free for any plan where every call is wallet-funded,
|
|
46
|
+
* which is every plan that existed before included windows, so it stays the
|
|
47
|
+
* default. It cannot see pool- or pack-funded usage, because that usage moves no
|
|
48
|
+
* money and therefore writes no transaction: a plan with an included window
|
|
49
|
+
* needs the meter ledger below.
|
|
50
|
+
*/
|
|
51
|
+
export declare function stripeBalanceUsageLedger(): UsageLedger;
|
|
52
|
+
/** Default name of the Stripe Billing Meter events are reported to. */
|
|
53
|
+
export declare const USAGE_METER_EVENT = "billing_tools_usage";
|
|
54
|
+
/**
|
|
55
|
+
* Stripe Billing Meters: purpose-built usage counting, aggregated server-side.
|
|
56
|
+
*
|
|
57
|
+
* Chosen over reading balance transactions for two reasons beyond the money/usage
|
|
58
|
+
* split. It is idempotent by construction (`identifier`), and a summary is ONE
|
|
59
|
+
* call for any window — `usageSince` walks pages newest-first until it passes the
|
|
60
|
+
* start, so an annual window would page through a year of transactions on the hot
|
|
61
|
+
* path of every metered execution.
|
|
62
|
+
*
|
|
63
|
+
* The trade: summaries lag aggregation by a few seconds, so a hard cap can
|
|
64
|
+
* overshoot slightly. Irrelevant against a pool of a million tokens; it is why
|
|
65
|
+
* seat packs, which are small, can keep using the exact balance path.
|
|
66
|
+
*
|
|
67
|
+
* `ensureMeters` provisions the meter, in the same spirit as `ensurePlans`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function stripeMeterUsageLedger(opts?: {
|
|
70
|
+
eventName?: string;
|
|
71
|
+
}): UsageLedger;
|
|
72
|
+
/**
|
|
73
|
+
* Create the usage meter if it doesn't exist. Idempotent, like `ensurePlans`.
|
|
74
|
+
*
|
|
75
|
+
* Only needed by a config with an included window; a wallet-only product never
|
|
76
|
+
* calls it. Aggregates `sum` over the reported `value`, which is the token cost.
|
|
77
|
+
*/
|
|
78
|
+
export declare function ensureMeters(opts?: {
|
|
79
|
+
eventName?: string;
|
|
80
|
+
displayName?: string;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
meterId: string;
|
|
83
|
+
created: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
/** Forget resolved meter ids — for a test, or after archiving one. */
|
|
86
|
+
export declare function invalidateMeters(): void;
|
|
87
|
+
//# sourceMappingURL=usage-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-ledger.d.ts","sourceRoot":"","sources":["../src/usage-ledger.ts"],"names":[],"mappings":"AAmBA,uCAAuC;AACvC,MAAM,MAAM,aAAa;AACvB,oCAAoC;AAClC,MAAM;AACR,8BAA8B;GAC5B,MAAM;AACR,uDAAuD;GACrD,QAAQ,CAAC;AAEb,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,iCAAiC;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,mCAAmC;IACnC,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAQtD;AAED,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAChC,WAAW,CAoCb;AAmBD;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAahD;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { getStripe, usageSince } from "./billing.js";
|
|
2
|
+
/**
|
|
3
|
+
* The ledger this library has always had: the debits themselves.
|
|
4
|
+
*
|
|
5
|
+
* `record` is a no-op — `deductTokens` already wrote the row — and `total` is
|
|
6
|
+
* `usageSince`. Correct and free for any plan where every call is wallet-funded,
|
|
7
|
+
* which is every plan that existed before included windows, so it stays the
|
|
8
|
+
* default. It cannot see pool- or pack-funded usage, because that usage moves no
|
|
9
|
+
* money and therefore writes no transaction: a plan with an included window
|
|
10
|
+
* needs the meter ledger below.
|
|
11
|
+
*/
|
|
12
|
+
export function stripeBalanceUsageLedger() {
|
|
13
|
+
return {
|
|
14
|
+
async record() {
|
|
15
|
+
/* the balance transaction IS the record */
|
|
16
|
+
},
|
|
17
|
+
// `start` is epoch ms throughout this seam; Stripe's `created` is seconds.
|
|
18
|
+
total: (q) => usageSince(q.customerId, Math.floor(q.start / 1000), q.filter),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Default name of the Stripe Billing Meter events are reported to. */
|
|
22
|
+
export const USAGE_METER_EVENT = "billing_tools_usage";
|
|
23
|
+
/**
|
|
24
|
+
* Stripe Billing Meters: purpose-built usage counting, aggregated server-side.
|
|
25
|
+
*
|
|
26
|
+
* Chosen over reading balance transactions for two reasons beyond the money/usage
|
|
27
|
+
* split. It is idempotent by construction (`identifier`), and a summary is ONE
|
|
28
|
+
* call for any window — `usageSince` walks pages newest-first until it passes the
|
|
29
|
+
* start, so an annual window would page through a year of transactions on the hot
|
|
30
|
+
* path of every metered execution.
|
|
31
|
+
*
|
|
32
|
+
* The trade: summaries lag aggregation by a few seconds, so a hard cap can
|
|
33
|
+
* overshoot slightly. Irrelevant against a pool of a million tokens; it is why
|
|
34
|
+
* seat packs, which are small, can keep using the exact balance path.
|
|
35
|
+
*
|
|
36
|
+
* `ensureMeters` provisions the meter, in the same spirit as `ensurePlans`.
|
|
37
|
+
*/
|
|
38
|
+
export function stripeMeterUsageLedger(opts = {}) {
|
|
39
|
+
const eventName = opts.eventName ?? USAGE_METER_EVENT;
|
|
40
|
+
return {
|
|
41
|
+
async record(e) {
|
|
42
|
+
await getStripe().billing.meterEvents.create({
|
|
43
|
+
event_name: eventName,
|
|
44
|
+
payload: {
|
|
45
|
+
// Stripe requires the customer on the payload; everything else is ours.
|
|
46
|
+
stripe_customer_id: e.customerId,
|
|
47
|
+
value: String(e.cost),
|
|
48
|
+
action: e.action,
|
|
49
|
+
funded: e.funded,
|
|
50
|
+
...(e.caller?.kind ? { caller_kind: e.caller.kind } : {}),
|
|
51
|
+
...(e.caller?.id ? { caller_id: e.caller.id } : {}),
|
|
52
|
+
},
|
|
53
|
+
...(e.idempotencyKey ? { identifier: e.idempotencyKey } : {}),
|
|
54
|
+
...(e.at ? { timestamp: Math.floor(e.at / 1000) } : {}),
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
async total(q) {
|
|
58
|
+
const meter = await meterIdFor(eventName);
|
|
59
|
+
if (!meter)
|
|
60
|
+
return 0;
|
|
61
|
+
// Seconds, and Stripe requires the window to sit on minute boundaries.
|
|
62
|
+
const floorMinute = (ms) => Math.floor(ms / 60_000) * 60;
|
|
63
|
+
const summaries = await getStripe().billing.meters.listEventSummaries(meter, {
|
|
64
|
+
customer: q.customerId,
|
|
65
|
+
start_time: floorMinute(q.start),
|
|
66
|
+
end_time: floorMinute(q.end ?? Date.now()),
|
|
67
|
+
limit: 100,
|
|
68
|
+
});
|
|
69
|
+
// A meter aggregates one dimension, so a per-caller filter can't be pushed
|
|
70
|
+
// down. Callers that need it use the balance ledger (seat packs), which is
|
|
71
|
+
// exact anyway — see the note above.
|
|
72
|
+
return summaries.data.reduce((sum, s) => sum + s.aggregated_value, 0);
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Meter ids are stable per event name; resolving one is a list call, so memoise
|
|
77
|
+
// it per process the way plan prices are.
|
|
78
|
+
const meterIds = new Map();
|
|
79
|
+
async function meterIdFor(eventName) {
|
|
80
|
+
const hit = meterIds.get(eventName);
|
|
81
|
+
if (hit !== undefined)
|
|
82
|
+
return hit;
|
|
83
|
+
for await (const m of getStripe().billing.meters.list({ status: "active", limit: 100 })) {
|
|
84
|
+
if (m.event_name === eventName) {
|
|
85
|
+
meterIds.set(eventName, m.id);
|
|
86
|
+
return m.id;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
meterIds.set(eventName, null);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Create the usage meter if it doesn't exist. Idempotent, like `ensurePlans`.
|
|
94
|
+
*
|
|
95
|
+
* Only needed by a config with an included window; a wallet-only product never
|
|
96
|
+
* calls it. Aggregates `sum` over the reported `value`, which is the token cost.
|
|
97
|
+
*/
|
|
98
|
+
export async function ensureMeters(opts = {}) {
|
|
99
|
+
const eventName = opts.eventName ?? USAGE_METER_EVENT;
|
|
100
|
+
const existing = await meterIdFor(eventName);
|
|
101
|
+
if (existing)
|
|
102
|
+
return { meterId: existing, created: false };
|
|
103
|
+
const meter = await getStripe().billing.meters.create({
|
|
104
|
+
display_name: opts.displayName ?? "billing-tools usage",
|
|
105
|
+
event_name: eventName,
|
|
106
|
+
default_aggregation: { formula: "sum" },
|
|
107
|
+
customer_mapping: { type: "by_id", event_payload_key: "stripe_customer_id" },
|
|
108
|
+
value_settings: { event_payload_key: "value" },
|
|
109
|
+
});
|
|
110
|
+
meterIds.set(eventName, meter.id);
|
|
111
|
+
return { meterId: meter.id, created: true };
|
|
112
|
+
}
|
|
113
|
+
/** Forget resolved meter ids — for a test, or after archiving one. */
|
|
114
|
+
export function invalidateMeters() {
|
|
115
|
+
meterIds.clear();
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=usage-ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-ledger.js","sourceRoot":"","sources":["../src/usage-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAyDrD;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,KAAK,CAAC,MAAM;YACV,2CAA2C;QAC7C,CAAC;QACD,2EAA2E;QAC3E,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;KAC7E,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB,CACpC,O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AAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAqD,EAAE;IAEvD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;IAC7C,IAAI,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC3D,MAAM,KAAK,GAAG,MAAM,SAAS,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACpD,YAAY,EAAE,IAAI,CAAC,WAAW,IAAI,qBAAqB;QACvD,UAAU,EAAE,SAAS;QACrB,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;QACvC,gBAAgB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;QAC5E,cAAc,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE;KAC/C,CAAC,CAAC;IACH,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IAClC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,gBAAgB;IAC9B,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arnaudjnn/billing-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "The get-paid engine for Stripe + WorkOS apps, for humans and AI agents. Drop-in API-key auth, token/credit + subscription billing, auth.md agent registration, and MPP machine payments, as MCP tools, a REST API, and a CLI. Framework-agnostic, storage-pluggable.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Arnaud Jeannin",
|
|
@@ -59,6 +59,11 @@
|
|
|
59
59
|
"types": "./dist/dev/stripe-cli.d.ts",
|
|
60
60
|
"import": "./dist/dev/stripe-cli.js",
|
|
61
61
|
"default": "./dist/dev/stripe-cli.js"
|
|
62
|
+
},
|
|
63
|
+
"./pricing": {
|
|
64
|
+
"types": "./dist/pricing.d.ts",
|
|
65
|
+
"import": "./dist/pricing.js",
|
|
66
|
+
"default": "./dist/pricing.js"
|
|
62
67
|
}
|
|
63
68
|
},
|
|
64
69
|
"files": [
|