@antelopejs/dms-saas 0.6.0 → 0.6.1

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.
@@ -14,6 +14,7 @@ declare const LifecycleDeliveryModel_base: {
14
14
  delete(id: string): Promise<number>;
15
15
  };
16
16
  readonly schemaName: string;
17
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<LifecycleDelivery>;
17
18
  fromPlainData(obj: any): LifecycleDelivery;
18
19
  fromDatabase(obj: any): LifecycleDelivery | undefined;
19
20
  toDatabase(obj: any): Record<string, any>;
@@ -17,6 +17,7 @@ declare const OperatorActionModel_base: {
17
17
  delete(id: string): Promise<number>;
18
18
  };
19
19
  readonly schemaName: string;
20
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<OperatorAction>;
20
21
  fromPlainData(obj: any): OperatorAction;
21
22
  fromDatabase(obj: any): OperatorAction | undefined;
22
23
  toDatabase(obj: any): Record<string, any>;
@@ -65,6 +65,7 @@ const identityForm = (0, base_1.Form)({
65
65
  successMessage: `${KEYS}.renamed`,
66
66
  errorMessage: `${KEYS}.error.rename`,
67
67
  })
68
+ .watch(base_1.FormEvents.SUBMIT_SUCCESS, base_1.BlockFunctions.REFRESH_PAGE)
68
69
  .meta({
69
70
  name: `${PERMISSIONS}.identity`,
70
71
  description: `${PERMISSIONS}.identity_description`,
@@ -1 +1 @@
1
- {"version":3,"file":"general.js","sourceRoot":"","sources":["../../../src/pages/tenant/general.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAIwC;AACxC,yDAMwC;AACxC,kEAAwE;AACxE,2FAA2F;AAC3F,oEAAuE;AACvE,oEAA4E;AAC5E,sEAA2E;AAG3E,MAAM,0BAA0B,GAAG,8BAA8B,CAAC;AAClE,MAAM,eAAe,GAAG,GAAG,0BAA0B,SAAS,CAAC;AAC/D,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,M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0BAA0B;QACrD,IAAI,EAAE,sBAAsB;KAC7B,CAAC,CACH,CAAC;;AA5CS,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAY,GAAE;GACF,2BAA2B,CA6CvC"}
@@ -24,6 +24,7 @@ declare const UpcomingInvoicePreviewCacheModel_base: {
24
24
  delete(id: string): Promise<number>;
25
25
  };
26
26
  readonly schemaName: string;
27
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<UpcomingInvoicePreviewEntry>;
27
28
  fromPlainData(obj: any): UpcomingInvoicePreviewEntry;
28
29
  fromDatabase(obj: any): UpcomingInvoicePreviewEntry | undefined;
29
30
  toDatabase(obj: any): Record<string, any>;
@@ -12,6 +12,7 @@ declare const ProvisioningAttemptModel_base: {
12
12
  delete(id: string): Promise<number>;
13
13
  };
14
14
  readonly schemaName: string;
15
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<ProvisioningAttempt>;
15
16
  fromPlainData(obj: any): ProvisioningAttempt;
16
17
  fromDatabase(obj: any): ProvisioningAttempt | undefined;
17
18
  toDatabase(obj: any): Record<string, any>;
@@ -13,6 +13,7 @@ declare const TrialIdentityModel_base: {
13
13
  delete(id: string): Promise<number>;
14
14
  };
15
15
  readonly schemaName: string;
16
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<TrialIdentity>;
16
17
  fromPlainData(obj: any): TrialIdentity;
17
18
  fromDatabase(obj: any): TrialIdentity | undefined;
18
19
  toDatabase(obj: any): Record<string, any>;
@@ -17,9 +17,9 @@ const { $authFetch } = useAuthFetch()
17
17
  const { confirm } = useConfirm()
18
18
  const { resolveApiError } = useApiErrorMessage()
19
19
  const toast = useToast()
20
+ // The deletion asks for the name as it is now: a rename on this page reads
21
+ // the page's data again, this overview included.
20
22
  const { data: overview, status, refresh } = useWorkspaceOverview()
21
- // The deletion asks for the name as it is now: read again after a rename.
22
- useWorkspaceRenamed(() => void refresh())
23
23
 
24
24
  const destroyedOn = computed(
25
25
  () =>
@@ -127,8 +127,6 @@ async function onWorkspaceCreated(
127
127
  await load()
128
128
  }
129
129
  }
130
-
131
- useWorkspaceRenamed(() => void load())
132
130
  </script>
133
131
 
134
132
  <template>
@@ -29,7 +29,8 @@ interface MyWorkspacesHandle {
29
29
 
30
30
  /**
31
31
  * Shared between the sidebar switcher and the screens that change what it
32
- * displays (a rename, a deletion), so a change never waits for a page reload.
32
+ * displays (a deletion; a rename reads it again with the rest of the page),
33
+ * so a change never waits for a page reload.
33
34
  * Nothing is read without a session: the public layouts mount the switcher's
34
35
  * readers too.
35
36
  */
@@ -233,7 +233,9 @@ async function submit(): Promise<void> {
233
233
  })
234
234
  const destination = landingPath()
235
235
  rememberChosenPlan(null)
236
- if (typeof window !== 'undefined') window.location.href = destination
236
+ // The token is spent: the destination takes this page's place in the
237
+ // history, so Back does not return to a form that can only fail.
238
+ if (typeof window !== 'undefined') window.location.replace(destination)
237
239
  } catch (error) {
238
240
  errorMessage.value = resolveApiError(
239
241
  error,
@@ -0,0 +1,22 @@
1
+ import { defineDmsServer } from '#dms/server'
2
+ import { LEGAL_DOCUMENTS } from './app/build/public/routes'
3
+
4
+ // The legal pages hold no visitor data and load their text in the browser:
5
+ // a shared cache in front of the frontend server may keep them a few minutes
6
+ // for visitors without any cookie. Every other request stays private.
7
+ const LEGAL_PAGE_CACHE = {
8
+ public: true,
9
+ maxAge: 300,
10
+ staleWhileRevalidate: 3600,
11
+ } as const
12
+
13
+ export default defineDmsServer((server) => {
14
+ server.registerRouteRules(
15
+ Object.fromEntries(
16
+ LEGAL_DOCUMENTS.map((document) => [
17
+ document.path,
18
+ { cache: LEGAL_PAGE_CACHE },
19
+ ]),
20
+ ),
21
+ )
22
+ })
@@ -6,7 +6,7 @@
6
6
  "license": "Apache-2.0",
7
7
  "packageManager": "pnpm@10.6.5",
8
8
  "engines": {
9
- "@antelopejs/dms-frontend": ">=0.6.0 <0.7.0"
9
+ "@antelopejs/dms-frontend": ">=0.6.3 <0.7.0"
10
10
  },
11
11
  "scripts": {
12
12
  "format": "prettier --write .",
package/package.json CHANGED
@@ -1,15 +1,31 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-saas",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
+ "description": "SaaS module for the AntelopeJS DMS: self-service sign-up and pricing, plans that gate features, Stripe billing, workspace settings and a back office.",
5
+ "keywords": [
6
+ "antelopejs",
7
+ "billing",
8
+ "dms",
9
+ "dms-module",
10
+ "multi-tenant",
11
+ "saas",
12
+ "stripe"
13
+ ],
14
+ "homepage": "https://dms.antelopejs.com/docs/modules/saas",
15
+ "bugs": {
16
+ "url": "https://github.com/AntelopeJS/dms-saas/issues"
17
+ },
4
18
  "license": "Apache-2.0",
5
19
  "repository": {
6
20
  "type": "git",
7
- "url": "git+https://github.com/AntelopeJS/dms-saas.git"
21
+ "url": "git+https://github.com/AntelopeJS/dms-saas.git",
22
+ "directory": "packages/dms-saas"
8
23
  },
9
24
  "files": [
10
25
  "dist",
11
26
  "!dist/.tsbuildinfo",
12
27
  "frontend-vue",
28
+ "skills",
13
29
  "package.json",
14
30
  "README.md",
15
31
  "LICENSE"
@@ -29,26 +45,25 @@
29
45
  "registry": "https://registry.npmjs.org/"
30
46
  },
31
47
  "dependencies": {
32
- "@antelopejs/interface-api": ">=0.0.14 <1.0.0",
33
- "@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
34
- "@antelopejs/interface-core": ">=0.1.1 <1.0.0",
35
- "@antelopejs/interface-data-api": ">=0.2.0 <1.0.0",
36
- "@antelopejs/interface-database": ">=0.1.8 <1.0.0",
37
- "@antelopejs/interface-database-decorators": ">=0.1.7 <1.0.0",
38
- "@antelopejs/interface-dms": ">=0.7.0 <1.0.0",
39
- "@antelopejs/interface-dms-saas": ">=0.4.0 <0.5.0",
48
+ "@antelopejs/interface-api": ">=0.0.15 <1.0.0",
49
+ "@antelopejs/interface-api-util": ">=0.1.3 <1.0.0",
50
+ "@antelopejs/interface-core": ">=0.2.4 <1.0.0",
51
+ "@antelopejs/interface-data-api": ">=0.2.2 <1.0.0",
52
+ "@antelopejs/interface-database": ">=0.1.10 <1.0.0",
53
+ "@antelopejs/interface-database-decorators": ">=0.1.9 <1.0.0",
54
+ "@antelopejs/interface-dms": ">=0.7.2 <1.0.0",
40
55
  "node-cron": "^4.2.1",
41
56
  "stripe": "^22.6.2",
42
- "zod": "^3.24.4"
57
+ "zod": "^3.24.4",
58
+ "@antelopejs/interface-dms-saas": "^0.4.1"
43
59
  },
44
60
  "devDependencies": {
45
- "@antelopejs/core": "1.13.5",
46
- "@antelopejs/dms": ">=0.9.0 <1.0.0",
47
- "@antelopejs/dms-frontend": ">=0.6.0 <0.7.0",
48
- "@antelopejs/mongodb": "1.4.2",
49
- "@antelopejs/tooling-configs": ">=0.0.7 <1.0.0",
61
+ "@antelopejs/core": "1.16.0",
62
+ "@antelopejs/dms": ">=0.9.3 <1.0.0",
63
+ "@antelopejs/dms-frontend": ">=0.6.3 <0.7.0",
64
+ "@antelopejs/mongodb": "1.4.3",
65
+ "@antelopejs/tooling-configs": ">=0.0.9 <1.0.0",
50
66
  "@types/node": "^24.0.0",
51
- "@types/node-cron": "^3.0.11",
52
67
  "knip": "^6.34.0",
53
68
  "mongodb-memory-server-core": "^11.0.1",
54
69
  "oxfmt": "^0.66.0",
@@ -61,12 +76,15 @@
61
76
  "vitest": "^4.1.10"
62
77
  },
63
78
  "optionalDependencies": {
64
- "@antelopejs/interface-dms-automation": ">=0.1.1 <1.0.0"
79
+ "@antelopejs/interface-dms-automation": ">=0.2.1 <1.0.0"
65
80
  },
66
81
  "antelopeJs": {
67
82
  "baseUrl": "dist",
68
83
  "implements": [
69
84
  "@antelopejs/interface-dms-saas"
85
+ ],
86
+ "skills": [
87
+ "./skills"
70
88
  ]
71
89
  },
72
90
  "scripts": {
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: dms-saas
3
+ description: Turns an AntelopeJS DMS project into a SaaS with the @antelopejs/dms-saas module. Use when installing or configuring dms-saas (Stripe keys, webhooks, registration card policy, admission mode, default plan), gating features by plan permissions, seeding plans or features, extending it through @antelopejs/interface-dms-saas (registration extras, invoice line items, upcoming invoice preview, workspace settings pages, billing page blocks, lifecycle consumers), or debugging sign-up, checkout, plan sync or reconciliation errors.
4
+ icon: i-lucide-building-2
5
+ category: billing
6
+ tags: [saas, billing, stripe, plans, subscriptions, multi-tenant, dms-module]
7
+ ---
8
+
9
+ # dms-saas
10
+
11
+ Self-service sign-up, plans, Stripe billing, customer workspace settings and an owner back office (`/modules/saas/...`).
12
+ User docs: `docs/` of this package, published at https://dms.antelopejs.com/docs/modules/saas
13
+ (`configuration`, `extending`, `stripe`, `operations`, `faq#upgrading`).
14
+
15
+ ## Setup checklist
16
+
17
+ - dms-saas 0.6 requires `@antelopejs/dms` >=0.9 (interface-dms 0.7, renderer `@antelopejs/dms-frontend` 0.6);
18
+ 0.5 is the DMS 0.8 line.
19
+ - `ajs project modules add @antelopejs/dms-saas`; config `stripe.{secretKey,publishableKey,webhookSecret}` from env
20
+ (`envOverrides`). Placeholder keys disable Stripe calls (plan sync skipped).
21
+ - Stripe webhook endpoint → `/api/saas/webhooks/stripe`, API version `2026-08-26.dahlia`.
22
+ - Frontend server env: `DMS_AUTH_ESTABLISH_ENDPOINTS=/api/saas/register/finalize`, else sign-ups stay signed out (403).
23
+ - `allowedRedirectHosts` for Checkout / billing-portal return URLs (loopback auto-allowed in dev only).
24
+ - A free plan must exist (or `defaultPlanSlug`): registration opens it, and every workspace without a subscription gets it.
25
+ - Options: `admissionMode` (`open` | `invitation-only`), `registration.paymentMethod` (`required` default | `optional` | `none`),
26
+ `publicScreens.{register,pricing}`, `upcomingInvoicePreviewCacheTtlSeconds`, `reportingCurrency`,
27
+ `stripe.readTimeoutMs` (4000; Stripe reads a page renders) and `stripe.readMaxNetworkRetries` (0).
28
+
29
+ ## Plans gate permissions
30
+
31
+ - The `dms-saas.plan-intersection` resolver keeps, per member, roles ∩ plan; the workspace owner gets every plan
32
+ permission (never `*`). A plan grants exactly the ids it lists: list every component id, not just the page.
33
+ - New project page or block → add its permission ids to the plans that should get it, or tenants lose it.
34
+ - Seeding plans from code: write name, price, currency, interval, billing mode; leave `paymentProviderRefs` to dms-saas.
35
+ - Features: `displayName` / `tooltip` are localized (`{ en, fr }` + `.localize("*")`), never i18n keys.
36
+
37
+ ## Extension points (`@antelopejs/interface-dms-saas`)
38
+
39
+ | Need | API |
40
+ | --- | --- |
41
+ | Own registration screen | `publicScreens.register: false` + `useSaasRegistration()` composable |
42
+ | Store sign-up answers | `extras` on the payload + `Hook.TENANT_BEING_PROVISIONED` listener (throwing cancels the sign-up; return `undefined`) |
43
+ | Bill metered usage | `RegisterInvoiceLineItemsProvider({ id, resolve })` in `construct`, unregister in `stop`; stable `key`s |
44
+ | Show tax-exact next invoice | `GetUpcomingInvoicePreview({ tenantId, userId })` → `available` / `absent` / `unavailable` |
45
+ | Page in workspace settings | `category: workspaceSettingsCategory` (from `/pages`) |
46
+ | Block on the billing page | `RegisterTenantBillingPageExtension({ name, components })` anchored on `tenantBillingPage.components.*` |
47
+ | React to create/suspend/reactivate | `RegisterWorkspaceLifecycleConsumer`; dedupe by `operationId`; gate on `IsWorkspaceProvisioningCommitted` |
48
+
49
+ Pages you add stay backend-declared blocks; only the missing block is a `CustomComponent`, with `.meta({ name, description, icon })`.
50
+
51
+ ## Gotchas
52
+
53
+ - `reconciliation_required` (operator actions, migrations, webhooks) is deliberate: never delete records or replay blindly.
54
+ - Checkout errors: `422 checkout_rejected` (retry), `503 checkout_unavailable`, `409 checkout_in_progress`.
55
+ - Upgrading old databases needs manual row fixes (`isComplimentary`, `documentType`, `revision`, `paidUsagePeriods`, localized features).
56
+ - Passwords follow the DMS policy: letters, digits and `@$!%*?&` only.
@@ -1,33 +0,0 @@
1
- import { onBeforeUnmount, onMounted } from 'vue'
2
-
3
- /** The General page's rename form, which changes the workspace's name. */
4
- const RENAME_SUBMIT_URL = '/api/saas/workspaces/current'
5
-
6
- interface FormSubmitPayload {
7
- submitUrl?: string
8
- }
9
-
10
- interface FormSubmitDetail {
11
- data?: FormSubmitPayload
12
- }
13
-
14
- /** Whether a form's success event is the rename of the current workspace. */
15
- function isWorkspaceRenameEvent(event: Event): boolean {
16
- const detail = (event as CustomEvent<FormSubmitDetail>).detail
17
- return detail?.data?.submitUrl === RENAME_SUBMIT_URL
18
- }
19
-
20
- /**
21
- * Runs `onRenamed` each time the General page's form renames the current
22
- * workspace, for as long as the calling component is mounted: whatever shows
23
- * the name (the switcher, the deletion's typed confirmation) reads it again.
24
- */
25
- export function useWorkspaceRenamed(onRenamed: () => void): void {
26
- function onFormSaved(event: Event): void {
27
- if (isWorkspaceRenameEvent(event)) onRenamed()
28
- }
29
- onMounted(() => window.addEventListener(FormEvents.SUBMIT_SUCCESS, onFormSaved))
30
- onBeforeUnmount(() =>
31
- window.removeEventListener(FormEvents.SUBMIT_SUCCESS, onFormSaved),
32
- )
33
- }