@ultimabase/stripe 0.0.0-first.0 → 0.0.0-stage
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 +2 -6
- package/package.json +3 -48
- package/dist/accounts.d.ts +0 -9
- package/dist/accounts.d.ts.map +0 -1
- package/dist/accounts.js +0 -20
- package/dist/apply.d.ts +0 -26
- package/dist/apply.d.ts.map +0 -1
- package/dist/apply.js +0 -73
- package/dist/audit.d.ts +0 -3
- package/dist/audit.d.ts.map +0 -1
- package/dist/audit.js +0 -123
- package/dist/billing-gateway.d.ts +0 -158
- package/dist/billing-gateway.d.ts.map +0 -1
- package/dist/billing-gateway.js +0 -23
- package/dist/billing.d.ts +0 -130
- package/dist/billing.d.ts.map +0 -1
- package/dist/billing.js +0 -128
- package/dist/calls.d.ts +0 -61
- package/dist/calls.d.ts.map +0 -1
- package/dist/calls.js +0 -172
- package/dist/catalog.d.ts +0 -54
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js +0 -182
- package/dist/credit.d.ts +0 -16
- package/dist/credit.d.ts.map +0 -1
- package/dist/credit.js +0 -18
- package/dist/credits.d.ts +0 -38
- package/dist/credits.d.ts.map +0 -1
- package/dist/credits.js +0 -138
- package/dist/customer.d.ts +0 -25
- package/dist/customer.d.ts.map +0 -1
- package/dist/customer.js +0 -88
- package/dist/describe.d.ts +0 -4
- package/dist/describe.d.ts.map +0 -1
- package/dist/describe.js +0 -56
- package/dist/duplicates.d.ts +0 -12
- package/dist/duplicates.d.ts.map +0 -1
- package/dist/duplicates.js +0 -24
- package/dist/fake-billing.d.ts +0 -72
- package/dist/fake-billing.d.ts.map +0 -1
- package/dist/fake-billing.js +0 -290
- package/dist/gateway.d.ts +0 -108
- package/dist/gateway.d.ts.map +0 -1
- package/dist/gateway.js +0 -196
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -6
- package/dist/job-input.d.ts +0 -6
- package/dist/job-input.d.ts.map +0 -1
- package/dist/job-input.js +0 -20
- package/dist/jobs.d.ts +0 -16
- package/dist/jobs.d.ts.map +0 -1
- package/dist/jobs.js +0 -189
- package/dist/keys.d.ts +0 -10
- package/dist/keys.d.ts.map +0 -1
- package/dist/keys.js +0 -30
- package/dist/kinds.d.ts +0 -11
- package/dist/kinds.d.ts.map +0 -1
- package/dist/kinds.js +0 -4
- package/dist/models.d.ts +0 -71
- package/dist/models.d.ts.map +0 -1
- package/dist/models.js +0 -41
- package/dist/plugin.d.ts +0 -41
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -229
- package/dist/portal.d.ts +0 -23
- package/dist/portal.d.ts.map +0 -1
- package/dist/portal.js +0 -66
- package/dist/product.d.ts +0 -57
- package/dist/product.d.ts.map +0 -1
- package/dist/product.js +0 -113
- package/dist/running.d.ts +0 -61
- package/dist/running.d.ts.map +0 -1
- package/dist/running.js +0 -35
- package/dist/sdk-billing.d.ts +0 -8
- package/dist/sdk-billing.d.ts.map +0 -1
- package/dist/sdk-billing.js +0 -200
- package/dist/sdk-common.d.ts +0 -13
- package/dist/sdk-common.d.ts.map +0 -1
- package/dist/sdk-common.js +0 -41
- package/dist/sdk-customer.d.ts +0 -9
- package/dist/sdk-customer.d.ts.map +0 -1
- package/dist/sdk-customer.js +0 -149
- package/dist/sdk-invoices.d.ts +0 -10
- package/dist/sdk-invoices.d.ts.map +0 -1
- package/dist/sdk-invoices.js +0 -53
- package/dist/sdk-recovery.d.ts +0 -5
- package/dist/sdk-recovery.d.ts.map +0 -1
- package/dist/sdk-recovery.js +0 -81
- package/dist/sync.d.ts +0 -8
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js +0 -196
- package/dist/testing.d.ts +0 -24
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -100
- package/dist/webhook.d.ts +0 -4
- package/dist/webhook.d.ts.map +0 -1
- package/dist/webhook.js +0 -73
- package/src/accounts.ts +0 -30
- package/src/apply.ts +0 -99
- package/src/audit.ts +0 -171
- package/src/billing-gateway.ts +0 -188
- package/src/billing.ts +0 -361
- package/src/calls.ts +0 -280
- package/src/catalog.ts +0 -327
- package/src/credit.ts +0 -36
- package/src/credits.ts +0 -206
- package/src/customer.ts +0 -113
- package/src/describe.ts +0 -76
- package/src/duplicates.ts +0 -45
- package/src/fake-billing.ts +0 -388
- package/src/gateway.ts +0 -333
- package/src/index.ts +0 -35
- package/src/job-input.ts +0 -24
- package/src/jobs.ts +0 -230
- package/src/keys.ts +0 -40
- package/src/kinds.ts +0 -15
- package/src/models.ts +0 -107
- package/src/plugin.ts +0 -307
- package/src/portal.ts +0 -95
- package/src/product.ts +0 -203
- package/src/running.ts +0 -104
- package/src/sdk-billing.ts +0 -220
- package/src/sdk-common.ts +0 -57
- package/src/sdk-customer.ts +0 -203
- package/src/sdk-invoices.ts +0 -81
- package/src/sdk-recovery.ts +0 -93
- package/src/sync.ts +0 -246
- package/src/testing.ts +0 -135
- package/src/webhook.ts +0 -100
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type { StripeCatalogOptions } from './apply.ts';
|
|
2
|
-
export { applyStripeCatalog } from './apply.ts';
|
|
3
|
-
export type { BalanceFields, CreditHistoryFields, PurchaseFields, SubscriptionFields, WithStripe, } from './billing.ts';
|
|
4
|
-
export { defineBalance, defineCreditHistory, definePurchase, defineSubscription, } from './billing.ts';
|
|
5
|
-
export type { CustomerProfile } from './billing-gateway.ts';
|
|
6
|
-
export type { CheckoutArgs, PortalArgs } from './calls.ts';
|
|
7
|
-
export { stripe } from './calls.ts';
|
|
8
|
-
export type { Credit, CreditAmount } from './credit.ts';
|
|
9
|
-
export { defineCredit } from './credit.ts';
|
|
10
|
-
export type { Stripe, StripeOptions } from './plugin.ts';
|
|
11
|
-
export { stripePlugin } from './plugin.ts';
|
|
12
|
-
export type { PortalOptions } from './portal.ts';
|
|
13
|
-
export type { Every, OneTimePrice, OneTimeProduct, Product, RecurringPrice, SubscriptionProduct, } from './product.ts';
|
|
14
|
-
export { defineProduct } from './product.ts';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,UAAU,GACV,MAAM,cAAc,CAAA;AACrB,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,kBAAkB,GAClB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,YAAY,EACX,KAAK,EACL,YAAY,EACZ,cAAc,EACd,OAAO,EACP,cAAc,EACd,mBAAmB,GACnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { applyStripeCatalog } from './apply.js';
|
|
2
|
-
export { defineBalance, defineCreditHistory, definePurchase, defineSubscription, } from './billing.js';
|
|
3
|
-
export { stripe } from './calls.js';
|
|
4
|
-
export { defineCredit } from './credit.js';
|
|
5
|
-
export { stripePlugin } from './plugin.js';
|
|
6
|
-
export { defineProduct } from './product.js';
|
package/dist/job-input.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { StandardSchema } from '@ultimabase/jobs';
|
|
2
|
-
/** A job's input: an object of the strings `keys` names. */
|
|
3
|
-
export declare function strings<const K extends string>(...keys: K[]): StandardSchema<{
|
|
4
|
-
readonly [P in K]: string;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=job-input.d.ts.map
|
package/dist/job-input.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-input.d.ts","sourceRoot":"","sources":["../src/job-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,4DAA4D;AAC5D,wBAAgB,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAC7C,GAAG,IAAI,EAAE,CAAC,EAAE,GACV,cAAc,CAAC;IAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,MAAM;CAAE,CAAC,CAiB/C"}
|
package/dist/job-input.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** A job's input: an object of the strings `keys` names. */
|
|
2
|
-
export function strings(...keys) {
|
|
3
|
-
const message = `An object of strings: ${keys.join(', ')}.`;
|
|
4
|
-
return {
|
|
5
|
-
'~standard': {
|
|
6
|
-
version: 1,
|
|
7
|
-
vendor: 'ultimabase-stripe',
|
|
8
|
-
validate: (value) => {
|
|
9
|
-
const read = {};
|
|
10
|
-
for (const key of keys) {
|
|
11
|
-
const field = Reflect.get(Object(value), key);
|
|
12
|
-
if (typeof field !== 'string')
|
|
13
|
-
return { issues: [{ message }] };
|
|
14
|
-
read[key] = field;
|
|
15
|
-
}
|
|
16
|
-
return { value: read };
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
package/dist/jobs.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Job, RecurringJob } from '@ultimabase/jobs';
|
|
2
|
-
/** Syncs the customer a stored event is about, then marks it processed. */
|
|
3
|
-
export declare const eventJob: Job<'stripe.event', {
|
|
4
|
-
readonly event: string;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* Closes the customer of a deleted payer: Stripe deletes it, which ends its
|
|
8
|
-
* subscriptions, and its row goes. A payer still there keeps it.
|
|
9
|
-
*/
|
|
10
|
-
export declare const closeJob: Job<'stripe.close', {
|
|
11
|
-
readonly model: string;
|
|
12
|
-
readonly payer: string;
|
|
13
|
-
}>;
|
|
14
|
-
/** The jobs the plugin adds (D-369). */
|
|
15
|
-
export declare const stripeJobs: readonly (Job<string, never> | RecurringJob<string>)[];
|
|
16
|
-
//# sourceMappingURL=jobs.d.ts.map
|
package/dist/jobs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAgCzD,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,EAAE,GAAG,CAAC,cAAc,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA0BlE,CAAA;AAuBH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,GAAG,CACzB,cAAc,EACd;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAsBjD,CAAA;AAgHF,wCAAwC;AACxC,eAAO,MAAM,UAAU,EAAE,SAAS,CACjC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CACzC,EAAwE,CAAA"}
|
package/dist/jobs.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { defineJob } from '@ultimabase/jobs';
|
|
2
|
-
import { auditJob } from './audit.js';
|
|
3
|
-
import { locked } from './customer.js';
|
|
4
|
-
import { strings } from './job-input.js';
|
|
5
|
-
import { duplicateJob } from './duplicates.js';
|
|
6
|
-
import { M, StripeCustomer, StripeEvent, StripeScan } from './models.js';
|
|
7
|
-
import { runningOf, stripeOf } from './running.js';
|
|
8
|
-
import { syncCustomer } from './sync.js';
|
|
9
|
-
const minute = 60 * 1000;
|
|
10
|
-
const hour = 60 * minute;
|
|
11
|
-
/**
|
|
12
|
-
* How long a processed event stays: longer than Stripe retries a delivery
|
|
13
|
-
* (3 days), so a late one is still stored once.
|
|
14
|
-
*/
|
|
15
|
-
const keepEvents = 90 * 24 * hour;
|
|
16
|
-
/** The customers the reconciliation reads at once. */
|
|
17
|
-
const page = 500;
|
|
18
|
-
/** The events a first scan reads back. */
|
|
19
|
-
const firstScan = 24 * hour;
|
|
20
|
-
/** How far a scan reads again before the last one's end: Stripe lists late. */
|
|
21
|
-
const overlap = 10 * minute;
|
|
22
|
-
/**
|
|
23
|
-
* A sync that began this long after a customer's last event read it: the
|
|
24
|
-
* margin covers the clocks' gap.
|
|
25
|
-
*/
|
|
26
|
-
const margin = minute;
|
|
27
|
-
/** Syncs the customer a stored event is about, then marks it processed. */
|
|
28
|
-
export const eventJob = defineJob({
|
|
29
|
-
name: 'stripe.event',
|
|
30
|
-
input: strings('event'),
|
|
31
|
-
key: ({ event }) => event,
|
|
32
|
-
run: async ({ input }) => {
|
|
33
|
-
const event = await StripeEvent.findUnique({ where: { id: input.event } }, M);
|
|
34
|
-
if (event === null || event.processedAt !== null)
|
|
35
|
-
return;
|
|
36
|
-
const { gateway } = stripeOf('stripe.event');
|
|
37
|
-
const customerId = await gateway.customerOf(event.objectType, event.objectId);
|
|
38
|
-
const where = { stripeId: customerId };
|
|
39
|
-
const row = customerId === null
|
|
40
|
-
? null
|
|
41
|
-
: await StripeCustomer.findUnique({ where }, M);
|
|
42
|
-
// Synced here: the event stays waiting, so retried, until it is.
|
|
43
|
-
if (row !== null)
|
|
44
|
-
await syncCustomer(row.id);
|
|
45
|
-
const data = { processedAt: new Date() };
|
|
46
|
-
await StripeEvent.update({ where: { id: event.id }, data }, M);
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
/** Syncs one customer, which the reconciliation found stale. */
|
|
50
|
-
const syncJob = defineJob({
|
|
51
|
-
name: 'stripe.sync',
|
|
52
|
-
input: strings('customer'),
|
|
53
|
-
key: ({ customer }) => customer,
|
|
54
|
-
run: async ({ input }) => {
|
|
55
|
-
await syncCustomer(input.customer);
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
/** The queries of each payer model, by name. */
|
|
59
|
-
const payersOf = (running) => new Map([running.subscription, running.purchase, running.balance].flatMap((billing) => billing === undefined
|
|
60
|
-
? []
|
|
61
|
-
: [[billing.payer.name, billing.payer.queries]]));
|
|
62
|
-
/**
|
|
63
|
-
* Closes the customer of a deleted payer: Stripe deletes it, which ends its
|
|
64
|
-
* subscriptions, and its row goes. A payer still there keeps it.
|
|
65
|
-
*/
|
|
66
|
-
export const closeJob = defineJob({
|
|
67
|
-
name: 'stripe.close',
|
|
68
|
-
input: strings('model', 'payer'),
|
|
69
|
-
key: ({ model, payer }) => `${model}:${payer}`,
|
|
70
|
-
run: async ({ input, logger }) => {
|
|
71
|
-
const running = runningOf('stripe.close');
|
|
72
|
-
const { gateway } = stripeOf('stripe.close');
|
|
73
|
-
const payers = payersOf(running).get(input.model);
|
|
74
|
-
if (payers === undefined) {
|
|
75
|
-
logger.warn(input, 'No billing model names this payer model.');
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const where = { id: input.payer };
|
|
79
|
-
if ((await payers.findUnique({ where }, M)) !== null)
|
|
80
|
-
return;
|
|
81
|
-
const held = await StripeCustomer.findUnique({ where: input }, M);
|
|
82
|
-
if (held === null)
|
|
83
|
-
return;
|
|
84
|
-
await locked(held.id, async (row) => {
|
|
85
|
-
if (row.stripeId !== null)
|
|
86
|
-
await gateway.deleteCustomer(row.stripeId);
|
|
87
|
-
await StripeCustomer.delete({ where: { id: row.id } }, M);
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
/** Whether a customer's payer is gone, by its model's queries. */
|
|
92
|
-
async function goneOf(running, rows) {
|
|
93
|
-
const payers = payersOf(running);
|
|
94
|
-
const gone = new Set();
|
|
95
|
-
for (const [model, held] of Map.groupBy(rows, (row) => row.model)) {
|
|
96
|
-
const queries = payers.get(model);
|
|
97
|
-
if (queries === undefined)
|
|
98
|
-
continue;
|
|
99
|
-
const ids = held.map(({ payer }) => payer);
|
|
100
|
-
const args = { where: { id: { in: ids } }, select: { id: true } };
|
|
101
|
-
const found = new Set((await queries.findMany(args, M)).map((r) => r.id));
|
|
102
|
-
for (const row of held)
|
|
103
|
-
if (!found.has(row.payer))
|
|
104
|
-
gone.add(row.id);
|
|
105
|
-
}
|
|
106
|
-
return gone;
|
|
107
|
-
}
|
|
108
|
-
/** Whether the customer needs a sync: its period ended since the last one. */
|
|
109
|
-
const stale = (row, now) => row.stripeId !== null &&
|
|
110
|
-
row.renewsAt !== null &&
|
|
111
|
-
row.renewsAt.getTime() <= now;
|
|
112
|
-
/**
|
|
113
|
-
* Closes the customers of deleted payers, and syncs those whose period
|
|
114
|
-
* ended: a renewal whose events were lost. Pages by id from a cursor; a
|
|
115
|
-
* cursor row deleted meanwhile ends the scan, and the next hour reads on.
|
|
116
|
-
*/
|
|
117
|
-
async function scanCustomers(running, now) {
|
|
118
|
-
const gone = [];
|
|
119
|
-
for (let cursor;;) {
|
|
120
|
-
const rows = await StripeCustomer.findMany({
|
|
121
|
-
orderBy: { id: 'asc' },
|
|
122
|
-
take: page,
|
|
123
|
-
...(cursor === undefined ? {} : { cursor: { id: cursor }, skip: 1 }),
|
|
124
|
-
}, M);
|
|
125
|
-
const goneIds = await goneOf(running, rows);
|
|
126
|
-
for (const row of rows) {
|
|
127
|
-
if (goneIds.has(row.id))
|
|
128
|
-
gone.push(row);
|
|
129
|
-
else if (stale(row, now))
|
|
130
|
-
await syncJob.enqueue({ customer: row.id });
|
|
131
|
-
}
|
|
132
|
-
cursor = rows.at(-1)?.id;
|
|
133
|
-
if (rows.length < page)
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
// Closed once the scan ends, so that no close deletes its cursor row.
|
|
137
|
-
for (const { model, payer } of gone)
|
|
138
|
-
await closeJob.enqueue({ model, payer });
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Syncs the customers Stripe's events changed since the last scan and that
|
|
142
|
-
* no sync read since: what a lost webhook missed (D-375). Its cost follows
|
|
143
|
-
* the account's activity, not its number of customers.
|
|
144
|
-
*/
|
|
145
|
-
async function scanEvents(gateway, now) {
|
|
146
|
-
const where = { name: 'events' };
|
|
147
|
-
const last = await StripeScan.findUnique({ where }, M);
|
|
148
|
-
const since = (last?.until.getTime() ?? now - firstScan) - overlap;
|
|
149
|
-
const changed = await gateway.changedSince(new Date(since));
|
|
150
|
-
const ids = [...changed.keys()];
|
|
151
|
-
for (let at = 0; at < ids.length; at += page) {
|
|
152
|
-
const stripeId = { in: ids.slice(at, at + page) };
|
|
153
|
-
const rows = await StripeCustomer.findMany({ where: { stripeId } }, M);
|
|
154
|
-
for (const row of rows) {
|
|
155
|
-
const event = changed.get(row.stripeId ?? '')?.getTime() ?? now;
|
|
156
|
-
if (row.syncedAt === null || row.syncedAt.getTime() < event + margin) {
|
|
157
|
-
await syncJob.enqueue({ customer: row.id });
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
const until = new Date(now);
|
|
162
|
-
await StripeScan.upsert({ where, create: { ...where, until }, update: { until } }, M);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Every hour: closes the customers of deleted payers, syncs those past a
|
|
166
|
-
* renewal, enqueues the events still waiting, deletes the old processed
|
|
167
|
-
* ones, then syncs the customers whose events were lost.
|
|
168
|
-
*/
|
|
169
|
-
async function reconcile() {
|
|
170
|
-
const running = runningOf('stripe.reconcile');
|
|
171
|
-
if (running.stripe === undefined)
|
|
172
|
-
return;
|
|
173
|
-
const now = Date.now();
|
|
174
|
-
await scanCustomers(running, now);
|
|
175
|
-
const waiting = await StripeEvent.findMany({ where: { processedAt: null }, select: { id: true } }, M);
|
|
176
|
-
for (const { id } of waiting)
|
|
177
|
-
await eventJob.enqueue({ event: id });
|
|
178
|
-
const old = new Date(now - keepEvents);
|
|
179
|
-
await StripeEvent.deleteMany({ where: { processedAt: { lt: old } } }, M);
|
|
180
|
-
// Last, so that an unreachable Stripe leaves the rest done.
|
|
181
|
-
await scanEvents(running.stripe.gateway, now);
|
|
182
|
-
}
|
|
183
|
-
const reconcileJob = defineJob({
|
|
184
|
-
name: 'stripe.reconcile',
|
|
185
|
-
every: hour,
|
|
186
|
-
run: reconcile,
|
|
187
|
-
});
|
|
188
|
-
/** The jobs the plugin adds (D-369). */
|
|
189
|
-
export const stripeJobs = [eventJob, syncJob, closeJob, duplicateJob, reconcileJob, auditJob];
|
package/dist/keys.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Where a message points: `defineProduct(pro)`, or the entry alone. */
|
|
2
|
-
export declare const whereOf: (entry: string, definition: object) => string;
|
|
3
|
-
/**
|
|
4
|
-
* Refuses a definition that is not an object, or holds a key `keys` does
|
|
5
|
-
* not name: a misspelt option would be dropped unread (D-370).
|
|
6
|
-
*/
|
|
7
|
-
export declare function ownKeys(entry: string, definition: unknown, keys: readonly string[]): asserts definition is object;
|
|
8
|
-
/** Refuses a key or a price's name that is not letters, digits, - and _. */
|
|
9
|
-
export declare function checkKey(where: string, key: unknown): void;
|
|
10
|
-
//# sourceMappingURL=keys.d.ts.map
|
package/dist/keys.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAOA,wEAAwE;AACxE,eAAO,MAAM,OAAO,UAAW,MAAM,cAAc,MAAM,KAAG,MAG3D,CAAA;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACtB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,SAAS,MAAM,EAAE,GACrB,OAAO,CAAC,UAAU,IAAI,MAAM,CAS9B;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAM1D"}
|
package/dist/keys.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// The checks every catalog definition shares: its keys, and the names it
|
|
2
|
-
// gives. A product's key and a price's name make the price's lookup key,
|
|
3
|
-
// `<product>.<price>`, so neither holds a dot.
|
|
4
|
-
import { Refused } from 'ultimabase';
|
|
5
|
-
const named = /^[\w-]+$/u;
|
|
6
|
-
/** Where a message points: `defineProduct(pro)`, or the entry alone. */
|
|
7
|
-
export const whereOf = (entry, definition) => {
|
|
8
|
-
const key = Reflect.get(definition, 'key');
|
|
9
|
-
return typeof key === 'string' ? `${entry}(${key})` : entry;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Refuses a definition that is not an object, or holds a key `keys` does
|
|
13
|
-
* not name: a misspelt option would be dropped unread (D-370).
|
|
14
|
-
*/
|
|
15
|
-
export function ownKeys(entry, definition, keys) {
|
|
16
|
-
if (typeof definition !== 'object' || definition === null) {
|
|
17
|
-
throw new Refused(`${entry} takes an object.`);
|
|
18
|
-
}
|
|
19
|
-
for (const key of Object.keys(definition)) {
|
|
20
|
-
if (!keys.includes(key)) {
|
|
21
|
-
throw new Refused(`${whereOf(entry, definition)} takes no ${key}.`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/** Refuses a key or a price's name that is not letters, digits, - and _. */
|
|
26
|
-
export function checkKey(where, key) {
|
|
27
|
-
if (typeof key !== 'string' || !named.test(key)) {
|
|
28
|
-
throw new Refused(`${where}: ${JSON.stringify(key)} is not a key: letters, digits, - and _ only.`);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/dist/kinds.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** The billing model kinds (D-373). */
|
|
2
|
-
export type Kind = 'subscription' | 'purchase' | 'balance' | 'history';
|
|
3
|
-
/** What a billing model was declared with. */
|
|
4
|
-
export interface Declared {
|
|
5
|
-
readonly kind: Kind;
|
|
6
|
-
/** Its payer's or owner's model: `() => User`. */
|
|
7
|
-
readonly payer: () => object;
|
|
8
|
-
}
|
|
9
|
-
/** Each billing model, by its queries. */
|
|
10
|
-
export declare const billingModels: WeakMap<object, Declared>;
|
|
11
|
-
//# sourceMappingURL=kinds.d.ts.map
|
package/dist/kinds.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAGA,uCAAuC;AACvC,MAAM,MAAM,IAAI,GAAG,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;AAEtE,8CAA8C;AAC9C,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAA;CAC5B;AAED,0CAA0C;AAC1C,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAiB,CAAA"}
|
package/dist/kinds.js
DELETED
package/dist/models.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Field, ModelOf, ScalarOptions } from 'ultimabase';
|
|
2
|
-
import { master } from 'ultimabase';
|
|
3
|
-
export declare const M: {
|
|
4
|
-
readonly as: typeof master;
|
|
5
|
-
};
|
|
6
|
-
type Text = Field<string, ScalarOptions<string>>;
|
|
7
|
-
type Optional<V> = Field<V | null, {
|
|
8
|
-
readonly optional: true;
|
|
9
|
-
}>;
|
|
10
|
-
type Counter = Field<number, {
|
|
11
|
-
readonly integer: true;
|
|
12
|
-
readonly default: number;
|
|
13
|
-
}>;
|
|
14
|
-
type CustomerFields = {
|
|
15
|
-
/** The payer's model, `User`, and its row's id (D-373 point 3). */
|
|
16
|
-
readonly model: Text;
|
|
17
|
-
readonly payer: Text;
|
|
18
|
-
/** Set once Stripe created it. */
|
|
19
|
-
readonly stripeId: Field<string | null, {
|
|
20
|
-
readonly optional: true;
|
|
21
|
-
readonly unique: true;
|
|
22
|
-
}>;
|
|
23
|
-
/** When the last sync written began to read Stripe. */
|
|
24
|
-
readonly syncedAt: Optional<Date>;
|
|
25
|
-
/** The syncs begun, and the number of the last one written. */
|
|
26
|
-
readonly syncsBegun: Counter;
|
|
27
|
-
readonly syncWritten: Counter;
|
|
28
|
-
/** When a subscription renews, ends or changes: the hourly job syncs it. */
|
|
29
|
-
readonly renewsAt: Optional<Date>;
|
|
30
|
-
/** Written to take the customer's lock. */
|
|
31
|
-
readonly lockedAt: Optional<Date>;
|
|
32
|
-
/** The profile Stripe holds, as JSON. */
|
|
33
|
-
readonly profile: Optional<string>;
|
|
34
|
-
};
|
|
35
|
-
type CustomerIndexes = readonly [
|
|
36
|
-
{
|
|
37
|
-
readonly fields: readonly ['model', 'payer'];
|
|
38
|
-
readonly unique: true;
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
readonly fields: readonly ['renewsAt'];
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
/** One per payer (D-373 point 3). */
|
|
45
|
-
export declare const StripeCustomer: ModelOf<'StripeCustomer', CustomerFields, [
|
|
46
|
-
], CustomerIndexes>;
|
|
47
|
-
type EventFields = {
|
|
48
|
-
readonly stripeId: Field<string, {
|
|
49
|
-
readonly unique: true;
|
|
50
|
-
}>;
|
|
51
|
-
/** `checkout.session.completed`: its v1 type. */
|
|
52
|
-
readonly type: Text;
|
|
53
|
-
/** Its related object: `subscription` and its id. */
|
|
54
|
-
readonly objectType: Text;
|
|
55
|
-
readonly objectId: Text;
|
|
56
|
-
readonly processedAt: Optional<Date>;
|
|
57
|
-
};
|
|
58
|
-
/** Each event received, once (D-371 point 4). */
|
|
59
|
-
export declare const StripeEvent: ModelOf<'StripeEvent', EventFields, []>;
|
|
60
|
-
type ScanFields = {
|
|
61
|
-
/** `events`: the one scan. */
|
|
62
|
-
readonly name: Field<string, {
|
|
63
|
-
readonly unique: true;
|
|
64
|
-
}>;
|
|
65
|
-
/** Stripe's events up to this time were read. */
|
|
66
|
-
readonly until: Field<Date, ScalarOptions<Date>>;
|
|
67
|
-
};
|
|
68
|
-
/** How far the hourly job read Stripe's events (D-375). */
|
|
69
|
-
export declare const StripeScan: ModelOf<'StripeScan', ScanFields, []>;
|
|
70
|
-
export {};
|
|
71
|
-
//# sourceMappingURL=models.d.ts.map
|
package/dist/models.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,EAAe,MAAM,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,MAAM,CAAA;CAAmB,CAAA;AAE/D,KAAK,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;AAChD,KAAK,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAC/D,KAAK,OAAO,GAAG,KAAK,CACnB,MAAM,EACN;IA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AQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;IAC3D,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;CACpC,CAAA;AAED,iDAAiD;AACjD,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE,CAY/D,CAAA;AAED,KAAK,UAAU,GAAG;IACjB,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;IACvD,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;CAChD,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,CAM3D,CAAA"}
|
package/dist/models.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defineModel, master } from 'ultimabase';
|
|
2
|
-
export const M = { as: master };
|
|
3
|
-
/** One per payer (D-373 point 3). */
|
|
4
|
-
export const StripeCustomer = defineModel({
|
|
5
|
-
name: 'StripeCustomer',
|
|
6
|
-
fields: (f) => ({
|
|
7
|
-
model: f.string(),
|
|
8
|
-
payer: f.string(),
|
|
9
|
-
stripeId: f.string({ optional: true, unique: true }),
|
|
10
|
-
syncedAt: f.dateTime({ optional: true }),
|
|
11
|
-
syncsBegun: f.number({ integer: true, default: 0 }),
|
|
12
|
-
syncWritten: f.number({ integer: true, default: 0 }),
|
|
13
|
-
renewsAt: f.dateTime({ optional: true }),
|
|
14
|
-
lockedAt: f.dateTime({ optional: true }),
|
|
15
|
-
profile: f.string({ optional: true }),
|
|
16
|
-
}),
|
|
17
|
-
indexes: [
|
|
18
|
-
{ fields: ['model', 'payer'], unique: true },
|
|
19
|
-
{ fields: ['renewsAt'] },
|
|
20
|
-
],
|
|
21
|
-
});
|
|
22
|
-
/** Each event received, once (D-371 point 4). */
|
|
23
|
-
export const StripeEvent = defineModel({
|
|
24
|
-
name: 'StripeEvent',
|
|
25
|
-
fields: (f) => ({
|
|
26
|
-
stripeId: f.string({ unique: true }),
|
|
27
|
-
type: f.string(),
|
|
28
|
-
objectType: f.string(),
|
|
29
|
-
objectId: f.string(),
|
|
30
|
-
processedAt: f.dateTime({ optional: true }),
|
|
31
|
-
}),
|
|
32
|
-
indexes: [{ fields: ['processedAt'] }],
|
|
33
|
-
});
|
|
34
|
-
/** How far the hourly job read Stripe's events (D-375). */
|
|
35
|
-
export const StripeScan = defineModel({
|
|
36
|
-
name: 'StripeScan',
|
|
37
|
-
fields: (f) => ({
|
|
38
|
-
name: f.string({ unique: true }),
|
|
39
|
-
until: f.dateTime(),
|
|
40
|
-
}),
|
|
41
|
-
});
|
package/dist/plugin.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Http } from '@ultimabase/http';
|
|
2
|
-
import type { Jobs } from '@ultimabase/jobs';
|
|
3
|
-
import type { PluginOf, PluginTypes, UseOf } from 'ultimabase';
|
|
4
|
-
import type { CustomerProfile } from './billing-gateway.ts';
|
|
5
|
-
import type { PortalOptions } from './portal.ts';
|
|
6
|
-
import type { Product } from './product.ts';
|
|
7
|
-
/** What `stripePlugin` takes (D-371 point 2). */
|
|
8
|
-
export interface StripeOptions {
|
|
9
|
-
/** `undefined`: the application starts, and payments are unavailable. */
|
|
10
|
-
readonly keys: {
|
|
11
|
-
readonly secret: string;
|
|
12
|
-
readonly webhook: string;
|
|
13
|
-
} | undefined;
|
|
14
|
-
/** Every price's currency, in lowercase: `eur`. */
|
|
15
|
-
readonly currency: string;
|
|
16
|
-
/** `'inclusive'`, by default, when the amounts include the taxes. */
|
|
17
|
-
readonly taxBehavior?: 'inclusive' | 'exclusive';
|
|
18
|
-
readonly products: readonly Product[];
|
|
19
|
-
readonly portal: PortalOptions;
|
|
20
|
-
/**
|
|
21
|
-
* What Stripe shows of a payer, from its row: type the parameter with the
|
|
22
|
-
* payer's record, `(user: UserRecord) => ({ email: user.email })`.
|
|
23
|
-
*/
|
|
24
|
-
readonly customer?: (payer: never) => CustomerProfile;
|
|
25
|
-
/** `/webhooks/stripe` by default. */
|
|
26
|
-
readonly webhookPath?: string;
|
|
27
|
-
/** One live subscription per payer (D-373 point 6). */
|
|
28
|
-
readonly oneSubscription?: boolean;
|
|
29
|
-
}
|
|
30
|
-
/** The Stripe plugin's types (D-57). */
|
|
31
|
-
export interface Stripe extends PluginTypes {
|
|
32
|
-
readonly name: 'stripe';
|
|
33
|
-
readonly appOptions: StripeOptions;
|
|
34
|
-
readonly requires: Http | Jobs;
|
|
35
|
-
readonly errors: 'PAYMENT_UNAVAILABLE' | 'ALREADY_SUBSCRIBED' | 'NOT_SUBSCRIBED' | 'NOT_ENOUGH_CREDITS';
|
|
36
|
-
}
|
|
37
|
-
/** Payments on Stripe's hosted pages; it requires `httpPlugin` and `jobsPlugin`. */
|
|
38
|
-
export declare const stripePlugin: PluginOf<Stripe>;
|
|
39
|
-
/** The plugin's entry in a billing model's `use`, which `define*` adds. */
|
|
40
|
-
export declare const stripeUse: UseOf<Stripe>;
|
|
41
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,KAAK,EAA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