@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,55 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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};
|