@contractspec/example.saas-boilerplate 3.8.9 → 3.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/.turbo/turbo-build.log +156 -156
  2. package/CHANGELOG.md +20 -0
  3. package/dist/billing/billing.entity.js +1 -113
  4. package/dist/billing/billing.enum.js +1 -19
  5. package/dist/billing/billing.event.js +1 -90
  6. package/dist/billing/billing.handler.js +1 -148
  7. package/dist/billing/billing.operations.js +1 -278
  8. package/dist/billing/billing.presentation.js +1 -55
  9. package/dist/billing/billing.schema.js +1 -121
  10. package/dist/billing/index.js +1 -691
  11. package/dist/browser/billing/billing.entity.js +1 -113
  12. package/dist/browser/billing/billing.enum.js +1 -19
  13. package/dist/browser/billing/billing.event.js +1 -90
  14. package/dist/browser/billing/billing.handler.js +1 -148
  15. package/dist/browser/billing/billing.operations.js +1 -278
  16. package/dist/browser/billing/billing.presentation.js +1 -55
  17. package/dist/browser/billing/billing.schema.js +1 -121
  18. package/dist/browser/billing/index.js +1 -691
  19. package/dist/browser/dashboard/dashboard.presentation.js +1 -55
  20. package/dist/browser/dashboard/index.js +1 -55
  21. package/dist/browser/docs/index.js +5 -49
  22. package/dist/browser/docs/saas-boilerplate.docblock.js +5 -49
  23. package/dist/browser/example.js +1 -39
  24. package/dist/browser/handlers/index.js +2 -358
  25. package/dist/browser/handlers/saas.handlers.js +2 -134
  26. package/dist/browser/index.js +9 -3591
  27. package/dist/browser/presentations/index.js +1 -299
  28. package/dist/browser/project/index.js +1 -793
  29. package/dist/browser/project/project.entity.js +1 -77
  30. package/dist/browser/project/project.enum.js +1 -18
  31. package/dist/browser/project/project.event.js +1 -103
  32. package/dist/browser/project/project.handler.js +1 -178
  33. package/dist/browser/project/project.operations.js +1 -372
  34. package/dist/browser/project/project.presentation.js +1 -180
  35. package/dist/browser/project/project.schema.js +1 -134
  36. package/dist/browser/saas-boilerplate.feature.js +1 -304
  37. package/dist/browser/seeders/index.js +2 -20
  38. package/dist/browser/settings/index.js +1 -75
  39. package/dist/browser/settings/settings.entity.js +1 -74
  40. package/dist/browser/settings/settings.enum.js +1 -11
  41. package/dist/browser/shared/mock-data.js +1 -104
  42. package/dist/browser/tests/operations.test-spec.js +1 -112
  43. package/dist/browser/ui/SaasDashboard.js +1 -1239
  44. package/dist/browser/ui/SaasDashboard.visualizations.js +1 -249
  45. package/dist/browser/ui/SaasProjectList.js +1 -162
  46. package/dist/browser/ui/SaasSettingsPanel.js +1 -145
  47. package/dist/browser/ui/hooks/index.js +1 -159
  48. package/dist/browser/ui/hooks/useProjectList.js +1 -66
  49. package/dist/browser/ui/hooks/useProjectMutations.js +1 -91
  50. package/dist/browser/ui/index.js +5 -2077
  51. package/dist/browser/ui/modals/CreateProjectModal.js +1 -153
  52. package/dist/browser/ui/modals/ProjectActionsModal.js +1 -335
  53. package/dist/browser/ui/modals/index.js +1 -487
  54. package/dist/browser/ui/overlays/demo-overlays.js +1 -61
  55. package/dist/browser/ui/overlays/index.js +1 -61
  56. package/dist/browser/ui/renderers/index.js +5 -901
  57. package/dist/browser/ui/renderers/project-list.markdown.js +5 -725
  58. package/dist/browser/ui/renderers/project-list.renderer.js +1 -177
  59. package/dist/browser/visualizations/catalog.js +1 -155
  60. package/dist/browser/visualizations/index.js +1 -217
  61. package/dist/browser/visualizations/selectors.js +1 -210
  62. package/dist/dashboard/dashboard.presentation.js +1 -55
  63. package/dist/dashboard/index.js +1 -55
  64. package/dist/docs/index.js +5 -49
  65. package/dist/docs/saas-boilerplate.docblock.js +5 -49
  66. package/dist/example.js +1 -39
  67. package/dist/handlers/index.js +2 -358
  68. package/dist/handlers/saas.handlers.js +2 -134
  69. package/dist/index.js +9 -3591
  70. package/dist/node/billing/billing.entity.js +1 -113
  71. package/dist/node/billing/billing.enum.js +1 -19
  72. package/dist/node/billing/billing.event.js +1 -90
  73. package/dist/node/billing/billing.handler.js +1 -148
  74. package/dist/node/billing/billing.operations.js +1 -278
  75. package/dist/node/billing/billing.presentation.js +1 -55
  76. package/dist/node/billing/billing.schema.js +1 -121
  77. package/dist/node/billing/index.js +1 -691
  78. package/dist/node/dashboard/dashboard.presentation.js +1 -55
  79. package/dist/node/dashboard/index.js +1 -55
  80. package/dist/node/docs/index.js +5 -49
  81. package/dist/node/docs/saas-boilerplate.docblock.js +5 -49
  82. package/dist/node/example.js +1 -39
  83. package/dist/node/handlers/index.js +2 -358
  84. package/dist/node/handlers/saas.handlers.js +2 -134
  85. package/dist/node/index.js +9 -3591
  86. package/dist/node/presentations/index.js +1 -299
  87. package/dist/node/project/index.js +1 -793
  88. package/dist/node/project/project.entity.js +1 -77
  89. package/dist/node/project/project.enum.js +1 -18
  90. package/dist/node/project/project.event.js +1 -103
  91. package/dist/node/project/project.handler.js +1 -178
  92. package/dist/node/project/project.operations.js +1 -372
  93. package/dist/node/project/project.presentation.js +1 -180
  94. package/dist/node/project/project.schema.js +1 -134
  95. package/dist/node/saas-boilerplate.feature.js +1 -304
  96. package/dist/node/seeders/index.js +2 -20
  97. package/dist/node/settings/index.js +1 -75
  98. package/dist/node/settings/settings.entity.js +1 -74
  99. package/dist/node/settings/settings.enum.js +1 -11
  100. package/dist/node/shared/mock-data.js +1 -104
  101. package/dist/node/tests/operations.test-spec.js +1 -112
  102. package/dist/node/ui/SaasDashboard.js +1 -1239
  103. package/dist/node/ui/SaasDashboard.visualizations.js +1 -249
  104. package/dist/node/ui/SaasProjectList.js +1 -162
  105. package/dist/node/ui/SaasSettingsPanel.js +1 -145
  106. package/dist/node/ui/hooks/index.js +1 -159
  107. package/dist/node/ui/hooks/useProjectList.js +1 -66
  108. package/dist/node/ui/hooks/useProjectMutations.js +1 -91
  109. package/dist/node/ui/index.js +5 -2077
  110. package/dist/node/ui/modals/CreateProjectModal.js +1 -153
  111. package/dist/node/ui/modals/ProjectActionsModal.js +1 -335
  112. package/dist/node/ui/modals/index.js +1 -487
  113. package/dist/node/ui/overlays/demo-overlays.js +1 -61
  114. package/dist/node/ui/overlays/index.js +1 -61
  115. package/dist/node/ui/renderers/index.js +5 -901
  116. package/dist/node/ui/renderers/project-list.markdown.js +5 -725
  117. package/dist/node/ui/renderers/project-list.renderer.js +1 -177
  118. package/dist/node/visualizations/catalog.js +1 -155
  119. package/dist/node/visualizations/index.js +1 -217
  120. package/dist/node/visualizations/selectors.js +1 -210
  121. package/dist/presentations/index.js +1 -299
  122. package/dist/project/index.js +1 -793
  123. package/dist/project/project.entity.js +1 -77
  124. package/dist/project/project.enum.js +1 -18
  125. package/dist/project/project.event.js +1 -103
  126. package/dist/project/project.handler.js +1 -178
  127. package/dist/project/project.operations.js +1 -372
  128. package/dist/project/project.presentation.js +1 -180
  129. package/dist/project/project.schema.js +1 -134
  130. package/dist/saas-boilerplate.feature.js +1 -304
  131. package/dist/seeders/index.js +2 -20
  132. package/dist/settings/index.js +1 -75
  133. package/dist/settings/settings.entity.js +1 -74
  134. package/dist/settings/settings.enum.js +1 -11
  135. package/dist/shared/mock-data.js +1 -104
  136. package/dist/tests/operations.test-spec.js +1 -112
  137. package/dist/ui/SaasDashboard.js +1 -1239
  138. package/dist/ui/SaasDashboard.visualizations.js +1 -249
  139. package/dist/ui/SaasProjectList.js +1 -162
  140. package/dist/ui/SaasSettingsPanel.js +1 -145
  141. package/dist/ui/hooks/index.js +1 -159
  142. package/dist/ui/hooks/useProjectList.js +1 -66
  143. package/dist/ui/hooks/useProjectMutations.js +1 -91
  144. package/dist/ui/index.js +5 -2077
  145. package/dist/ui/modals/CreateProjectModal.js +1 -153
  146. package/dist/ui/modals/ProjectActionsModal.js +1 -335
  147. package/dist/ui/modals/index.js +1 -487
  148. package/dist/ui/overlays/demo-overlays.js +1 -61
  149. package/dist/ui/overlays/index.js +1 -61
  150. package/dist/ui/renderers/index.js +5 -901
  151. package/dist/ui/renderers/project-list.markdown.js +5 -725
  152. package/dist/ui/renderers/project-list.renderer.js +1 -177
  153. package/dist/visualizations/catalog.js +1 -155
  154. package/dist/visualizations/index.js +1 -217
  155. package/dist/visualizations/selectors.js +1 -210
  156. package/package.json +12 -12
