@softure-ai/billing 0.1.7 → 0.1.8

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 (97) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +75 -16
  3. package/dist/contract.d.ts +19 -0
  4. package/dist/contract.d.ts.map +1 -1
  5. package/dist/contract.js +1 -0
  6. package/dist/contract.js.map +1 -1
  7. package/dist/fields.d.ts +2 -0
  8. package/dist/fields.d.ts.map +1 -1
  9. package/dist/fields.js +2 -0
  10. package/dist/fields.js.map +1 -1
  11. package/dist/index.d.ts +19 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -4
  14. package/dist/index.js.map +1 -1
  15. package/dist/messages/en.d.ts +17 -0
  16. package/dist/messages/en.d.ts.map +1 -1
  17. package/dist/messages/en.js +17 -0
  18. package/dist/messages/en.js.map +1 -1
  19. package/dist/messages/index.d.ts +36 -2
  20. package/dist/messages/index.d.ts.map +1 -1
  21. package/dist/messages/index.js.map +1 -1
  22. package/dist/messages/pl.d.ts.map +1 -1
  23. package/dist/messages/pl.js +17 -0
  24. package/dist/messages/pl.js.map +1 -1
  25. package/dist/next/actions.d.ts +8 -1
  26. package/dist/next/actions.d.ts.map +1 -1
  27. package/dist/next/actions.js +37 -1
  28. package/dist/next/actions.js.map +1 -1
  29. package/dist/next/index.d.ts +1 -1
  30. package/dist/next/index.d.ts.map +1 -1
  31. package/dist/next/index.js +1 -1
  32. package/dist/next/index.js.map +1 -1
  33. package/dist/next/pages.d.ts +13 -3
  34. package/dist/next/pages.d.ts.map +1 -1
  35. package/dist/next/pages.js +25 -8
  36. package/dist/next/pages.js.map +1 -1
  37. package/dist/schema.d.ts +109 -0
  38. package/dist/schema.d.ts.map +1 -1
  39. package/dist/schema.js +10 -2
  40. package/dist/schema.js.map +1 -1
  41. package/dist/scripts/entitlement-scripts.d.ts +2 -0
  42. package/dist/scripts/entitlement-scripts.d.ts.map +1 -1
  43. package/dist/scripts/entitlement-scripts.js +17 -5
  44. package/dist/scripts/entitlement-scripts.js.map +1 -1
  45. package/dist/server/entitlements.d.ts +23 -6
  46. package/dist/server/entitlements.d.ts.map +1 -1
  47. package/dist/server/entitlements.js +37 -6
  48. package/dist/server/entitlements.js.map +1 -1
  49. package/dist/server/grants.d.ts +13 -2
  50. package/dist/server/grants.d.ts.map +1 -1
  51. package/dist/server/grants.js +11 -2
  52. package/dist/server/grants.js.map +1 -1
  53. package/dist/server/health.d.ts.map +1 -1
  54. package/dist/server/health.js +2 -1
  55. package/dist/server/health.js.map +1 -1
  56. package/dist/server/index.d.ts +3 -2
  57. package/dist/server/index.d.ts.map +1 -1
  58. package/dist/server/index.js +1 -0
  59. package/dist/server/index.js.map +1 -1
  60. package/dist/server/privacy.d.ts +9 -0
  61. package/dist/server/privacy.d.ts.map +1 -1
  62. package/dist/server/privacy.js +19 -6
  63. package/dist/server/privacy.js.map +1 -1
  64. package/dist/server/trials.d.ts +22 -0
  65. package/dist/server/trials.d.ts.map +1 -0
  66. package/dist/server/trials.js +60 -0
  67. package/dist/server/trials.js.map +1 -0
  68. package/dist/ui/index.d.ts +1 -0
  69. package/dist/ui/index.d.ts.map +1 -1
  70. package/dist/ui/index.js +1 -0
  71. package/dist/ui/index.js.map +1 -1
  72. package/dist/ui/trial-form.d.ts +16 -0
  73. package/dist/ui/trial-form.d.ts.map +1 -0
  74. package/dist/ui/trial-form.js +25 -0
  75. package/dist/ui/trial-form.js.map +1 -0
  76. package/migrations/0010_record_trial_extensions_and_index_foreign_keys.sql +27 -0
  77. package/module.json +2 -2
  78. package/package.json +1 -1
  79. package/src/contract.ts +28 -0
  80. package/src/fields.ts +2 -0
  81. package/src/index.ts +7 -3
  82. package/src/messages/en.ts +17 -0
  83. package/src/messages/index.ts +2 -2
  84. package/src/messages/pl.ts +17 -0
  85. package/src/next/actions.ts +35 -2
  86. package/src/next/index.ts +9 -1
  87. package/src/next/pages.tsx +41 -6
  88. package/src/schema.ts +11 -2
  89. package/src/scripts/entitlement-scripts.ts +18 -5
  90. package/src/server/entitlements.ts +60 -6
  91. package/src/server/grants.ts +24 -3
  92. package/src/server/health.ts +2 -1
  93. package/src/server/index.ts +3 -0
  94. package/src/server/privacy.ts +29 -6
  95. package/src/server/trials.ts +70 -0
  96. package/src/ui/index.ts +1 -0
  97. package/src/ui/trial-form.tsx +80 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ Newest first. Each version lists what changed for an app that uses `@softure-ai/
4
4
  production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
5
5
  "Definition of done"). Versions before the first one below are described in their GitHub Releases (`billing@x.y.z`).
6
6
 
7
+ ## 0.1.8
8
+
9
+ - `BillingAdminPage` has an "Extend a trial" card: the account's email and the trial's new last day.
10
+ `extendTrialAction` (`/next`) and `extendTrialManually(ctx, { userId, until, adminId })` (`/server`) move the
11
+ trial end later without writing `paid_until`, and record it in the new `billing.trial_extensions`, listed in the
12
+ account's history (`AccountHistoryEntry` source `trial`). New codes `billing.trial_not_extended` and
13
+ `billing.day_invalid`; new `TrialForm` (`/ui`), `TrialFormState`, `TrialFormErrorCode`, `TrialExtensionErrorCode`.
14
+ - `importEntitlement(ctx, { ...input, mode: "replace" })` and `import-entitlements --exact` store what the old system
15
+ knew exactly, a trial shorter than the derived one included, for accounts that have no entitlement row yet; a
16
+ different existing row is `billing.entitlement_exists` (the script refuses the whole file), the same one is a
17
+ no-op. The default merge is unchanged.
18
+ - `PaymentPage` and `BillingAdminPage` render an `<h1>` first in their `<main>` (messages `payment.heading`,
19
+ `admin.heading`); `heading` replaces it, `heading={null}` leaves it out for an app whose frame has its own.
20
+ - Migration `0010`: `billing.trial_extensions`, and indexes behind the foreign keys `payment_requests.user_id`,
21
+ `manual_grants.granted_by` and `manual_grants.revoked_by`. Run `softure migrate`.
22
+ - The privacy export carries `trialExtensions` (`extendedAt`, `previousEndsAt`, `endsAt`); deletion erases them.
23
+
7
24
  ## 0.1.7
8
25
 
9
26
  - `sendAccessReminders` stops at a refused mail account or a spent quota (mailing's `halted`, counted in
package/README.md CHANGED
@@ -32,8 +32,10 @@ import of what the old system knew (`import-entitlements`) and a pin step for de
32
32
  period copy follow the app's locale.
33
33
  - **`PricingTiles`** (`/ui`) and **`Pricing`** (`/next`, wired to the config), a **`PaymentPage`**
34
34
  to mount at `routes.payment`, and a **`BillingAdminPage`** at `routes.admin` where an admin
35
- works the open invoice requests (grant or dismiss each), grants a plan by email, and looks up an
36
- account's history of grants and payments with a revoke button on each manual grant.
35
+ works the open invoice requests (grant or dismiss each), grants a plan by email, extends a trial
36
+ for free (never written as paid access), and looks up an account's history of grants, trial
37
+ extensions and payments with a revoke button on each manual grant. Both pages render an `<h1>`
38
+ first in their `<main>` (see "Page headings" in §4).
37
39
  - **A `PaymentProvider` interface** and its first adapter, **`manual({ onRequest })`**: the buyer
38
40
  requests an invoice, the app hands the request to its owner (a mail, a ticket), and the owner
39
41
  grants the plan once it is paid. The request is stored in `billing.payment_requests` before it is
@@ -55,10 +57,11 @@ import of what the old system knew (`import-entitlements`) and a pin step for de
55
57
  the account's history like the admin page's (see "Scripts" in §4).
56
58
  - **Existing accounts**: `trial.startsAt` gives accounts created before a chosen day a trial from
57
59
  that day; `import-entitlements` (`importEntitlement()` on the server) records the trial ends, paid
58
- periods and lifetime access another system knew, never shortening access; `pin-trials`
60
+ periods and lifetime access another system knew, never shortening access, or with `--exact`
61
+ (`mode: "replace"`) exactly as it knew them for accounts billing has no row of yet; `pin-trials`
59
62
  (`pinDerivedTrials()`) writes every derived trial into a row before a config change would move it
60
63
  (see "Existing accounts" in §4).
61
- - Export and deletion of the entitlement row, the payments, the invoice requests and the manual grants (`@softure-ai/privacy`), and a health check for
64
+ - Export and deletion of the entitlement row, the payments, the invoice requests, the manual grants and the trial extensions (`@softure-ai/privacy`), and a health check for
62
65
  `GET /api/health`.
63
66
 
64
67
  ## 2. Installation
@@ -176,6 +179,19 @@ export { BillingAdminPage as default } from "@softure-ai/billing/next";
176
179
  export { stripeWebhookRoute as POST } from "@softure-ai/billing/next";
177
180
  ```
