@contractspec/example.saas-boilerplate 1.57.0 → 1.59.0
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 +160 -180
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +39 -0
- package/dist/billing/billing.entity.d.ts +40 -45
- package/dist/billing/billing.entity.d.ts.map +1 -1
- package/dist/billing/billing.entity.js +110 -118
- package/dist/billing/billing.enum.d.ts +2 -7
- package/dist/billing/billing.enum.d.ts.map +1 -1
- package/dist/billing/billing.enum.js +17 -24
- package/dist/billing/billing.event.d.ts +67 -73
- package/dist/billing/billing.event.d.ts.map +1 -1
- package/dist/billing/billing.event.js +84 -146
- package/dist/billing/billing.handler.d.ts +59 -62
- package/dist/billing/billing.handler.d.ts.map +1 -1
- package/dist/billing/billing.handler.js +140 -49
- package/dist/billing/billing.operations.d.ts +138 -144
- package/dist/billing/billing.operations.d.ts.map +1 -1
- package/dist/billing/billing.operations.js +273 -175
- package/dist/billing/billing.presentation.d.ts +2 -7
- package/dist/billing/billing.presentation.d.ts.map +1 -1
- package/dist/billing/billing.presentation.js +51 -57
- package/dist/billing/billing.schema.d.ts +159 -164
- package/dist/billing/billing.schema.d.ts.map +1 -1
- package/dist/billing/billing.schema.js +112 -204
- package/dist/billing/index.d.ts +11 -8
- package/dist/billing/index.d.ts.map +1 -0
- package/dist/billing/index.js +689 -9
- package/dist/browser/billing/billing.entity.js +113 -0
- package/dist/browser/billing/billing.enum.js +19 -0
- package/dist/browser/billing/billing.event.js +90 -0
- package/dist/browser/billing/billing.handler.js +148 -0
- package/dist/browser/billing/billing.operations.js +278 -0
- package/dist/browser/billing/billing.presentation.js +52 -0
- package/dist/browser/billing/billing.schema.js +121 -0
- package/dist/browser/billing/index.js +688 -0
- package/dist/browser/dashboard/dashboard.presentation.js +52 -0
- package/dist/browser/dashboard/index.js +52 -0
- package/dist/browser/docs/index.js +93 -0
- package/dist/browser/docs/saas-boilerplate.docblock.js +93 -0
- package/dist/browser/example.js +39 -0
- package/dist/browser/handlers/index.js +358 -0
- package/dist/browser/handlers/saas.handlers.js +134 -0
- package/dist/browser/index.js +3340 -0
- package/dist/browser/presentations/index.js +290 -0
- package/dist/browser/project/index.js +790 -0
- package/dist/browser/project/project.entity.js +77 -0
- package/dist/browser/project/project.enum.js +18 -0
- package/dist/browser/project/project.event.js +103 -0
- package/dist/browser/project/project.handler.js +178 -0
- package/dist/browser/project/project.operations.js +372 -0
- package/dist/browser/project/project.presentation.js +177 -0
- package/dist/browser/project/project.schema.js +134 -0
- package/dist/browser/saas-boilerplate.feature.js +88 -0
- package/dist/browser/seeders/index.js +20 -0
- package/dist/browser/settings/index.js +75 -0
- package/dist/browser/settings/settings.entity.js +74 -0
- package/dist/browser/settings/settings.enum.js +11 -0
- package/dist/browser/shared/mock-data.js +104 -0
- package/dist/browser/shared/overlay-types.js +0 -0
- package/dist/browser/tests/operations.test-spec.js +112 -0
- package/dist/browser/ui/SaasDashboard.js +988 -0
- package/dist/browser/ui/SaasProjectList.js +162 -0
- package/dist/browser/ui/SaasSettingsPanel.js +145 -0
- package/dist/browser/ui/hooks/index.js +159 -0
- package/dist/browser/ui/hooks/useProjectList.js +66 -0
- package/dist/browser/ui/hooks/useProjectMutations.js +91 -0
- package/dist/browser/ui/index.js +1808 -0
- package/dist/browser/ui/modals/CreateProjectModal.js +153 -0
- package/dist/browser/ui/modals/ProjectActionsModal.js +335 -0
- package/dist/browser/ui/modals/index.js +487 -0
- package/dist/browser/ui/overlays/demo-overlays.js +61 -0
- package/dist/browser/ui/overlays/index.js +61 -0
- package/dist/browser/ui/renderers/index.js +675 -0
- package/dist/browser/ui/renderers/project-list.markdown.js +499 -0
- package/dist/browser/ui/renderers/project-list.renderer.js +177 -0
- package/dist/dashboard/dashboard.presentation.d.ts +2 -7
- package/dist/dashboard/dashboard.presentation.d.ts.map +1 -1
- package/dist/dashboard/dashboard.presentation.js +51 -53
- package/dist/dashboard/index.d.ts +5 -2
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +53 -3
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +94 -1
- package/dist/docs/saas-boilerplate.docblock.d.ts +2 -1
- package/dist/docs/saas-boilerplate.docblock.d.ts.map +1 -0
- package/dist/docs/saas-boilerplate.docblock.js +45 -51
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +38 -50
- package/dist/handlers/index.d.ts +7 -4
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +358 -4
- package/dist/handlers/saas.handlers.d.ts +60 -59
- package/dist/handlers/saas.handlers.d.ts.map +1 -1
- package/dist/handlers/saas.handlers.js +127 -140
- package/dist/index.d.ts +15 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3335 -75
- package/dist/node/billing/billing.entity.js +113 -0
- package/dist/node/billing/billing.enum.js +19 -0
- package/dist/node/billing/billing.event.js +90 -0
- package/dist/node/billing/billing.handler.js +148 -0
- package/dist/node/billing/billing.operations.js +278 -0
- package/dist/node/billing/billing.presentation.js +52 -0
- package/dist/node/billing/billing.schema.js +121 -0
- package/dist/node/billing/index.js +688 -0
- package/dist/node/dashboard/dashboard.presentation.js +52 -0
- package/dist/node/dashboard/index.js +52 -0
- package/dist/node/docs/index.js +93 -0
- package/dist/node/docs/saas-boilerplate.docblock.js +93 -0
- package/dist/node/example.js +39 -0
- package/dist/node/handlers/index.js +358 -0
- package/dist/node/handlers/saas.handlers.js +134 -0
- package/dist/node/index.js +3340 -0
- package/dist/node/presentations/index.js +290 -0
- package/dist/node/project/index.js +790 -0
- package/dist/node/project/project.entity.js +77 -0
- package/dist/node/project/project.enum.js +18 -0
- package/dist/node/project/project.event.js +103 -0
- package/dist/node/project/project.handler.js +178 -0
- package/dist/node/project/project.operations.js +372 -0
- package/dist/node/project/project.presentation.js +177 -0
- package/dist/node/project/project.schema.js +134 -0
- package/dist/node/saas-boilerplate.feature.js +88 -0
- package/dist/node/seeders/index.js +20 -0
- package/dist/node/settings/index.js +75 -0
- package/dist/node/settings/settings.entity.js +74 -0
- package/dist/node/settings/settings.enum.js +11 -0
- package/dist/node/shared/mock-data.js +104 -0
- package/dist/node/shared/overlay-types.js +0 -0
- package/dist/node/tests/operations.test-spec.js +112 -0
- package/dist/node/ui/SaasDashboard.js +988 -0
- package/dist/node/ui/SaasProjectList.js +162 -0
- package/dist/node/ui/SaasSettingsPanel.js +145 -0
- package/dist/node/ui/hooks/index.js +159 -0
- package/dist/node/ui/hooks/useProjectList.js +66 -0
- package/dist/node/ui/hooks/useProjectMutations.js +91 -0
- package/dist/node/ui/index.js +1808 -0
- package/dist/node/ui/modals/CreateProjectModal.js +153 -0
- package/dist/node/ui/modals/ProjectActionsModal.js +335 -0
- package/dist/node/ui/modals/index.js +487 -0
- package/dist/node/ui/overlays/demo-overlays.js +61 -0
- package/dist/node/ui/overlays/index.js +61 -0
- package/dist/node/ui/renderers/index.js +675 -0
- package/dist/node/ui/renderers/project-list.markdown.js +499 -0
- package/dist/node/ui/renderers/project-list.renderer.js +177 -0
- package/dist/presentations/index.d.ts +13 -14
- package/dist/presentations/index.d.ts.map +1 -1
- package/dist/presentations/index.js +289 -15
- package/dist/project/index.d.ts +11 -8
- package/dist/project/index.d.ts.map +1 -0
- package/dist/project/index.js +791 -9
- package/dist/project/project.entity.d.ts +23 -28
- package/dist/project/project.entity.d.ts.map +1 -1
- package/dist/project/project.entity.js +75 -82
- package/dist/project/project.enum.d.ts +2 -7
- package/dist/project/project.enum.d.ts.map +1 -1
- package/dist/project/project.enum.js +16 -23
- package/dist/project/project.event.d.ts +69 -75
- package/dist/project/project.event.d.ts.map +1 -1
- package/dist/project/project.event.js +95 -156
- package/dist/project/project.handler.d.ts +44 -47
- package/dist/project/project.handler.d.ts.map +1 -1
- package/dist/project/project.handler.js +168 -71
- package/dist/project/project.operations.d.ts +341 -347
- package/dist/project/project.operations.d.ts.map +1 -1
- package/dist/project/project.operations.js +366 -253
- package/dist/project/project.presentation.d.ts +2 -7
- package/dist/project/project.presentation.d.ts.map +1 -1
- package/dist/project/project.presentation.js +174 -61
- package/dist/project/project.schema.d.ts +191 -196
- package/dist/project/project.schema.d.ts.map +1 -1
- package/dist/project/project.schema.js +125 -205
- package/dist/saas-boilerplate.feature.d.ts +1 -6
- package/dist/saas-boilerplate.feature.d.ts.map +1 -1
- package/dist/saas-boilerplate.feature.js +87 -206
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +18 -16
- package/dist/settings/index.d.ts +6 -3
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +75 -3
- package/dist/settings/settings.entity.d.ts +23 -28
- package/dist/settings/settings.entity.d.ts.map +1 -1
- package/dist/settings/settings.entity.js +72 -75
- package/dist/settings/settings.enum.d.ts +1 -6
- package/dist/settings/settings.enum.d.ts.map +1 -1
- package/dist/settings/settings.enum.js +10 -19
- package/dist/shared/mock-data.d.ts +74 -77
- package/dist/shared/mock-data.d.ts.map +1 -1
- package/dist/shared/mock-data.js +102 -135
- package/dist/shared/overlay-types.d.ts +25 -28
- package/dist/shared/overlay-types.d.ts.map +1 -1
- package/dist/shared/overlay-types.js +1 -0
- package/dist/tests/operations.test-spec.d.ts +4 -9
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +108 -118
- package/dist/ui/SaasDashboard.d.ts +1 -6
- package/dist/ui/SaasDashboard.d.ts.map +1 -1
- package/dist/ui/SaasDashboard.js +977 -286
- package/dist/ui/SaasProjectList.d.ts +4 -11
- package/dist/ui/SaasProjectList.d.ts.map +1 -1
- package/dist/ui/SaasProjectList.js +159 -72
- package/dist/ui/SaasSettingsPanel.d.ts +1 -6
- package/dist/ui/SaasSettingsPanel.d.ts.map +1 -1
- package/dist/ui/SaasSettingsPanel.js +142 -134
- package/dist/ui/hooks/index.d.ts +3 -3
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +158 -4
- package/dist/ui/hooks/useProjectList.d.ts +26 -30
- package/dist/ui/hooks/useProjectList.d.ts.map +1 -1
- package/dist/ui/hooks/useProjectList.js +63 -71
- package/dist/ui/hooks/useProjectMutations.d.ts +20 -24
- package/dist/ui/hooks/useProjectMutations.d.ts.map +1 -1
- package/dist/ui/hooks/useProjectMutations.js +88 -142
- package/dist/ui/index.d.ts +8 -14
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +1809 -15
- package/dist/ui/modals/CreateProjectModal.d.ts +10 -19
- package/dist/ui/modals/CreateProjectModal.d.ts.map +1 -1
- package/dist/ui/modals/CreateProjectModal.js +150 -135
- package/dist/ui/modals/ProjectActionsModal.d.ts +20 -33
- package/dist/ui/modals/ProjectActionsModal.d.ts.map +1 -1
- package/dist/ui/modals/ProjectActionsModal.js +333 -289
- package/dist/ui/modals/index.d.ts +3 -3
- package/dist/ui/modals/index.d.ts.map +1 -0
- package/dist/ui/modals/index.js +487 -3
- package/dist/ui/overlays/demo-overlays.d.ts +10 -8
- package/dist/ui/overlays/demo-overlays.d.ts.map +1 -1
- package/dist/ui/overlays/demo-overlays.js +60 -68
- package/dist/ui/overlays/index.d.ts +2 -2
- package/dist/ui/overlays/index.d.ts.map +1 -0
- package/dist/ui/overlays/index.js +62 -3
- package/dist/ui/renderers/index.d.ts +3 -3
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +675 -3
- package/dist/ui/renderers/project-list.markdown.d.ts +15 -14
- package/dist/ui/renderers/project-list.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/project-list.markdown.js +496 -146
- package/dist/ui/renderers/project-list.renderer.d.ts +6 -7
- package/dist/ui/renderers/project-list.renderer.d.ts.map +1 -1
- package/dist/ui/renderers/project-list.renderer.js +176 -15
- package/package.json +508 -98
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -180
- package/dist/billing/billing.entity.js.map +0 -1
- package/dist/billing/billing.enum.js.map +0 -1
- package/dist/billing/billing.event.js.map +0 -1
- package/dist/billing/billing.handler.js.map +0 -1
- package/dist/billing/billing.operations.js.map +0 -1
- package/dist/billing/billing.presentation.js.map +0 -1
- package/dist/billing/billing.schema.js.map +0 -1
- package/dist/dashboard/dashboard.presentation.js.map +0 -1
- package/dist/docs/saas-boilerplate.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/saas.handlers.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/presentations/index.js.map +0 -1
- package/dist/project/project.entity.js.map +0 -1
- package/dist/project/project.enum.js.map +0 -1
- package/dist/project/project.event.js.map +0 -1
- package/dist/project/project.handler.js.map +0 -1
- package/dist/project/project.operations.js.map +0 -1
- package/dist/project/project.presentation.js.map +0 -1
- package/dist/project/project.schema.js.map +0 -1
- package/dist/saas-boilerplate.feature.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/settings/settings.entity.js.map +0 -1
- package/dist/settings/settings.enum.js.map +0 -1
- package/dist/shared/mock-data.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/ui/SaasDashboard.js.map +0 -1
- package/dist/ui/SaasProjectList.js.map +0 -1
- package/dist/ui/SaasSettingsPanel.js.map +0 -1
- package/dist/ui/hooks/useProjectList.js.map +0 -1
- package/dist/ui/hooks/useProjectMutations.js.map +0 -1
- package/dist/ui/modals/CreateProjectModal.js.map +0 -1
- package/dist/ui/modals/ProjectActionsModal.js.map +0 -1
- package/dist/ui/overlays/demo-overlays.js.map +0 -1
- package/dist/ui/renderers/project-list.markdown.js.map +0 -1
- package/dist/ui/renderers/project-list.renderer.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
package/dist/seeders/index.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { DatabasePort } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
projectId: string;
|
|
6
|
-
db: DatabasePort;
|
|
1
|
+
import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';
|
|
2
|
+
export declare function seedSaasBoilerplate(params: {
|
|
3
|
+
projectId: string;
|
|
4
|
+
db: DatabasePort;
|
|
7
5
|
}): Promise<void>;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { seedSaasBoilerplate };
|
|
10
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/seeders/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,YAAY,CAAC;CAClB,iBAsBA"}
|
package/dist/seeders/index.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/seeders/index.ts
|
|
2
3
|
async function seedSaasBoilerplate(params) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const { projectId, db } = params;
|
|
5
|
+
const existing = await db.query(`SELECT COUNT(*) as count FROM saas_project WHERE "projectId" = $1`, [projectId]);
|
|
6
|
+
if (existing.rows[0]?.count > 0)
|
|
7
|
+
return;
|
|
8
|
+
await db.execute(`INSERT INTO saas_project (id, "projectId", "organizationId", name, description, status, tier)
|
|
6
9
|
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
"saas_proj_1",
|
|
11
|
+
projectId,
|
|
12
|
+
"org_demo",
|
|
13
|
+
"Demo Project",
|
|
14
|
+
"A demo SaaS project",
|
|
15
|
+
"ACTIVE",
|
|
16
|
+
"PRO"
|
|
17
|
+
]);
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
19
|
+
export {
|
|
20
|
+
seedSaasBoilerplate
|
|
21
|
+
};
|
package/dist/settings/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Settings domain - application, organization, and user settings.
|
|
3
|
+
*/
|
|
4
|
+
export { SettingsScopeEnum } from './settings.enum';
|
|
5
|
+
export { SettingsEntity, FeatureFlagEntity } from './settings.entity';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/settings/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/settings/index.js
CHANGED
|
@@ -1,4 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/settings/settings.enum.ts
|
|
3
|
+
import { defineEntityEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var SettingsScopeEnum = defineEntityEnum({
|
|
5
|
+
name: "SettingsScope",
|
|
6
|
+
values: ["APP", "ORG", "USER", "PROJECT"],
|
|
7
|
+
schema: "saas_app",
|
|
8
|
+
description: "Scope of a setting."
|
|
9
|
+
});
|
|
3
10
|
|
|
4
|
-
|
|
11
|
+
// src/settings/settings.entity.ts
|
|
12
|
+
import { defineEntity, field, index } from "@contractspec/lib.schema";
|
|
13
|
+
var SettingsEntity = defineEntity({
|
|
14
|
+
name: "Settings",
|
|
15
|
+
description: "Application, organization, or user settings.",
|
|
16
|
+
schema: "saas_app",
|
|
17
|
+
map: "settings",
|
|
18
|
+
fields: {
|
|
19
|
+
id: field.id(),
|
|
20
|
+
key: field.string({
|
|
21
|
+
description: 'Setting key (e.g., "theme", "notifications.email")'
|
|
22
|
+
}),
|
|
23
|
+
scope: field.enum("SettingsScope"),
|
|
24
|
+
scopeId: field.string({
|
|
25
|
+
isOptional: true,
|
|
26
|
+
description: "ID of scoped entity (org, user, project)"
|
|
27
|
+
}),
|
|
28
|
+
value: field.json({ description: "Setting value" }),
|
|
29
|
+
valueType: field.string({
|
|
30
|
+
default: '"string"',
|
|
31
|
+
description: "Type hint for value"
|
|
32
|
+
}),
|
|
33
|
+
schema: field.json({
|
|
34
|
+
isOptional: true,
|
|
35
|
+
description: "JSON schema for validation"
|
|
36
|
+
}),
|
|
37
|
+
description: field.string({ isOptional: true }),
|
|
38
|
+
isSecret: field.boolean({
|
|
39
|
+
default: false,
|
|
40
|
+
description: "Whether value should be encrypted"
|
|
41
|
+
}),
|
|
42
|
+
createdAt: field.createdAt(),
|
|
43
|
+
updatedAt: field.updatedAt()
|
|
44
|
+
},
|
|
45
|
+
indexes: [
|
|
46
|
+
index.unique(["scope", "scopeId", "key"]),
|
|
47
|
+
index.on(["scope", "key"])
|
|
48
|
+
],
|
|
49
|
+
enums: [SettingsScopeEnum]
|
|
50
|
+
});
|
|
51
|
+
var FeatureFlagEntity = defineEntity({
|
|
52
|
+
name: "FeatureFlag",
|
|
53
|
+
description: "Feature flags for progressive rollout.",
|
|
54
|
+
schema: "saas_app",
|
|
55
|
+
map: "feature_flag",
|
|
56
|
+
fields: {
|
|
57
|
+
id: field.id(),
|
|
58
|
+
key: field.string({ isUnique: true, description: "Feature flag key" }),
|
|
59
|
+
name: field.string({ description: "Human-readable name" }),
|
|
60
|
+
description: field.string({ isOptional: true }),
|
|
61
|
+
enabled: field.boolean({ default: false }),
|
|
62
|
+
defaultValue: field.boolean({ default: false }),
|
|
63
|
+
rules: field.json({ isOptional: true, description: "Targeting rules" }),
|
|
64
|
+
rolloutPercentage: field.int({
|
|
65
|
+
default: 0,
|
|
66
|
+
description: "Percentage rollout (0-100)"
|
|
67
|
+
}),
|
|
68
|
+
createdAt: field.createdAt(),
|
|
69
|
+
updatedAt: field.updatedAt()
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
SettingsScopeEnum,
|
|
74
|
+
SettingsEntity,
|
|
75
|
+
FeatureFlagEntity
|
|
76
|
+
};
|
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/settings/settings.entity.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Settings entity - key-value configuration store.
|
|
6
3
|
*/
|
|
7
|
-
declare const SettingsEntity:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
export declare const SettingsEntity: import("@contractspec/lib.schema").EntitySpec<{
|
|
5
|
+
id: import("@contractspec/lib.schema").EntityScalarField;
|
|
6
|
+
key: import("@contractspec/lib.schema").EntityScalarField;
|
|
7
|
+
scope: import("@contractspec/lib.schema").EntityEnumField;
|
|
8
|
+
scopeId: import("@contractspec/lib.schema").EntityScalarField;
|
|
9
|
+
value: import("@contractspec/lib.schema").EntityScalarField;
|
|
10
|
+
valueType: import("@contractspec/lib.schema").EntityScalarField;
|
|
11
|
+
schema: import("@contractspec/lib.schema").EntityScalarField;
|
|
12
|
+
description: import("@contractspec/lib.schema").EntityScalarField;
|
|
13
|
+
isSecret: import("@contractspec/lib.schema").EntityScalarField;
|
|
14
|
+
createdAt: import("@contractspec/lib.schema").EntityScalarField;
|
|
15
|
+
updatedAt: import("@contractspec/lib.schema").EntityScalarField;
|
|
19
16
|
}>;
|
|
20
17
|
/**
|
|
21
18
|
* FeatureFlag entity - feature toggles.
|
|
22
19
|
*/
|
|
23
|
-
declare const FeatureFlagEntity:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
export declare const FeatureFlagEntity: import("@contractspec/lib.schema").EntitySpec<{
|
|
21
|
+
id: import("@contractspec/lib.schema").EntityScalarField;
|
|
22
|
+
key: import("@contractspec/lib.schema").EntityScalarField;
|
|
23
|
+
name: import("@contractspec/lib.schema").EntityScalarField;
|
|
24
|
+
description: import("@contractspec/lib.schema").EntityScalarField;
|
|
25
|
+
enabled: import("@contractspec/lib.schema").EntityScalarField;
|
|
26
|
+
defaultValue: import("@contractspec/lib.schema").EntityScalarField;
|
|
27
|
+
rules: import("@contractspec/lib.schema").EntityScalarField;
|
|
28
|
+
rolloutPercentage: import("@contractspec/lib.schema").EntityScalarField;
|
|
29
|
+
createdAt: import("@contractspec/lib.schema").EntityScalarField;
|
|
30
|
+
updatedAt: import("@contractspec/lib.schema").EntityScalarField;
|
|
34
31
|
}>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { FeatureFlagEntity, SettingsEntity };
|
|
37
32
|
//# sourceMappingURL=settings.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.entity.d.ts","
|
|
1
|
+
{"version":3,"file":"settings.entity.d.ts","sourceRoot":"","sources":["../../src/settings/settings.entity.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;EAiDzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;EA4B5B,CAAC"}
|
|
@@ -1,78 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/settings/settings.enum.ts
|
|
3
|
+
import { defineEntityEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var SettingsScopeEnum = defineEntityEnum({
|
|
5
|
+
name: "SettingsScope",
|
|
6
|
+
values: ["APP", "ORG", "USER", "PROJECT"],
|
|
7
|
+
schema: "saas_app",
|
|
8
|
+
description: "Scope of a setting."
|
|
9
|
+
});
|
|
3
10
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
enums: [SettingsScopeEnum]
|
|
11
|
+
// src/settings/settings.entity.ts
|
|
12
|
+
import { defineEntity, field, index } from "@contractspec/lib.schema";
|
|
13
|
+
var SettingsEntity = defineEntity({
|
|
14
|
+
name: "Settings",
|
|
15
|
+
description: "Application, organization, or user settings.",
|
|
16
|
+
schema: "saas_app",
|
|
17
|
+
map: "settings",
|
|
18
|
+
fields: {
|
|
19
|
+
id: field.id(),
|
|
20
|
+
key: field.string({
|
|
21
|
+
description: 'Setting key (e.g., "theme", "notifications.email")'
|
|
22
|
+
}),
|
|
23
|
+
scope: field.enum("SettingsScope"),
|
|
24
|
+
scopeId: field.string({
|
|
25
|
+
isOptional: true,
|
|
26
|
+
description: "ID of scoped entity (org, user, project)"
|
|
27
|
+
}),
|
|
28
|
+
value: field.json({ description: "Setting value" }),
|
|
29
|
+
valueType: field.string({
|
|
30
|
+
default: '"string"',
|
|
31
|
+
description: "Type hint for value"
|
|
32
|
+
}),
|
|
33
|
+
schema: field.json({
|
|
34
|
+
isOptional: true,
|
|
35
|
+
description: "JSON schema for validation"
|
|
36
|
+
}),
|
|
37
|
+
description: field.string({ isOptional: true }),
|
|
38
|
+
isSecret: field.boolean({
|
|
39
|
+
default: false,
|
|
40
|
+
description: "Whether value should be encrypted"
|
|
41
|
+
}),
|
|
42
|
+
createdAt: field.createdAt(),
|
|
43
|
+
updatedAt: field.updatedAt()
|
|
44
|
+
},
|
|
45
|
+
indexes: [
|
|
46
|
+
index.unique(["scope", "scopeId", "key"]),
|
|
47
|
+
index.on(["scope", "key"])
|
|
48
|
+
],
|
|
49
|
+
enums: [SettingsScopeEnum]
|
|
44
50
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
description: "Targeting rules"
|
|
66
|
-
}),
|
|
67
|
-
rolloutPercentage: field.int({
|
|
68
|
-
default: 0,
|
|
69
|
-
description: "Percentage rollout (0-100)"
|
|
70
|
-
}),
|
|
71
|
-
createdAt: field.createdAt(),
|
|
72
|
-
updatedAt: field.updatedAt()
|
|
73
|
-
}
|
|
51
|
+
var FeatureFlagEntity = defineEntity({
|
|
52
|
+
name: "FeatureFlag",
|
|
53
|
+
description: "Feature flags for progressive rollout.",
|
|
54
|
+
schema: "saas_app",
|
|
55
|
+
map: "feature_flag",
|
|
56
|
+
fields: {
|
|
57
|
+
id: field.id(),
|
|
58
|
+
key: field.string({ isUnique: true, description: "Feature flag key" }),
|
|
59
|
+
name: field.string({ description: "Human-readable name" }),
|
|
60
|
+
description: field.string({ isOptional: true }),
|
|
61
|
+
enabled: field.boolean({ default: false }),
|
|
62
|
+
defaultValue: field.boolean({ default: false }),
|
|
63
|
+
rules: field.json({ isOptional: true, description: "Targeting rules" }),
|
|
64
|
+
rolloutPercentage: field.int({
|
|
65
|
+
default: 0,
|
|
66
|
+
description: "Percentage rollout (0-100)"
|
|
67
|
+
}),
|
|
68
|
+
createdAt: field.createdAt(),
|
|
69
|
+
updatedAt: field.updatedAt()
|
|
70
|
+
}
|
|
74
71
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
export {
|
|
73
|
+
SettingsEntity,
|
|
74
|
+
FeatureFlagEntity
|
|
75
|
+
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/settings/settings.enum.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Settings scope enum.
|
|
6
3
|
*/
|
|
7
|
-
declare const SettingsScopeEnum:
|
|
8
|
-
//#endregion
|
|
9
|
-
export { SettingsScopeEnum };
|
|
4
|
+
export declare const SettingsScopeEnum: import("@contractspec/lib.schema").EntityEnumDef;
|
|
10
5
|
//# sourceMappingURL=settings.enum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.enum.d.ts","
|
|
1
|
+
{"version":3,"file":"settings.enum.d.ts","sourceRoot":"","sources":["../../src/settings/settings.enum.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,kDAK5B,CAAC"}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/settings/settings.enum.ts
|
|
1
3
|
import { defineEntityEnum } from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const SettingsScopeEnum = defineEntityEnum({
|
|
8
|
-
name: "SettingsScope",
|
|
9
|
-
values: [
|
|
10
|
-
"APP",
|
|
11
|
-
"ORG",
|
|
12
|
-
"USER",
|
|
13
|
-
"PROJECT"
|
|
14
|
-
],
|
|
15
|
-
schema: "saas_app",
|
|
16
|
-
description: "Scope of a setting."
|
|
4
|
+
var SettingsScopeEnum = defineEntityEnum({
|
|
5
|
+
name: "SettingsScope",
|
|
6
|
+
values: ["APP", "ORG", "USER", "PROJECT"],
|
|
7
|
+
schema: "saas_app",
|
|
8
|
+
description: "Scope of a setting."
|
|
17
9
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=settings.enum.js.map
|
|
10
|
+
export {
|
|
11
|
+
SettingsScopeEnum
|
|
12
|
+
};
|
|
@@ -1,86 +1,83 @@
|
|
|
1
|
-
//#region src/shared/mock-data.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Shared mock data for saas-boilerplate handlers.
|
|
4
3
|
*/
|
|
5
|
-
declare const MOCK_PROJECTS: ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
export declare const MOCK_PROJECTS: ({
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
organizationId: string;
|
|
10
|
+
createdBy: string;
|
|
11
|
+
status: "ACTIVE";
|
|
12
|
+
isPublic: boolean;
|
|
13
|
+
tags: string[];
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
17
16
|
} | {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
slug: string;
|
|
21
|
+
organizationId: string;
|
|
22
|
+
createdBy: string;
|
|
23
|
+
status: "DRAFT";
|
|
24
|
+
isPublic: boolean;
|
|
25
|
+
tags: string[];
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
29
28
|
} | {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
slug: string;
|
|
33
|
+
organizationId: string;
|
|
34
|
+
createdBy: string;
|
|
35
|
+
status: "ARCHIVED";
|
|
36
|
+
isPublic: boolean;
|
|
37
|
+
tags: string[];
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
41
40
|
})[];
|
|
42
|
-
declare const MOCK_SUBSCRIPTION: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
export declare const MOCK_SUBSCRIPTION: {
|
|
42
|
+
id: string;
|
|
43
|
+
organizationId: string;
|
|
44
|
+
planId: string;
|
|
45
|
+
planName: string;
|
|
46
|
+
status: "ACTIVE";
|
|
47
|
+
currentPeriodStart: Date;
|
|
48
|
+
currentPeriodEnd: Date;
|
|
49
|
+
limits: {
|
|
50
|
+
projects: number;
|
|
51
|
+
users: number;
|
|
52
|
+
storage: number;
|
|
53
|
+
apiCalls: number;
|
|
54
|
+
};
|
|
55
|
+
usage: {
|
|
56
|
+
projects: number;
|
|
57
|
+
users: number;
|
|
58
|
+
storage: number;
|
|
59
|
+
apiCalls: number;
|
|
60
|
+
};
|
|
62
61
|
};
|
|
63
|
-
declare const MOCK_USAGE_SUMMARY: {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
export declare const MOCK_USAGE_SUMMARY: {
|
|
63
|
+
organizationId: string;
|
|
64
|
+
period: string;
|
|
65
|
+
apiCalls: {
|
|
66
|
+
total: number;
|
|
67
|
+
limit: number;
|
|
68
|
+
percentUsed: number;
|
|
69
|
+
};
|
|
70
|
+
storage: {
|
|
71
|
+
totalGb: number;
|
|
72
|
+
limitGb: number;
|
|
73
|
+
percentUsed: number;
|
|
74
|
+
};
|
|
75
|
+
activeProjects: number;
|
|
76
|
+
activeUsers: number;
|
|
77
|
+
breakdown: {
|
|
78
|
+
date: string;
|
|
79
|
+
apiCalls: number;
|
|
80
|
+
storageGb: number;
|
|
81
|
+
}[];
|
|
83
82
|
};
|
|
84
|
-
//#endregion
|
|
85
|
-
export { MOCK_PROJECTS, MOCK_SUBSCRIPTION, MOCK_USAGE_SUMMARY };
|
|
86
83
|
//# sourceMappingURL=mock-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-data.d.ts","
|
|
1
|
+
{"version":3,"file":"mock-data.d.ts","sourceRoot":"","sources":["../../src/shared/mock-data.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqDzB,CAAC;AAIF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;CAoB7B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CAsB9B,CAAC"}
|