@@ -1,55 +1 @@
1
- // src/billing/billing.presentation.ts
2
- import {
3
- definePresentation,
4
- StabilityEnum
5
- } from "@contractspec/lib.contracts-spec";
6
- var SubscriptionPresentation = definePresentation({
7
- meta: {
8
- key: "saas.billing.subscription",
9
- version: "1.0.0",
10
- title: "Subscription Status",
11
- description: "Subscription status with plan info, limits, and current usage",
12
- domain: "saas-boilerplate",
13
- owners: ["@saas-team"],
14
- tags: ["billing", "subscription"],
15
- stability: StabilityEnum.Beta,
16
- goal: "View subscription plan and status",
17
- context: "Billing section"
18
- },
19
- source: {
20
- type: "component",
21
- framework: "react",
22
- componentKey: "SubscriptionView"
23
- },
24
- targets: ["react", "markdown"],
25
- policy: {
26
- flags: ["saas.billing.enabled"]
27
- }
28
- });
29
- var UsageDashboardPresentation = definePresentation({
30
- meta: {
31
- key: "saas.billing.usage",
32
- version: "1.0.0",
33
- title: "Usage Dashboard",
34
- description: "Usage metrics and breakdown by resource type",
35
- domain: "saas-boilerplate",
36
- owners: ["@saas-team"],
37
- tags: ["billing", "usage", "metrics"],
38
- stability: StabilityEnum.Beta,
39
- goal: "Monitor feature usage and limits",
40
- context: "Billing section"
41
- },
42
- source: {
43
- type: "component",
44
- framework: "react",
45
- componentKey: "UsageDashboardView"
46
- },
47
- targets: ["react", "markdown"],
48
- policy: {
49
- flags: ["saas.billing.enabled"]
50
- }
51
- });
52
- export {
53
- UsageDashboardPresentation,
54
- SubscriptionPresentation
55
- };
1
+ import{definePresentation as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({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:h.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"]}}),q=g({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:h.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"]}});export{q as UsageDashboardPresentation,k as SubscriptionPresentation};
@@ -1,121 +1 @@
1
- // src/billing/billing.enum.ts
2
- import { defineEnum } from "@contractspec/lib.schema";
3
- var SubscriptionStatusSchemaEnum = defineEnum("SubscriptionStatus", [
4
- "TRIALING",
5
- "ACTIVE",
6
- "PAST_DUE",
7
- "CANCELED",
8
- "PAUSED"
9
- ]);
10
- var FeatureAccessReasonEnum = defineEnum("FeatureAccessReason", [
11
- "included",
12
- "limit_available",
13
- "limit_reached",
14
- "not_in_plan"
15
- ]);
16
-
17
- // src/billing/billing.schema.ts
18
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
19
- var SubscriptionModel = defineSchemaModel({
20
- name: "Subscription",
21
- description: "Organization subscription details",
22
- fields: {
23
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
- organizationId: {
25
- type: ScalarTypeEnum.String_unsecure(),
26
- isOptional: false
27
- },
28
- planId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
- planName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
- status: { type: SubscriptionStatusSchemaEnum, isOptional: false },
31
- currentPeriodStart: { type: ScalarTypeEnum.DateTime(), isOptional: false },
32
- currentPeriodEnd: { type: ScalarTypeEnum.DateTime(), isOptional: false },
33
- trialEndsAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
34
- cancelAtPeriodEnd: { type: ScalarTypeEnum.Boolean(), isOptional: false }
35
- }
36
- });
37
- var UsageSummaryModel = defineSchemaModel({
38
- name: "UsageSummary",
39
- description: "Usage summary for a feature",
40
- fields: {
41
- feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
42
- used: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
43
- limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
44
- unit: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
45
- percentage: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true }
46
- }
47
- });
48
- var RecordUsageInputModel = defineSchemaModel({
49
- name: "RecordUsageInput",
50
- description: "Input for recording feature usage",
51
- fields: {
52
- feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
53
- quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
54
- sourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
55
- sourceType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
56
- metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true }
57
- }
58
- });
59
- var RecordUsageOutputModel = defineSchemaModel({
60
- name: "RecordUsageOutput",
61
- description: "Output for recording feature usage",
62
- fields: {
63
- recorded: { type: ScalarTypeEnum.Boolean(), isOptional: false },
64
- currentUsage: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
65
- limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
66
- limitReached: { type: ScalarTypeEnum.Boolean(), isOptional: false }
67
- }
68
- });
69
- var UsageRecordedPayloadModel = defineSchemaModel({
70
- name: "UsageRecordedPayload",
71
- description: "Payload for usage.recorded event",
72
- fields: {
73
- feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
74
- quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
75
- }
76
- });
77
- var GetUsageSummaryInputModel = defineSchemaModel({
78
- name: "GetUsageSummaryInput",
79
- description: "Input for getting usage summary",
80
- fields: {
81
- billingPeriod: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
82
- }
83
- });
84
- var GetUsageSummaryOutputModel = defineSchemaModel({
85
- name: "GetUsageSummaryOutput",
86
- description: "Output for usage summary",
87
- fields: {
88
- billingPeriod: {
89
- type: ScalarTypeEnum.String_unsecure(),
90
- isOptional: false
91
- },
92
- usage: { type: UsageSummaryModel, isArray: true, isOptional: false }
93
- }
94
- });
95
- var CheckFeatureAccessInputModel = defineSchemaModel({
96
- name: "CheckFeatureAccessInput",
97
- description: "Input for checking feature access",
98
- fields: {
99
- feature: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
100
- }
101
- });
102
- var CheckFeatureAccessOutputModel = defineSchemaModel({
103
- name: "CheckFeatureAccessOutput",
104
- description: "Output for feature access check",
105
- fields: {
106
- hasAccess: { type: ScalarTypeEnum.Boolean(), isOptional: false },
107
- reason: { type: FeatureAccessReasonEnum, isOptional: true },
108
- upgradeUrl: { type: ScalarTypeEnum.URL(), isOptional: true }
109
- }
110
- });
111
- export {
112
- UsageSummaryModel,
113
- UsageRecordedPayloadModel,
114
- SubscriptionModel,
115
- RecordUsageOutputModel,
116
- RecordUsageInputModel,
117
- GetUsageSummaryOutputModel,
118
- GetUsageSummaryInputModel,
119
- CheckFeatureAccessOutputModel,
120
- CheckFeatureAccessInputModel
121
- };
1
+ import{defineEnum as v}from"@contractspec/lib.schema";var w=v("SubscriptionStatus",["TRIALING","ACTIVE","PAST_DUE","CANCELED","PAUSED"]),x=v("FeatureAccessReason",["included","limit_available","limit_reached","not_in_plan"]);import{defineSchemaModel as q,ScalarTypeEnum as j}from"@contractspec/lib.schema";var H=q({name:"Subscription",description:"Organization subscription details",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},planId:{type:j.String_unsecure(),isOptional:!1},planName:{type:j.String_unsecure(),isOptional:!1},status:{type:w,isOptional:!1},currentPeriodStart:{type:j.DateTime(),isOptional:!1},currentPeriodEnd:{type:j.DateTime(),isOptional:!1},trialEndsAt:{type:j.DateTime(),isOptional:!0},cancelAtPeriodEnd:{type:j.Boolean(),isOptional:!1}}}),z=q({name:"UsageSummary",description:"Usage summary for a feature",fields:{feature:{type:j.String_unsecure(),isOptional:!1},used:{type:j.Int_unsecure(),isOptional:!1},limit:{type:j.Int_unsecure(),isOptional:!0},unit:{type:j.String_unsecure(),isOptional:!0},percentage:{type:j.Float_unsecure(),isOptional:!0}}}),I=q({name:"RecordUsageInput",description:"Input for recording feature usage",fields:{feature:{type:j.String_unsecure(),isOptional:!1},quantity:{type:j.Int_unsecure(),isOptional:!1},sourceId:{type:j.String_unsecure(),isOptional:!0},sourceType:{type:j.String_unsecure(),isOptional:!0},metadata:{type:j.JSONObject(),isOptional:!0}}}),J=q({name:"RecordUsageOutput",description:"Output for recording feature usage",fields:{recorded:{type:j.Boolean(),isOptional:!1},currentUsage:{type:j.Int_unsecure(),isOptional:!1},limit:{type:j.Int_unsecure(),isOptional:!0},limitReached:{type:j.Boolean(),isOptional:!1}}}),K=q({name:"UsageRecordedPayload",description:"Payload for usage.recorded event",fields:{feature:{type:j.String_unsecure(),isOptional:!1},quantity:{type:j.Int_unsecure(),isOptional:!1}}}),L=q({name:"GetUsageSummaryInput",description:"Input for getting usage summary",fields:{billingPeriod:{type:j.String_unsecure(),isOptional:!0}}}),N=q({name:"GetUsageSummaryOutput",description:"Output for usage summary",fields:{billingPeriod:{type:j.String_unsecure(),isOptional:!1},usage:{type:z,isArray:!0,isOptional:!1}}}),P=q({name:"CheckFeatureAccessInput",description:"Input for checking feature access",fields:{feature:{type:j.String_unsecure(),isOptional:!1}}}),Q=q({name:"CheckFeatureAccessOutput",description:"Output for feature access check",fields:{hasAccess:{type:j.Boolean(),isOptional:!1},reason:{type:x,isOptional:!0},upgradeUrl:{type:j.URL(),isOptional:!0}}});export{z as UsageSummaryModel,K as UsageRecordedPayloadModel,H as SubscriptionModel,J as RecordUsageOutputModel,I as RecordUsageInputModel,N as GetUsageSummaryOutputModel,L as GetUsageSummaryInputModel,Q as CheckFeatureAccessOutputModel,P as CheckFeatureAccessInputModel};