@lssm/example.saas-boilerplate 1.41.0 → 1.42.2

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.
Files changed (122) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +113 -0
  2. package/.turbo/turbo-build.log +109 -35
  3. package/CHANGELOG.md +46 -0
  4. package/LICENSE +21 -0
  5. package/README.md +3 -0
  6. package/dist/billing/billing.entity.d.ts +61 -0
  7. package/dist/billing/billing.entity.d.ts.map +1 -0
  8. package/dist/billing/billing.entity.js +122 -1
  9. package/dist/billing/billing.entity.js.map +1 -0
  10. package/dist/billing/billing.enum.d.ts +16 -0
  11. package/dist/billing/billing.enum.d.ts.map +1 -0
  12. package/dist/billing/billing.enum.js +27 -1
  13. package/dist/billing/billing.enum.js.map +1 -0
  14. package/dist/billing/billing.event.d.ts +86 -0
  15. package/dist/billing/billing.event.d.ts.map +1 -0
  16. package/dist/billing/billing.event.js +153 -1
  17. package/dist/billing/billing.event.js.map +1 -0
  18. package/dist/billing/billing.handler.d.ts +82 -0
  19. package/dist/billing/billing.handler.d.ts.map +1 -0
  20. package/dist/billing/billing.handler.js +58 -1
  21. package/dist/billing/billing.handler.js.map +1 -0
  22. package/dist/billing/billing.operations.d.ts +166 -0
  23. package/dist/billing/billing.operations.d.ts.map +1 -0
  24. package/dist/billing/billing.operations.js +181 -0
  25. package/dist/billing/billing.operations.js.map +1 -0
  26. package/dist/billing/billing.presentation.d.ts +15 -0
  27. package/dist/billing/billing.presentation.d.ts.map +1 -0
  28. package/dist/billing/billing.presentation.js +59 -1
  29. package/dist/billing/billing.presentation.js.map +1 -0
  30. package/dist/billing/billing.schema.d.ts +201 -0
  31. package/dist/billing/billing.schema.d.ts.map +1 -0
  32. package/dist/billing/billing.schema.js +214 -1
  33. package/dist/billing/billing.schema.js.map +1 -0
  34. package/dist/billing/index.d.ts +8 -0
  35. package/dist/billing/index.js +9 -1
  36. package/dist/dashboard/dashboard.presentation.d.ts +15 -0
  37. package/dist/dashboard/dashboard.presentation.d.ts.map +1 -0
  38. package/dist/dashboard/dashboard.presentation.js +55 -1
  39. package/dist/dashboard/dashboard.presentation.js.map +1 -0
  40. package/dist/dashboard/index.d.ts +2 -0
  41. package/dist/dashboard/index.js +3 -1
  42. package/dist/docs/index.d.ts +1 -0
  43. package/dist/docs/index.js +1 -1
  44. package/dist/docs/saas-boilerplate.docblock.d.ts +1 -0
  45. package/dist/docs/saas-boilerplate.docblock.js +56 -5
  46. package/dist/docs/saas-boilerplate.docblock.js.map +1 -0
  47. package/dist/example.d.ts +37 -0
  48. package/dist/example.d.ts.map +1 -0
  49. package/dist/example.js +46 -1
  50. package/dist/example.js.map +1 -0
  51. package/dist/handlers/index.d.ts +3 -0
  52. package/dist/handlers/index.js +4 -1
  53. package/dist/index.d.ts +42 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +69 -1
  56. package/dist/index.js.map +1 -0
  57. package/dist/presentations/index.d.ts +17 -0
  58. package/dist/presentations/index.d.ts.map +1 -0
  59. package/dist/presentations/index.js +17 -1
  60. package/dist/presentations/index.js.map +1 -0
  61. package/dist/project/index.d.ts +8 -0
  62. package/dist/project/index.js +9 -1
  63. package/dist/project/project.entity.d.ts +40 -0
  64. package/dist/project/project.entity.d.ts.map +1 -0
  65. package/dist/project/project.entity.js +85 -1
  66. package/dist/project/project.entity.js.map +1 -0
  67. package/dist/project/project.enum.d.ts +16 -0
  68. package/dist/project/project.enum.d.ts.map +1 -0
  69. package/dist/project/project.enum.js +26 -1
  70. package/dist/project/project.enum.js.map +1 -0
  71. package/dist/project/project.event.d.ts +92 -0
  72. package/dist/project/project.event.d.ts.map +1 -0
  73. package/dist/project/project.event.js +165 -1
  74. package/dist/project/project.event.js.map +1 -0
  75. package/dist/project/project.handler.d.ts +72 -0
  76. package/dist/project/project.handler.d.ts.map +1 -0
  77. package/dist/project/project.handler.js +82 -1
  78. package/dist/project/project.handler.js.map +1 -0
  79. package/dist/project/project.operations.d.ts +419 -0
  80. package/dist/project/project.operations.d.ts.map +1 -0
  81. package/dist/project/project.operations.js +260 -0
  82. package/dist/project/project.operations.js.map +1 -0
  83. package/dist/project/project.presentation.d.ts +15 -0
  84. package/dist/project/project.presentation.d.ts.map +1 -0
  85. package/dist/project/project.presentation.js +65 -1
  86. package/dist/project/project.presentation.js.map +1 -0
  87. package/dist/project/project.schema.d.ts +235 -0
  88. package/dist/project/project.schema.d.ts.map +1 -0
  89. package/dist/project/project.schema.js +215 -1
  90. package/dist/project/project.schema.js.map +1 -0
  91. package/dist/saas-boilerplate.feature.d.ts +12 -0
  92. package/dist/saas-boilerplate.feature.d.ts.map +1 -0
  93. package/dist/saas-boilerplate.feature.js +201 -1
  94. package/dist/saas-boilerplate.feature.js.map +1 -0
  95. package/dist/settings/index.d.ts +3 -0
  96. package/dist/settings/index.js +4 -1
  97. package/dist/settings/settings.entity.d.ts +37 -0
  98. package/dist/settings/settings.entity.d.ts.map +1 -0
  99. package/dist/settings/settings.entity.js +78 -1
  100. package/dist/settings/settings.entity.js.map +1 -0
  101. package/dist/settings/settings.enum.d.ts +10 -0
  102. package/dist/settings/settings.enum.d.ts.map +1 -0
  103. package/dist/settings/settings.enum.js +21 -1
  104. package/dist/settings/settings.enum.js.map +1 -0
  105. package/dist/shared/mock-data.d.ts +86 -0
  106. package/dist/shared/mock-data.d.ts.map +1 -0
  107. package/dist/shared/mock-data.js +138 -1
  108. package/dist/shared/mock-data.js.map +1 -0
  109. package/package.json +54 -44
  110. package/src/billing/billing.event.ts +24 -9
  111. package/src/billing/{billing.contracts.ts → billing.operations.ts} +82 -10
  112. package/src/billing/billing.presentation.ts +14 -5
  113. package/src/billing/index.ts +1 -1
  114. package/src/dashboard/dashboard.presentation.ts +14 -5
  115. package/src/project/index.ts +1 -1
  116. package/src/project/project.event.ts +32 -12
  117. package/src/project/{project.contracts.ts → project.operations.ts} +98 -13
  118. package/src/project/project.presentation.ts +14 -5
  119. package/src/saas-boilerplate.feature.ts +35 -34
  120. package/tsconfig.tsbuildinfo +1 -1
  121. package/dist/billing/billing.contracts.js +0 -1
  122. package/dist/project/project.contracts.js +0 -1
