@contractspec/example.saas-boilerplate 3.8.8 → 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 +40 -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 +15 -15
|
@@ -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,300 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
definePresentation,
|
|
5
|
-
StabilityEnum
|
|
6
|
-
} from "@contractspec/lib.contracts-spec";
|
|
7
|
-
var SubscriptionPresentation = definePresentation({
|
|
8
|
-
meta: {
|
|
9
|
-
key: "saas.billing.subscription",
|
|
10
|
-
version: "1.0.0",
|
|
11
|
-
title: "Subscription Status",
|
|
12
|
-
description: "Subscription status with plan info, limits, and current usage",
|
|
13
|
-
domain: "saas-boilerplate",
|
|
14
|
-
owners: ["@saas-team"],
|
|
15
|
-
tags: ["billing", "subscription"],
|
|
16
|
-
stability: StabilityEnum.Beta,
|
|
17
|
-
goal: "View subscription plan and status",
|
|
18
|
-
context: "Billing section"
|
|
19
|
-
},
|
|
20
|
-
source: {
|
|
21
|
-
type: "component",
|
|
22
|
-
framework: "react",
|
|
23
|
-
componentKey: "SubscriptionView"
|
|
24
|
-
},
|
|
25
|
-
targets: ["react", "markdown"],
|
|
26
|
-
policy: {
|
|
27
|
-
flags: ["saas.billing.enabled"]
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var UsageDashboardPresentation = definePresentation({
|
|
31
|
-
meta: {
|
|
32
|
-
key: "saas.billing.usage",
|
|
33
|
-
version: "1.0.0",
|
|
34
|
-
title: "Usage Dashboard",
|
|
35
|
-
description: "Usage metrics and breakdown by resource type",
|
|
36
|
-
domain: "saas-boilerplate",
|
|
37
|
-
owners: ["@saas-team"],
|
|
38
|
-
tags: ["billing", "usage", "metrics"],
|
|
39
|
-
stability: StabilityEnum.Beta,
|
|
40
|
-
goal: "Monitor feature usage and limits",
|
|
41
|
-
context: "Billing section"
|
|
42
|
-
},
|
|
43
|
-
source: {
|
|
44
|
-
type: "component",
|
|
45
|
-
framework: "react",
|
|
46
|
-
componentKey: "UsageDashboardView"
|
|
47
|
-
},
|
|
48
|
-
targets: ["react", "markdown"],
|
|
49
|
-
policy: {
|
|
50
|
-
flags: ["saas.billing.enabled"]
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// src/dashboard/dashboard.presentation.ts
|
|
55
|
-
import {
|
|
56
|
-
definePresentation as definePresentation2,
|
|
57
|
-
StabilityEnum as StabilityEnum2
|
|
58
|
-
} from "@contractspec/lib.contracts-spec";
|
|
59
|
-
var SaasDashboardPresentation = definePresentation2({
|
|
60
|
-
meta: {
|
|
61
|
-
key: "saas.dashboard",
|
|
62
|
-
version: "1.0.0",
|
|
63
|
-
title: "SaaS Dashboard",
|
|
64
|
-
description: "Main SaaS dashboard with project overview, usage stats, and quick actions",
|
|
65
|
-
domain: "saas-boilerplate",
|
|
66
|
-
owners: ["@saas-team"],
|
|
67
|
-
tags: ["dashboard", "overview"],
|
|
68
|
-
stability: StabilityEnum2.Beta,
|
|
69
|
-
goal: "Overview of SaaS activity and metrics",
|
|
70
|
-
context: "Main dashboard"
|
|
71
|
-
},
|
|
72
|
-
source: {
|
|
73
|
-
type: "component",
|
|
74
|
-
framework: "react",
|
|
75
|
-
componentKey: "SaasDashboard"
|
|
76
|
-
},
|
|
77
|
-
targets: ["react", "markdown"],
|
|
78
|
-
policy: {
|
|
79
|
-
flags: ["saas.enabled"]
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var SettingsPanelPresentation = definePresentation2({
|
|
83
|
-
meta: {
|
|
84
|
-
key: "saas.settings",
|
|
85
|
-
version: "1.0.0",
|
|
86
|
-
title: "Settings Panel",
|
|
87
|
-
description: "Organization and user settings panel",
|
|
88
|
-
domain: "saas-boilerplate",
|
|
89
|
-
owners: ["@saas-team"],
|
|
90
|
-
tags: ["settings", "config"],
|
|
91
|
-
stability: StabilityEnum2.Beta,
|
|
92
|
-
goal: "Configure organization and user settings",
|
|
93
|
-
context: "Settings section"
|
|
94
|
-
},
|
|
95
|
-
source: {
|
|
96
|
-
type: "component",
|
|
97
|
-
framework: "react",
|
|
98
|
-
componentKey: "SettingsPanel"
|
|
99
|
-
},
|
|
100
|
-
targets: ["react"],
|
|
101
|
-
policy: {
|
|
102
|
-
flags: ["saas.enabled"]
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// src/project/project.enum.ts
|
|
107
|
-
import { defineEnum } from "@contractspec/lib.schema";
|
|
108
|
-
var ProjectStatusSchemaEnum = defineEnum("ProjectStatus", [
|
|
109
|
-
"DRAFT",
|
|
110
|
-
"ACTIVE",
|
|
111
|
-
"ARCHIVED",
|
|
112
|
-
"DELETED"
|
|
113
|
-
]);
|
|
114
|
-
var ProjectStatusFilterEnum = defineEnum("ProjectStatusFilter", [
|
|
115
|
-
"DRAFT",
|
|
116
|
-
"ACTIVE",
|
|
117
|
-
"ARCHIVED",
|
|
118
|
-
"all"
|
|
119
|
-
]);
|
|
120
|
-
|
|
121
|
-
// src/project/project.schema.ts
|
|
122
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
123
|
-
var ProjectModel = defineSchemaModel({
|
|
124
|
-
name: "Project",
|
|
125
|
-
description: "A project within an organization",
|
|
126
|
-
fields: {
|
|
127
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
128
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
129
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
130
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
131
|
-
organizationId: {
|
|
132
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
133
|
-
isOptional: false
|
|
134
|
-
},
|
|
135
|
-
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
136
|
-
status: { type: ProjectStatusSchemaEnum, isOptional: false },
|
|
137
|
-
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
138
|
-
tags: {
|
|
139
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
140
|
-
isArray: true,
|
|
141
|
-
isOptional: false
|
|
142
|
-
},
|
|
143
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
144
|
-
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
var CreateProjectInputModel = defineSchemaModel({
|
|
148
|
-
name: "CreateProjectInput",
|
|
149
|
-
description: "Input for creating a project",
|
|
150
|
-
fields: {
|
|
151
|
-
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
152
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
153
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
154
|
-
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
155
|
-
tags: {
|
|
156
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
157
|
-
isArray: true,
|
|
158
|
-
isOptional: true
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
var UpdateProjectInputModel = defineSchemaModel({
|
|
163
|
-
name: "UpdateProjectInput",
|
|
164
|
-
description: "Input for updating a project",
|
|
165
|
-
fields: {
|
|
166
|
-
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
167
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
168
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
169
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
170
|
-
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
171
|
-
tags: {
|
|
172
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
173
|
-
isArray: true,
|
|
174
|
-
isOptional: true
|
|
175
|
-
},
|
|
176
|
-
status: { type: ProjectStatusSchemaEnum, isOptional: true }
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
var GetProjectInputModel = defineSchemaModel({
|
|
180
|
-
name: "GetProjectInput",
|
|
181
|
-
fields: {
|
|
182
|
-
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
var DeleteProjectInputModel = defineSchemaModel({
|
|
186
|
-
name: "DeleteProjectInput",
|
|
187
|
-
fields: {
|
|
188
|
-
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
var DeleteProjectOutputModel = defineSchemaModel({
|
|
192
|
-
name: "DeleteProjectOutput",
|
|
193
|
-
fields: {
|
|
194
|
-
success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
var ProjectDeletedPayloadModel = defineSchemaModel({
|
|
198
|
-
name: "ProjectDeletedPayload",
|
|
199
|
-
fields: {
|
|
200
|
-
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
var ListProjectsInputModel = defineSchemaModel({
|
|
204
|
-
name: "ListProjectsInput",
|
|
205
|
-
description: "Input for listing projects",
|
|
206
|
-
fields: {
|
|
207
|
-
status: { type: ProjectStatusFilterEnum, isOptional: true },
|
|
208
|
-
search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
209
|
-
limit: {
|
|
210
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
211
|
-
isOptional: true,
|
|
212
|
-
defaultValue: 20
|
|
213
|
-
},
|
|
214
|
-
offset: {
|
|
215
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
216
|
-
isOptional: true,
|
|
217
|
-
defaultValue: 0
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
var ListProjectsOutputModel = defineSchemaModel({
|
|
222
|
-
name: "ListProjectsOutput",
|
|
223
|
-
description: "Output for listing projects",
|
|
224
|
-
fields: {
|
|
225
|
-
projects: { type: ProjectModel, isArray: true, isOptional: false },
|
|
226
|
-
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// src/project/project.presentation.ts
|
|
231
|
-
import {
|
|
232
|
-
definePresentation as definePresentation3,
|
|
233
|
-
StabilityEnum as StabilityEnum3
|
|
234
|
-
} from "@contractspec/lib.contracts-spec";
|
|
235
|
-
var ProjectListPresentation = definePresentation3({
|
|
236
|
-
meta: {
|
|
237
|
-
key: "saas.project.list",
|
|
238
|
-
version: "1.0.0",
|
|
239
|
-
title: "Project List",
|
|
240
|
-
description: "List view of projects with status, tags, and last updated info",
|
|
241
|
-
domain: "saas-boilerplate",
|
|
242
|
-
owners: ["@saas-team"],
|
|
243
|
-
tags: ["project", "list", "dashboard"],
|
|
244
|
-
stability: StabilityEnum3.Beta,
|
|
245
|
-
goal: "Browse and manage projects",
|
|
246
|
-
context: "Project list page"
|
|
247
|
-
},
|
|
248
|
-
source: {
|
|
249
|
-
type: "component",
|
|
250
|
-
framework: "react",
|
|
251
|
-
componentKey: "ProjectListView",
|
|
252
|
-
props: ProjectModel
|
|
253
|
-
},
|
|
254
|
-
targets: ["react", "markdown", "application/json"],
|
|
255
|
-
policy: {
|
|
256
|
-
flags: ["saas.projects.enabled"]
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
var ProjectDetailPresentation = definePresentation3({
|
|
260
|
-
meta: {
|
|
261
|
-
key: "saas.project.detail",
|
|
262
|
-
version: "1.0.0",
|
|
263
|
-
title: "Project Details",
|
|
264
|
-
description: "Detailed view of a project with settings and activity",
|
|
265
|
-
domain: "saas-boilerplate",
|
|
266
|
-
owners: ["@saas-team"],
|
|
267
|
-
tags: ["project", "detail"],
|
|
268
|
-
stability: StabilityEnum3.Beta,
|
|
269
|
-
goal: "View and edit project details",
|
|
270
|
-
context: "Project detail page"
|
|
271
|
-
},
|
|
272
|
-
source: {
|
|
273
|
-
type: "component",
|
|
274
|
-
framework: "react",
|
|
275
|
-
componentKey: "ProjectDetailView"
|
|
276
|
-
},
|
|
277
|
-
targets: ["react", "markdown"],
|
|
278
|
-
policy: {
|
|
279
|
-
flags: ["saas.projects.enabled"]
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
// src/presentations/index.ts
|
|
284
|
-
var SaasBoilerplatePresentations = {
|
|
285
|
-
SubscriptionPresentation: undefined,
|
|
286
|
-
UsageDashboardPresentation: undefined,
|
|
287
|
-
ProjectListPresentation: undefined,
|
|
288
|
-
ProjectDetailPresentation: undefined,
|
|
289
|
-
SaasDashboardPresentation: undefined,
|
|
290
|
-
SettingsPanelPresentation: undefined
|
|
291
|
-
};
|
|
292
|
-
export {
|
|
293
|
-
UsageDashboardPresentation,
|
|
294
|
-
SubscriptionPresentation,
|
|
295
|
-
SettingsPanelPresentation,
|
|
296
|
-
SaasDashboardPresentation,
|
|
297
|
-
SaasBoilerplatePresentations,
|
|
298
|
-
ProjectListPresentation,
|
|
299
|
-
ProjectDetailPresentation
|
|
300
|
-
};
|
|
2
|
+
import{definePresentation as x,StabilityEnum as z}from"@contractspec/lib.contracts-spec";var I=x({meta:{key:"saas.billing.subscription",version:"1.0.0",title:"Subscription Status",description:"Subscription status with plan info, limits, and current usage",domain:"saas-boilerplate",owners:["@saas-team"],tags:["billing","subscription"],stability:z.Beta,goal:"View subscription plan and status",context:"Billing section"},source:{type:"component",framework:"react",componentKey:"SubscriptionView"},targets:["react","markdown"],policy:{flags:["saas.billing.enabled"]}}),J=x({meta:{key:"saas.billing.usage",version:"1.0.0",title:"Usage Dashboard",description:"Usage metrics and breakdown by resource type",domain:"saas-boilerplate",owners:["@saas-team"],tags:["billing","usage","metrics"],stability:z.Beta,goal:"Monitor feature usage and limits",context:"Billing section"},source:{type:"component",framework:"react",componentKey:"UsageDashboardView"},targets:["react","markdown"],policy:{flags:["saas.billing.enabled"]}});import{definePresentation as A,StabilityEnum as B}from"@contractspec/lib.contracts-spec";var K=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:B.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"]}}),L=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:B.Beta,goal:"Configure organization and user settings",context:"Settings section"},source:{type:"component",framework:"react",componentKey:"SettingsPanel"},targets:["react"],policy:{flags:["saas.enabled"]}});import{defineEnum as C}from"@contractspec/lib.schema";var v=C("ProjectStatus",["DRAFT","ACTIVE","ARCHIVED","DELETED"]),D=C("ProjectStatusFilter",["DRAFT","ACTIVE","ARCHIVED","all"]);import{defineSchemaModel as q,ScalarTypeEnum as k}from"@contractspec/lib.schema";var w=q({name:"Project",description:"A project within an organization",fields:{id:{type:k.String_unsecure(),isOptional:!1},name:{type:k.String_unsecure(),isOptional:!1},description:{type:k.String_unsecure(),isOptional:!0},slug:{type:k.String_unsecure(),isOptional:!0},organizationId:{type:k.String_unsecure(),isOptional:!1},createdBy:{type:k.String_unsecure(),isOptional:!1},status:{type:v,isOptional:!1},isPublic:{type:k.Boolean(),isOptional:!1},tags:{type:k.String_unsecure(),isArray:!0,isOptional:!1},createdAt:{type:k.DateTime(),isOptional:!1},updatedAt:{type:k.DateTime(),isOptional:!1}}}),$=q({name:"CreateProjectInput",description:"Input for creating a project",fields:{name:{type:k.NonEmptyString(),isOptional:!1},description:{type:k.String_unsecure(),isOptional:!0},slug:{type:k.String_unsecure(),isOptional:!0},isPublic:{type:k.Boolean(),isOptional:!0},tags:{type:k.String_unsecure(),isArray:!0,isOptional:!0}}}),g=q({name:"UpdateProjectInput",description:"Input for updating a project",fields:{projectId:{type:k.String_unsecure(),isOptional:!1},name:{type:k.String_unsecure(),isOptional:!0},description:{type:k.String_unsecure(),isOptional:!0},slug:{type:k.String_unsecure(),isOptional:!0},isPublic:{type:k.Boolean(),isOptional:!0},tags:{type:k.String_unsecure(),isArray:!0,isOptional:!0},status:{type:v,isOptional:!0}}}),F=q({name:"GetProjectInput",fields:{projectId:{type:k.String_unsecure(),isOptional:!1}}}),O=q({name:"DeleteProjectInput",fields:{projectId:{type:k.String_unsecure(),isOptional:!1}}}),j=q({name:"DeleteProjectOutput",fields:{success:{type:k.Boolean(),isOptional:!1}}}),M=q({name:"ProjectDeletedPayload",fields:{projectId:{type:k.String_unsecure(),isOptional:!1}}}),P=q({name:"ListProjectsInput",description:"Input for listing projects",fields:{status:{type:D,isOptional:!0},search:{type:k.String_unsecure(),isOptional:!0},limit:{type:k.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:k.Int_unsecure(),isOptional:!0,defaultValue:0}}}),b=q({name:"ListProjectsOutput",description:"Output for listing projects",fields:{projects:{type:w,isArray:!0,isOptional:!1},total:{type:k.Int_unsecure(),isOptional:!1}}});import{definePresentation as G,StabilityEnum as H}from"@contractspec/lib.contracts-spec";var N=G({meta:{key:"saas.project.list",version:"1.0.0",title:"Project List",description:"List view of projects with status, tags, and last updated info",domain:"saas-boilerplate",owners:["@saas-team"],tags:["project","list","dashboard"],stability:H.Beta,goal:"Browse and manage projects",context:"Project list page"},source:{type:"component",framework:"react",componentKey:"ProjectListView",props:w},targets:["react","markdown","application/json"],policy:{flags:["saas.projects.enabled"]}}),Q=G({meta:{key:"saas.project.detail",version:"1.0.0",title:"Project Details",description:"Detailed view of a project with settings and activity",domain:"saas-boilerplate",owners:["@saas-team"],tags:["project","detail"],stability:H.Beta,goal:"View and edit project details",context:"Project detail page"},source:{type:"component",framework:"react",componentKey:"ProjectDetailView"},targets:["react","markdown"],policy:{flags:["saas.projects.enabled"]}});var d={SubscriptionPresentation:void 0,UsageDashboardPresentation:void 0,ProjectListPresentation:void 0,ProjectDetailPresentation:void 0,SaasDashboardPresentation:void 0,SettingsPanelPresentation:void 0};export{J as UsageDashboardPresentation,I as SubscriptionPresentation,L as SettingsPanelPresentation,K as SaasDashboardPresentation,d as SaasBoilerplatePresentations,N as ProjectListPresentation,Q as ProjectDetailPresentation};
|