@contractspec/example.saas-boilerplate 3.8.9 → 3.8.11
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/.turbo/turbo-build.log +155 -155
- package/CHANGELOG.md +34 -0
- package/dist/billing/billing.entity.js +1 -113
- package/dist/billing/billing.enum.js +1 -19
- package/dist/billing/billing.event.js +1 -90
- package/dist/billing/billing.handler.js +1 -148
- package/dist/billing/billing.operations.js +1 -278
- package/dist/billing/billing.presentation.js +1 -55
- package/dist/billing/billing.schema.js +1 -121
- package/dist/billing/index.js +1 -691
- package/dist/browser/billing/billing.entity.js +1 -113
- package/dist/browser/billing/billing.enum.js +1 -19
- package/dist/browser/billing/billing.event.js +1 -90
- package/dist/browser/billing/billing.handler.js +1 -148
- package/dist/browser/billing/billing.operations.js +1 -278
- package/dist/browser/billing/billing.presentation.js +1 -55
- package/dist/browser/billing/billing.schema.js +1 -121
- package/dist/browser/billing/index.js +1 -691
- package/dist/browser/dashboard/dashboard.presentation.js +1 -55
- package/dist/browser/dashboard/index.js +1 -55
- package/dist/browser/docs/index.js +5 -49
- package/dist/browser/docs/saas-boilerplate.docblock.js +5 -49
- package/dist/browser/example.js +1 -39
- package/dist/browser/handlers/index.js +2 -358
- package/dist/browser/handlers/saas.handlers.js +2 -134
- package/dist/browser/index.js +9 -3591
- package/dist/browser/presentations/index.js +1 -299
- package/dist/browser/project/index.js +1 -793
- package/dist/browser/project/project.entity.js +1 -77
- package/dist/browser/project/project.enum.js +1 -18
- package/dist/browser/project/project.event.js +1 -103
- package/dist/browser/project/project.handler.js +1 -178
- package/dist/browser/project/project.operations.js +1 -372
- package/dist/browser/project/project.presentation.js +1 -180
- package/dist/browser/project/project.schema.js +1 -134
- package/dist/browser/saas-boilerplate.feature.js +1 -304
- package/dist/browser/seeders/index.js +2 -20
- package/dist/browser/settings/index.js +1 -75
- package/dist/browser/settings/settings.entity.js +1 -74
- package/dist/browser/settings/settings.enum.js +1 -11
- package/dist/browser/shared/mock-data.js +1 -104
- package/dist/browser/tests/operations.test-spec.js +1 -112
- package/dist/browser/ui/SaasDashboard.js +1 -1239
- package/dist/browser/ui/SaasDashboard.visualizations.js +1 -249
- package/dist/browser/ui/SaasProjectList.js +1 -162
- package/dist/browser/ui/SaasSettingsPanel.js +1 -145
- package/dist/browser/ui/hooks/index.js +1 -159
- package/dist/browser/ui/hooks/useProjectList.js +1 -66
- package/dist/browser/ui/hooks/useProjectMutations.js +1 -91
- package/dist/browser/ui/index.js +5 -2077
- package/dist/browser/ui/modals/CreateProjectModal.js +1 -153
- package/dist/browser/ui/modals/ProjectActionsModal.js +1 -335
- package/dist/browser/ui/modals/index.js +1 -487
- package/dist/browser/ui/overlays/demo-overlays.js +1 -61
- package/dist/browser/ui/overlays/index.js +1 -61
- package/dist/browser/ui/renderers/index.js +5 -901
- package/dist/browser/ui/renderers/project-list.markdown.js +5 -725
- package/dist/browser/ui/renderers/project-list.renderer.js +1 -177
- package/dist/browser/visualizations/catalog.js +1 -155
- package/dist/browser/visualizations/index.js +1 -217
- package/dist/browser/visualizations/selectors.js +1 -210
- package/dist/dashboard/dashboard.presentation.js +1 -55
- package/dist/dashboard/index.js +1 -55
- package/dist/docs/index.js +5 -49
- package/dist/docs/saas-boilerplate.docblock.js +5 -49
- package/dist/example.js +1 -39
- package/dist/handlers/index.js +2 -358
- package/dist/handlers/saas.handlers.js +2 -134
- package/dist/index.js +9 -3591
- package/dist/node/billing/billing.entity.js +1 -113
- package/dist/node/billing/billing.enum.js +1 -19
- package/dist/node/billing/billing.event.js +1 -90
- package/dist/node/billing/billing.handler.js +1 -148
- package/dist/node/billing/billing.operations.js +1 -278
- package/dist/node/billing/billing.presentation.js +1 -55
- package/dist/node/billing/billing.schema.js +1 -121
- package/dist/node/billing/index.js +1 -691
- package/dist/node/dashboard/dashboard.presentation.js +1 -55
- package/dist/node/dashboard/index.js +1 -55
- package/dist/node/docs/index.js +5 -49
- package/dist/node/docs/saas-boilerplate.docblock.js +5 -49
- package/dist/node/example.js +1 -39
- package/dist/node/handlers/index.js +2 -358
- package/dist/node/handlers/saas.handlers.js +2 -134
- package/dist/node/index.js +9 -3591
- package/dist/node/presentations/index.js +1 -299
- package/dist/node/project/index.js +1 -793
- package/dist/node/project/project.entity.js +1 -77
- package/dist/node/project/project.enum.js +1 -18
- package/dist/node/project/project.event.js +1 -103
- package/dist/node/project/project.handler.js +1 -178
- package/dist/node/project/project.operations.js +1 -372
- package/dist/node/project/project.presentation.js +1 -180
- package/dist/node/project/project.schema.js +1 -134
- package/dist/node/saas-boilerplate.feature.js +1 -304
- package/dist/node/seeders/index.js +2 -20
- package/dist/node/settings/index.js +1 -75
- package/dist/node/settings/settings.entity.js +1 -74
- package/dist/node/settings/settings.enum.js +1 -11
- package/dist/node/shared/mock-data.js +1 -104
- package/dist/node/tests/operations.test-spec.js +1 -112
- package/dist/node/ui/SaasDashboard.js +1 -1239
- package/dist/node/ui/SaasDashboard.visualizations.js +1 -249
- package/dist/node/ui/SaasProjectList.js +1 -162
- package/dist/node/ui/SaasSettingsPanel.js +1 -145
- package/dist/node/ui/hooks/index.js +1 -159
- package/dist/node/ui/hooks/useProjectList.js +1 -66
- package/dist/node/ui/hooks/useProjectMutations.js +1 -91
- package/dist/node/ui/index.js +5 -2077
- package/dist/node/ui/modals/CreateProjectModal.js +1 -153
- package/dist/node/ui/modals/ProjectActionsModal.js +1 -335
- package/dist/node/ui/modals/index.js +1 -487
- package/dist/node/ui/overlays/demo-overlays.js +1 -61
- package/dist/node/ui/overlays/index.js +1 -61
- package/dist/node/ui/renderers/index.js +5 -901
- package/dist/node/ui/renderers/project-list.markdown.js +5 -725
- package/dist/node/ui/renderers/project-list.renderer.js +1 -177
- package/dist/node/visualizations/catalog.js +1 -155
- package/dist/node/visualizations/index.js +1 -217
- package/dist/node/visualizations/selectors.js +1 -210
- package/dist/presentations/index.js +1 -299
- package/dist/project/index.js +1 -793
- package/dist/project/project.entity.js +1 -77
- package/dist/project/project.enum.js +1 -18
- package/dist/project/project.event.js +1 -103
- package/dist/project/project.handler.js +1 -178
- package/dist/project/project.operations.js +1 -372
- package/dist/project/project.presentation.js +1 -180
- package/dist/project/project.schema.js +1 -134
- package/dist/saas-boilerplate.feature.js +1 -304
- package/dist/seeders/index.js +2 -20
- package/dist/settings/index.js +1 -75
- package/dist/settings/settings.entity.js +1 -74
- package/dist/settings/settings.enum.js +1 -11
- package/dist/shared/mock-data.js +1 -104
- package/dist/tests/operations.test-spec.js +1 -112
- package/dist/ui/SaasDashboard.js +1 -1239
- package/dist/ui/SaasDashboard.visualizations.js +1 -249
- package/dist/ui/SaasProjectList.js +1 -162
- package/dist/ui/SaasSettingsPanel.js +1 -145
- package/dist/ui/hooks/index.js +1 -159
- package/dist/ui/hooks/useProjectList.js +1 -66
- package/dist/ui/hooks/useProjectMutations.js +1 -91
- package/dist/ui/index.js +5 -2077
- package/dist/ui/modals/CreateProjectModal.js +1 -153
- package/dist/ui/modals/ProjectActionsModal.js +1 -335
- package/dist/ui/modals/index.js +1 -487
- package/dist/ui/overlays/demo-overlays.js +1 -61
- package/dist/ui/overlays/index.js +1 -61
- package/dist/ui/renderers/index.js +5 -901
- package/dist/ui/renderers/project-list.markdown.js +5 -725
- package/dist/ui/renderers/project-list.renderer.js +1 -177
- package/dist/visualizations/catalog.js +1 -155
- package/dist/visualizations/index.js +1 -217
- package/dist/visualizations/selectors.js +1 -210
- package/package.json +12 -12
|
@@ -1,55 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
definePresentation,
|
|
4
|
-
StabilityEnum
|
|
5
|
-
} from "@contractspec/lib.contracts-spec";
|
|
6
|
-
var SaasDashboardPresentation = definePresentation({
|
|
7
|
-
meta: {
|
|
8
|
-
key: "saas.dashboard",
|
|
9
|
-
version: "1.0.0",
|
|
10
|
-
title: "SaaS Dashboard",
|
|
11
|
-
description: "Main SaaS dashboard with project overview, usage stats, and quick actions",
|
|
12
|
-
domain: "saas-boilerplate",
|
|
13
|
-
owners: ["@saas-team"],
|
|
14
|
-
tags: ["dashboard", "overview"],
|
|
15
|
-
stability: StabilityEnum.Beta,
|
|
16
|
-
goal: "Overview of SaaS activity and metrics",
|
|
17
|
-
context: "Main dashboard"
|
|
18
|
-
},
|
|
19
|
-
source: {
|
|
20
|
-
type: "component",
|
|
21
|
-
framework: "react",
|
|
22
|
-
componentKey: "SaasDashboard"
|
|
23
|
-
},
|
|
24
|
-
targets: ["react", "markdown"],
|
|
25
|
-
policy: {
|
|
26
|
-
flags: ["saas.enabled"]
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var SettingsPanelPresentation = definePresentation({
|
|
30
|
-
meta: {
|
|
31
|
-
key: "saas.settings",
|
|
32
|
-
version: "1.0.0",
|
|
33
|
-
title: "Settings Panel",
|
|
34
|
-
description: "Organization and user settings panel",
|
|
35
|
-
domain: "saas-boilerplate",
|
|
36
|
-
owners: ["@saas-team"],
|
|
37
|
-
tags: ["settings", "config"],
|
|
38
|
-
stability: StabilityEnum.Beta,
|
|
39
|
-
goal: "Configure organization and user settings",
|
|
40
|
-
context: "Settings section"
|
|
41
|
-
},
|
|
42
|
-
source: {
|
|
43
|
-
type: "component",
|
|
44
|
-
framework: "react",
|
|
45
|
-
componentKey: "SettingsPanel"
|
|
46
|
-
},
|
|
47
|
-
targets: ["react"],
|
|
48
|
-
policy: {
|
|
49
|
-
flags: ["saas.enabled"]
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
export {
|
|
53
|
-
SettingsPanelPresentation,
|
|
54
|
-
SaasDashboardPresentation
|
|
55
|
-
};
|
|
1
|
+
import{definePresentation as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({meta:{key:"saas.dashboard",version:"1.0.0",title:"SaaS Dashboard",description:"Main SaaS dashboard with project overview, usage stats, and quick actions",domain:"saas-boilerplate",owners:["@saas-team"],tags:["dashboard","overview"],stability:h.Beta,goal:"Overview of SaaS activity and metrics",context:"Main dashboard"},source:{type:"component",framework:"react",componentKey:"SaasDashboard"},targets:["react","markdown"],policy:{flags:["saas.enabled"]}}),q=g({meta:{key:"saas.settings",version:"1.0.0",title:"Settings Panel",description:"Organization and user settings panel",domain:"saas-boilerplate",owners:["@saas-team"],tags:["settings","config"],stability:h.Beta,goal:"Configure organization and user settings",context:"Settings section"},source:{type:"component",framework:"react",componentKey:"SettingsPanel"},targets:["react"],policy:{flags:["saas.enabled"]}});export{q as SettingsPanelPresentation,k as SaasDashboardPresentation};
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
definePresentation,
|
|
4
|
-
StabilityEnum
|
|
5
|
-
} from "@contractspec/lib.contracts-spec";
|
|
6
|
-
var SaasDashboardPresentation = definePresentation({
|
|
7
|
-
meta: {
|
|
8
|
-
key: "saas.dashboard",
|
|
9
|
-
version: "1.0.0",
|
|
10
|
-
title: "SaaS Dashboard",
|
|
11
|
-
description: "Main SaaS dashboard with project overview, usage stats, and quick actions",
|
|
12
|
-
domain: "saas-boilerplate",
|
|
13
|
-
owners: ["@saas-team"],
|
|
14
|
-
tags: ["dashboard", "overview"],
|
|
15
|
-
stability: StabilityEnum.Beta,
|
|
16
|
-
goal: "Overview of SaaS activity and metrics",
|
|
17
|
-
context: "Main dashboard"
|
|
18
|
-
},
|
|
19
|
-
source: {
|
|
20
|
-
type: "component",
|
|
21
|
-
framework: "react",
|
|
22
|
-
componentKey: "SaasDashboard"
|
|
23
|
-
},
|
|
24
|
-
targets: ["react", "markdown"],
|
|
25
|
-
policy: {
|
|
26
|
-
flags: ["saas.enabled"]
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var SettingsPanelPresentation = definePresentation({
|
|
30
|
-
meta: {
|
|
31
|
-
key: "saas.settings",
|
|
32
|
-
version: "1.0.0",
|
|
33
|
-
title: "Settings Panel",
|
|
34
|
-
description: "Organization and user settings panel",
|
|
35
|
-
domain: "saas-boilerplate",
|
|
36
|
-
owners: ["@saas-team"],
|
|
37
|
-
tags: ["settings", "config"],
|
|
38
|
-
stability: StabilityEnum.Beta,
|
|
39
|
-
goal: "Configure organization and user settings",
|
|
40
|
-
context: "Settings section"
|
|
41
|
-
},
|
|
42
|
-
source: {
|
|
43
|
-
type: "component",
|
|
44
|
-
framework: "react",
|
|
45
|
-
componentKey: "SettingsPanel"
|
|
46
|
-
},
|
|
47
|
-
targets: ["react"],
|
|
48
|
-
policy: {
|
|
49
|
-
flags: ["saas.enabled"]
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
export {
|
|
53
|
-
SettingsPanelPresentation,
|
|
54
|
-
SaasDashboardPresentation
|
|
55
|
-
};
|
|
1
|
+
import{definePresentation as a,StabilityEnum as s}from"@contractspec/lib.contracts-spec";var d=a({meta:{key:"saas.dashboard",version:"1.0.0",title:"SaaS Dashboard",description:"Main SaaS dashboard with project overview, usage stats, and quick actions",domain:"saas-boilerplate",owners:["@saas-team"],tags:["dashboard","overview"],stability:s.Beta,goal:"Overview of SaaS activity and metrics",context:"Main dashboard"},source:{type:"component",framework:"react",componentKey:"SaasDashboard"},targets:["react","markdown"],policy:{flags:["saas.enabled"]}}),o=a({meta:{key:"saas.settings",version:"1.0.0",title:"Settings Panel",description:"Organization and user settings panel",domain:"saas-boilerplate",owners:["@saas-team"],tags:["settings","config"],stability:s.Beta,goal:"Configure organization and user settings",context:"Settings section"},source:{type:"component",framework:"react",componentKey:"SettingsPanel"},targets:["react"],policy:{flags:["saas.enabled"]}});export{o as SettingsPanelPresentation,d as SaasDashboardPresentation};
|
package/dist/node/docs/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var saasBoilerplateDocBlocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.examples.saas-boilerplate.goal",
|
|
6
|
-
title: "SaaS Boilerplate — Goal",
|
|
7
|
-
summary: "Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.",
|
|
8
|
-
kind: "goal",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/examples/saas-boilerplate/goal",
|
|
11
|
-
tags: ["saas", "goal"],
|
|
12
|
-
body: `## Why it matters
|
|
1
|
+
import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.examples.saas-boilerplate.goal",title:"SaaS Boilerplate — Goal",summary:"Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.",kind:"goal",visibility:"public",route:"/docs/examples/saas-boilerplate/goal",tags:["saas","goal"],body:`## Why it matters
|
|
13
2
|
- Provides a regenerable SaaS base: orgs, members, projects, settings, usage/billing.
|
|
14
3
|
- Avoids drift across identity, settings, and usage capture.
|
|
15
4
|
|
|
@@ -19,17 +8,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
19
8
|
|
|
20
9
|
## Success criteria
|
|
21
10
|
- Spec changes to org/project/settings/usage regenerate UI/API/events cleanly.
|
|
22
|
-
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "docs.examples.saas-boilerplate.usage",
|
|
26
|
-
title: "SaaS Boilerplate — Usage",
|
|
27
|
-
summary: "How to seed, extend, and regenerate the SaaS base.",
|
|
28
|
-
kind: "usage",
|
|
29
|
-
visibility: "public",
|
|
30
|
-
route: "/docs/examples/saas-boilerplate/usage",
|
|
31
|
-
tags: ["saas", "usage"],
|
|
32
|
-
body: `## Setup
|
|
11
|
+
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`},{id:"docs.examples.saas-boilerplate.usage",title:"SaaS Boilerplate — Usage",summary:"How to seed, extend, and regenerate the SaaS base.",kind:"usage",visibility:"public",route:"/docs/examples/saas-boilerplate/usage",tags:["saas","usage"],body:`## Setup
|
|
33
12
|
1) Seed (if available) or create orgs, members, and projects via UI.
|
|
34
13
|
2) Configure Notifications for invites and project events; set policy.pii for sensitive fields.
|
|
35
14
|
|
|
@@ -41,17 +20,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
41
20
|
## Guardrails
|
|
42
21
|
- Keep tenant/role context explicit in contracts and presentations.
|
|
43
22
|
- Emit events for invites, project changes, and usage records; log in Audit Trail.
|
|
44
|
-
- Redact sensitive user/org data in markdown/JSON outputs.`
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "docs.examples.saas-boilerplate.reference",
|
|
48
|
-
title: "SaaS Boilerplate — Reference",
|
|
49
|
-
summary: "Entities, contracts, events, and presentations for the SaaS starter.",
|
|
50
|
-
kind: "reference",
|
|
51
|
-
visibility: "public",
|
|
52
|
-
route: "/docs/examples/saas-boilerplate",
|
|
53
|
-
tags: ["saas", "reference"],
|
|
54
|
-
body: `## Entities
|
|
23
|
+
- Redact sensitive user/org data in markdown/JSON outputs.`},{id:"docs.examples.saas-boilerplate.reference",title:"SaaS Boilerplate — Reference",summary:"Entities, contracts, events, and presentations for the SaaS starter.",kind:"reference",visibility:"public",route:"/docs/examples/saas-boilerplate",tags:["saas","reference"],body:`## Entities
|
|
55
24
|
- Organization, Member, Role, Project, AppSettings, UserSettings, BillingUsage.
|
|
56
25
|
|
|
57
26
|
## Contracts
|
|
@@ -65,17 +34,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
65
34
|
|
|
66
35
|
## Notes
|
|
67
36
|
- Tenant isolation is mandatory; enforce via RBAC/policies.
|
|
68
|
-
- Usage/Metering drives billing/limits; keep units explicit.`
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: "docs.examples.saas-boilerplate.constraints",
|
|
72
|
-
title: "SaaS Boilerplate — Constraints & Safety",
|
|
73
|
-
summary: "Internal guardrails for tenancy, RBAC, usage metering, and regeneration.",
|
|
74
|
-
kind: "reference",
|
|
75
|
-
visibility: "internal",
|
|
76
|
-
route: "/docs/examples/saas-boilerplate/constraints",
|
|
77
|
-
tags: ["saas", "constraints", "internal"],
|
|
78
|
-
body: `## Constraints
|
|
37
|
+
- Usage/Metering drives billing/limits; keep units explicit.`},{id:"docs.examples.saas-boilerplate.constraints",title:"SaaS Boilerplate — Constraints & Safety",summary:"Internal guardrails for tenancy, RBAC, usage metering, and regeneration.",kind:"reference",visibility:"internal",route:"/docs/examples/saas-boilerplate/constraints",tags:["saas","constraints","internal"],body:`## Constraints
|
|
79
38
|
- Tenant isolation and RBAC must remain explicit in spec; no implicit defaults in code.
|
|
80
39
|
- Events to emit: org.created, member.invited/accepted, project.created/updated, usage.recorded.
|
|
81
40
|
- Regeneration must not change billing/usage semantics without spec diffs.
|
|
@@ -87,7 +46,4 @@ var saasBoilerplateDocBlocks = [
|
|
|
87
46
|
## Verification
|
|
88
47
|
- Add fixtures for usage recording and role changes.
|
|
89
48
|
- Ensure Audit/Notifications remain wired for invites/project updates.
|
|
90
|
-
- Use Feature Flags for new settings/billing fields; default safe/off.`
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
registerDocBlocks(saasBoilerplateDocBlocks);
|
|
49
|
+
- Use Feature Flags for new settings/billing fields; default safe/off.`}];m(f);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var saasBoilerplateDocBlocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.examples.saas-boilerplate.goal",
|
|
6
|
-
title: "SaaS Boilerplate — Goal",
|
|
7
|
-
summary: "Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.",
|
|
8
|
-
kind: "goal",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/examples/saas-boilerplate/goal",
|
|
11
|
-
tags: ["saas", "goal"],
|
|
12
|
-
body: `## Why it matters
|
|
1
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.saas-boilerplate.goal",title:"SaaS Boilerplate — Goal",summary:"Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.",kind:"goal",visibility:"public",route:"/docs/examples/saas-boilerplate/goal",tags:["saas","goal"],body:`## Why it matters
|
|
13
2
|
- Provides a regenerable SaaS base: orgs, members, projects, settings, usage/billing.
|
|
14
3
|
- Avoids drift across identity, settings, and usage capture.
|
|
15
4
|
|
|
@@ -19,17 +8,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
19
8
|
|
|
20
9
|
## Success criteria
|
|
21
10
|
- Spec changes to org/project/settings/usage regenerate UI/API/events cleanly.
|
|
22
|
-
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "docs.examples.saas-boilerplate.usage",
|
|
26
|
-
title: "SaaS Boilerplate — Usage",
|
|
27
|
-
summary: "How to seed, extend, and regenerate the SaaS base.",
|
|
28
|
-
kind: "usage",
|
|
29
|
-
visibility: "public",
|
|
30
|
-
route: "/docs/examples/saas-boilerplate/usage",
|
|
31
|
-
tags: ["saas", "usage"],
|
|
32
|
-
body: `## Setup
|
|
11
|
+
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`},{id:"docs.examples.saas-boilerplate.usage",title:"SaaS Boilerplate — Usage",summary:"How to seed, extend, and regenerate the SaaS base.",kind:"usage",visibility:"public",route:"/docs/examples/saas-boilerplate/usage",tags:["saas","usage"],body:`## Setup
|
|
33
12
|
1) Seed (if available) or create orgs, members, and projects via UI.
|
|
34
13
|
2) Configure Notifications for invites and project events; set policy.pii for sensitive fields.
|
|
35
14
|
|
|
@@ -41,17 +20,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
41
20
|
## Guardrails
|
|
42
21
|
- Keep tenant/role context explicit in contracts and presentations.
|
|
43
22
|
- Emit events for invites, project changes, and usage records; log in Audit Trail.
|
|
44
|
-
- Redact sensitive user/org data in markdown/JSON outputs.`
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "docs.examples.saas-boilerplate.reference",
|
|
48
|
-
title: "SaaS Boilerplate — Reference",
|
|
49
|
-
summary: "Entities, contracts, events, and presentations for the SaaS starter.",
|
|
50
|
-
kind: "reference",
|
|
51
|
-
visibility: "public",
|
|
52
|
-
route: "/docs/examples/saas-boilerplate",
|
|
53
|
-
tags: ["saas", "reference"],
|
|
54
|
-
body: `## Entities
|
|
23
|
+
- Redact sensitive user/org data in markdown/JSON outputs.`},{id:"docs.examples.saas-boilerplate.reference",title:"SaaS Boilerplate — Reference",summary:"Entities, contracts, events, and presentations for the SaaS starter.",kind:"reference",visibility:"public",route:"/docs/examples/saas-boilerplate",tags:["saas","reference"],body:`## Entities
|
|
55
24
|
- Organization, Member, Role, Project, AppSettings, UserSettings, BillingUsage.
|
|
56
25
|
|
|
57
26
|
## Contracts
|
|
@@ -65,17 +34,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
65
34
|
|
|
66
35
|
## Notes
|
|
67
36
|
- Tenant isolation is mandatory; enforce via RBAC/policies.
|
|
68
|
-
- Usage/Metering drives billing/limits; keep units explicit.`
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: "docs.examples.saas-boilerplate.constraints",
|
|
72
|
-
title: "SaaS Boilerplate — Constraints & Safety",
|
|
73
|
-
summary: "Internal guardrails for tenancy, RBAC, usage metering, and regeneration.",
|
|
74
|
-
kind: "reference",
|
|
75
|
-
visibility: "internal",
|
|
76
|
-
route: "/docs/examples/saas-boilerplate/constraints",
|
|
77
|
-
tags: ["saas", "constraints", "internal"],
|
|
78
|
-
body: `## Constraints
|
|
37
|
+
- Usage/Metering drives billing/limits; keep units explicit.`},{id:"docs.examples.saas-boilerplate.constraints",title:"SaaS Boilerplate — Constraints & Safety",summary:"Internal guardrails for tenancy, RBAC, usage metering, and regeneration.",kind:"reference",visibility:"internal",route:"/docs/examples/saas-boilerplate/constraints",tags:["saas","constraints","internal"],body:`## Constraints
|
|
79
38
|
- Tenant isolation and RBAC must remain explicit in spec; no implicit defaults in code.
|
|
80
39
|
- Events to emit: org.created, member.invited/accepted, project.created/updated, usage.recorded.
|
|
81
40
|
- Regeneration must not change billing/usage semantics without spec diffs.
|
|
@@ -87,7 +46,4 @@ var saasBoilerplateDocBlocks = [
|
|
|
87
46
|
## Verification
|
|
88
47
|
- Add fixtures for usage recording and role changes.
|
|
89
48
|
- Ensure Audit/Notifications remain wired for invites/project updates.
|
|
90
|
-
- Use Feature Flags for new settings/billing fields; default safe/off.`
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
registerDocBlocks(saasBoilerplateDocBlocks);
|
|
49
|
+
- Use Feature Flags for new settings/billing fields; default safe/off.`}];f(h);
|
package/dist/node/example.js
CHANGED
|
@@ -1,39 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var example = defineExample({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "saas-boilerplate",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "SaaS Boilerplate",
|
|
8
|
-
description: "Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.",
|
|
9
|
-
kind: "template",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
stability: "experimental",
|
|
12
|
-
owners: ["@platform.core"],
|
|
13
|
-
tags: ["saas", "multi-tenant", "billing", "rbac"]
|
|
14
|
-
},
|
|
15
|
-
docs: {
|
|
16
|
-
rootDocId: "docs.examples.saas-boilerplate"
|
|
17
|
-
},
|
|
18
|
-
entrypoints: {
|
|
19
|
-
packageName: "@contractspec/example.saas-boilerplate",
|
|
20
|
-
feature: "./feature",
|
|
21
|
-
contracts: "./contracts",
|
|
22
|
-
presentations: "./presentations",
|
|
23
|
-
handlers: "./handlers",
|
|
24
|
-
docs: "./docs"
|
|
25
|
-
},
|
|
26
|
-
surfaces: {
|
|
27
|
-
templates: true,
|
|
28
|
-
sandbox: {
|
|
29
|
-
enabled: true,
|
|
30
|
-
modes: ["playground", "specs", "builder", "markdown", "evolution"]
|
|
31
|
-
},
|
|
32
|
-
studio: { enabled: true, installable: true },
|
|
33
|
-
mcp: { enabled: true }
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var example_default = example;
|
|
37
|
-
export {
|
|
38
|
-
example_default as default
|
|
39
|
-
};
|
|
1
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"saas-boilerplate",version:"1.0.0",title:"SaaS Boilerplate",description:"Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["saas","multi-tenant","billing","rbac"]},docs:{rootDocId:"docs.examples.saas-boilerplate"},entrypoints:{packageName:"@contractspec/example.saas-boilerplate",feature:"./feature",contracts:"./contracts",presentations:"./presentations",handlers:"./handlers",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs","builder","markdown","evolution"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|