178
181
 
182
+ **Page headings.** Each page renders one `<h1>` as the first child of its `<main>`: the
183
+ `payment.heading` and `admin.heading` messages ("Payment", "Billing"). Pass `heading` to replace
184
+ it, or `heading={null}` when the app's own frame renders the page heading:
185
+
186
+ ```tsx
187
+ // app/admin/billing/page.tsx, inside the app's frame that has its own <h1>
188
+ import { BillingAdminPage, type BillingAdminPageProps } from "@softure-ai/billing/next";
189
+
190
+ export default function Page(props: BillingAdminPageProps) {
191
+ return <BillingAdminPage {...props} heading={null} />;
192
+ }
193
+ ```
194
+
179
195
  **The Stripe webhook.** In the Stripe dashboard, add an endpoint at `<appOrigin>/api/billing/webhook`
180
196
  for `checkout.session.completed`, `checkout.session.async_payment_succeeded`, `charge.refunded` and
181
197
  `refund.failed`, and put its signing secret in `STRIPE_WEBHOOK_SECRET` (locally: `stripe listen --forward-to
@@ -273,7 +289,7 @@ sees that it has nothing left to pay for instead of the order (`startPayment` re
273
289
  `<Pricing LinkComponent={Link} />`.
274
290
 
275
291
  **The admin page.** `BillingAdminPage` answers "not found" to anyone without `adminRole`; every
276
- action checks the role from the session again before reading its form. It has three cards:
292
+ action checks the role from the session again before reading its form. It has four cards:
277
293
 
278
294
  - **Invoice requests**: the open requests, oldest first, with the account, the plan, when it was
279
295
  asked for, the price it quoted and the invoice details (the latest ones: a buyer who asks again
@@ -283,9 +299,18 @@ action checks the role from the session again before reading its form. It has th
283
299
  - **Grant access**: a plan for the account with a given email, recorded like a request's grant.
284
300
  An account with lifetime access is refused (`billing.lifetime_active`): a dated period under
285
301
  lifetime would be invisible.
302
+ - **Extend a trial**: the account's email and the trial's new last day (a date field; the trial
303
+ ends when the next day begins in the app's time zone). `extendTrialAction` calls
304
+ `extendTrialManually(ctx, { userId, until, adminId })` (`/server`), which moves the trial end
305
+ later and records it in `billing.trial_extensions` with the end before and after. It never writes
306
+ `paid_until`, so an app that counts paying accounts by it does not count a free extension (an
307
+ invited user, a longer trial for an account). It works under paid access too (paid access still
308
+ comes first; the longer trial shows once it ends) and on a trial that already ended. An end at or
309
+ before now is `billing.end_not_in_future`, one at or before the current trial end
310
+ `billing.trial_not_extended`, a malformed day `billing.day_invalid`; a refusal writes nothing.
286
311
  - **Account history**: the email lookup sends the admin to `?account=<id>` (no address in a URL),
287
- which shows the account's badge and its manual grants and provider payments, newest first, each
288
- with its price, the access it added and its state. **Revoke** on an active manual grant takes back only
312
+ which shows the account's badge and its manual grants, trial extensions and provider payments,
313
+ newest first, each with its price, the access it added and its state. **Revoke** on an active manual grant takes back only
289
314
  what it added, like a refund: a period loses its unused days and the periods stored after it
290
315
  (manual or paid) move back; a lifetime ends unless another active manual lifetime or a paid
291
316
  lifetime payment still gives it. Provider payments are refunded at the provider, not here.
@@ -439,7 +464,7 @@ older than `trial.days` read-only at once. Three tools, in this order, keep thei
439
464
  that local day gets its `trial.days` from it, on every read, without a write; accounts created on
440
465
  or after it keep their own trial. The reminder mail sees the floored trials too, so all those
441
466
  accounts get their trial-ending mail in the same window.
442
- 2. **An import** of what the old system knew (FIRE_TRACKER's `trial_ends_at`, `paid_until`):
467
+ 2. **An import** of what the old system knew (e.g. its `trial_ends_at`, `paid_until` columns):
443
468
 
444
469
  ```ts
445
470
  // scripts/import-entitlements.ts: npm run import-entitlements -- --file=entitlements.json [--commit]
@@ -474,6 +499,16 @@ older than `trial.days` read-only at once. Three tools, in this order, keep thei
474
499
  large file: every row takes its locks until the end of the run. `importEntitlement(ctx, { userId,
475
500
  trialEndsAt?, paidUntil?, isLifetime? })` (`/server`) is the same merge for an app that migrates in
476
501
  its own code; it returns the `Entitlement` or `Err<billing.account_unknown>`.
502
+
503
+ **An exact import** (`--exact`, `importEntitlement(ctx, { ...row, mode: "replace" })`) stores each
504
+ row as given instead: when the old system had shortened access (a trial counted from a later day
505
+ than `created_at`, a revoked purchase), a merge would give the account back its longer derived
506
+ trial, the exact import keeps it ended. `trialEndsAt` omitted or `null` keeps the derived trial,
507
+ `paidUntil` `null` means none. It writes only an account's first row: an account that already has
508
+ one (a change, a pin) is refused with `billing.entitlement_exists`, unless its row holds exactly
509
+ that record, so running the same file again changes nothing. The script refuses the whole file,
510
+ naming the rows, when any account already has a different row. Run it before anything writes
511
+ rows (before `pin-trials` and before the app opens billing to its accounts).
477
512
  3. **A pin** before any change of `trial.days`, `trial.startsAt` or `config.timezone`:
478
513
  `npm run pin-trials [-- --commit]` (`createPinTrialsScript(config)`, no arguments) writes the trial
479
514
  every account without a row is on, exactly as reads derive it, into a row, so the change moves no
@@ -589,6 +624,20 @@ again refreshes its details and time.
589
624
  | `status`, `revoked_at` | `active` or `revoked`; CHECKs tie `revoked_at` and `revoked_by` to the status. |
590
625
  | `amount`, `currency` | What it was granted for (`0006`): the price its request quoted, else the plan's price when granted; NULL on rows stored before. |
591
626
 
627
+ `migrations/0010_record_trial_extensions_and_index_foreign_keys.sql` creates
628
+ `billing.trial_extensions`, one row per trial an admin extended:
629
+
630
+ | Column | Meaning |
631
+ | --- | --- |
632
+ | `id`, `user_id` | The extension and its account (`ON DELETE CASCADE`). |
633
+ | `extended_by` | The admin (`ON DELETE SET NULL`); NULL for one made without an admin. |
634
+ | `extended_at` | When it was extended. |
635
+ | `previous_ends_at`, `ends_at` | The trial end before and after (CHECK: later, and after `extended_at`). |
636
+
637
+ It also indexes the foreign keys `payment_requests.user_id`, `manual_grants.granted_by` and
638
+ `manual_grants.revoked_by` (partial, `IS NOT NULL`), so deleting an account or an admin does not
639
+ scan those tables; every billing foreign key now has an index that starts with its column.
640
+
592
641
  A grant and the request it closes share a transaction; a grant and a revoke take the account, then
593
642
  the entitlement, then their row (a conditional update), the order of a refund.
594
643
 
@@ -620,9 +669,9 @@ tile gets `--sft-border-strong` and a shadow, and sets `data-plan`, `data-featur
620
669
  `billingMessages` (`en`, `pl`): `badge` (status names, `daysLeft` plural forms, `until`), `notice`
621
670
  (the four notices and their two link texts), `pricing` (period plural forms per unit, `lifetime`,
622
671
  `featured`, `choose`, `empty`), `reminderMail` (`subject` and `body` of `trialEnding`,
623
- `paidEnding`, `trialEnded` and `paidEnded`; the link text is the notice's), `payment` (the payment page, the invoice form and the notices after a
624
- hosted checkout, `checkoutSuccess` and `checkoutCancelled`), `admin` (the
625
- grant form) and `errors`. Plan names, descriptions and features come from the config, per locale. `{date}` is the last day of access in
672
+ `paidEnding`, `trialEnded` and `paidEnded`; the link text is the notice's), `payment` (the payment page and its `heading`, the invoice form and the notices after a
673
+ hosted checkout, `checkoutSuccess` and `checkoutCancelled`), `admin` (the page's `heading`, the
674
+ grant form, `trial` for the trial form, `requests`, `history`) and `errors`. Plan names, descriptions and features come from the config, per locale. `{date}` is the last day of access in
626
675
  the app's locale and time zone, `{count}` the days left. Override them with
627
676
  `billing({ messages: { en: { notice: { choosePlan: "See plans" } } } })`.
628
677
 
@@ -630,7 +679,17 @@ the app's locale and time zone, `{count}` the days left. Override them with
630
679
 
631
680
  `manual({ onRequest(request, ctx) })` receives every invoice request (plan, account, invoice
632
681
  details, return URL) and resolves with `Ok` once handed over, or an `Err` the buyer sees as
633
- `billing.payment_failed`. Apps react to a change in their own code around `changeEntitlement` and
682
+ `billing.payment_failed`. Mailing the request to the operator with the buyer as the reply-to
683
+ (`@softure-ai/mailing` 0.1.10 or later) lets the operator answer the buyer with "Reply":
684
+
685
+ ```ts
686
+ payment: manual({
687
+ onRequest: async (request, ctx) => {
688
+ const sent = await sendMail(ctx, { to: OPERATOR, replyTo: request.account.email, subject: `Invoice request: ${request.plan.id}`, text: describeRequest(request) });
689
+ return sent.ok ? ok() : err(sent.error);
690
+ },
691
+ }),
692
+ ``` Apps react to a change in their own code around `changeEntitlement` and
634
693
  `grantPlan`. The Stripe webhook has no hook yet; its effect shows in `getEntitlement`.
635
694
 
636
695
  ## 11. GDPR
@@ -642,10 +701,10 @@ details, return URL) and resolves with `Ok` once handed over, or an `Err` the bu
642
701
  failed (`paymentId`, `refundId`, `amount`, `refundCreatedAt`, `failedAt`), its invoice requests (`planId`, the
643
702
  invoice details while open, `amount`, `currency`, `status`, `requestedAt`, `closedAt`) and the
644
703
  plans granted to it by hand (`planId`, `grantedAt`, the grant, `status`, `revokedAt`, `amount`,
645
- `currency`). Which admin granted or revoked
646
- is the admin's data and stays out of the account's export.
647
- - Deletion: the row, the payments (their failed refunds with them), the requests and the manual grants, and the foreign keys remove
648
- them with the account too; an erased admin's id is cleared from the grants they made.
704
+ `currency`) and the trials extended for it by hand (`extendedAt`, `previousEndsAt`, `endsAt`).
705
+ Which admin granted, revoked or extended is the admin's data and stays out of the account's export.
706
+ - Deletion: the row, the payments (their failed refunds with them), the requests, the manual grants and the trial extensions, and the foreign keys remove
707
+ them with the account too; an erased admin's id is cleared from the grants and extensions they made.
649
708
  Stripe keeps its own record of each payment (the controller's accounting record there).
650
709
  - Reminder mail: what was sent is in `mailing.deliveries` under a recipient key (never the
651
710
  address) and a scope naming the account id and the end; mailing keeps that ledger after an account
@@ -7,6 +7,10 @@ export type BillingErrorCode =
7
7
  | "billing.account_unknown"
8
8
  /** A grant or a trial extension that ends now or earlier. */
9
9
  | "billing.end_not_in_future";
10
+ /** Why an admin could not extend a trial (`extendTrialManually`). */
11
+ export type TrialExtensionErrorCode = "billing.account_unknown" | "billing.end_not_in_future"
12
+ /** The trial already ends then or later: an extension would change nothing. */
13
+ | "billing.trial_not_extended";
10
14
  /** Every code a guarded write can show: the guard's own and the generic ones. */
11
15
  export type BillingFormErrorCode = BillingErrorCode | CoreErrorCode;
12
16
  export declare const ENTITLEMENT_STATUSES: readonly ["trial", "paid", "read_only"];
@@ -144,6 +148,10 @@ export type PaymentErrorCode =
144
148
  export type PaymentFormErrorCode = PaymentErrorCode | InvoiceFieldErrorCode | "security.rate_limited" | CoreErrorCode;
145
149
  /** Every code the admin grant form can show. */
146
150
  export type GrantFormErrorCode = "billing.plan_unknown" | "billing.account_unknown" | "billing.lifetime_active" | "auth.forbidden" | CoreErrorCode;
151
+ /** Every code the admin trial form can show. */
152
+ export type TrialFormErrorCode = TrialExtensionErrorCode
153
+ /** The last day is not a calendar day (`YYYY-MM-DD`). */
154
+ | "billing.day_invalid" | "auth.forbidden" | CoreErrorCode;
147
155
  /** Why an admin could not act on a request or a manual grant. */
148
156
  export type AdminErrorCode =
149
157
  /** The request was granted or dismissed already, or never existed. */
@@ -173,6 +181,17 @@ export interface GrantFormState {
173
181
  readonly planId?: string;
174
182
  }
175
183
  export declare const INITIAL_GRANT_FORM_STATE: GrantFormState;
184
+ /** What the admin trial action returns to its form (`useActionState`). */
185
+ export interface TrialFormState {
186
+ readonly status: "idle" | "extended" | "error";
187
+ readonly error?: TrialFormErrorCode;
188
+ /** After an extension: the trial's new last day, in the app's copy. */
189
+ readonly notice?: string;
190
+ /** The email and last day as sent, to fill the form again after an error. */
191
+ readonly email?: string;
192
+ readonly lastDay?: string;
193
+ }
194
+ export declare const INITIAL_TRIAL_FORM_STATE: TrialFormState;
176
195
  /** What an admin button (grant or dismiss a request, revoke a grant, find an account) returns to its form. */
177
196
  export type AdminActionState = {
178
197
  readonly status: "idle";
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,gBAAgB;AAC1B,8EAA8E;AAC5E,mBAAmB;AACrB,8BAA8B;GAC5B,yBAAyB;AAC3B,6DAA6D;GAC3D,2BAA2B,CAAC;AAEhC,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAEpE,eAAO,MAAM,oBAAoB,yCAA0C,CAAC;AAE5E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,4EAA4E;AAC5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KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,wBAAwB,EAAE,cAAmC,CAAC;AAE3E,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IACpC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,EAAE,cAAmC,CAAC;AAE3E,8GAA8G;AAC9G,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG,eAAO,MAAM,0BAA0B,EAAE,gBAAqC,CAAC"}
package/dist/contract.js CHANGED
@@ -2,5 +2,6 @@ export const ENTITLEMENT_STATUSES = ["trial", "paid", "read_only"];
2
2
  export const PERIOD_UNITS = ["day", "week", "month", "year"];
3
3
  export const INITIAL_PAYMENT_FORM_STATE = { status: "idle" };
4
4
  export const INITIAL_GRANT_FORM_STATE = { status: "idle" };
5
+ export const INITIAL_TRIAL_FORM_STATE = { status: "idle" };
5
6
  export const INITIAL_ADMIN_ACTION_STATE = { status: "idle" };
6
7
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAU,CAAC;AA8E5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAiEtE,MAAM,CAAC,MAAM,0BAA0B,GAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAa/E,MAAM,CAAC,MAAM,wBAAwB,GAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAQ3E,MAAM,CAAC,MAAM,0BAA0B,GAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAU,CAAC;AA8E5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAyEtE,MAAM,CAAC,MAAM,0BAA0B,GAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAa/E,MAAM,CAAC,MAAM,wBAAwB,GAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAa3E,MAAM,CAAC,MAAM,wBAAwB,GAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAQ3E,MAAM,CAAC,MAAM,0BAA0B,GAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
package/dist/fields.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export declare const PLAN_FIELD = "plan";
2
2
  export declare const EMAIL_FIELD = "email";
3
+ /** The admin trial form's field: the trial's new last day, `YYYY-MM-DD`. */
4
+ export declare const TRIAL_LAST_DAY_FIELD = "trialLastDay";
3
5
  export declare const INVOICE_FIELDS: {
4
6
  readonly name: "invoiceName";
5
7
  readonly taxId: "invoiceTaxId";
@@ -1 +1 @@
1
- {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGtE;AAED,iHAAiH;AACjH,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,eAAO,MAAM,gBAAgB,mCAAoC,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,uGAAuG;AACvG,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,0GAA0G;AAC1G,eAAO,MAAM,aAAa,YAAY,CAAC"}
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGtE;AAED,iHAAiH;AACjH,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,eAAO,MAAM,gBAAgB,mCAAoC,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,uGAAuG;AACvG,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,0GAA0G;AAC1G,eAAO,MAAM,aAAa,YAAY,CAAC"}
package/dist/fields.js CHANGED
@@ -1,6 +1,8 @@
1
1
  // Form field names shared by the forms (`/ui`) and the actions that read them (`/next`).
2
2
  export const PLAN_FIELD = "plan";
3
3
  export const EMAIL_FIELD = "email";
4
+ /** The admin trial form's field: the trial's new last day, `YYYY-MM-DD`. */
5
+ export const TRIAL_LAST_DAY_FIELD = "trialLastDay";
4
6
  export const INVOICE_FIELDS = {
5
7
  name: "invoiceName",
6
8
  taxId: "invoiceTaxId",
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,gBAAgB;CACjB,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,GAAG;CACJ,CAAC;AAEX,oFAAoF;AACpF,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,MAAM,GAAG,GAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAqC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,c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AAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,iHAAiH;AACjH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,WAAW,CAAU,CAAC;AAIlE,uGAAuG;AACvG,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,0GAA0G;AAC1G,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
package/dist/index.d.ts CHANGED
@@ -91,6 +91,7 @@ export declare const billing: import("@softure-ai/core").ModuleFactory<{
91
91
  empty: string;
92
92
  };
93
93
  payment: {
94
+ heading: string;
94
95
  title: string;
95
96
  lead: string;
96
97
  plansLabel: string;
@@ -112,6 +113,7 @@ export declare const billing: import("@softure-ai/core").ModuleFactory<{
112
113
  lifetime: string;
113
114
  };
114
115
  admin: {
116
+ heading: string;
115
117
  title: string;
116
118
  lead: string;
117
119
  email: string;
@@ -121,6 +123,15 @@ export declare const billing: import("@softure-ai/core").ModuleFactory<{
121
123
  granted: string;
122
124
  grantedUntil: string;
123
125
  noPlans: string;
126
+ trial: {
127
+ title: string;
128
+ lead: string;
129
+ email: string;
130
+ lastDay: string;
131
+ submit: string;
132
+ pending: string;
133
+ extended: string;
134
+ };
124
135
  requests: {
125
136
  title: string;
126
137
  lead: string;
@@ -164,6 +175,10 @@ export declare const billing: import("@softure-ai/core").ModuleFactory<{
164
175
  revoke: string;
165
176
  revoking: string;
166
177
  revokeLabel: string;
178
+ trialExtended: string;
179
+ trialUntil: string;
180
+ extendedOn: string;
181
+ trialWasUntil: string;
167
182
  };
168
183
  };
169
184
  errors: {
@@ -180,6 +195,8 @@ export declare const billing: import("@softure-ai/core").ModuleFactory<{
180
195
  lifetime_active: string;
181
196
  request_closed: string;
182
197
  grant_revoked: string;
198
+ trial_not_extended: string;
199
+ day_invalid: string;
183
200
  };
184
201
  security: {
185
202
  rate_limited: string;
@@ -254,7 +271,7 @@ export declare const billing: import("@softure-ai/core").ModuleFactory<{
254
271
  adminRole: import("zod").ZodDefault<import("zod").ZodString>;
255
272
  }, import("zod/v4/core").$strict>>;
256
273
  export { getDayNumber, getDaysLeft, getStartOfDay, getTrialEnd, parseDay } from "./calendar.js";
257
- export { ENTITLEMENT_STATUSES, INITIAL_ADMIN_ACTION_STATE, INITIAL_GRANT_FORM_STATE, INITIAL_PAYMENT_FORM_STATE, PERIOD_UNITS, type AdminActionErrorCode, type AdminActionState, type AdminErrorCode, type BillingErrorCode, type BillingFormErrorCode, type Entitlement, type EntitlementEvent, type EntitlementRecord, type EntitlementStatus, type GrantFormErrorCode, type GrantFormState, type LocalizedText, type PaymentErrorCode, type PaymentFormErrorCode, type PaymentFormState, type PaymentGrant, type PeriodUnit, type Plan, type PlanPeriod, type PlanPrice, } from "./contract.js";
274
+ export { ENTITLEMENT_STATUSES, INITIAL_ADMIN_ACTION_STATE, INITIAL_GRANT_FORM_STATE, INITIAL_PAYMENT_FORM_STATE, INITIAL_TRIAL_FORM_STATE, PERIOD_UNITS, type AdminActionErrorCode, type AdminActionState, type AdminErrorCode, type BillingErrorCode, type TrialExtensionErrorCode, type TrialFormErrorCode, type TrialFormState, type BillingFormErrorCode, type Entitlement, type EntitlementEvent, type EntitlementRecord, type EntitlementStatus, type GrantFormErrorCode, type GrantFormState, type LocalizedText, type PaymentErrorCode, type PaymentFormErrorCode, type PaymentFormState, type PaymentGrant, type PeriodUnit, type Plan, type PlanPeriod, type PlanPrice, } from "./contract.js";
258
275
  export { applyEntitlementEvent, hasWriteAccess, resolveEntitlement, type EntitlementPolicy } from "./entitlement.js";
259
276
  export { CHECKOUT_PARAM, CHECKOUT_RESULTS, type CheckoutResult } from "./fields.js";
260
277
  export { invoiceDetailsSchema, type InvoiceFieldErrorCode } from "./invoice.js";
@@ -267,7 +284,7 @@ export { getPaymentGrant, getRefundEvent, getRestoredDays, getTakenBackDays, get
267
284
  export { ACCESS_REMINDER_KINDS, DEFAULT_CATCH_UP_DAYS, getAccessReminder, getAccessReminderScope, MAX_CATCH_UP_DAYS, type AccessReminder, type AccessReminderInput, type AccessReminderKind, } from "./reminder.js";
268
285
  export { CURRENCY_MINOR_UNIT_DIGITS } from "./currency-digits.js";
269
286
  export { formatPrice, getMinorUnitDigits, isSupportedCurrency } from "./price.js";
270
- export { billingSchema, entitlements, manualGrants, paymentRequests, payments } from "./schema.js";
287
+ export { billingSchema, entitlements, manualGrants, paymentRequests, payments, trialExtensions } from "./schema.js";
271
288
  export { getCheckoutSessionParams, stripe, STRIPE_API_BASE, STRIPE_SECRET_KEY_ENV, STRIPE_TIMEOUT_MS, type StripeOptions } from "./stripe.js";
272
289
  export { describeStripePriceProblem, fromStripeAmount, getStripeMinorUnitDigits, STRIPE_THREE_DECIMAL_CURRENCIES, STRIPE_ZERO_DECIMAL_CURRENCIES, toStripeAmount, } from "./stripe-currency.js";
273
290
  export { parseStripeEvent, readStripeWebhook, signStripePayload, STRIPE_METADATA, STRIPE_SIGNATURE_HEADER, STRIPE_SIGNATURE_TOLERANCE_SECONDS, verifyStripeSignature, type FailedRefund, type PaidCheckout, type SignStripePayloadInput, type StripeWebhookError, type StripeWebhookEvent, type VerifyStripeSignatureInput, } from "./stripe-webhook.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;CAE7B,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Ac,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACpH,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9I,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,kCAAkC,EAClC,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -25,10 +25,10 @@ export const BILLING_RATE_LIMIT_BUCKETS = {
25
25
  export const billing = defineModule({
26
26
  manifest: {
27
27
  id: MODULE_ID,
28
- version: "0.1.7",
28
+ version: "0.1.8",
29
29
  dependsOn: { security: "^0.1.0", auth: "^0.1.0", mailing: "^0.1.0?", ops: "^0.1.0?" },
30
30
  dbSchema: "billing",
31
- tables: ["entitlements", "payments", "payment_requests", "manual_grants"],
31
+ tables: ["entitlements", "payments", "payment_requests", "manual_grants", "trial_extensions"],
32
32
  env: [
33
33
  {
34
34
  name: "STRIPE_SECRET_KEY",
@@ -53,7 +53,7 @@ export const billing = defineModule({
53
53
  health: checkBillingTables,
54
54
  });
55
55
  export { getDayNumber, getDaysLeft, getStartOfDay, getTrialEnd, parseDay } from "./calendar.js";
56
- export { ENTITLEMENT_STATUSES, INITIAL_ADMIN_ACTION_STATE, INITIAL_GRANT_FORM_STATE, INITIAL_PAYMENT_FORM_STATE, PERIOD_UNITS, } from "./contract.js";
56
+ export { ENTITLEMENT_STATUSES, INITIAL_ADMIN_ACTION_STATE, INITIAL_GRANT_FORM_STATE, INITIAL_PAYMENT_FORM_STATE, INITIAL_TRIAL_FORM_STATE, PERIOD_UNITS, } from "./contract.js";
57
57
  export { applyEntitlementEvent, hasWriteAccess, resolveEntitlement } from "./entitlement.js";
58
58
  export { CHECKOUT_PARAM, CHECKOUT_RESULTS } from "./fields.js";
59
59
  export { invoiceDetailsSchema } from "./invoice.js";
@@ -66,7 +66,7 @@ export { getPaymentGrant, getRefundEvent, getRestoredDays, getTakenBackDays, get
66
66
  export { ACCESS_REMINDER_KINDS, DEFAULT_CATCH_UP_DAYS, getAccessReminder, getAccessReminderScope, MAX_CATCH_UP_DAYS, } from "./reminder.js";
67
67
  export { CURRENCY_MINOR_UNIT_DIGITS } from "./currency-digits.js";
68
68
  export { formatPrice, getMinorUnitDigits, isSupportedCurrency } from "./price.js";
69
- export { billingSchema, entitlements, manualGrants, paymentRequests, payments } from "./schema.js";
69
+ export { billingSchema, entitlements, manualGrants, paymentRequests, payments, trialExtensions } from "./schema.js";
70
70
  export { getCheckoutSessionParams, stripe, STRIPE_API_BASE, STRIPE_SECRET_KEY_ENV, STRIPE_TIMEOUT_MS } from "./stripe.js";
71
71
  export { describeStripePriceProblem, fromStripeAmount, getStripeMinorUnitDigits, STRIPE_THREE_DECIMAL_CURRENCIES, STRIPE_ZERO_DECIMAL_CURRENCIES, toStripeAmount, } from "./stripe-currency.js";
72
72
  export { parseStripeEvent, readStripeWebhook, signStripePayload, STRIPE_METADATA, STRIPE_SIGNATURE_HEADER, STRIPE_SIGNATURE_TOLERANCE_SECONDS, verifyStripeSignature, } from "./stripe-webhook.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,iGAAiG;AACjG,yFAAyF;AACzF,wFAAwF;AACxF,oGAAoG;AACpG,2FAA2F;AAC3F,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,iBAAiB,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE;CAC1C,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,QAAQ,EAAE;QACR,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE;QACrF,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,CAAC,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,CAAC;QACzE,GAAG,EAAE;YACH;gBACE,IAAI,EAAE,mBAAmB;gBACzB,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,+JAA+J;aAC7K;YACD;gBACE,IAAI,EAAE,uBAAuB;gBAC7B,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,mIAAmI;aACjJ;SACF;QACD,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,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACpH,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,EAAsB,MAAM,aAAa,CAAC;AAC9I,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,kCAAkC,EAClC,qBAAqB,GAOtB,MAAM,qBAAqB,CAAC"}
@@ -71,6 +71,7 @@ export declare const en: {
71
71
  empty: string;
72
72
  };
73
73
  payment: {
74
+ heading: string;
74
75
  title: string;
75
76
  lead: string;
76
77
  plansLabel: string;
@@ -92,6 +93,7 @@ export declare const en: {
92
93
  lifetime: string;
93
94
  };
94
95
  admin: {
96
+ heading: string;
95
97
  title: string;
96
98
  lead: string;
97
99
  email: string;
@@ -101,6 +103,15 @@ export declare const en: {
101
103
  granted: string;
102
104
  grantedUntil: string;
103
105
  noPlans: string;
106
+ trial: {
107
+ title: string;
108
+ lead: string;
109
+ email: string;
110
+ lastDay: string;
111
+ submit: string;
112
+ pending: string;
113
+ extended: string;
114
+ };
104
115
  requests: {
105
116
  title: string;
106
117
  lead: string;
@@ -144,6 +155,10 @@ export declare const en: {
144
155
  revoke: string;
145
156
  revoking: string;
146
157
  revokeLabel: string;
158
+ trialExtended: string;
159
+ trialUntil: string;
160
+ extendedOn: string;
161
+ trialWasUntil: string;
147
162
  };
148
163
  };
149
164
  errors: {
@@ -160,6 +175,8 @@ export declare const en: {
160
175
  lifetime_active: string;
161
176
  request_closed: string;
162
177
  grant_revoked: string;
178
+ trial_not_extended: string;
179
+ day_invalid: string;
163
180
  };
164
181
  security: {
165
182
  rate_limited: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqJd,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKd,CAAC"}
@@ -46,6 +46,7 @@ export const en = {
46
46
  empty: "No plans are available yet.",
47
47
  },
48
48
  payment: {
49
+ heading: "Payment",
49
50
  title: "Choose a plan",
50
51
  lead: "Pick the plan that suits you. Paid access starts when your current access ends.",
51
52
  plansLabel: "Plans",
@@ -67,6 +68,7 @@ export const en = {
67
68
  lifetime: "You have lifetime access: there is nothing left to pay for.",
68
69
  },
69
70
  admin: {
71
+ heading: "Billing",
70
72
  title: "Grant access",
71
73
  lead: "Grant a plan to an account once its payment has arrived. A paid period starts when the account's current access ends.",
72
74
  email: "Account email",
@@ -76,6 +78,15 @@ export const en = {
76
78
  granted: "{email} now has {plan}.",
77
79
  grantedUntil: "{email} now has {plan}, with access until {date}.",
78
80
  noPlans: "There are no plans to grant: add them to billing({ plans }).",
81
+ trial: {
82
+ title: "Extend a trial",
83
+ lead: "Give an account a longer trial for free, e.g. an invited user. It is not paid access: the account keeps its paid periods, and the trial lasts through the day you choose.",
84
+ email: "Email of the account to extend",
85
+ lastDay: "Last day of the trial",
86
+ submit: "Extend trial",
87
+ pending: "Extending…",
88
+ extended: "{email} now has a trial until {date}.",
89
+ },
79
90
  requests: {
80
91
  title: "Invoice requests",
81
92
  lead: "Requests sent from the payment page. Grant the plan once the invoice is paid, or dismiss the request.",
@@ -119,6 +130,10 @@ export const en = {
119
130
  revoke: "Revoke",
120
131
  revoking: "Revoking…",
121
132
  revokeLabel: "Revoke {plan} granted on {date}",
133
+ trialExtended: "Trial extended",
134
+ trialUntil: "Trial until {date}",
135
+ extendedOn: "Extended on {date}",
136
+ trialWasUntil: "The trial was until {date}",
122
137
  },
123
138
  },
124
139
  errors: {
@@ -135,6 +150,8 @@ export const en = {
135
150
  lifetime_active: "This account already has lifetime access: there is nothing to pay for or grant.",
136
151
  request_closed: "This request was granted or dismissed already.",
137
152
  grant_revoked: "This grant was revoked already.",
153
+ trial_not_extended: "The trial already lasts through this day or longer.",
154
+ day_invalid: "Enter a date, e.g. 2026-11-30.",
138
155
  },
139
156
  security: {
140
157
  rate_limited: "Too many attempts. Try again later.",
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;QACtH,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