@contractspec/example.saas-boilerplate 3.8.9 → 3.8.10
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 +156 -156
- package/CHANGELOG.md +20 -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,210 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
defineVisualization,
|
|
4
|
-
VisualizationRegistry
|
|
5
|
-
} from "@contractspec/lib.contracts-spec/visualizations";
|
|
6
|
-
var PROJECT_LIST_REF = {
|
|
7
|
-
key: "saas.project.list",
|
|
8
|
-
version: "1.0.0"
|
|
9
|
-
};
|
|
10
|
-
var META = {
|
|
11
|
-
version: "1.0.0",
|
|
12
|
-
domain: "saas",
|
|
13
|
-
stability: "experimental",
|
|
14
|
-
owners: ["@example.saas-boilerplate"],
|
|
15
|
-
tags: ["saas", "visualization", "projects"]
|
|
16
|
-
};
|
|
17
|
-
var SaasProjectUsageVisualization = defineVisualization({
|
|
18
|
-
meta: {
|
|
19
|
-
...META,
|
|
20
|
-
key: "saas-boilerplate.visualization.project-usage",
|
|
21
|
-
title: "Project Capacity",
|
|
22
|
-
description: "Current project count against the current plan limit.",
|
|
23
|
-
goal: "Show usage against the active plan allowance.",
|
|
24
|
-
context: "SaaS account overview."
|
|
25
|
-
},
|
|
26
|
-
source: { primary: PROJECT_LIST_REF, resultPath: "data" },
|
|
27
|
-
visualization: {
|
|
28
|
-
kind: "metric",
|
|
29
|
-
measure: "totalProjects",
|
|
30
|
-
comparisonMeasure: "projectLimit",
|
|
31
|
-
measures: [
|
|
32
|
-
{
|
|
33
|
-
key: "totalProjects",
|
|
34
|
-
label: "Projects",
|
|
35
|
-
dataPath: "totalProjects",
|
|
36
|
-
format: "number"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: "projectLimit",
|
|
40
|
-
label: "Plan Limit",
|
|
41
|
-
dataPath: "projectLimit",
|
|
42
|
-
format: "number"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
table: { caption: "Current project count and plan limit." }
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
var SaasProjectStatusVisualization = defineVisualization({
|
|
49
|
-
meta: {
|
|
50
|
-
...META,
|
|
51
|
-
key: "saas-boilerplate.visualization.project-status",
|
|
52
|
-
title: "Project Status",
|
|
53
|
-
description: "Distribution of project states.",
|
|
54
|
-
goal: "Show the mix of active, draft, and archived projects.",
|
|
55
|
-
context: "Project portfolio overview."
|
|
56
|
-
},
|
|
57
|
-
source: { primary: PROJECT_LIST_REF, resultPath: "data" },
|
|
58
|
-
visualization: {
|
|
59
|
-
kind: "pie",
|
|
60
|
-
nameDimension: "status",
|
|
61
|
-
valueMeasure: "projects",
|
|
62
|
-
dimensions: [
|
|
63
|
-
{ key: "status", label: "Status", dataPath: "status", type: "category" }
|
|
64
|
-
],
|
|
65
|
-
measures: [
|
|
66
|
-
{
|
|
67
|
-
key: "projects",
|
|
68
|
-
label: "Projects",
|
|
69
|
-
dataPath: "projects",
|
|
70
|
-
format: "number"
|
|
71
|
-
}
|
|
72
|
-
],
|
|
73
|
-
table: { caption: "Project counts by status." }
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
var SaasProjectTierVisualization = defineVisualization({
|
|
77
|
-
meta: {
|
|
78
|
-
...META,
|
|
79
|
-
key: "saas-boilerplate.visualization.project-tiers",
|
|
80
|
-
title: "Tier Comparison",
|
|
81
|
-
description: "Distribution of projects across tiers.",
|
|
82
|
-
goal: "Compare how the current portfolio is distributed by tier.",
|
|
83
|
-
context: "Plan and packaging overview."
|
|
84
|
-
},
|
|
85
|
-
source: { primary: PROJECT_LIST_REF, resultPath: "data" },
|
|
86
|
-
visualization: {
|
|
87
|
-
kind: "cartesian",
|
|
88
|
-
variant: "bar",
|
|
89
|
-
xDimension: "tier",
|
|
90
|
-
yMeasures: ["projects"],
|
|
91
|
-
dimensions: [
|
|
92
|
-
{ key: "tier", label: "Tier", dataPath: "tier", type: "category" }
|
|
93
|
-
],
|
|
94
|
-
measures: [
|
|
95
|
-
{
|
|
96
|
-
key: "projects",
|
|
97
|
-
label: "Projects",
|
|
98
|
-
dataPath: "projects",
|
|
99
|
-
format: "number",
|
|
100
|
-
color: "#1d4ed8"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
table: { caption: "Project counts by tier." }
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
var SaasProjectActivityVisualization = defineVisualization({
|
|
107
|
-
meta: {
|
|
108
|
-
...META,
|
|
109
|
-
key: "saas-boilerplate.visualization.project-activity",
|
|
110
|
-
title: "Recent Project Activity",
|
|
111
|
-
description: "Daily project creation activity.",
|
|
112
|
-
goal: "Show recent project activity over time.",
|
|
113
|
-
context: "Project portfolio trend view."
|
|
114
|
-
},
|
|
115
|
-
source: { primary: PROJECT_LIST_REF, resultPath: "data" },
|
|
116
|
-
visualization: {
|
|
117
|
-
kind: "cartesian",
|
|
118
|
-
variant: "line",
|
|
119
|
-
xDimension: "day",
|
|
120
|
-
yMeasures: ["projects"],
|
|
121
|
-
dimensions: [{ key: "day", label: "Day", dataPath: "day", type: "time" }],
|
|
122
|
-
measures: [
|
|
123
|
-
{
|
|
124
|
-
key: "projects",
|
|
125
|
-
label: "Projects",
|
|
126
|
-
dataPath: "projects",
|
|
127
|
-
format: "number",
|
|
128
|
-
color: "#0f766e"
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
table: { caption: "Daily project creation counts." }
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
var SaasVisualizationSpecs = [
|
|
135
|
-
SaasProjectUsageVisualization,
|
|
136
|
-
SaasProjectStatusVisualization,
|
|
137
|
-
SaasProjectTierVisualization,
|
|
138
|
-
SaasProjectActivityVisualization
|
|
139
|
-
];
|
|
140
|
-
var SaasVisualizationRegistry = new VisualizationRegistry([
|
|
141
|
-
...SaasVisualizationSpecs
|
|
142
|
-
]);
|
|
143
|
-
var SaasVisualizationRefs = SaasVisualizationSpecs.map((spec) => ({
|
|
144
|
-
key: spec.meta.key,
|
|
145
|
-
version: spec.meta.version
|
|
146
|
-
}));
|
|
147
|
-
|
|
148
|
-
// src/visualizations/selectors.ts
|
|
149
|
-
function toDayKey(value) {
|
|
150
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
151
|
-
return date.toISOString().slice(0, 10);
|
|
152
|
-
}
|
|
153
|
-
function createSaasVisualizationItems(projects, projectLimit = 10) {
|
|
154
|
-
const statusCounts = new Map;
|
|
155
|
-
const tierCounts = new Map;
|
|
156
|
-
const activityCounts = new Map;
|
|
157
|
-
for (const project of projects) {
|
|
158
|
-
statusCounts.set(project.status, (statusCounts.get(project.status) ?? 0) + 1);
|
|
159
|
-
tierCounts.set(project.tier, (tierCounts.get(project.tier) ?? 0) + 1);
|
|
160
|
-
const day = toDayKey(project.createdAt);
|
|
161
|
-
activityCounts.set(day, (activityCounts.get(day) ?? 0) + 1);
|
|
162
|
-
}
|
|
163
|
-
return [
|
|
164
|
-
{
|
|
165
|
-
key: "saas-capacity",
|
|
166
|
-
spec: SaasProjectUsageVisualization,
|
|
167
|
-
data: { data: [{ totalProjects: projects.length, projectLimit }] },
|
|
168
|
-
title: "Project Capacity",
|
|
169
|
-
description: "Current project count compared to the active limit.",
|
|
170
|
-
height: 220
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
key: "saas-status",
|
|
174
|
-
spec: SaasProjectStatusVisualization,
|
|
175
|
-
data: {
|
|
176
|
-
data: Array.from(statusCounts.entries()).map(([status, count]) => ({
|
|
177
|
-
status,
|
|
178
|
-
projects: count
|
|
179
|
-
}))
|
|
180
|
-
},
|
|
181
|
-
title: "Project Status",
|
|
182
|
-
description: "Status mix across the current project portfolio.",
|
|
183
|
-
height: 260
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
key: "saas-tier",
|
|
187
|
-
spec: SaasProjectTierVisualization,
|
|
188
|
-
data: {
|
|
189
|
-
data: Array.from(tierCounts.entries()).map(([tier, count]) => ({
|
|
190
|
-
tier,
|
|
191
|
-
projects: count
|
|
192
|
-
}))
|
|
193
|
-
},
|
|
194
|
-
title: "Tier Comparison",
|
|
195
|
-
description: "How projects are distributed across tiers."
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
key: "saas-activity",
|
|
199
|
-
spec: SaasProjectActivityVisualization,
|
|
200
|
-
data: {
|
|
201
|
-
data: Array.from(activityCounts.entries()).sort(([left], [right]) => left.localeCompare(right)).map(([day, count]) => ({ day, projects: count }))
|
|
202
|
-
},
|
|
203
|
-
title: "Recent Project Activity",
|
|
204
|
-
description: "Daily project creation activity."
|
|
205
|
-
}
|
|
206
|
-
];
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
createSaasVisualizationItems
|
|
210
|
-
};
|
|
1
|
+
import{defineVisualization as w,VisualizationRegistry as D}from"@contractspec/lib.contracts-spec/visualizations";var x={key:"saas.project.list",version:"1.0.0"},B={version:"1.0.0",domain:"saas",stability:"experimental",owners:["@example.saas-boilerplate"],tags:["saas","visualization","projects"]},Q=w({meta:{...B,key:"saas-boilerplate.visualization.project-usage",title:"Project Capacity",description:"Current project count against the current plan limit.",goal:"Show usage against the active plan allowance.",context:"SaaS account overview."},source:{primary:x,resultPath:"data"},visualization:{kind:"metric",measure:"totalProjects",comparisonMeasure:"projectLimit",measures:[{key:"totalProjects",label:"Projects",dataPath:"totalProjects",format:"number"},{key:"projectLimit",label:"Plan Limit",dataPath:"projectLimit",format:"number"}],table:{caption:"Current project count and plan limit."}}}),W=w({meta:{...B,key:"saas-boilerplate.visualization.project-status",title:"Project Status",description:"Distribution of project states.",goal:"Show the mix of active, draft, and archived projects.",context:"Project portfolio overview."},source:{primary:x,resultPath:"data"},visualization:{kind:"pie",nameDimension:"status",valueMeasure:"projects",dimensions:[{key:"status",label:"Status",dataPath:"status",type:"category"}],measures:[{key:"projects",label:"Projects",dataPath:"projects",format:"number"}],table:{caption:"Project counts by status."}}}),X=w({meta:{...B,key:"saas-boilerplate.visualization.project-tiers",title:"Tier Comparison",description:"Distribution of projects across tiers.",goal:"Compare how the current portfolio is distributed by tier.",context:"Plan and packaging overview."},source:{primary:x,resultPath:"data"},visualization:{kind:"cartesian",variant:"bar",xDimension:"tier",yMeasures:["projects"],dimensions:[{key:"tier",label:"Tier",dataPath:"tier",type:"category"}],measures:[{key:"projects",label:"Projects",dataPath:"projects",format:"number",color:"#1d4ed8"}],table:{caption:"Project counts by tier."}}}),Y=w({meta:{...B,key:"saas-boilerplate.visualization.project-activity",title:"Recent Project Activity",description:"Daily project creation activity.",goal:"Show recent project activity over time.",context:"Project portfolio trend view."},source:{primary:x,resultPath:"data"},visualization:{kind:"cartesian",variant:"line",xDimension:"day",yMeasures:["projects"],dimensions:[{key:"day",label:"Day",dataPath:"day",type:"time"}],measures:[{key:"projects",label:"Projects",dataPath:"projects",format:"number",color:"#0f766e"}],table:{caption:"Daily project creation counts."}}}),$=[Q,W,X,Y],m=new D([...$]),U=$.map((q)=>({key:q.meta.key,version:q.meta.version}));function K(q){return(q instanceof Date?q:new Date(q)).toISOString().slice(0,10)}function J(q,Z=10){let G=new Map,H=new Map,N=new Map;for(let b of q){G.set(b.status,(G.get(b.status)??0)+1),H.set(b.tier,(H.get(b.tier)??0)+1);let k=K(b.createdAt);N.set(k,(N.get(k)??0)+1)}return[{key:"saas-capacity",spec:Q,data:{data:[{totalProjects:q.length,projectLimit:Z}]},title:"Project Capacity",description:"Current project count compared to the active limit.",height:220},{key:"saas-status",spec:W,data:{data:Array.from(G.entries()).map(([b,k])=>({status:b,projects:k}))},title:"Project Status",description:"Status mix across the current project portfolio.",height:260},{key:"saas-tier",spec:X,data:{data:Array.from(H.entries()).map(([b,k])=>({tier:b,projects:k}))},title:"Tier Comparison",description:"How projects are distributed across tiers."},{key:"saas-activity",spec:Y,data:{data:Array.from(N.entries()).sort(([b],[k])=>b.localeCompare(k)).map(([b,k])=>({day:b,projects:k}))},title:"Recent Project Activity",description:"Daily project creation activity."}]}export{J as createSaasVisualizationItems};
|
|
@@ -1,56 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
definePresentation,
|
|
5
|
-
StabilityEnum
|
|
6
|
-
} from "@contractspec/lib.contracts-spec";
|
|
7
|
-
var SaasDashboardPresentation = definePresentation({
|
|
8
|
-
meta: {
|
|
9
|
-
key: "saas.dashboard",
|
|
10
|
-
version: "1.0.0",
|
|
11
|
-
title: "SaaS Dashboard",
|
|
12
|
-
description: "Main SaaS dashboard with project overview, usage stats, and quick actions",
|
|
13
|
-
domain: "saas-boilerplate",
|
|
14
|
-
owners: ["@saas-team"],
|
|
15
|
-
tags: ["dashboard", "overview"],
|
|
16
|
-
stability: StabilityEnum.Beta,
|
|
17
|
-
goal: "Overview of SaaS activity and metrics",
|
|
18
|
-
context: "Main dashboard"
|
|
19
|
-
},
|
|
20
|
-
source: {
|
|
21
|
-
type: "component",
|
|
22
|
-
framework: "react",
|
|
23
|
-
componentKey: "SaasDashboard"
|
|
24
|
-
},
|
|
25
|
-
targets: ["react", "markdown"],
|
|
26
|
-
policy: {
|
|
27
|
-
flags: ["saas.enabled"]
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var SettingsPanelPresentation = definePresentation({
|
|
31
|
-
meta: {
|
|
32
|
-
key: "saas.settings",
|
|
33
|
-
version: "1.0.0",
|
|
34
|
-
title: "Settings Panel",
|
|
35
|
-
description: "Organization and user settings panel",
|
|
36
|
-
domain: "saas-boilerplate",
|
|
37
|
-
owners: ["@saas-team"],
|
|
38
|
-
tags: ["settings", "config"],
|
|
39
|
-
stability: StabilityEnum.Beta,
|
|
40
|
-
goal: "Configure organization and user settings",
|
|
41
|
-
context: "Settings section"
|
|
42
|
-
},
|
|
43
|
-
source: {
|
|
44
|
-
type: "component",
|
|
45
|
-
framework: "react",
|
|
46
|
-
componentKey: "SettingsPanel"
|
|
47
|
-
},
|
|
48
|
-
targets: ["react"],
|
|
49
|
-
policy: {
|
|
50
|
-
flags: ["saas.enabled"]
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
export {
|
|
54
|
-
SettingsPanelPresentation,
|
|
55
|
-
SaasDashboardPresentation
|
|
56
|
-
};
|
|
2
|
+
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};
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
definePresentation,
|
|
5
|
-
StabilityEnum
|
|
6
|
-
} from "@contractspec/lib.contracts-spec";
|
|
7
|
-
var SaasDashboardPresentation = definePresentation({
|
|
8
|
-
meta: {
|
|
9
|
-
key: "saas.dashboard",
|
|
10
|
-
version: "1.0.0",
|
|
11
|
-
title: "SaaS Dashboard",
|
|
12
|
-
description: "Main SaaS dashboard with project overview, usage stats, and quick actions",
|
|
13
|
-
domain: "saas-boilerplate",
|
|
14
|
-
owners: ["@saas-team"],
|
|
15
|
-
tags: ["dashboard", "overview"],
|
|
16
|
-
stability: StabilityEnum.Beta,
|
|
17
|
-
goal: "Overview of SaaS activity and metrics",
|
|
18
|
-
context: "Main dashboard"
|
|
19
|
-
},
|
|
20
|
-
source: {
|
|
21
|
-
type: "component",
|
|
22
|
-
framework: "react",
|
|
23
|
-
componentKey: "SaasDashboard"
|
|
24
|
-
},
|
|
25
|
-
targets: ["react", "markdown"],
|
|
26
|
-
policy: {
|
|
27
|
-
flags: ["saas.enabled"]
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var SettingsPanelPresentation = definePresentation({
|
|
31
|
-
meta: {
|
|
32
|
-
key: "saas.settings",
|
|
33
|
-
version: "1.0.0",
|
|
34
|
-
title: "Settings Panel",
|
|
35
|
-
description: "Organization and user settings panel",
|
|
36
|
-
domain: "saas-boilerplate",
|
|
37
|
-
owners: ["@saas-team"],
|
|
38
|
-
tags: ["settings", "config"],
|
|
39
|
-
stability: StabilityEnum.Beta,
|
|
40
|
-
goal: "Configure organization and user settings",
|
|
41
|
-
context: "Settings section"
|
|
42
|
-
},
|
|
43
|
-
source: {
|
|
44
|
-
type: "component",
|
|
45
|
-
framework: "react",
|
|
46
|
-
componentKey: "SettingsPanel"
|
|
47
|
-
},
|
|
48
|
-
targets: ["react"],
|
|
49
|
-
policy: {
|
|
50
|
-
flags: ["saas.enabled"]
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
export {
|
|
54
|
-
SettingsPanelPresentation,
|
|
55
|
-
SaasDashboardPresentation
|
|
56
|
-
};
|
|
2
|
+
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/docs/index.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
4
|
-
var saasBoilerplateDocBlocks = [
|
|
5
|
-
{
|
|
6
|
-
id: "docs.examples.saas-boilerplate.goal",
|
|
7
|
-
title: "SaaS Boilerplate \u2014 Goal",
|
|
8
|
-
summary: "Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.",
|
|
9
|
-
kind: "goal",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
route: "/docs/examples/saas-boilerplate/goal",
|
|
12
|
-
tags: ["saas", "goal"],
|
|
13
|
-
body: `## Why it matters
|
|
2
|
+
import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.examples.saas-boilerplate.goal",title:"SaaS Boilerplate \u2014 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
|
|
14
3
|
- Provides a regenerable SaaS base: orgs, members, projects, settings, usage/billing.
|
|
15
4
|
- Avoids drift across identity, settings, and usage capture.
|
|
16
5
|
|
|
@@ -20,17 +9,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
20
9
|
|
|
21
10
|
## Success criteria
|
|
22
11
|
- Spec changes to org/project/settings/usage regenerate UI/API/events cleanly.
|
|
23
|
-
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: "docs.examples.saas-boilerplate.usage",
|
|
27
|
-
title: "SaaS Boilerplate \u2014 Usage",
|
|
28
|
-
summary: "How to seed, extend, and regenerate the SaaS base.",
|
|
29
|
-
kind: "usage",
|
|
30
|
-
visibility: "public",
|
|
31
|
-
route: "/docs/examples/saas-boilerplate/usage",
|
|
32
|
-
tags: ["saas", "usage"],
|
|
33
|
-
body: `## Setup
|
|
12
|
+
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`},{id:"docs.examples.saas-boilerplate.usage",title:"SaaS Boilerplate \u2014 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
|
|
34
13
|
1) Seed (if available) or create orgs, members, and projects via UI.
|
|
35
14
|
2) Configure Notifications for invites and project events; set policy.pii for sensitive fields.
|
|
36
15
|
|
|
@@ -42,17 +21,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
42
21
|
## Guardrails
|
|
43
22
|
- Keep tenant/role context explicit in contracts and presentations.
|
|
44
23
|
- Emit events for invites, project changes, and usage records; log in Audit Trail.
|
|
45
|
-
- Redact sensitive user/org data in markdown/JSON outputs.`
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "docs.examples.saas-boilerplate.reference",
|
|
49
|
-
title: "SaaS Boilerplate \u2014 Reference",
|
|
50
|
-
summary: "Entities, contracts, events, and presentations for the SaaS starter.",
|
|
51
|
-
kind: "reference",
|
|
52
|
-
visibility: "public",
|
|
53
|
-
route: "/docs/examples/saas-boilerplate",
|
|
54
|
-
tags: ["saas", "reference"],
|
|
55
|
-
body: `## Entities
|
|
24
|
+
- Redact sensitive user/org data in markdown/JSON outputs.`},{id:"docs.examples.saas-boilerplate.reference",title:"SaaS Boilerplate \u2014 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
|
|
56
25
|
- Organization, Member, Role, Project, AppSettings, UserSettings, BillingUsage.
|
|
57
26
|
|
|
58
27
|
## Contracts
|
|
@@ -66,17 +35,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
66
35
|
|
|
67
36
|
## Notes
|
|
68
37
|
- Tenant isolation is mandatory; enforce via RBAC/policies.
|
|
69
|
-
- Usage/Metering drives billing/limits; keep units explicit.`
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: "docs.examples.saas-boilerplate.constraints",
|
|
73
|
-
title: "SaaS Boilerplate \u2014 Constraints & Safety",
|
|
74
|
-
summary: "Internal guardrails for tenancy, RBAC, usage metering, and regeneration.",
|
|
75
|
-
kind: "reference",
|
|
76
|
-
visibility: "internal",
|
|
77
|
-
route: "/docs/examples/saas-boilerplate/constraints",
|
|
78
|
-
tags: ["saas", "constraints", "internal"],
|
|
79
|
-
body: `## Constraints
|
|
38
|
+
- Usage/Metering drives billing/limits; keep units explicit.`},{id:"docs.examples.saas-boilerplate.constraints",title:"SaaS Boilerplate \u2014 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
|
|
80
39
|
- Tenant isolation and RBAC must remain explicit in spec; no implicit defaults in code.
|
|
81
40
|
- Events to emit: org.created, member.invited/accepted, project.created/updated, usage.recorded.
|
|
82
41
|
- Regeneration must not change billing/usage semantics without spec diffs.
|
|
@@ -88,7 +47,4 @@ var saasBoilerplateDocBlocks = [
|
|
|
88
47
|
## Verification
|
|
89
48
|
- Add fixtures for usage recording and role changes.
|
|
90
49
|
- Ensure Audit/Notifications remain wired for invites/project updates.
|
|
91
|
-
- Use Feature Flags for new settings/billing fields; default safe/off.`
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
|
-
registerDocBlocks(saasBoilerplateDocBlocks);
|
|
50
|
+
- Use Feature Flags for new settings/billing fields; default safe/off.`}];m(f);
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
4
|
-
var saasBoilerplateDocBlocks = [
|
|
5
|
-
{
|
|
6
|
-
id: "docs.examples.saas-boilerplate.goal",
|
|
7
|
-
title: "SaaS Boilerplate \u2014 Goal",
|
|
8
|
-
summary: "Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.",
|
|
9
|
-
kind: "goal",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
route: "/docs/examples/saas-boilerplate/goal",
|
|
12
|
-
tags: ["saas", "goal"],
|
|
13
|
-
body: `## Why it matters
|
|
2
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.saas-boilerplate.goal",title:"SaaS Boilerplate \u2014 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
|
|
14
3
|
- Provides a regenerable SaaS base: orgs, members, projects, settings, usage/billing.
|
|
15
4
|
- Avoids drift across identity, settings, and usage capture.
|
|
16
5
|
|
|
@@ -20,17 +9,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
20
9
|
|
|
21
10
|
## Success criteria
|
|
22
11
|
- Spec changes to org/project/settings/usage regenerate UI/API/events cleanly.
|
|
23
|
-
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: "docs.examples.saas-boilerplate.usage",
|
|
27
|
-
title: "SaaS Boilerplate \u2014 Usage",
|
|
28
|
-
summary: "How to seed, extend, and regenerate the SaaS base.",
|
|
29
|
-
kind: "usage",
|
|
30
|
-
visibility: "public",
|
|
31
|
-
route: "/docs/examples/saas-boilerplate/usage",
|
|
32
|
-
tags: ["saas", "usage"],
|
|
33
|
-
body: `## Setup
|
|
12
|
+
- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`},{id:"docs.examples.saas-boilerplate.usage",title:"SaaS Boilerplate \u2014 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
|
|
34
13
|
1) Seed (if available) or create orgs, members, and projects via UI.
|
|
35
14
|
2) Configure Notifications for invites and project events; set policy.pii for sensitive fields.
|
|
36
15
|
|
|
@@ -42,17 +21,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
42
21
|
## Guardrails
|
|
43
22
|
- Keep tenant/role context explicit in contracts and presentations.
|
|
44
23
|
- Emit events for invites, project changes, and usage records; log in Audit Trail.
|
|
45
|
-
- Redact sensitive user/org data in markdown/JSON outputs.`
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "docs.examples.saas-boilerplate.reference",
|
|
49
|
-
title: "SaaS Boilerplate \u2014 Reference",
|
|
50
|
-
summary: "Entities, contracts, events, and presentations for the SaaS starter.",
|
|
51
|
-
kind: "reference",
|
|
52
|
-
visibility: "public",
|
|
53
|
-
route: "/docs/examples/saas-boilerplate",
|
|
54
|
-
tags: ["saas", "reference"],
|
|
55
|
-
body: `## Entities
|
|
24
|
+
- Redact sensitive user/org data in markdown/JSON outputs.`},{id:"docs.examples.saas-boilerplate.reference",title:"SaaS Boilerplate \u2014 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
|
|
56
25
|
- Organization, Member, Role, Project, AppSettings, UserSettings, BillingUsage.
|
|
57
26
|
|
|
58
27
|
## Contracts
|
|
@@ -66,17 +35,7 @@ var saasBoilerplateDocBlocks = [
|
|
|
66
35
|
|
|
67
36
|
## Notes
|
|
68
37
|
- Tenant isolation is mandatory; enforce via RBAC/policies.
|
|
69
|
-
- Usage/Metering drives billing/limits; keep units explicit.`
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: "docs.examples.saas-boilerplate.constraints",
|
|
73
|
-
title: "SaaS Boilerplate \u2014 Constraints & Safety",
|
|
74
|
-
summary: "Internal guardrails for tenancy, RBAC, usage metering, and regeneration.",
|
|
75
|
-
kind: "reference",
|
|
76
|
-
visibility: "internal",
|
|
77
|
-
route: "/docs/examples/saas-boilerplate/constraints",
|
|
78
|
-
tags: ["saas", "constraints", "internal"],
|
|
79
|
-
body: `## Constraints
|
|
38
|
+
- Usage/Metering drives billing/limits; keep units explicit.`},{id:"docs.examples.saas-boilerplate.constraints",title:"SaaS Boilerplate \u2014 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
|
|
80
39
|
- Tenant isolation and RBAC must remain explicit in spec; no implicit defaults in code.
|
|
81
40
|
- Events to emit: org.created, member.invited/accepted, project.created/updated, usage.recorded.
|
|
82
41
|
- Regeneration must not change billing/usage semantics without spec diffs.
|
|
@@ -88,7 +47,4 @@ var saasBoilerplateDocBlocks = [
|
|
|
88
47
|
## Verification
|
|
89
48
|
- Add fixtures for usage recording and role changes.
|
|
90
49
|
- Ensure Audit/Notifications remain wired for invites/project updates.
|
|
91
|
-
- Use Feature Flags for new settings/billing fields; default safe/off.`
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
|
-
registerDocBlocks(saasBoilerplateDocBlocks);
|
|
50
|
+
- Use Feature Flags for new settings/billing fields; default safe/off.`}];f(h);
|
package/dist/example.js
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
var example = defineExample({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "saas-boilerplate",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
title: "SaaS Boilerplate",
|
|
9
|
-
description: "Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.",
|
|
10
|
-
kind: "template",
|
|
11
|
-
visibility: "public",
|
|
12
|
-
stability: "experimental",
|
|
13
|
-
owners: ["@platform.core"],
|
|
14
|
-
tags: ["saas", "multi-tenant", "billing", "rbac"]
|
|
15
|
-
},
|
|
16
|
-
docs: {
|
|
17
|
-
rootDocId: "docs.examples.saas-boilerplate"
|
|
18
|
-
},
|
|
19
|
-
entrypoints: {
|
|
20
|
-
packageName: "@contractspec/example.saas-boilerplate",
|
|
21
|
-
feature: "./feature",
|
|
22
|
-
contracts: "./contracts",
|
|
23
|
-
presentations: "./presentations",
|
|
24
|
-
handlers: "./handlers",
|
|
25
|
-
docs: "./docs"
|
|
26
|
-
},
|
|
27
|
-
surfaces: {
|
|
28
|
-
templates: true,
|
|
29
|
-
sandbox: {
|
|
30
|
-
enabled: true,
|
|
31
|
-
modes: ["playground", "specs", "builder", "markdown", "evolution"]
|
|
32
|
-
},
|
|
33
|
-
studio: { enabled: true, installable: true },
|
|
34
|
-
mcp: { enabled: true }
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
var example_default = example;
|
|
38
|
-
export {
|
|
39
|
-
example_default as default
|
|
40
|
-
};
|
|
2
|
+
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};
|