@lssm/example.saas-boilerplate 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060433
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$colon$bundle.log +69 -0
- package/CHANGELOG.md +8 -42
- package/dist/billing/billing.contracts.d.ts +165 -0
- package/dist/billing/billing.entity.d.ts +60 -0
- package/dist/billing/billing.enum.d.ts +15 -0
- package/dist/billing/billing.event.d.ts +85 -0
- package/dist/billing/billing.handler.d.ts +81 -0
- package/dist/billing/billing.presentation.d.ts +14 -0
- package/dist/billing/billing.schema.d.ts +200 -0
- package/dist/billing/index.d.ts +8 -0
- package/dist/dashboard/dashboard.presentation.d.ts +14 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/saas-boilerplate.docblock.d.ts +1 -0
- package/dist/example.d.ts +36 -0
- package/dist/handlers/index.d.ts +3 -0
- package/dist/index.d.ts +41 -0
- package/dist/presentations/index.d.ts +16 -0
- package/dist/project/index.d.ts +8 -0
- package/dist/project/project.contracts.d.ts +418 -0
- package/dist/project/project.entity.d.ts +39 -0
- package/dist/project/project.enum.d.ts +15 -0
- package/dist/project/project.event.d.ts +91 -0
- package/dist/project/project.handler.d.ts +71 -0
- package/dist/project/project.presentation.d.ts +14 -0
- package/dist/project/project.schema.d.ts +234 -0
- package/dist/saas-boilerplate.feature.d.ts +11 -0
- package/dist/settings/index.d.ts +3 -0
- package/dist/settings/settings.entity.d.ts +36 -0
- package/dist/settings/settings.enum.d.ts +9 -0
- package/dist/shared/mock-data.d.ts +85 -0
- package/package.json +10 -10
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mtsdown[0m
|
|
3
|
+
[34mℹ[39m tsdown [2mv0.17.4[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
|
+
[34mℹ[39m config file: [4m/Users/tboutron/Documents/clients/lssm/monorepo-lssm/packages/contractspec/packages/examples/saas-boilerplate/tsdown.config.js[24m (unrun)
|
|
5
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/saas-boilerplate.feature.ts, src/billing/billing.contracts.ts, src/billing/billing.entity.ts, src/billing/billing.enum.ts, src/billing/billing.event.ts, src/billing/billing.handler.ts, src/billing/billing.presentation.ts, src/billing/billing.schema.ts, src/billing/index.ts, src/dashboard/dashboard.presentation.ts, src/dashboard/index.ts, src/docs/index.ts, src/docs/saas-boilerplate.docblock.ts, src/handlers/index.ts, src/presentations/index.ts, src/project/index.ts, src/project/project.contracts.ts, src/project/project.entity.ts, src/project/project.enum.ts, src/project/project.event.ts, src/project/project.handler.ts, src/project/project.presentation.ts, src/project/project.schema.ts, src/settings/index.ts, src/settings/settings.entity.ts, src/settings/settings.enum.ts, src/shared/mock-data.ts[39m
|
|
6
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m Cleaning 66 files
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m 5.04 kB[22m [2m│ gzip: 1.28 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/saas-boilerplate.docblock.js[22m [2m 3.46 kB[22m [2m│ gzip: 1.38 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.contracts.js[22m [2m 2.78 kB[22m [2m│ gzip: 0.94 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.schema.js[22m [2m 2.73 kB[22m [2m│ gzip: 0.70 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.entity.js[22m [2m 2.57 kB[22m [2m│ gzip: 0.94 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.schema.js[22m [2m 2.57 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mshared/mock-data.js[22m [2m 2.06 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1msaas-boilerplate.feature.js[22m [2m 2.00 kB[22m [2m│ gzip: 0.52 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mproject/index.js[22m [2m 1.87 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/index.js[22m [2m 1.87 kB[22m [2m│ gzip: 0.51 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.contracts.js[22m [2m 1.86 kB[22m [2m│ gzip: 0.69 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.event.js[22m [2m 1.80 kB[22m [2m│ gzip: 0.45 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.event.js[22m [2m 1.65 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.entity.js[22m [2m 1.64 kB[22m [2m│ gzip: 0.67 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[1msettings/settings.entity.js[22m [2m 1.49 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.handler.js[22m [2m 1.43 kB[22m [2m│ gzip: 0.65 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.presentation.js[22m [2m 0.84 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.presentation.js[22m [2m 0.77 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22m[1mpresentations/index.js[22m [2m 0.76 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
29
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.handler.js[22m [2m 0.72 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
30
|
+
[34mℹ[39m [2mdist/[22m[1mdashboard/dashboard.presentation.js[22m [2m 0.71 kB[22m [2m│ gzip: 0.33 kB[22m
|
|
31
|
+
[34mℹ[39m [2mdist/[22m[1mhandlers/index.js[22m [2m 0.64 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
32
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m 0.63 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
33
|
+
[34mℹ[39m [2mdist/[22m[1mbilling/billing.enum.js[22m [2m 0.29 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
34
|
+
[34mℹ[39m [2mdist/[22m[1mproject/project.enum.js[22m [2m 0.24 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
35
|
+
[34mℹ[39m [2mdist/[22m[1msettings/settings.enum.js[22m [2m 0.21 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
36
|
+
[34mℹ[39m [2mdist/[22m[1msettings/index.js[22m [2m 0.21 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
37
|
+
[34mℹ[39m [2mdist/[22m[1mdashboard/index.js[22m [2m 0.17 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m 0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
39
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.contracts.d.ts[22m[39m [2m10.87 kB[22m [2m│ gzip: 0.84 kB[22m
|
|
40
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.schema.d.ts[22m[39m [2m 6.08 kB[22m [2m│ gzip: 0.73 kB[22m
|
|
41
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.schema.d.ts[22m[39m [2m 5.20 kB[22m [2m│ gzip: 0.76 kB[22m
|
|
42
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m 4.98 kB[22m [2m│ gzip: 1.03 kB[22m
|
|
43
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.contracts.d.ts[22m[39m [2m 4.49 kB[22m [2m│ gzip: 0.74 kB[22m
|
|
44
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.entity.d.ts[22m[39m [2m 2.61 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
45
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.event.d.ts[22m[39m [2m 2.50 kB[22m [2m│ gzip: 0.41 kB[22m
|
|
46
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.event.d.ts[22m[39m [2m 2.33 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
47
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.handler.d.ts[22m[39m [2m 2.07 kB[22m [2m│ gzip: 0.69 kB[22m
|
|
48
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/index.d.ts[22m[39m [2m 1.90 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
49
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.handler.d.ts[22m[39m [2m 1.89 kB[22m [2m│ gzip: 0.51 kB[22m
|
|
50
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/index.d.ts[22m[39m [2m 1.87 kB[22m [2m│ gzip: 0.40 kB[22m
|
|
51
|
+
[34mℹ[39m [2mdist/[22m[32m[1mshared/mock-data.d.ts[22m[39m [2m 1.64 kB[22m [2m│ gzip: 0.48 kB[22m
|
|
52
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.entity.d.ts[22m[39m [2m 1.54 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
53
|
+
[34mℹ[39m [2mdist/[22m[32m[1msettings/settings.entity.d.ts[22m[39m [2m 1.46 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
54
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m 1.13 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
55
|
+
[34mℹ[39m [2mdist/[22m[32m[1mpresentations/index.d.ts[22m[39m [2m 0.86 kB[22m [2m│ gzip: 0.26 kB[22m
|
|
56
|
+
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/index.d.ts[22m[39m [2m 0.58 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
57
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.enum.d.ts[22m[39m [2m 0.56 kB[22m [2m│ gzip: 0.27 kB[22m
|
|
58
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.enum.d.ts[22m[39m [2m 0.56 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
59
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdashboard/dashboard.presentation.d.ts[22m[39m [2m 0.43 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
60
|
+
[34mℹ[39m [2mdist/[22m[32m[1mproject/project.presentation.d.ts[22m[39m [2m 0.43 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
61
|
+
[34mℹ[39m [2mdist/[22m[32m[1mbilling/billing.presentation.d.ts[22m[39m [2m 0.42 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
62
|
+
[34mℹ[39m [2mdist/[22m[32m[1msaas-boilerplate.feature.d.ts[22m[39m [2m 0.35 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
63
|
+
[34mℹ[39m [2mdist/[22m[32m[1msettings/settings.enum.d.ts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
64
|
+
[34mℹ[39m [2mdist/[22m[32m[1msettings/index.d.ts[22m[39m [2m 0.19 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
65
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdashboard/index.d.ts[22m[39m [2m 0.16 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
66
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
67
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/saas-boilerplate.docblock.d.ts[22m[39m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
68
|
+
[34mℹ[39m 58 files, total: 100.44 kB
|
|
69
|
+
[32m✔[39m Build complete in [32m8911ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lssm/example.saas-boilerplate
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20251217060433
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -9,44 +9,10 @@
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies [66a5dfd]
|
|
12
|
-
- @lssm/lib.bus@0.0.0-canary-
|
|
13
|
-
- @lssm/lib.contracts@0.0.0-canary-
|
|
14
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-
|
|
15
|
-
- @lssm/lib.jobs@0.0.0-canary-
|
|
16
|
-
- @lssm/lib.schema@0.0.0-canary-
|
|
17
|
-
- @lssm/module.audit-trail@0.0.0-canary-
|
|
18
|
-
- @lssm/module.notifications@0.0.0-canary-
|
|
19
|
-
|
|
20
|
-
## 1.42.0
|
|
21
|
-
|
|
22
|
-
### Minor Changes
|
|
23
|
-
|
|
24
|
-
- 66a5dfd: initial release
|
|
25
|
-
|
|
26
|
-
### Patch Changes
|
|
27
|
-
|
|
28
|
-
- Updated dependencies [66a5dfd]
|
|
29
|
-
- @lssm/lib.bus@1.42.0
|
|
30
|
-
- @lssm/lib.contracts@1.42.0
|
|
31
|
-
- @lssm/lib.identity-rbac@1.42.0
|
|
32
|
-
- @lssm/lib.jobs@1.42.0
|
|
33
|
-
- @lssm/lib.schema@1.42.0
|
|
34
|
-
- @lssm/module.audit-trail@1.42.0
|
|
35
|
-
- @lssm/module.notifications@1.42.0
|
|
36
|
-
|
|
37
|
-
## 0.0.0-canary-20251217053014
|
|
38
|
-
|
|
39
|
-
### Minor Changes
|
|
40
|
-
|
|
41
|
-
- 66a5dfd: initial release
|
|
42
|
-
|
|
43
|
-
### Patch Changes
|
|
44
|
-
|
|
45
|
-
- Updated dependencies [66a5dfd]
|
|
46
|
-
- @lssm/lib.bus@0.0.0-canary-20251217053014
|
|
47
|
-
- @lssm/lib.contracts@0.0.0-canary-20251217053014
|
|
48
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-20251217053014
|
|
49
|
-
- @lssm/lib.jobs@0.0.0-canary-20251217053014
|
|
50
|
-
- @lssm/lib.schema@0.0.0-canary-20251217053014
|
|
51
|
-
- @lssm/module.audit-trail@0.0.0-canary-20251217053014
|
|
52
|
-
- @lssm/module.notifications@0.0.0-canary-20251217053014
|
|
12
|
+
- @lssm/lib.bus@0.0.0-canary-20251217060433
|
|
13
|
+
- @lssm/lib.contracts@0.0.0-canary-20251217060433
|
|
14
|
+
- @lssm/lib.identity-rbac@0.0.0-canary-20251217060433
|
|
15
|
+
- @lssm/lib.jobs@0.0.0-canary-20251217060433
|
|
16
|
+
- @lssm/lib.schema@0.0.0-canary-20251217060433
|
|
17
|
+
- @lssm/module.audit-trail@0.0.0-canary-20251217060433
|
|
18
|
+
- @lssm/module.notifications@0.0.0-canary-20251217060433
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as _lssm_lib_schema45 from "@lssm/lib.schema";
|
|
2
|
+
import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
|
|
3
|
+
|
|
4
|
+
//#region src/billing/billing.contracts.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Get subscription status.
|
|
7
|
+
*/
|
|
8
|
+
declare const GetSubscriptionContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.AnySchemaModel, _lssm_lib_schema45.SchemaModel<{
|
|
9
|
+
id: {
|
|
10
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
organizationId: {
|
|
14
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
planId: {
|
|
18
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
planName: {
|
|
22
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
status: {
|
|
26
|
+
type: _lssm_lib_schema45.EnumType<[string, string, string, string, string]>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
currentPeriodStart: {
|
|
30
|
+
type: _lssm_lib_schema45.FieldType<Date, string>;
|
|
31
|
+
isOptional: false;
|
|
32
|
+
};
|
|
33
|
+
currentPeriodEnd: {
|
|
34
|
+
type: _lssm_lib_schema45.FieldType<Date, string>;
|
|
35
|
+
isOptional: false;
|
|
36
|
+
};
|
|
37
|
+
trialEndsAt: {
|
|
38
|
+
type: _lssm_lib_schema45.FieldType<Date, string>;
|
|
39
|
+
isOptional: true;
|
|
40
|
+
};
|
|
41
|
+
cancelAtPeriodEnd: {
|
|
42
|
+
type: _lssm_lib_schema45.FieldType<boolean, boolean>;
|
|
43
|
+
isOptional: false;
|
|
44
|
+
};
|
|
45
|
+
}>, undefined>;
|
|
46
|
+
/**
|
|
47
|
+
* Record feature usage.
|
|
48
|
+
*/
|
|
49
|
+
declare const RecordUsageContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.SchemaModel<{
|
|
50
|
+
feature: {
|
|
51
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
quantity: {
|
|
55
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
sourceId: {
|
|
59
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
60
|
+
isOptional: true;
|
|
61
|
+
};
|
|
62
|
+
sourceType: {
|
|
63
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
64
|
+
isOptional: true;
|
|
65
|
+
};
|
|
66
|
+
metadata: {
|
|
67
|
+
type: _lssm_lib_schema45.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
68
|
+
isOptional: true;
|
|
69
|
+
};
|
|
70
|
+
}>, _lssm_lib_schema45.SchemaModel<{
|
|
71
|
+
recorded: {
|
|
72
|
+
type: _lssm_lib_schema45.FieldType<boolean, boolean>;
|
|
73
|
+
isOptional: false;
|
|
74
|
+
};
|
|
75
|
+
currentUsage: {
|
|
76
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
77
|
+
isOptional: false;
|
|
78
|
+
};
|
|
79
|
+
limit: {
|
|
80
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
81
|
+
isOptional: true;
|
|
82
|
+
};
|
|
83
|
+
limitReached: {
|
|
84
|
+
type: _lssm_lib_schema45.FieldType<boolean, boolean>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
}>, {
|
|
88
|
+
name: string;
|
|
89
|
+
version: number;
|
|
90
|
+
when: string;
|
|
91
|
+
payload: _lssm_lib_schema45.SchemaModel<{
|
|
92
|
+
feature: {
|
|
93
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
94
|
+
isOptional: false;
|
|
95
|
+
};
|
|
96
|
+
quantity: {
|
|
97
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
98
|
+
isOptional: false;
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
}[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Get usage summary.
|
|
104
|
+
*/
|
|
105
|
+
declare const GetUsageSummaryContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.SchemaModel<{
|
|
106
|
+
billingPeriod: {
|
|
107
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
108
|
+
isOptional: true;
|
|
109
|
+
};
|
|
110
|
+
}>, _lssm_lib_schema45.SchemaModel<{
|
|
111
|
+
billingPeriod: {
|
|
112
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
113
|
+
isOptional: false;
|
|
114
|
+
};
|
|
115
|
+
usage: {
|
|
116
|
+
type: _lssm_lib_schema45.SchemaModel<{
|
|
117
|
+
feature: {
|
|
118
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
119
|
+
isOptional: false;
|
|
120
|
+
};
|
|
121
|
+
used: {
|
|
122
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
123
|
+
isOptional: false;
|
|
124
|
+
};
|
|
125
|
+
limit: {
|
|
126
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
127
|
+
isOptional: true;
|
|
128
|
+
};
|
|
129
|
+
unit: {
|
|
130
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
131
|
+
isOptional: true;
|
|
132
|
+
};
|
|
133
|
+
percentage: {
|
|
134
|
+
type: _lssm_lib_schema45.FieldType<number, number>;
|
|
135
|
+
isOptional: true;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
isArray: true;
|
|
139
|
+
isOptional: false;
|
|
140
|
+
};
|
|
141
|
+
}>, undefined>;
|
|
142
|
+
/**
|
|
143
|
+
* Check feature access.
|
|
144
|
+
*/
|
|
145
|
+
declare const CheckFeatureAccessContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema45.SchemaModel<{
|
|
146
|
+
feature: {
|
|
147
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
148
|
+
isOptional: false;
|
|
149
|
+
};
|
|
150
|
+
}>, _lssm_lib_schema45.SchemaModel<{
|
|
151
|
+
hasAccess: {
|
|
152
|
+
type: _lssm_lib_schema45.FieldType<boolean, boolean>;
|
|
153
|
+
isOptional: false;
|
|
154
|
+
};
|
|
155
|
+
reason: {
|
|
156
|
+
type: _lssm_lib_schema45.EnumType<[string, string, string, string]>;
|
|
157
|
+
isOptional: true;
|
|
158
|
+
};
|
|
159
|
+
upgradeUrl: {
|
|
160
|
+
type: _lssm_lib_schema45.FieldType<string, string>;
|
|
161
|
+
isOptional: true;
|
|
162
|
+
};
|
|
163
|
+
}>, undefined>;
|
|
164
|
+
//#endregion
|
|
165
|
+
export { CheckFeatureAccessContract, GetSubscriptionContract, GetUsageSummaryContract, RecordUsageContract };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as _lssm_lib_schema128 from "@lssm/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/billing/billing.entity.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Subscription status enum for entities.
|
|
6
|
+
*/
|
|
7
|
+
declare const SubscriptionStatusEnum: _lssm_lib_schema128.EntityEnumDef;
|
|
8
|
+
/**
|
|
9
|
+
* Subscription entity - organization subscription info.
|
|
10
|
+
*/
|
|
11
|
+
declare const SubscriptionEntity: _lssm_lib_schema128.EntitySpec<{
|
|
12
|
+
id: _lssm_lib_schema128.EntityScalarField;
|
|
13
|
+
organizationId: _lssm_lib_schema128.EntityScalarField;
|
|
14
|
+
planId: _lssm_lib_schema128.EntityScalarField;
|
|
15
|
+
planName: _lssm_lib_schema128.EntityScalarField;
|
|
16
|
+
status: _lssm_lib_schema128.EntityEnumField;
|
|
17
|
+
currentPeriodStart: _lssm_lib_schema128.EntityScalarField;
|
|
18
|
+
currentPeriodEnd: _lssm_lib_schema128.EntityScalarField;
|
|
19
|
+
trialEndsAt: _lssm_lib_schema128.EntityScalarField;
|
|
20
|
+
cancelAtPeriodEnd: _lssm_lib_schema128.EntityScalarField;
|
|
21
|
+
canceledAt: _lssm_lib_schema128.EntityScalarField;
|
|
22
|
+
stripeSubscriptionId: _lssm_lib_schema128.EntityScalarField;
|
|
23
|
+
stripeCustomerId: _lssm_lib_schema128.EntityScalarField;
|
|
24
|
+
metadata: _lssm_lib_schema128.EntityScalarField;
|
|
25
|
+
createdAt: _lssm_lib_schema128.EntityScalarField;
|
|
26
|
+
updatedAt: _lssm_lib_schema128.EntityScalarField;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* BillingUsage entity - track feature usage.
|
|
30
|
+
*/
|
|
31
|
+
declare const BillingUsageEntity: _lssm_lib_schema128.EntitySpec<{
|
|
32
|
+
id: _lssm_lib_schema128.EntityScalarField;
|
|
33
|
+
organizationId: _lssm_lib_schema128.EntityScalarField;
|
|
34
|
+
feature: _lssm_lib_schema128.EntityScalarField;
|
|
35
|
+
quantity: _lssm_lib_schema128.EntityScalarField;
|
|
36
|
+
unit: _lssm_lib_schema128.EntityScalarField;
|
|
37
|
+
billingPeriod: _lssm_lib_schema128.EntityScalarField;
|
|
38
|
+
recordedAt: _lssm_lib_schema128.EntityScalarField;
|
|
39
|
+
sourceId: _lssm_lib_schema128.EntityScalarField;
|
|
40
|
+
sourceType: _lssm_lib_schema128.EntityScalarField;
|
|
41
|
+
metadata: _lssm_lib_schema128.EntityScalarField;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* UsageLimit entity - feature usage limits per plan.
|
|
45
|
+
*/
|
|
46
|
+
declare const UsageLimitEntity: _lssm_lib_schema128.EntitySpec<{
|
|
47
|
+
id: _lssm_lib_schema128.EntityScalarField;
|
|
48
|
+
planId: _lssm_lib_schema128.EntityScalarField;
|
|
49
|
+
organizationId: _lssm_lib_schema128.EntityScalarField;
|
|
50
|
+
feature: _lssm_lib_schema128.EntityScalarField;
|
|
51
|
+
limit: _lssm_lib_schema128.EntityScalarField;
|
|
52
|
+
resetPeriod: _lssm_lib_schema128.EntityScalarField;
|
|
53
|
+
isSoftLimit: _lssm_lib_schema128.EntityScalarField;
|
|
54
|
+
overage: _lssm_lib_schema128.EntityScalarField;
|
|
55
|
+
overageRate: _lssm_lib_schema128.EntityScalarField;
|
|
56
|
+
createdAt: _lssm_lib_schema128.EntityScalarField;
|
|
57
|
+
updatedAt: _lssm_lib_schema128.EntityScalarField;
|
|
58
|
+
}>;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { BillingUsageEntity, SubscriptionEntity, SubscriptionStatusEnum, UsageLimitEntity };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _lssm_lib_schema269 from "@lssm/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/billing/billing.enum.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Subscription status enum for contract schemas.
|
|
7
|
+
* Note: Entity enum is defined separately in billing.entity.ts
|
|
8
|
+
*/
|
|
9
|
+
declare const SubscriptionStatusSchemaEnum: _lssm_lib_schema269.EnumType<[string, string, string, string, string]>;
|
|
10
|
+
/**
|
|
11
|
+
* Feature access reason enum.
|
|
12
|
+
*/
|
|
13
|
+
declare const FeatureAccessReasonEnum: _lssm_lib_schema269.EnumType<[string, string, string, string]>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as _lssm_lib_schema86 from "@lssm/lib.schema";
|
|
2
|
+
import * as _lssm_lib_contracts3 from "@lssm/lib.contracts";
|
|
3
|
+
|
|
4
|
+
//#region src/billing/billing.event.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Event: Feature usage has been recorded.
|
|
7
|
+
*/
|
|
8
|
+
declare const UsageRecordedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema86.SchemaModel<{
|
|
9
|
+
organizationId: {
|
|
10
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
feature: {
|
|
14
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
quantity: {
|
|
18
|
+
type: _lssm_lib_schema86.FieldType<number, number>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
billingPeriod: {
|
|
22
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
recordedAt: {
|
|
26
|
+
type: _lssm_lib_schema86.FieldType<Date, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
}>>;
|
|
30
|
+
/**
|
|
31
|
+
* Event: Usage limit has been reached for a feature.
|
|
32
|
+
*/
|
|
33
|
+
declare const UsageLimitReachedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema86.SchemaModel<{
|
|
34
|
+
organizationId: {
|
|
35
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
37
|
+
};
|
|
38
|
+
feature: {
|
|
39
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
limit: {
|
|
43
|
+
type: _lssm_lib_schema86.FieldType<number, number>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
currentUsage: {
|
|
47
|
+
type: _lssm_lib_schema86.FieldType<number, number>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
reachedAt: {
|
|
51
|
+
type: _lssm_lib_schema86.FieldType<Date, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
}>>;
|
|
55
|
+
/**
|
|
56
|
+
* Event: Subscription status has changed.
|
|
57
|
+
*/
|
|
58
|
+
declare const SubscriptionChangedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema86.SchemaModel<{
|
|
59
|
+
organizationId: {
|
|
60
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
61
|
+
isOptional: false;
|
|
62
|
+
};
|
|
63
|
+
previousPlan: {
|
|
64
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
65
|
+
isOptional: true;
|
|
66
|
+
};
|
|
67
|
+
newPlan: {
|
|
68
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
69
|
+
isOptional: false;
|
|
70
|
+
};
|
|
71
|
+
previousStatus: {
|
|
72
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
73
|
+
isOptional: true;
|
|
74
|
+
};
|
|
75
|
+
newStatus: {
|
|
76
|
+
type: _lssm_lib_schema86.FieldType<string, string>;
|
|
77
|
+
isOptional: false;
|
|
78
|
+
};
|
|
79
|
+
changedAt: {
|
|
80
|
+
type: _lssm_lib_schema86.FieldType<Date, string>;
|
|
81
|
+
isOptional: false;
|
|
82
|
+
};
|
|
83
|
+
}>>;
|
|
84
|
+
//#endregion
|
|
85
|
+
export { SubscriptionChangedEvent, UsageLimitReachedEvent, UsageRecordedEvent };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
//#region src/billing/billing.handler.d.ts
|
|
2
|
+
interface Subscription {
|
|
3
|
+
id: string;
|
|
4
|
+
organizationId: string;
|
|
5
|
+
planId: string;
|
|
6
|
+
planName: string;
|
|
7
|
+
status: 'ACTIVE' | 'TRIALING' | 'PAST_DUE' | 'CANCELED' | 'UNPAID';
|
|
8
|
+
currentPeriodStart: Date;
|
|
9
|
+
currentPeriodEnd: Date;
|
|
10
|
+
limits: {
|
|
11
|
+
projects: number;
|
|
12
|
+
users: number;
|
|
13
|
+
storage: number;
|
|
14
|
+
apiCalls: number;
|
|
15
|
+
};
|
|
16
|
+
usage: {
|
|
17
|
+
projects: number;
|
|
18
|
+
users: number;
|
|
19
|
+
storage: number;
|
|
20
|
+
apiCalls: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface UsageSummary {
|
|
24
|
+
organizationId: string;
|
|
25
|
+
period: string;
|
|
26
|
+
apiCalls: {
|
|
27
|
+
total: number;
|
|
28
|
+
limit: number;
|
|
29
|
+
percentUsed: number;
|
|
30
|
+
};
|
|
31
|
+
storage: {
|
|
32
|
+
totalGb: number;
|
|
33
|
+
limitGb: number;
|
|
34
|
+
percentUsed: number;
|
|
35
|
+
};
|
|
36
|
+
activeProjects: number;
|
|
37
|
+
activeUsers: number;
|
|
38
|
+
breakdown: {
|
|
39
|
+
date: string;
|
|
40
|
+
apiCalls: number;
|
|
41
|
+
storageGb: number;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
interface RecordUsageInput {
|
|
45
|
+
metric: string;
|
|
46
|
+
quantity: number;
|
|
47
|
+
timestamp?: Date;
|
|
48
|
+
metadata?: Record<string, unknown>;
|
|
49
|
+
}
|
|
50
|
+
interface CheckFeatureAccessInput {
|
|
51
|
+
feature: string;
|
|
52
|
+
}
|
|
53
|
+
interface CheckFeatureAccessOutput {
|
|
54
|
+
allowed: boolean;
|
|
55
|
+
reason?: 'PLAN_LIMIT' | 'FEATURE_NOT_INCLUDED' | 'QUOTA_EXCEEDED' | 'SUBSCRIPTION_INACTIVE';
|
|
56
|
+
currentUsage?: number;
|
|
57
|
+
limit?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Mock handler for GetSubscriptionContract.
|
|
61
|
+
*/
|
|
62
|
+
declare function mockGetSubscriptionHandler(): Promise<Subscription>;
|
|
63
|
+
/**
|
|
64
|
+
* Mock handler for GetUsageSummaryContract.
|
|
65
|
+
*/
|
|
66
|
+
declare function mockGetUsageSummaryHandler(input: {
|
|
67
|
+
period?: string;
|
|
68
|
+
}): Promise<UsageSummary>;
|
|
69
|
+
/**
|
|
70
|
+
* Mock handler for RecordUsageContract.
|
|
71
|
+
*/
|
|
72
|
+
declare function mockRecordUsageHandler(input: RecordUsageInput): Promise<{
|
|
73
|
+
recorded: boolean;
|
|
74
|
+
newTotal: number;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Mock handler for CheckFeatureAccessContract.
|
|
78
|
+
*/
|
|
79
|
+
declare function mockCheckFeatureAccessHandler(input: CheckFeatureAccessInput): Promise<CheckFeatureAccessOutput>;
|
|
80
|
+
//#endregion
|
|
81
|
+
export { CheckFeatureAccessInput, CheckFeatureAccessOutput, RecordUsageInput, Subscription, UsageSummary, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PresentationDescriptorV2 } from "@lssm/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/billing/billing.presentation.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Presentation for subscription overview.
|
|
7
|
+
*/
|
|
8
|
+
declare const SubscriptionPresentation: PresentationDescriptorV2;
|
|
9
|
+
/**
|
|
10
|
+
* Presentation for usage dashboard.
|
|
11
|
+
*/
|
|
12
|
+
declare const UsageDashboardPresentation: PresentationDescriptorV2;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SubscriptionPresentation, UsageDashboardPresentation };
|