@@ -1 +1,214 @@
1
- import{FeatureAccessReasonEnum as e,SubscriptionStatusSchemaEnum as t}from"./billing.enum.js";import{ScalarTypeEnum as n,defineSchemaModel as r}from"@lssm/lib.schema";const i=r({name:`Subscription`,description:`Organization subscription details`,fields:{id:{type:n.String_unsecure(),isOptional:!1},organizationId:{type:n.String_unsecure(),isOptional:!1},planId:{type:n.String_unsecure(),isOptional:!1},planName:{type:n.String_unsecure(),isOptional:!1},status:{type:t,isOptional:!1},currentPeriodStart:{type:n.DateTime(),isOptional:!1},currentPeriodEnd:{type:n.DateTime(),isOptional:!1},trialEndsAt:{type:n.DateTime(),isOptional:!0},cancelAtPeriodEnd:{type:n.Boolean(),isOptional:!1}}}),a=r({name:`UsageSummary`,description:`Usage summary for a feature`,fields:{feature:{type:n.String_unsecure(),isOptional:!1},used:{type:n.Int_unsecure(),isOptional:!1},limit:{type:n.Int_unsecure(),isOptional:!0},unit:{type:n.String_unsecure(),isOptional:!0},percentage:{type:n.Float_unsecure(),isOptional:!0}}}),o=r({name:`RecordUsageInput`,description:`Input for recording feature usage`,fields:{feature:{type:n.String_unsecure(),isOptional:!1},quantity:{type:n.Int_unsecure(),isOptional:!1},sourceId:{type:n.String_unsecure(),isOptional:!0},sourceType:{type:n.String_unsecure(),isOptional:!0},metadata:{type:n.JSONObject(),isOptional:!0}}}),s=r({name:`RecordUsageOutput`,description:`Output for recording feature usage`,fields:{recorded:{type:n.Boolean(),isOptional:!1},currentUsage:{type:n.Int_unsecure(),isOptional:!1},limit:{type:n.Int_unsecure(),isOptional:!0},limitReached:{type:n.Boolean(),isOptional:!1}}}),c=r({name:`UsageRecordedPayload`,description:`Payload for usage.recorded event`,fields:{feature:{type:n.String_unsecure(),isOptional:!1},quantity:{type:n.Int_unsecure(),isOptional:!1}}}),l=r({name:`GetUsageSummaryInput`,description:`Input for getting usage summary`,fields:{billingPeriod:{type:n.String_unsecure(),isOptional:!0}}}),u=r({name:`GetUsageSummaryOutput`,description:`Output for usage summary`,fields:{billingPeriod:{type:n.String_unsecure(),isOptional:!1},usage:{type:a,isArray:!0,isOptional:!1}}}),d=r({name:`CheckFeatureAccessInput`,description:`Input for checking feature access`,fields:{feature:{type:n.String_unsecure(),isOptional:!1}}}),f=r({name:`CheckFeatureAccessOutput`,description:`Output for feature access check`,fields:{hasAccess:{type:n.Boolean(),isOptional:!1},reason:{type:e,isOptional:!0},upgradeUrl:{type:n.URL(),isOptional:!0}}});export{d as CheckFeatureAccessInputModel,f as CheckFeatureAccessOutputModel,l as GetUsageSummaryInputModel,u as GetUsageSummaryOutputModel,o as RecordUsageInputModel,s as RecordUsageOutputModel,i as SubscriptionModel,c as UsageRecordedPayloadModel,a as UsageSummaryModel};
1
+ import { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum } from "./billing.enum.js";
2
+ import { ScalarTypeEnum, defineSchemaModel } from "@lssm/lib.schema";
3
+
4
+ //#region src/billing/billing.schema.ts
5
+ /**
6
+ * Organization subscription details schema.
7
+ */
8
+ const SubscriptionModel = defineSchemaModel({
9
+ name: "Subscription",
10
+ description: "Organization subscription details",
11
+ fields: {
12
+ id: {
13
+ type: ScalarTypeEnum.String_unsecure(),
14
+ isOptional: false
15
+ },
16
+ organizationId: {
17
+ type: ScalarTypeEnum.String_unsecure(),
18
+ isOptional: false
19
+ },
20
+ planId: {
21
+ type: ScalarTypeEnum.String_unsecure(),
22
+ isOptional: false
23
+ },
24
+ planName: {
25
+ type: ScalarTypeEnum.String_unsecure(),
26
+ isOptional: false
27
+ },
28
+ status: {
29
+ type: SubscriptionStatusSchemaEnum,
30
+ isOptional: false
31
+ },
32
+ currentPeriodStart: {
33
+ type: ScalarTypeEnum.DateTime(),
34
+ isOptional: false
35
+ },
36
+ currentPeriodEnd: {
37
+ type: ScalarTypeEnum.DateTime(),
38
+ isOptional: false
39
+ },
40
+ trialEndsAt: {
41
+ type: ScalarTypeEnum.DateTime(),
42
+ isOptional: true
43
+ },
44
+ cancelAtPeriodEnd: {
45
+ type: ScalarTypeEnum.Boolean(),
46
+ isOptional: false
47
+ }
48
+ }
49
+ });
50
+ /**
51
+ * Usage summary for a feature schema.
52
+ */
53
+ const UsageSummaryModel = defineSchemaModel({
54
+ name: "UsageSummary",
55
+ description: "Usage summary for a feature",
56
+ fields: {
57
+ feature: {
58
+ type: ScalarTypeEnum.String_unsecure(),
59
+ isOptional: false
60
+ },
61
+ used: {
62
+ type: ScalarTypeEnum.Int_unsecure(),
63
+ isOptional: false
64
+ },
65
+ limit: {
66
+ type: ScalarTypeEnum.Int_unsecure(),
67
+ isOptional: true
68
+ },
69
+ unit: {
70
+ type: ScalarTypeEnum.String_unsecure(),
71
+ isOptional: true
72
+ },
73
+ percentage: {
74
+ type: ScalarTypeEnum.Float_unsecure(),
75
+ isOptional: true
76
+ }
77
+ }
78
+ });
79
+ /**
80
+ * Input for recording feature usage.
81
+ */
82
+ const RecordUsageInputModel = defineSchemaModel({
83
+ name: "RecordUsageInput",
84
+ description: "Input for recording feature usage",
85
+ fields: {
86
+ feature: {
87
+ type: ScalarTypeEnum.String_unsecure(),
88
+ isOptional: false
89
+ },
90
+ quantity: {
91
+ type: ScalarTypeEnum.Int_unsecure(),
92
+ isOptional: false
93
+ },
94
+ sourceId: {
95
+ type: ScalarTypeEnum.String_unsecure(),
96
+ isOptional: true
97
+ },
98
+ sourceType: {
99
+ type: ScalarTypeEnum.String_unsecure(),
100
+ isOptional: true
101
+ },
102
+ metadata: {
103
+ type: ScalarTypeEnum.JSONObject(),
104
+ isOptional: true
105
+ }
106
+ }
107
+ });
108
+ /**
109
+ * Output for recording feature usage.
110
+ */
111
+ const RecordUsageOutputModel = defineSchemaModel({
112
+ name: "RecordUsageOutput",
113
+ description: "Output for recording feature usage",
114
+ fields: {
115
+ recorded: {
116
+ type: ScalarTypeEnum.Boolean(),
117
+ isOptional: false
118
+ },
119
+ currentUsage: {
120
+ type: ScalarTypeEnum.Int_unsecure(),
121
+ isOptional: false
122
+ },
123
+ limit: {
124
+ type: ScalarTypeEnum.Int_unsecure(),
125
+ isOptional: true
126
+ },
127
+ limitReached: {
128
+ type: ScalarTypeEnum.Boolean(),
129
+ isOptional: false
130
+ }
131
+ }
132
+ });
133
+ /**
134
+ * Payload for usage.recorded event.
135
+ */
136
+ const UsageRecordedPayloadModel = defineSchemaModel({
137
+ name: "UsageRecordedPayload",
138
+ description: "Payload for usage.recorded event",
139
+ fields: {
140
+ feature: {
141
+ type: ScalarTypeEnum.String_unsecure(),
142
+ isOptional: false
143
+ },
144
+ quantity: {
145
+ type: ScalarTypeEnum.Int_unsecure(),
146
+ isOptional: false
147
+ }
148
+ }
149
+ });
150
+ /**
151
+ * Input for getting usage summary.
152
+ */
153
+ const GetUsageSummaryInputModel = defineSchemaModel({
154
+ name: "GetUsageSummaryInput",
155
+ description: "Input for getting usage summary",
156
+ fields: { billingPeriod: {
157
+ type: ScalarTypeEnum.String_unsecure(),
158
+ isOptional: true
159
+ } }
160
+ });
161
+ /**
162
+ * Output for usage summary.
163
+ */
164
+ const GetUsageSummaryOutputModel = defineSchemaModel({
165
+ name: "GetUsageSummaryOutput",
166
+ description: "Output for usage summary",
167
+ fields: {
168
+ billingPeriod: {
169
+ type: ScalarTypeEnum.String_unsecure(),
170
+ isOptional: false
171
+ },
172
+ usage: {
173
+ type: UsageSummaryModel,
174
+ isArray: true,
175
+ isOptional: false
176
+ }
177
+ }
178
+ });
179
+ /**
180
+ * Input for checking feature access.
181
+ */
182
+ const CheckFeatureAccessInputModel = defineSchemaModel({
183
+ name: "CheckFeatureAccessInput",
184
+ description: "Input for checking feature access",
185
+ fields: { feature: {
186
+ type: ScalarTypeEnum.String_unsecure(),
187
+ isOptional: false
188
+ } }
189
+ });
190
+ /**
191
+ * Output for feature access check.
192
+ */
193
+ const CheckFeatureAccessOutputModel = defineSchemaModel({
194
+ name: "CheckFeatureAccessOutput",
195
+ description: "Output for feature access check",
196
+ fields: {
197
+ hasAccess: {
198
+ type: ScalarTypeEnum.Boolean(),
199
+ isOptional: false
200
+ },
201
+ reason: {
202
+ type: FeatureAccessReasonEnum,
203
+ isOptional: true
204
+ },
205
+ upgradeUrl: {
206
+ type: ScalarTypeEnum.URL(),
207
+ isOptional: true
208
+ }
209
+ }
210
+ });
211
+
212
+ //#endregion
213
+ export { CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageInputModel, RecordUsageOutputModel, SubscriptionModel, UsageRecordedPayloadModel, UsageSummaryModel };
214
+ //# sourceMappingURL=billing.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.schema.js","names":[],"sources":["../../src/billing/billing.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport {\n SubscriptionStatusSchemaEnum,\n FeatureAccessReasonEnum,\n} from './billing.enum';\n\n/**\n * Organization subscription details schema.\n */\nexport const SubscriptionModel = defineSchemaModel({\n name: 'Subscription',\n description: 'Organization subscription details',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n planId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n planName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: SubscriptionStatusSchemaEnum, isOptional: false },\n currentPeriodStart: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n currentPeriodEnd: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n trialEndsAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n cancelAtPeriodEnd: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n/**\n * Usage summary for a feature schema.\n */\nexport const UsageSummaryModel = defineSchemaModel({\n name: 'UsageSummary',\n description: 'Usage summary for a feature',\n fields: {\n feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n used: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n unit: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n percentage: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Input for recording feature usage.\n */\nexport const RecordUsageInputModel = defineSchemaModel({\n name: 'RecordUsageInput',\n description: 'Input for recording feature usage',\n fields: {\n feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n sourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sourceType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n },\n});\n\n/**\n * Output for recording feature usage.\n */\nexport const RecordUsageOutputModel = defineSchemaModel({\n name: 'RecordUsageOutput',\n description: 'Output for recording feature usage',\n fields: {\n recorded: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n currentUsage: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n limitReached: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n/**\n * Payload for usage.recorded event.\n */\nexport const UsageRecordedPayloadModel = defineSchemaModel({\n name: 'UsageRecordedPayload',\n description: 'Payload for usage.recorded event',\n fields: {\n feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Input for getting usage summary.\n */\nexport const GetUsageSummaryInputModel = defineSchemaModel({\n name: 'GetUsageSummaryInput',\n description: 'Input for getting usage summary',\n fields: {\n billingPeriod: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Output for usage summary.\n */\nexport const GetUsageSummaryOutputModel = defineSchemaModel({\n name: 'GetUsageSummaryOutput',\n description: 'Output for usage summary',\n fields: {\n billingPeriod: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n usage: { type: UsageSummaryModel, isArray: true, isOptional: false },\n },\n});\n\n/**\n * Input for checking feature access.\n */\nexport const CheckFeatureAccessInputModel = defineSchemaModel({\n name: 'CheckFeatureAccessInput',\n description: 'Input for checking feature access',\n fields: {\n feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Output for feature access check.\n */\nexport const CheckFeatureAccessOutputModel = defineSchemaModel({\n name: 'CheckFeatureAccessOutput',\n description: 'Output for feature access check',\n fields: {\n hasAccess: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n reason: { type: FeatureAccessReasonEnum, isOptional: true },\n upgradeUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;;AASA,MAAa,oBAAoB,kBAAkB;CACjD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,QAAQ;GAAE,MAAM;GAA8B,YAAY;GAAO;EACjE,oBAAoB;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAC1E,kBAAkB;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACxE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE,mBAAmB;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EACzE;CACF,CAAC;;;;AAKF,MAAa,oBAAoB,kBAAkB;CACjD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,MAAM;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAChE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EAChE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,YAAY;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAM;EACxE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,UAAU;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACpE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE,UAAU;GAAE,MAAM,eAAe,YAAY;GAAE,YAAY;GAAM;EAClE;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAC/D,cAAc;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACxE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EAChE,cAAc;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EACpE;CACF,CAAC;;;;AAKF,MAAa,4BAA4B,kBAAkB;CACzD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,UAAU;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACrE;CACF,CAAC;;;;AAKF,MAAa,4BAA4B,kBAAkB;CACzD,MAAM;CACN,aAAa;CACb,QAAQ,EACN,eAAe;EAAE,MAAM,eAAe,iBAAiB;EAAE,YAAY;EAAM,EAC5E;CACF,CAAC;;;;AAKF,MAAa,6BAA6B,kBAAkB;CAC1D,MAAM;CACN,aAAa;CACb,QAAQ;EACN,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,OAAO;GAAE,MAAM;GAAmB,SAAS;GAAM,YAAY;GAAO;EACrE;CACF,CAAC;;;;AAKF,MAAa,+BAA+B,kBAAkB;CAC5D,MAAM;CACN,aAAa;CACb,QAAQ,EACN,SAAS;EAAE,MAAM,eAAe,iBAAiB;EAAE,YAAY;EAAO,EACvE;CACF,CAAC;;;;AAKF,MAAa,gCAAgC,kBAAkB;CAC7D,MAAM;CACN,aAAa;CACb,QAAQ;EACN,WAAW;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAChE,QAAQ;GAAE,MAAM;GAAyB,YAAY;GAAM;EAC3D,YAAY;GAAE,MAAM,eAAe,KAAK;GAAE,YAAY;GAAM;EAC7D;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { BillingUsageEntity, SubscriptionEntity, SubscriptionStatusEnum, UsageLimitEntity } from "./billing.entity.js";
2
+ import { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum } from "./billing.enum.js";
3
+ import { SubscriptionChangedEvent, UsageLimitReachedEvent, UsageRecordedEvent } from "./billing.event.js";
4
+ import { CheckFeatureAccessInput, CheckFeatureAccessOutput, RecordUsageInput, Subscription, UsageSummary, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler } from "./billing.handler.js";
5
+ import { CheckFeatureAccessContract, GetSubscriptionContract, GetUsageSummaryContract, RecordUsageContract } from "./billing.operations.js";
6
+ import { SubscriptionPresentation, UsageDashboardPresentation } from "./billing.presentation.js";
7
+ import { CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageInputModel, RecordUsageOutputModel, SubscriptionModel, UsageRecordedPayloadModel, UsageSummaryModel } from "./billing.schema.js";
8
+ export { BillingUsageEntity, CheckFeatureAccessContract, type CheckFeatureAccessInput, CheckFeatureAccessInputModel, type CheckFeatureAccessOutput, CheckFeatureAccessOutputModel, FeatureAccessReasonEnum, GetSubscriptionContract, GetUsageSummaryContract, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageContract, type RecordUsageInput, RecordUsageInputModel, RecordUsageOutputModel, type Subscription, SubscriptionChangedEvent, SubscriptionEntity, SubscriptionModel, SubscriptionPresentation, SubscriptionStatusEnum, SubscriptionStatusSchemaEnum, UsageDashboardPresentation, UsageLimitEntity, UsageLimitReachedEvent, UsageRecordedEvent, UsageRecordedPayloadModel, type UsageSummary, UsageSummaryModel, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler };
@@ -1 +1,9 @@
1
- import{FeatureAccessReasonEnum as e,SubscriptionStatusSchemaEnum as t}from"./billing.enum.js";import{CheckFeatureAccessInputModel as n,CheckFeatureAccessOutputModel as r,GetUsageSummaryInputModel as i,GetUsageSummaryOutputModel as a,RecordUsageInputModel as o,RecordUsageOutputModel as s,SubscriptionModel as c,UsageRecordedPayloadModel as l,UsageSummaryModel as u}from"./billing.schema.js";import{CheckFeatureAccessContract as d,GetSubscriptionContract as f,GetUsageSummaryContract as p,RecordUsageContract as m}from"./billing.contracts.js";import{SubscriptionChangedEvent as h,UsageLimitReachedEvent as g,UsageRecordedEvent as _}from"./billing.event.js";import{BillingUsageEntity as v,SubscriptionEntity as y,SubscriptionStatusEnum as b,UsageLimitEntity as x}from"./billing.entity.js";import{SubscriptionPresentation as S,UsageDashboardPresentation as C}from"./billing.presentation.js";import{mockCheckFeatureAccessHandler as w,mockGetSubscriptionHandler as T,mockGetUsageSummaryHandler as E,mockRecordUsageHandler as D}from"./billing.handler.js";export{v as BillingUsageEntity,d as CheckFeatureAccessContract,n as CheckFeatureAccessInputModel,r as CheckFeatureAccessOutputModel,e as FeatureAccessReasonEnum,f as GetSubscriptionContract,p as GetUsageSummaryContract,i as GetUsageSummaryInputModel,a as GetUsageSummaryOutputModel,m as RecordUsageContract,o as RecordUsageInputModel,s as RecordUsageOutputModel,h as SubscriptionChangedEvent,y as SubscriptionEntity,c as SubscriptionModel,S as SubscriptionPresentation,b as SubscriptionStatusEnum,t as SubscriptionStatusSchemaEnum,C as UsageDashboardPresentation,x as UsageLimitEntity,g as UsageLimitReachedEvent,_ as UsageRecordedEvent,l as UsageRecordedPayloadModel,u as UsageSummaryModel,w as mockCheckFeatureAccessHandler,T as mockGetSubscriptionHandler,E as mockGetUsageSummaryHandler,D as mockRecordUsageHandler};
1
+ import { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum } from "./billing.enum.js";
2
+ import { CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageInputModel, RecordUsageOutputModel, SubscriptionModel, UsageRecordedPayloadModel, UsageSummaryModel } from "./billing.schema.js";
3
+ import { CheckFeatureAccessContract, GetSubscriptionContract, GetUsageSummaryContract, RecordUsageContract } from "./billing.operations.js";
4
+ import { SubscriptionChangedEvent, UsageLimitReachedEvent, UsageRecordedEvent } from "./billing.event.js";
5
+ import { BillingUsageEntity, SubscriptionEntity, SubscriptionStatusEnum, UsageLimitEntity } from "./billing.entity.js";
6
+ import { SubscriptionPresentation, UsageDashboardPresentation } from "./billing.presentation.js";
7
+ import { mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler } from "./billing.handler.js";
8
+
9
+ export { BillingUsageEntity, CheckFeatureAccessContract, CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, FeatureAccessReasonEnum, GetSubscriptionContract, GetUsageSummaryContract, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageContract, RecordUsageInputModel, RecordUsageOutputModel, SubscriptionChangedEvent, SubscriptionEntity, SubscriptionModel, SubscriptionPresentation, SubscriptionStatusEnum, SubscriptionStatusSchemaEnum, UsageDashboardPresentation, UsageLimitEntity, UsageLimitReachedEvent, UsageRecordedEvent, UsageRecordedPayloadModel, UsageSummaryModel, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler };
@@ -0,0 +1,15 @@
1
+ import { PresentationSpec } from "@lssm/lib.contracts";
2
+
3
+ //#region src/dashboard/dashboard.presentation.d.ts
4
+
5
+ /**
6
+ * Main dashboard presentation for the SaaS application.
7
+ */
8
+ declare const SaasDashboardPresentation: PresentationSpec;
9
+ /**
10
+ * Settings panel presentation.
11
+ */
12
+ declare const SettingsPanelPresentation: PresentationSpec;
13
+ //#endregion
14
+ export { SaasDashboardPresentation, SettingsPanelPresentation };
15
+ //# sourceMappingURL=dashboard.presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.presentation.d.ts","names":[],"sources":["../../src/dashboard/dashboard.presentation.ts"],"sourcesContent":[],"mappings":";;;;;;AAMA;AA4Ba,cA5BA,yBA4B2B,EA5BA,gBAkDvC;;;;cAtBY,2BAA2B"}
@@ -1 +1,55 @@
1
- const e={meta:{name:`saas.dashboard`,version:1,description:`Main SaaS dashboard with project overview, usage stats, and quick actions`,domain:`saas-boilerplate`,owners:[`@saas-team`],tags:[`dashboard`,`overview`]},source:{type:`component`,framework:`react`,componentKey:`SaasDashboard`},targets:[`react`,`markdown`],policy:{flags:[`saas.enabled`]}},t={meta:{name:`saas.settings`,version:1,description:`Organization and user settings panel`,domain:`saas-boilerplate`,owners:[`@saas-team`],tags:[`settings`,`config`]},source:{type:`component`,framework:`react`,componentKey:`SettingsPanel`},targets:[`react`],policy:{flags:[`saas.enabled`]}};export{e as SaasDashboardPresentation,t as SettingsPanelPresentation};
1
+ import { StabilityEnum } from "@lssm/lib.contracts";
2
+
3
+ //#region src/dashboard/dashboard.presentation.ts
4
+ /**
5
+ * Main dashboard presentation for the SaaS application.
6
+ */
7
+ const SaasDashboardPresentation = {
8
+ meta: {
9
+ key: "saas.dashboard",
10
+ version: 1,
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: { flags: ["saas.enabled"] }
27
+ };
28
+ /**
29
+ * Settings panel presentation.
30
+ */
31
+ const SettingsPanelPresentation = {
32
+ meta: {
33
+ key: "saas.settings",
34
+ version: 1,
35
+ title: "Settings Panel",
36
+ description: "Organization and user settings panel",
37
+ domain: "saas-boilerplate",
38
+ owners: ["@saas-team"],
39
+ tags: ["settings", "config"],
40
+ stability: StabilityEnum.Beta,
41
+ goal: "Configure organization and user settings",
42
+ context: "Settings section"
43
+ },
44
+ source: {
45
+ type: "component",
46
+ framework: "react",
47
+ componentKey: "SettingsPanel"
48
+ },
49
+ targets: ["react"],
50
+ policy: { flags: ["saas.enabled"] }
51
+ };
52
+
53
+ //#endregion
54
+ export { SaasDashboardPresentation, SettingsPanelPresentation };
55
+ //# sourceMappingURL=dashboard.presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.presentation.js","names":["SaasDashboardPresentation: PresentationSpec","SettingsPanelPresentation: PresentationSpec"],"sources":["../../src/dashboard/dashboard.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@lssm/lib.contracts';\nimport { StabilityEnum } from '@lssm/lib.contracts';\n\n/**\n * Main dashboard presentation for the SaaS application.\n */\nexport const SaasDashboardPresentation: PresentationSpec = {\n meta: {\n key: 'saas.dashboard',\n version: 1,\n title: 'SaaS Dashboard',\n description:\n 'Main SaaS dashboard with project overview, usage stats, and quick actions',\n domain: 'saas-boilerplate',\n owners: ['@saas-team'],\n tags: ['dashboard', 'overview'],\n stability: StabilityEnum.Beta,\n goal: 'Overview of SaaS activity and metrics',\n context: 'Main dashboard',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SaasDashboard',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['saas.enabled'],\n },\n};\n\n/**\n * Settings panel presentation.\n */\nexport const SettingsPanelPresentation: PresentationSpec = {\n meta: {\n key: 'saas.settings',\n version: 1,\n title: 'Settings Panel',\n description: 'Organization and user settings panel',\n domain: 'saas-boilerplate',\n owners: ['@saas-team'],\n tags: ['settings', 'config'],\n stability: StabilityEnum.Beta,\n goal: 'Configure organization and user settings',\n context: 'Settings section',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SettingsPanel',\n },\n targets: ['react'],\n policy: {\n flags: ['saas.enabled'],\n },\n};\n"],"mappings":";;;;;;AAMA,MAAaA,4BAA8C;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,aAAa;EACtB,MAAM,CAAC,aAAa,WAAW;EAC/B,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,eAAe,EACxB;CACF;;;;AAKD,MAAaC,4BAA8C;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,aAAa;EACtB,MAAM,CAAC,YAAY,SAAS;EAC5B,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,eAAe,EACxB;CACF"}
@@ -0,0 +1,2 @@
1
+ import { SaasDashboardPresentation, SettingsPanelPresentation } from "./dashboard.presentation.js";
2
+ export { SaasDashboardPresentation, SettingsPanelPresentation };
@@ -1 +1,3 @@
1
- import{SaasDashboardPresentation as e,SettingsPanelPresentation as t}from"./dashboard.presentation.js";export{e as SaasDashboardPresentation,t as SettingsPanelPresentation};
1
+ import { SaasDashboardPresentation, SettingsPanelPresentation } from "./dashboard.presentation.js";
2
+
3
+ export { SaasDashboardPresentation, SettingsPanelPresentation };
@@ -0,0 +1 @@
1
+ export { };
@@ -1 +1 @@
1
- import"./saas-boilerplate.docblock.js";
1
+ import "./saas-boilerplate.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -1,4 +1,16 @@
1
- import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.examples.saas-boilerplate.goal`,title:`SaaS Boilerplate — Goal`,summary:`Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.`,kind:`goal`,visibility:`public`,route:`/docs/examples/saas-boilerplate/goal`,tags:[`saas`,`goal`],body:`## Why it matters
1
+ import { registerDocBlocks } from "@lssm/lib.contracts/docs";
2
+
3
+ //#region src/docs/saas-boilerplate.docblock.ts
4
+ registerDocBlocks([
5
+ {
6
+ id: "docs.examples.saas-boilerplate.goal",
7
+ title: "SaaS Boilerplate — 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
14
  - Provides a regenerable SaaS base: orgs, members, projects, settings, usage/billing.
3
15
  - Avoids drift across identity, settings, and usage capture.
4
16
 
@@ -8,7 +20,17 @@ import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.exampl
8
20
 
9
21
  ## Success criteria
10
22
  - Spec changes to org/project/settings/usage regenerate UI/API/events cleanly.
11
- - Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`},{id:`docs.examples.saas-boilerplate.usage`,title:`SaaS Boilerplate — Usage`,summary:`How to seed, extend, and regenerate the SaaS base.`,kind:`usage`,visibility:`public`,route:`/docs/examples/saas-boilerplate/usage`,tags:[`saas`,`usage`],body:`## Setup
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 — 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
34
  1) Seed (if available) or create orgs, members, and projects via UI.
13
35
  2) Configure Notifications for invites and project events; set policy.pii for sensitive fields.
14
36
 
@@ -20,7 +42,17 @@ import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.exampl
20
42
  ## Guardrails
21
43
  - Keep tenant/role context explicit in contracts and presentations.
22
44
  - Emit events for invites, project changes, and usage records; log in Audit Trail.
23
- - Redact sensitive user/org data in markdown/JSON outputs.`},{id:`docs.examples.saas-boilerplate.reference`,title:`SaaS Boilerplate — Reference`,summary:`Entities, contracts, events, and presentations for the SaaS starter.`,kind:`reference`,visibility:`public`,route:`/docs/examples/saas-boilerplate`,tags:[`saas`,`reference`],body:`## Entities
45
+ - Redact sensitive user/org data in markdown/JSON outputs.`
46
+ },
47
+ {
48
+ id: "docs.examples.saas-boilerplate.reference",
49
+ title: "SaaS Boilerplate — 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
56
  - Organization, Member, Role, Project, AppSettings, UserSettings, BillingUsage.
25
57
 
26
58
  ## Contracts
@@ -34,7 +66,21 @@ import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.exampl
34
66
 
35
67
  ## Notes
36
68
  - Tenant isolation is mandatory; enforce via RBAC/policies.
37
- - Usage/Metering drives billing/limits; keep units explicit.`},{id:`docs.examples.saas-boilerplate.constraints`,title:`SaaS Boilerplate — Constraints & Safety`,summary:`Internal guardrails for tenancy, RBAC, usage metering, and regeneration.`,kind:`reference`,visibility:`internal`,route:`/docs/examples/saas-boilerplate/constraints`,tags:[`saas`,`constraints`,`internal`],body:`## Constraints
69
+ - Usage/Metering drives billing/limits; keep units explicit.`
70
+ },
71
+ {
72
+ id: "docs.examples.saas-boilerplate.constraints",
73
+ title: "SaaS Boilerplate — 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: [
79
+ "saas",
80
+ "constraints",
81
+ "internal"
82
+ ],
83
+ body: `## Constraints
38
84
  - Tenant isolation and RBAC must remain explicit in spec; no implicit defaults in code.
39
85
  - Events to emit: org.created, member.invited/accepted, project.created/updated, usage.recorded.
40
86
  - Regeneration must not change billing/usage semantics without spec diffs.
@@ -46,4 +92,9 @@ import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.exampl
46
92
  ## Verification
47
93
  - Add fixtures for usage recording and role changes.
48
94
  - Ensure Audit/Notifications remain wired for invites/project updates.
49
- - Use Feature Flags for new settings/billing fields; default safe/off.`}]);
95
+ - Use Feature Flags for new settings/billing fields; default safe/off.`
96
+ }
97
+ ]);
98
+
99
+ //#endregion
100
+ //# sourceMappingURL=saas-boilerplate.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saas-boilerplate.docblock.js","names":[],"sources":["../../src/docs/saas-boilerplate.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@lssm/lib.contracts/docs';\nimport { registerDocBlocks } from '@lssm/lib.contracts/docs';\n\nconst saasBoilerplateDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.saas-boilerplate.goal',\n title: 'SaaS Boilerplate — Goal',\n summary:\n 'Multi-tenant SaaS foundation with orgs, members, projects, settings, and usage.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/saas-boilerplate/goal',\n tags: ['saas', 'goal'],\n body: `## Why it matters\n- Provides a regenerable SaaS base: orgs, members, projects, settings, usage/billing.\n- Avoids drift across identity, settings, and usage capture.\n\n## Business/Product goal\n- Ship SaaS faster with tenant isolation, RBAC, and usage metering baked in.\n- Keep audit/notifications ready for compliance and customer comms.\n\n## Success criteria\n- Spec changes to org/project/settings/usage regenerate UI/API/events cleanly.\n- Tenant isolation and RBAC stay enforced; usage data is captured with PII scopes.`,\n },\n {\n id: 'docs.examples.saas-boilerplate.usage',\n title: 'SaaS Boilerplate — Usage',\n summary: 'How to seed, extend, and regenerate the SaaS base.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/saas-boilerplate/usage',\n tags: ['saas', 'usage'],\n body: `## Setup\n1) Seed (if available) or create orgs, members, and projects via UI.\n2) Configure Notifications for invites and project events; set policy.pii for sensitive fields.\n\n## Extend & regenerate\n1) Adjust schemas (project metadata, settings, usage records) in spec.\n2) Regenerate to sync UI/API/events and usage metering.\n3) Use Feature Flags to roll out new settings or billing fields gradually.\n\n## Guardrails\n- Keep tenant/role context explicit in contracts and presentations.\n- Emit events for invites, project changes, and usage records; log in Audit Trail.\n- Redact sensitive user/org data in markdown/JSON outputs.`,\n },\n {\n id: 'docs.examples.saas-boilerplate.reference',\n title: 'SaaS Boilerplate — Reference',\n summary:\n 'Entities, contracts, events, and presentations for the SaaS starter.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/saas-boilerplate',\n tags: ['saas', 'reference'],\n body: `## Entities\n- Organization, Member, Role, Project, AppSettings, UserSettings, BillingUsage.\n\n## Contracts\n- org/project CRUD, invites, role assignment, usage recording.\n\n## Events\n- org.created, member.invited/accepted, project.created/updated, usage.recorded.\n\n## Presentations\n- Org/project dashboards, member management, settings screens, usage views.\n\n## Notes\n- Tenant isolation is mandatory; enforce via RBAC/policies.\n- Usage/Metering drives billing/limits; keep units explicit.`,\n },\n {\n id: 'docs.examples.saas-boilerplate.constraints',\n title: 'SaaS Boilerplate — Constraints & Safety',\n summary:\n 'Internal guardrails for tenancy, RBAC, usage metering, and regeneration.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/saas-boilerplate/constraints',\n tags: ['saas', 'constraints', 'internal'],\n body: `## Constraints\n- Tenant isolation and RBAC must remain explicit in spec; no implicit defaults in code.\n- Events to emit: org.created, member.invited/accepted, project.created/updated, usage.recorded.\n- Regeneration must not change billing/usage semantics without spec diffs.\n\n## PII & Settings\n- Mark PII (user emails, names) for redaction; keep settings scoped to org/member.\n- Avoid leaking secrets/config in markdown/JSON presentations.\n\n## Verification\n- Add fixtures for usage recording and role changes.\n- Ensure Audit/Notifications remain wired for invites/project updates.\n- Use Feature Flags for new settings/billing fields; default safe/off.`,\n },\n];\n\nregisterDocBlocks(saasBoilerplateDocBlocks);\n"],"mappings":";;;AAiGA,kBA9F6C;CAC3C;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,QAAQ,OAAO;EACtB,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,QAAQ,QAAQ;EACvB,MAAM;;;;;;;;;;;;;EAaP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,QAAQ,YAAY;EAC3B,MAAM;;;;;;;;;;;;;;;EAeP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAQ;GAAe;GAAW;EACzC,MAAM;;;;;;;;;;;;;EAaP;CACF,CAE0C"}
@@ -0,0 +1,37 @@
1
+ //#region src/example.d.ts
2
+ declare const example: {
3
+ readonly id: "saas-boilerplate";
4
+ readonly title: "SaaS Boilerplate";
5
+ readonly summary: "Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.";
6
+ readonly tags: readonly ["saas", "multi-tenant", "billing", "rbac"];
7
+ readonly kind: "template";
8
+ readonly visibility: "public";
9
+ readonly docs: {
10
+ readonly rootDocId: "docs.examples.saas-boilerplate";
11
+ };
12
+ readonly entrypoints: {
13
+ readonly packageName: "@lssm/example.saas-boilerplate";
14
+ readonly feature: "./feature";
15
+ readonly contracts: "./contracts";
16
+ readonly presentations: "./presentations";
17
+ readonly handlers: "./handlers";
18
+ readonly docs: "./docs";
19
+ };
20
+ readonly surfaces: {
21
+ readonly templates: true;
22
+ readonly sandbox: {
23
+ readonly enabled: true;
24
+ readonly modes: readonly ["playground", "specs", "builder", "markdown", "evolution"];
25
+ };
26
+ readonly studio: {
27
+ readonly enabled: true;
28
+ readonly installable: true;
29
+ };
30
+ readonly mcp: {
31
+ readonly enabled: true;
32
+ };
33
+ };
34
+ };
35
+ //#endregion
36
+ export { example as default };
37
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";cAAM;EAAA,SAAA,EA4BI,EAAA,kBAAA"}
package/dist/example.js CHANGED
@@ -1 +1,46 @@
1
- var e={id:`saas-boilerplate`,title:`SaaS Boilerplate`,summary:`Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.`,tags:[`saas`,`multi-tenant`,`billing`,`rbac`],kind:`template`,visibility:`public`,docs:{rootDocId:`docs.examples.saas-boilerplate`},entrypoints:{packageName:`@lssm/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}}};export{e as default};
1
+ //#region src/example.ts
2
+ const example = {
3
+ id: "saas-boilerplate",
4
+ title: "SaaS Boilerplate",
5
+ summary: "Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.",
6
+ tags: [
7
+ "saas",
8
+ "multi-tenant",
9
+ "billing",
10
+ "rbac"
11
+ ],
12
+ kind: "template",
13
+ visibility: "public",
14
+ docs: { rootDocId: "docs.examples.saas-boilerplate" },
15
+ entrypoints: {
16
+ packageName: "@lssm/example.saas-boilerplate",
17
+ feature: "./feature",
18
+ contracts: "./contracts",
19
+ presentations: "./presentations",
20
+ handlers: "./handlers",
21
+ docs: "./docs"
22
+ },
23
+ surfaces: {
24
+ templates: true,
25
+ sandbox: {
26
+ enabled: true,
27
+ modes: [
28
+ "playground",
29
+ "specs",
30
+ "builder",
31
+ "markdown",
32
+ "evolution"
33
+ ]
34
+ },
35
+ studio: {
36
+ enabled: true,
37
+ installable: true
38
+ },
39
+ mcp: { enabled: true }
40
+ }
41
+ };
42
+ var example_default = example;
43
+
44
+ //#endregion
45
+ export { example_default as default };
46
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["const example = {\n id: 'saas-boilerplate',\n title: 'SaaS Boilerplate',\n summary:\n 'Multi-tenant SaaS foundation with orgs, projects, settings, billing usage, and RBAC.',\n tags: ['saas', 'multi-tenant', 'billing', 'rbac'],\n kind: 'template',\n visibility: 'public',\n docs: {\n rootDocId: 'docs.examples.saas-boilerplate',\n },\n entrypoints: {\n packageName: '@lssm/example.saas-boilerplate',\n feature: './feature',\n contracts: './contracts',\n presentations: './presentations',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: {\n enabled: true,\n modes: ['playground', 'specs', 'builder', 'markdown', 'evolution'],\n },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n} as const;\n\nexport default example;\n"],"mappings":";AAAA,MAAM,UAAU;CACd,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;EAAC;EAAQ;EAAgB;EAAW;EAAO;CACjD,MAAM;CACN,YAAY;CACZ,MAAM,EACJ,WAAW,kCACZ;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,eAAe;EACf,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GACP,SAAS;GACT,OAAO;IAAC;IAAc;IAAS;IAAW;IAAY;IAAY;GACnE;EACD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
@@ -0,0 +1,3 @@
1
+ import { mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler } from "../billing/billing.handler.js";
2
+ import { mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockListProjectsHandler, mockUpdateProjectHandler } from "../project/project.handler.js";
3
+ export { mockCheckFeatureAccessHandler, mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockListProjectsHandler, mockRecordUsageHandler, mockUpdateProjectHandler };
@@ -1 +1,4 @@
1
- import{mockCheckFeatureAccessHandler as e,mockGetSubscriptionHandler as t,mockGetUsageSummaryHandler as n,mockRecordUsageHandler as r}from"../billing/billing.handler.js";import{mockCreateProjectHandler as i,mockDeleteProjectHandler as a,mockGetProjectHandler as o,mockListProjectsHandler as s,mockUpdateProjectHandler as c}from"../project/project.handler.js";export{e as mockCheckFeatureAccessHandler,i as mockCreateProjectHandler,a as mockDeleteProjectHandler,o as mockGetProjectHandler,t as mockGetSubscriptionHandler,n as mockGetUsageSummaryHandler,s as mockListProjectsHandler,r as mockRecordUsageHandler,c as mockUpdateProjectHandler};
1
+ import { mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler } from "../billing/billing.handler.js";
2
+ import { mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockListProjectsHandler, mockUpdateProjectHandler } from "../project/project.handler.js";
3
+
4
+ export { mockCheckFeatureAccessHandler, mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockListProjectsHandler, mockRecordUsageHandler, mockUpdateProjectHandler };
@@ -0,0 +1,42 @@
1
+ import { BillingUsageEntity, SubscriptionEntity, SubscriptionStatusEnum, UsageLimitEntity } from "./billing/billing.entity.js";
2
+ import { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum } from "./billing/billing.enum.js";
3
+ import { SubscriptionChangedEvent, UsageLimitReachedEvent, UsageRecordedEvent } from "./billing/billing.event.js";
4
+ import { CheckFeatureAccessInput, CheckFeatureAccessOutput, RecordUsageInput, Subscription, UsageSummary, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler } from "./billing/billing.handler.js";
5
+ import { CheckFeatureAccessContract, GetSubscriptionContract, GetUsageSummaryContract, RecordUsageContract } from "./billing/billing.operations.js";
6
+ import { SubscriptionPresentation, UsageDashboardPresentation } from "./billing/billing.presentation.js";
7
+ import { CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageInputModel, RecordUsageOutputModel, SubscriptionModel, UsageRecordedPayloadModel, UsageSummaryModel } from "./billing/billing.schema.js";
8
+ import "./billing/index.js";
9
+ import { SaasDashboardPresentation, SettingsPanelPresentation } from "./dashboard/dashboard.presentation.js";
10
+ import "./dashboard/index.js";
11
+ import example from "./example.js";
12
+ import { CreateProjectInput, ListProjectsInput, ListProjectsOutput, Project, UpdateProjectInput, mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockListProjectsHandler, mockUpdateProjectHandler } from "./project/project.handler.js";
13
+ import { ProjectStatusFilterEnum, ProjectStatusSchemaEnum } from "./project/project.enum.js";
14
+ import { CreateProjectInputModel, DeleteProjectInputModel, DeleteProjectOutputModel, GetProjectInputModel, ListProjectsInputModel, ListProjectsOutputModel, ProjectDeletedPayloadModel, ProjectModel, UpdateProjectInputModel } from "./project/project.schema.js";
15
+ import { CreateProjectContract, DeleteProjectContract, GetProjectContract, ListProjectsContract, UpdateProjectContract } from "./project/project.operations.js";
16
+ import { ProjectArchivedEvent, ProjectCreatedEvent, ProjectDeletedEvent, ProjectUpdatedEvent } from "./project/project.event.js";
17
+ import { ProjectEntity, ProjectMemberEntity, ProjectStatusEnum } from "./project/project.entity.js";
18
+ import { ProjectDetailPresentation, ProjectListPresentation } from "./project/project.presentation.js";
19
+ import "./project/index.js";
20
+ import { SettingsScopeEnum } from "./settings/settings.enum.js";
21
+ import { FeatureFlagEntity, SettingsEntity } from "./settings/settings.entity.js";
22
+ import "./settings/index.js";
23
+ import { SaasBoilerplateFeature } from "./saas-boilerplate.feature.js";
24
+ import { ModuleSchemaContribution } from "@lssm/lib.schema";
25
+
26
+ //#region src/index.d.ts
27
+ /**
28
+ * SaaS boilerplate schema contribution.
29
+ */
30
+ declare const saasBoilerplateSchemaContribution: ModuleSchemaContribution;
31
+ /**
32
+ * Complete schema composition for SaaS Boilerplate.
33
+ * Use with `database schema:compose` to generate Prisma schema.
34
+ */
35
+ declare const schemaComposition: {
36
+ modules: ModuleSchemaContribution[];
37
+ provider: "postgresql";
38
+ outputPath: string;
39
+ };
40
+ //#endregion
41
+ export { BillingUsageEntity, CheckFeatureAccessContract, CheckFeatureAccessInput, CheckFeatureAccessInputModel, CheckFeatureAccessOutput, CheckFeatureAccessOutputModel, CreateProjectContract, CreateProjectInput, CreateProjectInputModel, DeleteProjectContract, DeleteProjectInputModel, DeleteProjectOutputModel, FeatureAccessReasonEnum, FeatureFlagEntity, GetProjectContract, GetProjectInputModel, GetSubscriptionContract, GetUsageSummaryContract, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, ListProjectsContract, ListProjectsInput, ListProjectsInputModel, ListProjectsOutput, ListProjectsOutputModel, Project, ProjectArchivedEvent, ProjectCreatedEvent, ProjectDeletedEvent, ProjectDeletedPayloadModel, ProjectDetailPresentation, ProjectEntity, ProjectListPresentation, ProjectMemberEntity, ProjectModel, ProjectStatusEnum, ProjectStatusFilterEnum, ProjectStatusSchemaEnum, ProjectUpdatedEvent, RecordUsageContract, RecordUsageInput, RecordUsageInputModel, RecordUsageOutputModel, SaasBoilerplateFeature, SaasDashboardPresentation, SettingsEntity, SettingsPanelPresentation, SettingsScopeEnum, Subscription, SubscriptionChangedEvent, SubscriptionEntity, SubscriptionModel, SubscriptionPresentation, SubscriptionStatusEnum, SubscriptionStatusSchemaEnum, UpdateProjectContract, UpdateProjectInput, UpdateProjectInputModel, UsageDashboardPresentation, UsageLimitEntity, UsageLimitReachedEvent, UsageRecordedEvent, UsageRecordedPayloadModel, UsageSummary, UsageSummaryModel, example, mockCheckFeatureAccessHandler, mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockListProjectsHandler, mockRecordUsageHandler, mockUpdateProjectHandler, saasBoilerplateSchemaContribution, schemaComposition };
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ca,mCAAmC;;;;;cAkBnC;WAUZ"}