@contractspec/example.saas-boilerplate 1.46.0 → 1.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$bundle.log +183 -108
- package/.turbo/turbo-build.log +182 -107
- package/CHANGELOG.md +58 -0
- package/README.md +0 -1
- package/dist/billing/billing.event.d.ts +4 -4
- package/dist/billing/billing.event.js +1 -1
- package/dist/billing/billing.operations.d.ts +5 -5
- package/dist/billing/billing.presentation.d.ts +3 -4
- package/dist/billing/billing.presentation.d.ts.map +1 -1
- package/dist/billing/billing.presentation.js +5 -5
- package/dist/billing/billing.presentation.js.map +1 -1
- package/dist/dashboard/dashboard.presentation.d.ts +3 -4
- package/dist/dashboard/dashboard.presentation.d.ts.map +1 -1
- package/dist/dashboard/dashboard.presentation.js +5 -5
- package/dist/dashboard/dashboard.presentation.js.map +1 -1
- package/dist/example.d.ts +2 -2
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +4 -2
- package/dist/example.js.map +1 -1
- package/dist/handlers/index.d.ts +2 -1
- package/dist/handlers/index.js +2 -1
- package/dist/handlers/saas.handlers.d.ts +68 -0
- package/dist/handlers/saas.handlers.d.ts.map +1 -0
- package/dist/handlers/saas.handlers.js +148 -0
- package/dist/handlers/saas.handlers.js.map +1 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/project/project.event.d.ts +5 -5
- package/dist/project/project.event.d.ts.map +1 -1
- package/dist/project/project.event.js +1 -1
- package/dist/project/project.operations.d.ts +6 -6
- package/dist/project/project.presentation.d.ts +3 -4
- package/dist/project/project.presentation.d.ts.map +1 -1
- package/dist/project/project.presentation.js +5 -5
- package/dist/project/project.presentation.js.map +1 -1
- package/dist/saas-boilerplate.feature.d.ts +2 -2
- package/dist/saas-boilerplate.feature.d.ts.map +1 -1
- package/dist/saas-boilerplate.feature.js +9 -2
- package/dist/saas-boilerplate.feature.js.map +1 -1
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +19 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/shared/overlay-types.d.ts +34 -0
- package/dist/shared/overlay-types.d.ts.map +1 -0
- package/dist/shared/overlay-types.js +0 -0
- package/dist/tests/operations.test-spec.d.ts +10 -0
- package/dist/tests/operations.test-spec.d.ts.map +1 -0
- package/dist/tests/operations.test-spec.js +123 -0
- package/dist/tests/operations.test-spec.js.map +1 -0
- package/dist/ui/SaasDashboard.d.ts +7 -0
- package/dist/ui/SaasDashboard.d.ts.map +1 -0
- package/dist/ui/SaasDashboard.js +298 -0
- package/dist/ui/SaasDashboard.js.map +1 -0
- package/dist/ui/SaasProjectList.d.ts +14 -0
- package/dist/ui/SaasProjectList.d.ts.map +1 -0
- package/dist/ui/SaasProjectList.js +76 -0
- package/dist/ui/SaasProjectList.js.map +1 -0
- package/dist/ui/SaasSettingsPanel.d.ts +7 -0
- package/dist/ui/SaasSettingsPanel.d.ts.map +1 -0
- package/dist/ui/SaasSettingsPanel.js +138 -0
- package/dist/ui/SaasSettingsPanel.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +3 -0
- package/dist/ui/hooks/index.js +6 -0
- package/dist/ui/hooks/useProjectList.d.ts +34 -0
- package/dist/ui/hooks/useProjectList.d.ts.map +1 -0
- package/dist/ui/hooks/useProjectList.js +75 -0
- package/dist/ui/hooks/useProjectList.js.map +1 -0
- package/dist/ui/hooks/useProjectMutations.d.ts +28 -0
- package/dist/ui/hooks/useProjectMutations.d.ts.map +1 -0
- package/dist/ui/hooks/useProjectMutations.js +146 -0
- package/dist/ui/hooks/useProjectMutations.js.map +1 -0
- package/dist/ui/index.d.ts +14 -0
- package/dist/ui/index.js +15 -0
- package/dist/ui/modals/CreateProjectModal.d.ts +23 -0
- package/dist/ui/modals/CreateProjectModal.d.ts.map +1 -0
- package/dist/ui/modals/CreateProjectModal.js +139 -0
- package/dist/ui/modals/CreateProjectModal.js.map +1 -0
- package/dist/ui/modals/ProjectActionsModal.d.ts +38 -0
- package/dist/ui/modals/ProjectActionsModal.d.ts.map +1 -0
- package/dist/ui/modals/ProjectActionsModal.js +292 -0
- package/dist/ui/modals/ProjectActionsModal.js.map +1 -0
- package/dist/ui/modals/index.d.ts +3 -0
- package/dist/ui/modals/index.js +4 -0
- package/dist/ui/overlays/demo-overlays.d.ts +19 -0
- package/dist/ui/overlays/demo-overlays.d.ts.map +1 -0
- package/dist/ui/overlays/demo-overlays.js +70 -0
- package/dist/ui/overlays/demo-overlays.js.map +1 -0
- package/dist/ui/overlays/index.d.ts +2 -0
- package/dist/ui/overlays/index.js +3 -0
- package/dist/ui/renderers/index.d.ts +3 -0
- package/dist/ui/renderers/index.js +4 -0
- package/dist/ui/renderers/project-list.markdown.d.ts +31 -0
- package/dist/ui/renderers/project-list.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/project-list.markdown.js +148 -0
- package/dist/ui/renderers/project-list.markdown.js.map +1 -0
- package/dist/ui/renderers/project-list.renderer.d.ts +9 -0
- package/dist/ui/renderers/project-list.renderer.d.ts.map +1 -0
- package/dist/ui/renderers/project-list.renderer.js +17 -0
- package/dist/ui/renderers/project-list.renderer.js.map +1 -0
- package/package.json +38 -14
- package/src/billing/billing.presentation.ts +5 -6
- package/src/dashboard/dashboard.presentation.ts +5 -6
- package/src/example.ts +3 -3
- package/src/handlers/index.ts +3 -0
- package/src/handlers/saas.handlers.ts +300 -0
- package/src/index.ts +5 -0
- package/src/project/project.presentation.ts +5 -6
- package/src/saas-boilerplate.feature.ts +3 -3
- package/src/seeders/index.ts +28 -0
- package/src/shared/overlay-types.ts +39 -0
- package/src/tests/operations.test-spec.ts +109 -0
- package/src/ui/SaasDashboard.tsx +325 -0
- package/src/ui/SaasProjectList.tsx +113 -0
- package/src/ui/SaasSettingsPanel.tsx +96 -0
- package/src/ui/hooks/index.ts +10 -0
- package/src/ui/hooks/useProjectList.ts +95 -0
- package/src/ui/hooks/useProjectMutations.ts +166 -0
- package/src/ui/index.ts +18 -0
- package/src/ui/modals/CreateProjectModal.tsx +176 -0
- package/src/ui/modals/ProjectActionsModal.tsx +346 -0
- package/src/ui/modals/index.ts +2 -0
- package/src/ui/overlays/demo-overlays.ts +74 -0
- package/src/ui/overlays/index.ts +1 -0
- package/src/ui/renderers/index.ts +7 -0
- package/src/ui/renderers/project-list.markdown.ts +239 -0
- package/src/ui/renderers/project-list.renderer.tsx +22 -0
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/ui/overlays/demo-overlays.ts
|
|
2
|
+
/**
|
|
3
|
+
* Free tier overlay - shows upgrade prompts and limits
|
|
4
|
+
*/
|
|
5
|
+
const saasFreeUserOverlay = {
|
|
6
|
+
overlayId: "saas-boilerplate.free-tier",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
description: "Shows limitations for free tier users",
|
|
9
|
+
appliesTo: {
|
|
10
|
+
feature: "saas-boilerplate",
|
|
11
|
+
tier: "free"
|
|
12
|
+
},
|
|
13
|
+
modifications: [
|
|
14
|
+
{
|
|
15
|
+
type: "setLimit",
|
|
16
|
+
field: "projects",
|
|
17
|
+
max: 3,
|
|
18
|
+
message: "Upgrade to create more projects"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: "hideField",
|
|
22
|
+
field: "advancedSettings",
|
|
23
|
+
reason: "Pro feature"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: "addBadge",
|
|
27
|
+
position: "header",
|
|
28
|
+
label: "Free Plan",
|
|
29
|
+
variant: "default"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Demo user overlay
|
|
35
|
+
*/
|
|
36
|
+
const saasDemoOverlay = {
|
|
37
|
+
overlayId: "saas-boilerplate.demo-user",
|
|
38
|
+
version: "1.0.0",
|
|
39
|
+
description: "Demo mode for SaaS boilerplate",
|
|
40
|
+
appliesTo: {
|
|
41
|
+
feature: "saas-boilerplate",
|
|
42
|
+
role: "demo"
|
|
43
|
+
},
|
|
44
|
+
modifications: [
|
|
45
|
+
{
|
|
46
|
+
type: "hideField",
|
|
47
|
+
field: "billingSection",
|
|
48
|
+
reason: "Demo users cannot access billing"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: "hideField",
|
|
52
|
+
field: "deleteAccount",
|
|
53
|
+
reason: "Not available in demo"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "addBadge",
|
|
57
|
+
position: "header",
|
|
58
|
+
label: "Demo Mode",
|
|
59
|
+
variant: "warning"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* All overlays for saas-boilerplate
|
|
65
|
+
*/
|
|
66
|
+
const saasOverlays = [saasFreeUserOverlay, saasDemoOverlay];
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { saasDemoOverlay, saasFreeUserOverlay, saasOverlays };
|
|
70
|
+
//# sourceMappingURL=demo-overlays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-overlays.js","names":[],"sources":["../../../src/ui/overlays/demo-overlays.ts"],"sourcesContent":["/**\n * Demo Overlay Definitions for SaaS Boilerplate\n *\n * These overlays customize the presentation for different contexts\n * (e.g., demo users, different subscription tiers).\n */\nimport type { OverlayDefinition } from '../../shared/overlay-types';\n\n/**\n * Free tier overlay - shows upgrade prompts and limits\n */\nexport const saasFreeUserOverlay: OverlayDefinition = {\n overlayId: 'saas-boilerplate.free-tier',\n version: '1.0.0',\n description: 'Shows limitations for free tier users',\n appliesTo: {\n feature: 'saas-boilerplate',\n tier: 'free',\n },\n modifications: [\n {\n type: 'setLimit',\n field: 'projects',\n max: 3,\n message: 'Upgrade to create more projects',\n },\n { type: 'hideField', field: 'advancedSettings', reason: 'Pro feature' },\n {\n type: 'addBadge',\n position: 'header',\n label: 'Free Plan',\n variant: 'default',\n },\n ],\n};\n\n/**\n * Demo user overlay\n */\nexport const saasDemoOverlay: OverlayDefinition = {\n overlayId: 'saas-boilerplate.demo-user',\n version: '1.0.0',\n description: 'Demo mode for SaaS boilerplate',\n appliesTo: {\n feature: 'saas-boilerplate',\n role: 'demo',\n },\n modifications: [\n {\n type: 'hideField',\n field: 'billingSection',\n reason: 'Demo users cannot access billing',\n },\n {\n type: 'hideField',\n field: 'deleteAccount',\n reason: 'Not available in demo',\n },\n {\n type: 'addBadge',\n position: 'header',\n label: 'Demo Mode',\n variant: 'warning',\n },\n ],\n};\n\n/**\n * All overlays for saas-boilerplate\n */\nexport const saasOverlays: OverlayDefinition[] = [\n saasFreeUserOverlay,\n saasDemoOverlay,\n];\n"],"mappings":";;;;AAWA,MAAa,sBAAyC;CACpD,WAAW;CACX,SAAS;CACT,aAAa;CACb,WAAW;EACT,SAAS;EACT,MAAM;EACP;CACD,eAAe;EACb;GACE,MAAM;GACN,OAAO;GACP,KAAK;GACL,SAAS;GACV;EACD;GAAE,MAAM;GAAa,OAAO;GAAoB,QAAQ;GAAe;EACvE;GACE,MAAM;GACN,UAAU;GACV,OAAO;GACP,SAAS;GACV;EACF;CACF;;;;AAKD,MAAa,kBAAqC;CAChD,WAAW;CACX,SAAS;CACT,aAAa;CACb,WAAW;EACT,SAAS;EACT,MAAM;EACP;CACD,eAAe;EACb;GACE,MAAM;GACN,OAAO;GACP,QAAQ;GACT;EACD;GACE,MAAM;GACN,OAAO;GACP,QAAQ;GACT;EACD;GACE,MAAM;GACN,UAAU;GACV,OAAO;GACP,SAAS;GACV;EACF;CACF;;;;AAKD,MAAa,eAAoC,CAC/C,qBACA,gBACD"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { projectListReactRenderer } from "./project-list.renderer.js";
|
|
2
|
+
import { projectListMarkdownRenderer, saasBillingMarkdownRenderer, saasDashboardMarkdownRenderer } from "./project-list.markdown.js";
|
|
3
|
+
export { projectListMarkdownRenderer, projectListReactRenderer, saasBillingMarkdownRenderer, saasDashboardMarkdownRenderer };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { projectListReactRenderer } from "./project-list.renderer.js";
|
|
2
|
+
import { projectListMarkdownRenderer, saasBillingMarkdownRenderer, saasDashboardMarkdownRenderer } from "./project-list.markdown.js";
|
|
3
|
+
|
|
4
|
+
export { projectListMarkdownRenderer, projectListReactRenderer, saasBillingMarkdownRenderer, saasDashboardMarkdownRenderer };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PresentationRenderer } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/ui/renderers/project-list.markdown.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Markdown renderer for saas-boilerplate.project.list presentation
|
|
7
|
+
* Only handles ProjectListView component
|
|
8
|
+
*/
|
|
9
|
+
declare const projectListMarkdownRenderer: PresentationRenderer<{
|
|
10
|
+
mimeType: string;
|
|
11
|
+
body: string;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Markdown renderer for saas-boilerplate.dashboard presentation
|
|
15
|
+
* Only handles SaasDashboard component
|
|
16
|
+
*/
|
|
17
|
+
declare const saasDashboardMarkdownRenderer: PresentationRenderer<{
|
|
18
|
+
mimeType: string;
|
|
19
|
+
body: string;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Markdown renderer for saas-boilerplate.billing.settings presentation
|
|
23
|
+
* Only handles SubscriptionView component
|
|
24
|
+
*/
|
|
25
|
+
declare const saasBillingMarkdownRenderer: PresentationRenderer<{
|
|
26
|
+
mimeType: string;
|
|
27
|
+
body: string;
|
|
28
|
+
}>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { projectListMarkdownRenderer, saasBillingMarkdownRenderer, saasDashboardMarkdownRenderer };
|
|
31
|
+
//# sourceMappingURL=project-list.markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-list.markdown.d.ts","names":[],"sources":["../../../src/ui/renderers/project-list.markdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAsBa,6BAA6B;;;;;;;;cA6D7B,+BAA+B;;;;;;;;cA0F/B,6BAA6B"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { mockGetSubscriptionHandler, mockListProjectsHandler } from "@contractspec/example.saas-boilerplate/handlers";
|
|
2
|
+
|
|
3
|
+
//#region src/ui/renderers/project-list.markdown.ts
|
|
4
|
+
/**
|
|
5
|
+
* Markdown renderer for saas-boilerplate.project.list presentation
|
|
6
|
+
* Only handles ProjectListView component
|
|
7
|
+
*/
|
|
8
|
+
const projectListMarkdownRenderer = {
|
|
9
|
+
target: "markdown",
|
|
10
|
+
render: async (desc, _ctx) => {
|
|
11
|
+
if (desc.source.type !== "component" || desc.source.componentKey !== "ProjectListView") throw new Error("projectListMarkdownRenderer: not ProjectListView");
|
|
12
|
+
const data = await mockListProjectsHandler({
|
|
13
|
+
limit: 20,
|
|
14
|
+
offset: 0
|
|
15
|
+
});
|
|
16
|
+
const items = data.projects ?? data.items ?? [];
|
|
17
|
+
const lines = [
|
|
18
|
+
"# Projects",
|
|
19
|
+
"",
|
|
20
|
+
`**Total**: ${data.total} projects`,
|
|
21
|
+
""
|
|
22
|
+
];
|
|
23
|
+
if (items.length === 0) lines.push("_No projects found._");
|
|
24
|
+
else {
|
|
25
|
+
lines.push("| Status | Project | Description |");
|
|
26
|
+
lines.push("|--------|---------|-------------|");
|
|
27
|
+
for (const project of items) {
|
|
28
|
+
const status = project.status === "ACTIVE" ? "✅" : project.status === "ARCHIVED" ? "📦" : "⏸️";
|
|
29
|
+
lines.push(`| ${status} | **${project.name}** | ${project.description ?? "-"} |`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
mimeType: "text/markdown",
|
|
34
|
+
body: lines.join("\n")
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Markdown renderer for saas-boilerplate.dashboard presentation
|
|
40
|
+
* Only handles SaasDashboard component
|
|
41
|
+
*/
|
|
42
|
+
const saasDashboardMarkdownRenderer = {
|
|
43
|
+
target: "markdown",
|
|
44
|
+
render: async (desc, _ctx) => {
|
|
45
|
+
if (desc.source.type !== "component" || desc.source.componentKey !== "SaasDashboard") throw new Error("saasDashboardMarkdownRenderer: not SaasDashboard");
|
|
46
|
+
const [projectsData, subscription] = await Promise.all([mockListProjectsHandler({ limit: 50 }), mockGetSubscriptionHandler()]);
|
|
47
|
+
const projects = projectsData.projects ?? [];
|
|
48
|
+
const activeProjects = projects.filter((p) => p.status === "ACTIVE").length;
|
|
49
|
+
const archivedProjects = projects.filter((p) => p.status === "ARCHIVED").length;
|
|
50
|
+
const lines = [
|
|
51
|
+
"# SaaS Dashboard",
|
|
52
|
+
"",
|
|
53
|
+
"> Organization overview and usage summary",
|
|
54
|
+
"",
|
|
55
|
+
"## Summary",
|
|
56
|
+
"",
|
|
57
|
+
"| Metric | Value |",
|
|
58
|
+
"|--------|-------|",
|
|
59
|
+
`| Total Projects | ${projectsData.total} |`,
|
|
60
|
+
`| Active Projects | ${activeProjects} |`,
|
|
61
|
+
`| Archived Projects | ${archivedProjects} |`,
|
|
62
|
+
`| Subscription Plan | ${subscription.planName} |`,
|
|
63
|
+
`| Subscription Status | ${subscription.status} |`,
|
|
64
|
+
"",
|
|
65
|
+
"## Projects",
|
|
66
|
+
""
|
|
67
|
+
];
|
|
68
|
+
if (projects.length === 0) lines.push("_No projects yet._");
|
|
69
|
+
else {
|
|
70
|
+
lines.push("| Status | Project | Description |");
|
|
71
|
+
lines.push("|--------|---------|-------------|");
|
|
72
|
+
for (const project of projects.slice(0, 10)) {
|
|
73
|
+
const status = project.status === "ACTIVE" ? "✅" : project.status === "ARCHIVED" ? "📦" : "⏸️";
|
|
74
|
+
lines.push(`| ${status} | **${project.name}** | ${project.description ?? "-"} |`);
|
|
75
|
+
}
|
|
76
|
+
if (projects.length > 10) lines.push(`| ... | ... | _${projectsData.total - 10} more projects_ |`);
|
|
77
|
+
}
|
|
78
|
+
lines.push("");
|
|
79
|
+
lines.push("## Subscription");
|
|
80
|
+
lines.push("");
|
|
81
|
+
lines.push(`- **Plan**: ${subscription.planName}`);
|
|
82
|
+
lines.push(`- **Status**: ${subscription.status}`);
|
|
83
|
+
if (subscription.currentPeriodEnd) lines.push(`- **Period End**: ${new Date(subscription.currentPeriodEnd).toLocaleDateString()}`);
|
|
84
|
+
return {
|
|
85
|
+
mimeType: "text/markdown",
|
|
86
|
+
body: lines.join("\n")
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Markdown renderer for saas-boilerplate.billing.settings presentation
|
|
92
|
+
* Only handles SubscriptionView component
|
|
93
|
+
*/
|
|
94
|
+
const saasBillingMarkdownRenderer = {
|
|
95
|
+
target: "markdown",
|
|
96
|
+
render: async (desc, _ctx) => {
|
|
97
|
+
if (desc.source.type !== "component" || desc.source.componentKey !== "SubscriptionView") throw new Error("saasBillingMarkdownRenderer: not SubscriptionView");
|
|
98
|
+
const subscription = await mockGetSubscriptionHandler();
|
|
99
|
+
const lines = [
|
|
100
|
+
"# Billing & Subscription",
|
|
101
|
+
"",
|
|
102
|
+
"> Current subscription details and billing information",
|
|
103
|
+
"",
|
|
104
|
+
"## Subscription Details",
|
|
105
|
+
"",
|
|
106
|
+
"| Property | Value |",
|
|
107
|
+
"|----------|-------|",
|
|
108
|
+
`| Plan | ${subscription.planName} |`,
|
|
109
|
+
`| Status | ${subscription.status} |`,
|
|
110
|
+
`| ID | ${subscription.id} |`,
|
|
111
|
+
`| Period Start | ${new Date(subscription.currentPeriodStart).toLocaleDateString()} |`,
|
|
112
|
+
`| Period End | ${new Date(subscription.currentPeriodEnd).toLocaleDateString()} |`
|
|
113
|
+
];
|
|
114
|
+
lines.push("");
|
|
115
|
+
lines.push("## Plan Limits");
|
|
116
|
+
lines.push("");
|
|
117
|
+
lines.push(`- **Projects**: ${subscription.limits.projects}`);
|
|
118
|
+
lines.push(`- **Users**: ${subscription.limits.users}`);
|
|
119
|
+
lines.push("");
|
|
120
|
+
lines.push("## Plan Features");
|
|
121
|
+
lines.push("");
|
|
122
|
+
if (subscription.planName.toLowerCase().includes("free")) {
|
|
123
|
+
lines.push("- ✅ Up to 3 projects");
|
|
124
|
+
lines.push("- ✅ Basic support");
|
|
125
|
+
lines.push("- ❌ Priority support");
|
|
126
|
+
lines.push("- ❌ Advanced analytics");
|
|
127
|
+
} else if (subscription.planName.toLowerCase().includes("pro")) {
|
|
128
|
+
lines.push("- ✅ Unlimited projects");
|
|
129
|
+
lines.push("- ✅ Priority support");
|
|
130
|
+
lines.push("- ✅ Advanced analytics");
|
|
131
|
+
lines.push("- ❌ Custom integrations");
|
|
132
|
+
} else {
|
|
133
|
+
lines.push("- ✅ Unlimited projects");
|
|
134
|
+
lines.push("- ✅ Priority support");
|
|
135
|
+
lines.push("- ✅ Advanced analytics");
|
|
136
|
+
lines.push("- ✅ Custom integrations");
|
|
137
|
+
lines.push("- ✅ Dedicated support");
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
mimeType: "text/markdown",
|
|
141
|
+
body: lines.join("\n")
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
//#endregion
|
|
147
|
+
export { projectListMarkdownRenderer, saasBillingMarkdownRenderer, saasDashboardMarkdownRenderer };
|
|
148
|
+
//# sourceMappingURL=project-list.markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-list.markdown.js","names":[],"sources":["../../../src/ui/renderers/project-list.markdown.ts"],"sourcesContent":["/**\n * Markdown renderer for SaaS Project List presentation\n *\n * Uses dynamic import to ensure correct build order.\n */\nimport type { PresentationRenderer } from '@contractspec/lib.contracts';\nimport {\n mockListProjectsHandler,\n mockGetSubscriptionHandler,\n} from '@contractspec/example.saas-boilerplate/handlers';\n\ninterface ProjectItem {\n id: string;\n name: string;\n status: string;\n description?: string;\n}\n\n/**\n * Markdown renderer for saas-boilerplate.project.list presentation\n * Only handles ProjectListView component\n */\nexport const projectListMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle ProjectListView\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'ProjectListView'\n ) {\n throw new Error('projectListMarkdownRenderer: not ProjectListView');\n }\n\n const data = await mockListProjectsHandler({\n limit: 20,\n offset: 0,\n });\n\n // The example handler returns 'projects', not 'items'\n const items =\n (data as { projects?: ProjectItem[]; items?: ProjectItem[] }).projects ??\n (data as { items?: ProjectItem[] }).items ??\n [];\n\n const lines: string[] = [\n '# Projects',\n '',\n `**Total**: ${data.total} projects`,\n '',\n ];\n\n if (items.length === 0) {\n lines.push('_No projects found._');\n } else {\n lines.push('| Status | Project | Description |');\n lines.push('|--------|---------|-------------|');\n for (const project of items) {\n const status =\n project.status === 'ACTIVE'\n ? '✅'\n : project.status === 'ARCHIVED'\n ? '📦'\n : '⏸️';\n lines.push(\n `| ${status} | **${project.name}** | ${project.description ?? '-'} |`\n );\n }\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n\n/**\n * Markdown renderer for saas-boilerplate.dashboard presentation\n * Only handles SaasDashboard component\n */\nexport const saasDashboardMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle SaasDashboard\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'SaasDashboard'\n ) {\n throw new Error('saasDashboardMarkdownRenderer: not SaasDashboard');\n }\n\n const [projectsData, subscription] = await Promise.all([\n mockListProjectsHandler({ limit: 50 }),\n mockGetSubscriptionHandler(),\n ]);\n\n const projects =\n (projectsData as { projects?: ProjectItem[] }).projects ?? [];\n const activeProjects = projects.filter((p) => p.status === 'ACTIVE').length;\n const archivedProjects = projects.filter(\n (p) => p.status === 'ARCHIVED'\n ).length;\n\n const lines: string[] = [\n '# SaaS Dashboard',\n '',\n '> Organization overview and usage summary',\n '',\n '## Summary',\n '',\n '| Metric | Value |',\n '|--------|-------|',\n `| Total Projects | ${projectsData.total} |`,\n `| Active Projects | ${activeProjects} |`,\n `| Archived Projects | ${archivedProjects} |`,\n `| Subscription Plan | ${subscription.planName} |`,\n `| Subscription Status | ${subscription.status} |`,\n '',\n '## Projects',\n '',\n ];\n\n if (projects.length === 0) {\n lines.push('_No projects yet._');\n } else {\n lines.push('| Status | Project | Description |');\n lines.push('|--------|---------|-------------|');\n for (const project of projects.slice(0, 10)) {\n const status =\n project.status === 'ACTIVE'\n ? '✅'\n : project.status === 'ARCHIVED'\n ? '📦'\n : '⏸️';\n lines.push(\n `| ${status} | **${project.name}** | ${project.description ?? '-'} |`\n );\n }\n if (projects.length > 10) {\n lines.push(\n `| ... | ... | _${projectsData.total - 10} more projects_ |`\n );\n }\n }\n\n lines.push('');\n lines.push('## Subscription');\n lines.push('');\n lines.push(`- **Plan**: ${subscription.planName}`);\n lines.push(`- **Status**: ${subscription.status}`);\n if (subscription.currentPeriodEnd) {\n lines.push(\n `- **Period End**: ${new Date(subscription.currentPeriodEnd).toLocaleDateString()}`\n );\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n\n/**\n * Markdown renderer for saas-boilerplate.billing.settings presentation\n * Only handles SubscriptionView component\n */\nexport const saasBillingMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle SubscriptionView\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'SubscriptionView'\n ) {\n throw new Error('saasBillingMarkdownRenderer: not SubscriptionView');\n }\n\n const subscription = await mockGetSubscriptionHandler();\n\n const lines: string[] = [\n '# Billing & Subscription',\n '',\n '> Current subscription details and billing information',\n '',\n '## Subscription Details',\n '',\n '| Property | Value |',\n '|----------|-------|',\n `| Plan | ${subscription.planName} |`,\n `| Status | ${subscription.status} |`,\n `| ID | ${subscription.id} |`,\n `| Period Start | ${new Date(subscription.currentPeriodStart).toLocaleDateString()} |`,\n `| Period End | ${new Date(subscription.currentPeriodEnd).toLocaleDateString()} |`,\n ];\n\n lines.push('');\n lines.push('## Plan Limits');\n lines.push('');\n lines.push(`- **Projects**: ${subscription.limits.projects}`);\n lines.push(`- **Users**: ${subscription.limits.users}`);\n\n lines.push('');\n lines.push('## Plan Features');\n lines.push('');\n\n if (subscription.planName.toLowerCase().includes('free')) {\n lines.push('- ✅ Up to 3 projects');\n lines.push('- ✅ Basic support');\n lines.push('- ❌ Priority support');\n lines.push('- ❌ Advanced analytics');\n } else if (subscription.planName.toLowerCase().includes('pro')) {\n lines.push('- ✅ Unlimited projects');\n lines.push('- ✅ Priority support');\n lines.push('- ✅ Advanced analytics');\n lines.push('- ❌ Custom integrations');\n } else {\n lines.push('- ✅ Unlimited projects');\n lines.push('- ✅ Priority support');\n lines.push('- ✅ Advanced analytics');\n lines.push('- ✅ Custom integrations');\n lines.push('- ✅ Dedicated support');\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PresentationRenderer } from "@contractspec/lib.contracts";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/ui/renderers/project-list.renderer.d.ts
|
|
5
|
+
|
|
6
|
+
declare const projectListReactRenderer: PresentationRenderer<React.ReactElement>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { projectListReactRenderer };
|
|
9
|
+
//# sourceMappingURL=project-list.renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-list.renderer.d.ts","names":[],"sources":["../../../src/ui/renderers/project-list.renderer.tsx"],"sourcesContent":[],"mappings":";;;;;cAOa,0BAA0B,qBAAqB,KAAA,CAAM"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SaasProjectList } from "../SaasProjectList.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/ui/renderers/project-list.renderer.tsx
|
|
6
|
+
const projectListReactRenderer = {
|
|
7
|
+
target: "react",
|
|
8
|
+
render: async (desc, _ctx) => {
|
|
9
|
+
if (desc.source.type !== "component") throw new Error("Invalid source type");
|
|
10
|
+
if (desc.source.componentKey !== "SaasProjectListView") throw new Error(`Unknown component: ${desc.source.componentKey}`);
|
|
11
|
+
return /* @__PURE__ */ jsx(SaasProjectList, {});
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { projectListReactRenderer };
|
|
17
|
+
//# sourceMappingURL=project-list.renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-list.renderer.js","names":[],"sources":["../../../src/ui/renderers/project-list.renderer.tsx"],"sourcesContent":["/**\n * React renderer for SaaS Project List presentation\n */\nimport * as React from 'react';\nimport type { PresentationRenderer } from '@contractspec/lib.contracts';\nimport { SaasProjectList } from '../SaasProjectList';\n\nexport const projectListReactRenderer: PresentationRenderer<React.ReactElement> =\n {\n target: 'react',\n render: async (desc, _ctx) => {\n if (desc.source.type !== 'component') {\n throw new Error('Invalid source type');\n }\n\n if (desc.source.componentKey !== 'SaasProjectListView') {\n throw new Error(`Unknown component: ${desc.source.componentKey}`);\n }\n\n return <SaasProjectList />;\n },\n };\n"],"mappings":";;;;;AAOA,MAAa,2BACX;CACE,QAAQ;CACR,QAAQ,OAAO,MAAM,SAAS;AAC5B,MAAI,KAAK,OAAO,SAAS,YACvB,OAAM,IAAI,MAAM,sBAAsB;AAGxC,MAAI,KAAK,OAAO,iBAAiB,sBAC/B,OAAM,IAAI,MAAM,sBAAsB,KAAK,OAAO,eAAe;AAGnE,SAAO,oBAAC,oBAAkB;;CAE7B"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.saas-boilerplate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "SaaS Boilerplate - Users, Orgs, Projects, Billing, Settings",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
6
|
"types": "./dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": "./dist/index.js",
|
|
@@ -21,6 +20,7 @@
|
|
|
21
20
|
"./docs/saas-boilerplate.docblock": "./dist/docs/saas-boilerplate.docblock.js",
|
|
22
21
|
"./example": "./dist/example.js",
|
|
23
22
|
"./handlers": "./dist/handlers/index.js",
|
|
23
|
+
"./handlers/saas.handlers": "./dist/handlers/saas.handlers.js",
|
|
24
24
|
"./presentations": "./dist/presentations/index.js",
|
|
25
25
|
"./project": "./dist/project/index.js",
|
|
26
26
|
"./project/project.entity": "./dist/project/project.entity.js",
|
|
@@ -31,10 +31,28 @@
|
|
|
31
31
|
"./project/project.presentation": "./dist/project/project.presentation.js",
|
|
32
32
|
"./project/project.schema": "./dist/project/project.schema.js",
|
|
33
33
|
"./saas-boilerplate.feature": "./dist/saas-boilerplate.feature.js",
|
|
34
|
+
"./seeders": "./dist/seeders/index.js",
|
|
34
35
|
"./settings": "./dist/settings/index.js",
|
|
35
36
|
"./settings/settings.entity": "./dist/settings/settings.entity.js",
|
|
36
37
|
"./settings/settings.enum": "./dist/settings/settings.enum.js",
|
|
37
38
|
"./shared/mock-data": "./dist/shared/mock-data.js",
|
|
39
|
+
"./shared/overlay-types": "./dist/shared/overlay-types.js",
|
|
40
|
+
"./tests/operations.test-spec": "./dist/tests/operations.test-spec.js",
|
|
41
|
+
"./ui": "./dist/ui/index.js",
|
|
42
|
+
"./ui/hooks": "./dist/ui/hooks/index.js",
|
|
43
|
+
"./ui/hooks/useProjectList": "./dist/ui/hooks/useProjectList.js",
|
|
44
|
+
"./ui/hooks/useProjectMutations": "./dist/ui/hooks/useProjectMutations.js",
|
|
45
|
+
"./ui/modals": "./dist/ui/modals/index.js",
|
|
46
|
+
"./ui/modals/CreateProjectModal": "./dist/ui/modals/CreateProjectModal.js",
|
|
47
|
+
"./ui/modals/ProjectActionsModal": "./dist/ui/modals/ProjectActionsModal.js",
|
|
48
|
+
"./ui/overlays": "./dist/ui/overlays/index.js",
|
|
49
|
+
"./ui/overlays/demo-overlays": "./dist/ui/overlays/demo-overlays.js",
|
|
50
|
+
"./ui/renderers": "./dist/ui/renderers/index.js",
|
|
51
|
+
"./ui/renderers/project-list.markdown": "./dist/ui/renderers/project-list.markdown.js",
|
|
52
|
+
"./ui/renderers/project-list.renderer": "./dist/ui/renderers/project-list.renderer.js",
|
|
53
|
+
"./ui/SaasDashboard": "./dist/ui/SaasDashboard.js",
|
|
54
|
+
"./ui/SaasProjectList": "./dist/ui/SaasProjectList.js",
|
|
55
|
+
"./ui/SaasSettingsPanel": "./dist/ui/SaasSettingsPanel.js",
|
|
38
56
|
"./*": "./*"
|
|
39
57
|
},
|
|
40
58
|
"scripts": {
|
|
@@ -48,23 +66,29 @@
|
|
|
48
66
|
"lint": "bun lint:fix",
|
|
49
67
|
"lint:fix": "eslint src --fix",
|
|
50
68
|
"lint:check": "eslint src",
|
|
51
|
-
"test": "bun
|
|
69
|
+
"test": "bun test"
|
|
52
70
|
},
|
|
53
71
|
"dependencies": {
|
|
54
|
-
"@contractspec/lib.identity-rbac": "1.
|
|
55
|
-
"@contractspec/lib.jobs": "1.
|
|
56
|
-
"@contractspec/module.audit-trail": "1.
|
|
57
|
-
"@contractspec/module.notifications": "1.
|
|
58
|
-
"@contractspec/lib.contracts": "1.
|
|
59
|
-
"@contractspec/lib.schema": "1.
|
|
72
|
+
"@contractspec/lib.identity-rbac": "1.47.0",
|
|
73
|
+
"@contractspec/lib.jobs": "1.47.0",
|
|
74
|
+
"@contractspec/module.audit-trail": "1.47.0",
|
|
75
|
+
"@contractspec/module.notifications": "1.47.0",
|
|
76
|
+
"@contractspec/lib.contracts": "1.47.0",
|
|
77
|
+
"@contractspec/lib.schema": "1.47.0",
|
|
78
|
+
"@contractspec/lib.example-shared-ui": "1.1.0",
|
|
79
|
+
"@contractspec/lib.design-system": "1.47.0",
|
|
80
|
+
"@contractspec/lib.runtime-sandbox": "0.2.0",
|
|
81
|
+
"react": "19.2.3",
|
|
82
|
+
"react-dom": "19.2.3"
|
|
60
83
|
},
|
|
61
84
|
"devDependencies": {
|
|
62
|
-
"@contractspec/tool.tsdown": "1.
|
|
63
|
-
"@contractspec/tool.typescript": "1.
|
|
64
|
-
"tsdown": "^0.
|
|
65
|
-
"typescript": "^5.9.3"
|
|
85
|
+
"@contractspec/tool.tsdown": "1.47.0",
|
|
86
|
+
"@contractspec/tool.typescript": "1.47.0",
|
|
87
|
+
"tsdown": "^0.19.0",
|
|
88
|
+
"typescript": "^5.9.3",
|
|
89
|
+
"@types/react": "^19.2.8",
|
|
90
|
+
"@types/react-dom": "^19.2.2"
|
|
66
91
|
},
|
|
67
|
-
"module": "./dist/index.js",
|
|
68
92
|
"publishConfig": {
|
|
69
93
|
"exports": {
|
|
70
94
|
".": "./dist/index.js",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StabilityEnum } from '@contractspec/lib.contracts';
|
|
1
|
+
import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Presentation for subscription overview.
|
|
6
5
|
*/
|
|
7
|
-
export const SubscriptionPresentation
|
|
6
|
+
export const SubscriptionPresentation = definePresentation({
|
|
8
7
|
meta: {
|
|
9
8
|
key: 'saas.billing.subscription',
|
|
10
9
|
version: '1.0.0',
|
|
@@ -27,12 +26,12 @@ export const SubscriptionPresentation: PresentationSpec = {
|
|
|
27
26
|
policy: {
|
|
28
27
|
flags: ['saas.billing.enabled'],
|
|
29
28
|
},
|
|
30
|
-
};
|
|
29
|
+
});
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* Presentation for usage dashboard.
|
|
34
33
|
*/
|
|
35
|
-
export const UsageDashboardPresentation
|
|
34
|
+
export const UsageDashboardPresentation = definePresentation({
|
|
36
35
|
meta: {
|
|
37
36
|
key: 'saas.billing.usage',
|
|
38
37
|
version: '1.0.0',
|
|
@@ -54,4 +53,4 @@ export const UsageDashboardPresentation: PresentationSpec = {
|
|
|
54
53
|
policy: {
|
|
55
54
|
flags: ['saas.billing.enabled'],
|
|
56
55
|
},
|
|
57
|
-
};
|
|
56
|
+
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StabilityEnum } from '@contractspec/lib.contracts';
|
|
1
|
+
import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Main dashboard presentation for the SaaS application.
|
|
6
5
|
*/
|
|
7
|
-
export const SaasDashboardPresentation
|
|
6
|
+
export const SaasDashboardPresentation = definePresentation({
|
|
8
7
|
meta: {
|
|
9
8
|
key: 'saas.dashboard',
|
|
10
9
|
version: '1.0.0',
|
|
@@ -27,12 +26,12 @@ export const SaasDashboardPresentation: PresentationSpec = {
|
|
|
27
26
|
policy: {
|
|
28
27
|
flags: ['saas.enabled'],
|
|
29
28
|
},
|
|
30
|
-
};
|
|
29
|
+
});
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* Settings panel presentation.
|
|
34
33
|
*/
|
|
35
|
-
export const SettingsPanelPresentation
|
|
34
|
+
export const SettingsPanelPresentation = definePresentation({
|
|
36
35
|
meta: {
|
|
37
36
|
key: 'saas.settings',
|
|
38
37
|
version: '1.0.0',
|
|
@@ -54,4 +53,4 @@ export const SettingsPanelPresentation: PresentationSpec = {
|
|
|
54
53
|
policy: {
|
|
55
54
|
flags: ['saas.enabled'],
|
|
56
55
|
},
|
|
57
|
-
};
|
|
56
|
+
});
|
package/src/example.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineExample } from '@contractspec/lib.contracts';
|
|
2
2
|
|
|
3
|
-
const example
|
|
3
|
+
const example = defineExample({
|
|
4
4
|
meta: {
|
|
5
5
|
key: 'saas-boilerplate',
|
|
6
6
|
version: '1.0.0',
|
|
@@ -33,6 +33,6 @@ const example: ExampleSpec = {
|
|
|
33
33
|
studio: { enabled: true, installable: true },
|
|
34
34
|
mcp: { enabled: true },
|
|
35
35
|
},
|
|
36
|
-
};
|
|
36
|
+
});
|
|
37
37
|
|
|
38
38
|
export default example;
|