@contractspec/example.saas-boilerplate 1.44.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$colon$bundle.log +113 -0
- package/.turbo/turbo-build.log +114 -0
- package/CHANGELOG.md +246 -0
- package/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/billing/billing.entity.d.ts +61 -0
- package/dist/billing/billing.entity.d.ts.map +1 -0
- package/dist/billing/billing.entity.js +122 -0
- package/dist/billing/billing.entity.js.map +1 -0
- package/dist/billing/billing.enum.d.ts +16 -0
- package/dist/billing/billing.enum.d.ts.map +1 -0
- package/dist/billing/billing.enum.js +27 -0
- package/dist/billing/billing.enum.js.map +1 -0
- package/dist/billing/billing.event.d.ts +86 -0
- package/dist/billing/billing.event.d.ts.map +1 -0
- package/dist/billing/billing.event.js +153 -0
- package/dist/billing/billing.event.js.map +1 -0
- package/dist/billing/billing.handler.d.ts +82 -0
- package/dist/billing/billing.handler.d.ts.map +1 -0
- package/dist/billing/billing.handler.js +58 -0
- package/dist/billing/billing.handler.js.map +1 -0
- package/dist/billing/billing.operations.d.ts +166 -0
- package/dist/billing/billing.operations.d.ts.map +1 -0
- package/dist/billing/billing.operations.js +181 -0
- package/dist/billing/billing.operations.js.map +1 -0
- package/dist/billing/billing.presentation.d.ts +15 -0
- package/dist/billing/billing.presentation.d.ts.map +1 -0
- package/dist/billing/billing.presentation.js +59 -0
- package/dist/billing/billing.presentation.js.map +1 -0
- package/dist/billing/billing.schema.d.ts +201 -0
- package/dist/billing/billing.schema.d.ts.map +1 -0
- package/dist/billing/billing.schema.js +214 -0
- package/dist/billing/billing.schema.js.map +1 -0
- package/dist/billing/index.d.ts +8 -0
- package/dist/billing/index.js +9 -0
- package/dist/dashboard/dashboard.presentation.d.ts +15 -0
- package/dist/dashboard/dashboard.presentation.d.ts.map +1 -0
- package/dist/dashboard/dashboard.presentation.js +55 -0
- package/dist/dashboard/dashboard.presentation.js.map +1 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.js +3 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/saas-boilerplate.docblock.d.ts +1 -0
- package/dist/docs/saas-boilerplate.docblock.js +100 -0
- package/dist/docs/saas-boilerplate.docblock.js.map +1 -0
- package/dist/example.d.ts +37 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +46 -0
- package/dist/example.js.map +1 -0
- package/dist/handlers/index.d.ts +3 -0
- package/dist/handlers/index.js +4 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/presentations/index.d.ts +17 -0
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +17 -0
- package/dist/presentations/index.js.map +1 -0
- package/dist/project/index.d.ts +8 -0
- package/dist/project/index.js +9 -0
- package/dist/project/project.entity.d.ts +40 -0
- package/dist/project/project.entity.d.ts.map +1 -0
- package/dist/project/project.entity.js +85 -0
- package/dist/project/project.entity.js.map +1 -0
- package/dist/project/project.enum.d.ts +16 -0
- package/dist/project/project.enum.d.ts.map +1 -0
- package/dist/project/project.enum.js +26 -0
- package/dist/project/project.enum.js.map +1 -0
- package/dist/project/project.event.d.ts +92 -0
- package/dist/project/project.event.d.ts.map +1 -0
- package/dist/project/project.event.js +165 -0
- package/dist/project/project.event.js.map +1 -0
- package/dist/project/project.handler.d.ts +72 -0
- package/dist/project/project.handler.d.ts.map +1 -0
- package/dist/project/project.handler.js +82 -0
- package/dist/project/project.handler.js.map +1 -0
- package/dist/project/project.operations.d.ts +419 -0
- package/dist/project/project.operations.d.ts.map +1 -0
- package/dist/project/project.operations.js +260 -0
- package/dist/project/project.operations.js.map +1 -0
- package/dist/project/project.presentation.d.ts +15 -0
- package/dist/project/project.presentation.d.ts.map +1 -0
- package/dist/project/project.presentation.js +65 -0
- package/dist/project/project.presentation.js.map +1 -0
- package/dist/project/project.schema.d.ts +235 -0
- package/dist/project/project.schema.d.ts.map +1 -0
- package/dist/project/project.schema.js +215 -0
- package/dist/project/project.schema.js.map +1 -0
- package/dist/saas-boilerplate.feature.d.ts +12 -0
- package/dist/saas-boilerplate.feature.d.ts.map +1 -0
- package/dist/saas-boilerplate.feature.js +201 -0
- package/dist/saas-boilerplate.feature.js.map +1 -0
- package/dist/settings/index.d.ts +3 -0
- package/dist/settings/index.js +4 -0
- package/dist/settings/settings.entity.d.ts +37 -0
- package/dist/settings/settings.entity.d.ts.map +1 -0
- package/dist/settings/settings.entity.js +78 -0
- package/dist/settings/settings.entity.js.map +1 -0
- package/dist/settings/settings.enum.d.ts +10 -0
- package/dist/settings/settings.enum.d.ts.map +1 -0
- package/dist/settings/settings.enum.js +21 -0
- package/dist/settings/settings.enum.js.map +1 -0
- package/dist/shared/mock-data.d.ts +86 -0
- package/dist/shared/mock-data.d.ts.map +1 -0
- package/dist/shared/mock-data.js +138 -0
- package/dist/shared/mock-data.js.map +1 -0
- package/example.ts +1 -0
- package/package.json +113 -0
- package/src/billing/billing.entity.ts +158 -0
- package/src/billing/billing.enum.ts +23 -0
- package/src/billing/billing.event.ts +108 -0
- package/src/billing/billing.handler.ts +137 -0
- package/src/billing/billing.operations.ts +187 -0
- package/src/billing/billing.presentation.ts +57 -0
- package/src/billing/billing.schema.ts +133 -0
- package/src/billing/index.ts +64 -0
- package/src/dashboard/dashboard.presentation.ts +57 -0
- package/src/dashboard/index.ts +8 -0
- package/src/docs/index.ts +1 -0
- package/src/docs/saas-boilerplate.docblock.ts +98 -0
- package/src/example.ts +31 -0
- package/src/handlers/index.ts +20 -0
- package/src/index.ts +71 -0
- package/src/presentations/index.ts +36 -0
- package/src/project/index.ts +66 -0
- package/src/project/project.entity.ts +93 -0
- package/src/project/project.enum.ts +22 -0
- package/src/project/project.event.ts +128 -0
- package/src/project/project.handler.ts +168 -0
- package/src/project/project.operations.ts +272 -0
- package/src/project/project.presentation.ts +59 -0
- package/src/project/project.schema.ts +147 -0
- package/src/saas-boilerplate.feature.ts +109 -0
- package/src/settings/index.ts +9 -0
- package/src/settings/settings.entity.ts +89 -0
- package/src/settings/settings.enum.ts +11 -0
- package/src/shared/mock-data.ts +110 -0
- package/tsconfig.json +10 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +7 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { ProjectStatusFilterEnum, ProjectStatusSchemaEnum } from "./project.enum.js";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/project/project.schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* A project within an organization.
|
|
7
|
+
*/
|
|
8
|
+
const ProjectModel = defineSchemaModel({
|
|
9
|
+
name: "Project",
|
|
10
|
+
description: "A project within an organization",
|
|
11
|
+
fields: {
|
|
12
|
+
id: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
},
|
|
16
|
+
name: {
|
|
17
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
+
isOptional: false
|
|
19
|
+
},
|
|
20
|
+
description: {
|
|
21
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
+
isOptional: true
|
|
23
|
+
},
|
|
24
|
+
slug: {
|
|
25
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
26
|
+
isOptional: true
|
|
27
|
+
},
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
30
|
+
isOptional: false
|
|
31
|
+
},
|
|
32
|
+
createdBy: {
|
|
33
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
34
|
+
isOptional: false
|
|
35
|
+
},
|
|
36
|
+
status: {
|
|
37
|
+
type: ProjectStatusSchemaEnum,
|
|
38
|
+
isOptional: false
|
|
39
|
+
},
|
|
40
|
+
isPublic: {
|
|
41
|
+
type: ScalarTypeEnum.Boolean(),
|
|
42
|
+
isOptional: false
|
|
43
|
+
},
|
|
44
|
+
tags: {
|
|
45
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
+
isArray: true,
|
|
47
|
+
isOptional: false
|
|
48
|
+
},
|
|
49
|
+
createdAt: {
|
|
50
|
+
type: ScalarTypeEnum.DateTime(),
|
|
51
|
+
isOptional: false
|
|
52
|
+
},
|
|
53
|
+
updatedAt: {
|
|
54
|
+
type: ScalarTypeEnum.DateTime(),
|
|
55
|
+
isOptional: false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Input for creating a project.
|
|
61
|
+
*/
|
|
62
|
+
const CreateProjectInputModel = defineSchemaModel({
|
|
63
|
+
name: "CreateProjectInput",
|
|
64
|
+
description: "Input for creating a project",
|
|
65
|
+
fields: {
|
|
66
|
+
name: {
|
|
67
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
68
|
+
isOptional: false
|
|
69
|
+
},
|
|
70
|
+
description: {
|
|
71
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
72
|
+
isOptional: true
|
|
73
|
+
},
|
|
74
|
+
slug: {
|
|
75
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
76
|
+
isOptional: true
|
|
77
|
+
},
|
|
78
|
+
isPublic: {
|
|
79
|
+
type: ScalarTypeEnum.Boolean(),
|
|
80
|
+
isOptional: true
|
|
81
|
+
},
|
|
82
|
+
tags: {
|
|
83
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
84
|
+
isArray: true,
|
|
85
|
+
isOptional: true
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Input for updating a project.
|
|
91
|
+
*/
|
|
92
|
+
const UpdateProjectInputModel = defineSchemaModel({
|
|
93
|
+
name: "UpdateProjectInput",
|
|
94
|
+
description: "Input for updating a project",
|
|
95
|
+
fields: {
|
|
96
|
+
projectId: {
|
|
97
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
98
|
+
isOptional: false
|
|
99
|
+
},
|
|
100
|
+
name: {
|
|
101
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
102
|
+
isOptional: true
|
|
103
|
+
},
|
|
104
|
+
description: {
|
|
105
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
106
|
+
isOptional: true
|
|
107
|
+
},
|
|
108
|
+
slug: {
|
|
109
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
110
|
+
isOptional: true
|
|
111
|
+
},
|
|
112
|
+
isPublic: {
|
|
113
|
+
type: ScalarTypeEnum.Boolean(),
|
|
114
|
+
isOptional: true
|
|
115
|
+
},
|
|
116
|
+
tags: {
|
|
117
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
118
|
+
isArray: true,
|
|
119
|
+
isOptional: true
|
|
120
|
+
},
|
|
121
|
+
status: {
|
|
122
|
+
type: ProjectStatusSchemaEnum,
|
|
123
|
+
isOptional: true
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* Input for getting a project.
|
|
129
|
+
*/
|
|
130
|
+
const GetProjectInputModel = defineSchemaModel({
|
|
131
|
+
name: "GetProjectInput",
|
|
132
|
+
fields: { projectId: {
|
|
133
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
134
|
+
isOptional: false
|
|
135
|
+
} }
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* Input for deleting a project.
|
|
139
|
+
*/
|
|
140
|
+
const DeleteProjectInputModel = defineSchemaModel({
|
|
141
|
+
name: "DeleteProjectInput",
|
|
142
|
+
fields: { projectId: {
|
|
143
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
144
|
+
isOptional: false
|
|
145
|
+
} }
|
|
146
|
+
});
|
|
147
|
+
/**
|
|
148
|
+
* Output for delete operation.
|
|
149
|
+
*/
|
|
150
|
+
const DeleteProjectOutputModel = defineSchemaModel({
|
|
151
|
+
name: "DeleteProjectOutput",
|
|
152
|
+
fields: { success: {
|
|
153
|
+
type: ScalarTypeEnum.Boolean(),
|
|
154
|
+
isOptional: false
|
|
155
|
+
} }
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* Payload for project deleted event.
|
|
159
|
+
*/
|
|
160
|
+
const ProjectDeletedPayloadModel = defineSchemaModel({
|
|
161
|
+
name: "ProjectDeletedPayload",
|
|
162
|
+
fields: { projectId: {
|
|
163
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
164
|
+
isOptional: false
|
|
165
|
+
} }
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* Input for listing projects.
|
|
169
|
+
*/
|
|
170
|
+
const ListProjectsInputModel = defineSchemaModel({
|
|
171
|
+
name: "ListProjectsInput",
|
|
172
|
+
description: "Input for listing projects",
|
|
173
|
+
fields: {
|
|
174
|
+
status: {
|
|
175
|
+
type: ProjectStatusFilterEnum,
|
|
176
|
+
isOptional: true
|
|
177
|
+
},
|
|
178
|
+
search: {
|
|
179
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
180
|
+
isOptional: true
|
|
181
|
+
},
|
|
182
|
+
limit: {
|
|
183
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
184
|
+
isOptional: true,
|
|
185
|
+
defaultValue: 20
|
|
186
|
+
},
|
|
187
|
+
offset: {
|
|
188
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
189
|
+
isOptional: true,
|
|
190
|
+
defaultValue: 0
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
/**
|
|
195
|
+
* Output for listing projects.
|
|
196
|
+
*/
|
|
197
|
+
const ListProjectsOutputModel = defineSchemaModel({
|
|
198
|
+
name: "ListProjectsOutput",
|
|
199
|
+
description: "Output for listing projects",
|
|
200
|
+
fields: {
|
|
201
|
+
projects: {
|
|
202
|
+
type: ProjectModel,
|
|
203
|
+
isArray: true,
|
|
204
|
+
isOptional: false
|
|
205
|
+
},
|
|
206
|
+
total: {
|
|
207
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
208
|
+
isOptional: false
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
//#endregion
|
|
214
|
+
export { CreateProjectInputModel, DeleteProjectInputModel, DeleteProjectOutputModel, GetProjectInputModel, ListProjectsInputModel, ListProjectsOutputModel, ProjectDeletedPayloadModel, ProjectModel, UpdateProjectInputModel };
|
|
215
|
+
//# sourceMappingURL=project.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.schema.js","names":[],"sources":["../../src/project/project.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport {\n ProjectStatusSchemaEnum,\n ProjectStatusFilterEnum,\n} from './project.enum';\n\n/**\n * A project within an organization.\n */\nexport const ProjectModel = defineSchemaModel({\n name: 'Project',\n description: 'A project within an organization',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ProjectStatusSchemaEnum, isOptional: false },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n tags: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: false,\n },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a project.\n */\nexport const CreateProjectInputModel = defineSchemaModel({\n name: 'CreateProjectInput',\n description: 'Input for creating a project',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n tags: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: true,\n },\n },\n});\n\n/**\n * Input for updating a project.\n */\nexport const UpdateProjectInputModel = defineSchemaModel({\n name: 'UpdateProjectInput',\n description: 'Input for updating a project',\n fields: {\n projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n tags: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: true,\n },\n status: { type: ProjectStatusSchemaEnum, isOptional: true },\n },\n});\n\n/**\n * Input for getting a project.\n */\nexport const GetProjectInputModel = defineSchemaModel({\n name: 'GetProjectInput',\n fields: {\n projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Input for deleting a project.\n */\nexport const DeleteProjectInputModel = defineSchemaModel({\n name: 'DeleteProjectInput',\n fields: {\n projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Output for delete operation.\n */\nexport const DeleteProjectOutputModel = defineSchemaModel({\n name: 'DeleteProjectOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n/**\n * Payload for project deleted event.\n */\nexport const ProjectDeletedPayloadModel = defineSchemaModel({\n name: 'ProjectDeletedPayload',\n fields: {\n projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Input for listing projects.\n */\nexport const ListProjectsInputModel = defineSchemaModel({\n name: 'ListProjectsInput',\n description: 'Input for listing projects',\n fields: {\n status: { type: ProjectStatusFilterEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\n/**\n * Output for listing projects.\n */\nexport const ListProjectsOutputModel = defineSchemaModel({\n name: 'ListProjectsOutput',\n description: 'Output for listing projects',\n fields: {\n projects: { type: ProjectModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n"],"mappings":";;;;;;;AASA,MAAa,eAAe,kBAAkB;CAC5C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,QAAQ;GAAE,MAAM;GAAyB,YAAY;GAAO;EAC5D,UAAU;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAC/D,MAAM;GACJ,MAAM,eAAe,iBAAiB;GACtC,SAAS;GACT,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,kBAAkB;CACvD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,MAAM;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAClE,aAAa;GAAE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,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,QAAQ;GAAE,MAAM;GAAyB,YAAY;GAAM;EAC3D,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE,OAAO;GACL,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACD,QAAQ;GACN,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACF;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,kBAAkB;CACvD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAc,SAAS;GAAM,YAAY;GAAO;EAClE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAClE;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FeatureModuleSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/saas-boilerplate.feature.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SaaS Boilerplate feature module that bundles project management,
|
|
7
|
+
* billing, and settings operations into an installable feature.
|
|
8
|
+
*/
|
|
9
|
+
declare const SaasBoilerplateFeature: FeatureModuleSpec;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SaasBoilerplateFeature };
|
|
12
|
+
//# sourceMappingURL=saas-boilerplate.feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saas-boilerplate.feature.d.ts","names":[],"sources":["../src/saas-boilerplate.feature.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAWa,wBAAwB"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
//#region src/saas-boilerplate.feature.ts
|
|
2
|
+
/**
|
|
3
|
+
* SaaS Boilerplate feature module that bundles project management,
|
|
4
|
+
* billing, and settings operations into an installable feature.
|
|
5
|
+
*/
|
|
6
|
+
const SaasBoilerplateFeature = {
|
|
7
|
+
meta: {
|
|
8
|
+
key: "saas-boilerplate",
|
|
9
|
+
title: "SaaS Boilerplate",
|
|
10
|
+
description: "SaaS application foundation with projects, billing, and settings",
|
|
11
|
+
domain: "saas",
|
|
12
|
+
owners: ["@saas-team"],
|
|
13
|
+
tags: [
|
|
14
|
+
"saas",
|
|
15
|
+
"projects",
|
|
16
|
+
"billing"
|
|
17
|
+
],
|
|
18
|
+
stability: "experimental",
|
|
19
|
+
version: 1
|
|
20
|
+
},
|
|
21
|
+
operations: [
|
|
22
|
+
{
|
|
23
|
+
key: "saas.project.create",
|
|
24
|
+
version: 1
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: "saas.project.get",
|
|
28
|
+
version: 1
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: "saas.project.update",
|
|
32
|
+
version: 1
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "saas.project.delete",
|
|
36
|
+
version: 1
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "saas.project.list",
|
|
40
|
+
version: 1
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "saas.billing.subscription.get",
|
|
44
|
+
version: 1
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "saas.billing.usage.record",
|
|
48
|
+
version: 1
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: "saas.billing.usage.summary",
|
|
52
|
+
version: 1
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: "saas.billing.feature.check",
|
|
56
|
+
version: 1
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
events: [
|
|
60
|
+
{
|
|
61
|
+
key: "project.created",
|
|
62
|
+
version: 1
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "project.updated",
|
|
66
|
+
version: 1
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "project.deleted",
|
|
70
|
+
version: 1
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "project.archived",
|
|
74
|
+
version: 1
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: "billing.usage.recorded",
|
|
78
|
+
version: 1
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: "billing.subscription.changed",
|
|
82
|
+
version: 1
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "billing.limit.reached",
|
|
86
|
+
version: 1
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
presentations: [
|
|
90
|
+
{
|
|
91
|
+
key: "saas.dashboard",
|
|
92
|
+
version: 1
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "saas.project.list",
|
|
96
|
+
version: 1
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: "saas.project.detail",
|
|
100
|
+
version: 1
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "saas.billing.subscription",
|
|
104
|
+
version: 1
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: "saas.billing.usage",
|
|
108
|
+
version: 1
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: "saas.settings",
|
|
112
|
+
version: 1
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
opToPresentation: [
|
|
116
|
+
{
|
|
117
|
+
op: {
|
|
118
|
+
key: "saas.project.list",
|
|
119
|
+
version: 1
|
|
120
|
+
},
|
|
121
|
+
pres: {
|
|
122
|
+
key: "saas.project.list",
|
|
123
|
+
version: 1
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
op: {
|
|
128
|
+
key: "saas.project.get",
|
|
129
|
+
version: 1
|
|
130
|
+
},
|
|
131
|
+
pres: {
|
|
132
|
+
key: "saas.project.detail",
|
|
133
|
+
version: 1
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
op: {
|
|
138
|
+
key: "saas.billing.subscription.get",
|
|
139
|
+
version: 1
|
|
140
|
+
},
|
|
141
|
+
pres: {
|
|
142
|
+
key: "saas.billing.subscription",
|
|
143
|
+
version: 1
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
op: {
|
|
148
|
+
key: "saas.billing.usage.summary",
|
|
149
|
+
version: 1
|
|
150
|
+
},
|
|
151
|
+
pres: {
|
|
152
|
+
key: "saas.billing.usage",
|
|
153
|
+
version: 1
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
presentationsTargets: [
|
|
158
|
+
{
|
|
159
|
+
key: "saas.dashboard",
|
|
160
|
+
version: 1,
|
|
161
|
+
targets: ["react", "markdown"]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
key: "saas.project.list",
|
|
165
|
+
version: 1,
|
|
166
|
+
targets: [
|
|
167
|
+
"react",
|
|
168
|
+
"markdown",
|
|
169
|
+
"application/json"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
key: "saas.billing.subscription",
|
|
174
|
+
version: 1,
|
|
175
|
+
targets: ["react", "markdown"]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: "saas.billing.usage",
|
|
179
|
+
version: 1,
|
|
180
|
+
targets: ["react", "markdown"]
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
capabilities: { requires: [
|
|
184
|
+
{
|
|
185
|
+
key: "identity",
|
|
186
|
+
version: 1
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: "audit-trail",
|
|
190
|
+
version: 1
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
key: "notifications",
|
|
194
|
+
version: 1
|
|
195
|
+
}
|
|
196
|
+
] }
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
//#endregion
|
|
200
|
+
export { SaasBoilerplateFeature };
|
|
201
|
+
//# sourceMappingURL=saas-boilerplate.feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saas-boilerplate.feature.js","names":["SaasBoilerplateFeature: FeatureModuleSpec"],"sources":["../src/saas-boilerplate.feature.ts"],"sourcesContent":["/**\n * SaaS Boilerplate Feature Module Specification\n *\n * Defines the feature module for the SaaS application foundation.\n */\nimport type { FeatureModuleSpec } from '@contractspec/lib.contracts';\n\n/**\n * SaaS Boilerplate feature module that bundles project management,\n * billing, and settings operations into an installable feature.\n */\nexport const SaasBoilerplateFeature: FeatureModuleSpec = {\n meta: {\n key: 'saas-boilerplate',\n title: 'SaaS Boilerplate',\n description:\n 'SaaS application foundation with projects, billing, and settings',\n domain: 'saas',\n owners: ['@saas-team'],\n tags: ['saas', 'projects', 'billing'],\n stability: 'experimental',\n version: 1,\n },\n\n // All contract operations included in this feature\n operations: [\n // Project operations\n { key: 'saas.project.create', version: 1 },\n { key: 'saas.project.get', version: 1 },\n { key: 'saas.project.update', version: 1 },\n { key: 'saas.project.delete', version: 1 },\n { key: 'saas.project.list', version: 1 },\n\n // Billing operations\n { key: 'saas.billing.subscription.get', version: 1 },\n { key: 'saas.billing.usage.record', version: 1 },\n { key: 'saas.billing.usage.summary', version: 1 },\n { key: 'saas.billing.feature.check', version: 1 },\n ],\n\n // Events emitted by this feature\n events: [\n // Project events\n { key: 'project.created', version: 1 },\n { key: 'project.updated', version: 1 },\n { key: 'project.deleted', version: 1 },\n { key: 'project.archived', version: 1 },\n\n // Billing events\n { key: 'billing.usage.recorded', version: 1 },\n { key: 'billing.subscription.changed', version: 1 },\n { key: 'billing.limit.reached', version: 1 },\n ],\n\n // Presentations associated with this feature\n presentations: [\n { key: 'saas.dashboard', version: 1 },\n { key: 'saas.project.list', version: 1 },\n { key: 'saas.project.detail', version: 1 },\n { key: 'saas.billing.subscription', version: 1 },\n { key: 'saas.billing.usage', version: 1 },\n { key: 'saas.settings', version: 1 },\n ],\n\n // Link operations to their primary presentations\n opToPresentation: [\n {\n op: { key: 'saas.project.list', version: 1 },\n pres: { key: 'saas.project.list', version: 1 },\n },\n {\n op: { key: 'saas.project.get', version: 1 },\n pres: { key: 'saas.project.detail', version: 1 },\n },\n {\n op: { key: 'saas.billing.subscription.get', version: 1 },\n pres: { key: 'saas.billing.subscription', version: 1 },\n },\n {\n op: { key: 'saas.billing.usage.summary', version: 1 },\n pres: { key: 'saas.billing.usage', version: 1 },\n },\n ],\n\n // Target requirements for multi-surface rendering\n presentationsTargets: [\n { key: 'saas.dashboard', version: 1, targets: ['react', 'markdown'] },\n {\n key: 'saas.project.list',\n version: 1,\n targets: ['react', 'markdown', 'application/json'],\n },\n {\n key: 'saas.billing.subscription',\n version: 1,\n targets: ['react', 'markdown'],\n },\n { key: 'saas.billing.usage', version: 1, targets: ['react', 'markdown'] },\n ],\n\n // Capability requirements\n capabilities: {\n requires: [\n { key: 'identity', version: 1 },\n { key: 'audit-trail', version: 1 },\n { key: 'notifications', version: 1 },\n ],\n },\n};\n"],"mappings":";;;;;AAWA,MAAaA,yBAA4C;CACvD,MAAM;EACJ,KAAK;EACL,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,aAAa;EACtB,MAAM;GAAC;GAAQ;GAAY;GAAU;EACrC,WAAW;EACX,SAAS;EACV;CAGD,YAAY;EAEV;GAAE,KAAK;GAAuB,SAAS;GAAG;EAC1C;GAAE,KAAK;GAAoB,SAAS;GAAG;EACvC;GAAE,KAAK;GAAuB,SAAS;GAAG;EAC1C;GAAE,KAAK;GAAuB,SAAS;GAAG;EAC1C;GAAE,KAAK;GAAqB,SAAS;GAAG;EAGxC;GAAE,KAAK;GAAiC,SAAS;GAAG;EACpD;GAAE,KAAK;GAA6B,SAAS;GAAG;EAChD;GAAE,KAAK;GAA8B,SAAS;GAAG;EACjD;GAAE,KAAK;GAA8B,SAAS;GAAG;EAClD;CAGD,QAAQ;EAEN;GAAE,KAAK;GAAmB,SAAS;GAAG;EACtC;GAAE,KAAK;GAAmB,SAAS;GAAG;EACtC;GAAE,KAAK;GAAmB,SAAS;GAAG;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ACrC,EACF;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema346 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/settings/settings.entity.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Settings entity - key-value configuration store.
|
|
6
|
+
*/
|
|
7
|
+
declare const SettingsEntity: _contractspec_lib_schema346.EntitySpec<{
|
|
8
|
+
id: _contractspec_lib_schema346.EntityScalarField;
|
|
9
|
+
key: _contractspec_lib_schema346.EntityScalarField;
|
|
10
|
+
scope: _contractspec_lib_schema346.EntityEnumField;
|
|
11
|
+
scopeId: _contractspec_lib_schema346.EntityScalarField;
|
|
12
|
+
value: _contractspec_lib_schema346.EntityScalarField;
|
|
13
|
+
valueType: _contractspec_lib_schema346.EntityScalarField;
|
|
14
|
+
schema: _contractspec_lib_schema346.EntityScalarField;
|
|
15
|
+
description: _contractspec_lib_schema346.EntityScalarField;
|
|
16
|
+
isSecret: _contractspec_lib_schema346.EntityScalarField;
|
|
17
|
+
createdAt: _contractspec_lib_schema346.EntityScalarField;
|
|
18
|
+
updatedAt: _contractspec_lib_schema346.EntityScalarField;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* FeatureFlag entity - feature toggles.
|
|
22
|
+
*/
|
|
23
|
+
declare const FeatureFlagEntity: _contractspec_lib_schema346.EntitySpec<{
|
|
24
|
+
id: _contractspec_lib_schema346.EntityScalarField;
|
|
25
|
+
key: _contractspec_lib_schema346.EntityScalarField;
|
|
26
|
+
name: _contractspec_lib_schema346.EntityScalarField;
|
|
27
|
+
description: _contractspec_lib_schema346.EntityScalarField;
|
|
28
|
+
enabled: _contractspec_lib_schema346.EntityScalarField;
|
|
29
|
+
defaultValue: _contractspec_lib_schema346.EntityScalarField;
|
|
30
|
+
rules: _contractspec_lib_schema346.EntityScalarField;
|
|
31
|
+
rolloutPercentage: _contractspec_lib_schema346.EntityScalarField;
|
|
32
|
+
createdAt: _contractspec_lib_schema346.EntityScalarField;
|
|
33
|
+
updatedAt: _contractspec_lib_schema346.EntityScalarField;
|
|
34
|
+
}>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { FeatureFlagEntity, SettingsEntity };
|
|
37
|
+
//# sourceMappingURL=settings.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.entity.d.ts","names":[],"sources":["../../src/settings/settings.entity.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,cAiDX,8BAjDyB,UAiDzB,CAAA;EAAA,EAAA,EAAA,2BAAA,CAAA,iBAAA;;;;;;;;;;;;;AAKF;;cAAa,+CAAiB;MA4B5B,2BAAA,CAAA;;;;;;;;0DA5B4B;EAAA,SAAA,+CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { SettingsScopeEnum } from "./settings.enum.js";
|
|
2
|
+
import { defineEntity, field, index } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/settings/settings.entity.ts
|
|
5
|
+
/**
|
|
6
|
+
* Settings entity - key-value configuration store.
|
|
7
|
+
*/
|
|
8
|
+
const SettingsEntity = defineEntity({
|
|
9
|
+
name: "Settings",
|
|
10
|
+
description: "Application, organization, or user settings.",
|
|
11
|
+
schema: "saas_app",
|
|
12
|
+
map: "settings",
|
|
13
|
+
fields: {
|
|
14
|
+
id: field.id(),
|
|
15
|
+
key: field.string({ description: "Setting key (e.g., \"theme\", \"notifications.email\")" }),
|
|
16
|
+
scope: field.enum("SettingsScope"),
|
|
17
|
+
scopeId: field.string({
|
|
18
|
+
isOptional: true,
|
|
19
|
+
description: "ID of scoped entity (org, user, project)"
|
|
20
|
+
}),
|
|
21
|
+
value: field.json({ description: "Setting value" }),
|
|
22
|
+
valueType: field.string({
|
|
23
|
+
default: "\"string\"",
|
|
24
|
+
description: "Type hint for value"
|
|
25
|
+
}),
|
|
26
|
+
schema: field.json({
|
|
27
|
+
isOptional: true,
|
|
28
|
+
description: "JSON schema for validation"
|
|
29
|
+
}),
|
|
30
|
+
description: field.string({ isOptional: true }),
|
|
31
|
+
isSecret: field.boolean({
|
|
32
|
+
default: false,
|
|
33
|
+
description: "Whether value should be encrypted"
|
|
34
|
+
}),
|
|
35
|
+
createdAt: field.createdAt(),
|
|
36
|
+
updatedAt: field.updatedAt()
|
|
37
|
+
},
|
|
38
|
+
indexes: [index.unique([
|
|
39
|
+
"scope",
|
|
40
|
+
"scopeId",
|
|
41
|
+
"key"
|
|
42
|
+
]), index.on(["scope", "key"])],
|
|
43
|
+
enums: [SettingsScopeEnum]
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* FeatureFlag entity - feature toggles.
|
|
47
|
+
*/
|
|
48
|
+
const FeatureFlagEntity = defineEntity({
|
|
49
|
+
name: "FeatureFlag",
|
|
50
|
+
description: "Feature flags for progressive rollout.",
|
|
51
|
+
schema: "saas_app",
|
|
52
|
+
map: "feature_flag",
|
|
53
|
+
fields: {
|
|
54
|
+
id: field.id(),
|
|
55
|
+
key: field.string({
|
|
56
|
+
isUnique: true,
|
|
57
|
+
description: "Feature flag key"
|
|
58
|
+
}),
|
|
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({
|
|
64
|
+
isOptional: true,
|
|
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
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { FeatureFlagEntity, SettingsEntity };
|
|
78
|
+
//# sourceMappingURL=settings.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.entity.js","names":[],"sources":["../../src/settings/settings.entity.ts"],"sourcesContent":["import { defineEntity, field, index } from '@contractspec/lib.schema';\nimport { SettingsScopeEnum } from './settings.enum';\n\n/**\n * Settings entity - key-value configuration store.\n */\nexport const SettingsEntity = defineEntity({\n name: 'Settings',\n description: 'Application, organization, or user settings.',\n schema: 'saas_app',\n map: 'settings',\n fields: {\n id: field.id(),\n\n // Key identification\n key: field.string({\n description: 'Setting key (e.g., \"theme\", \"notifications.email\")',\n }),\n\n // Scope\n scope: field.enum('SettingsScope'),\n scopeId: field.string({\n isOptional: true,\n description: 'ID of scoped entity (org, user, project)',\n }),\n\n // Value\n value: field.json({ description: 'Setting value' }),\n valueType: field.string({\n default: '\"string\"',\n description: 'Type hint for value',\n }),\n\n // Schema\n schema: field.json({\n isOptional: true,\n description: 'JSON schema for validation',\n }),\n\n // Metadata\n description: field.string({ isOptional: true }),\n isSecret: field.boolean({\n default: false,\n description: 'Whether value should be encrypted',\n }),\n\n // Timestamps\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n },\n indexes: [\n index.unique(['scope', 'scopeId', 'key']),\n index.on(['scope', 'key']),\n ],\n enums: [SettingsScopeEnum],\n});\n\n/**\n * FeatureFlag entity - feature toggles.\n */\nexport const FeatureFlagEntity = defineEntity({\n name: 'FeatureFlag',\n description: 'Feature flags for progressive rollout.',\n schema: 'saas_app',\n map: 'feature_flag',\n fields: {\n id: field.id(),\n key: field.string({ isUnique: true, description: 'Feature flag key' }),\n name: field.string({ description: 'Human-readable name' }),\n description: field.string({ isOptional: true }),\n\n // Status\n enabled: field.boolean({ default: false }),\n\n // Targeting\n defaultValue: field.boolean({ default: false }),\n rules: field.json({ isOptional: true, description: 'Targeting rules' }),\n\n // Rollout\n rolloutPercentage: field.int({\n default: 0,\n description: 'Percentage rollout (0-100)',\n }),\n\n // Timestamps\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n },\n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;GACd,CAAC;EAGF,WAAW,MAAM,WAAW;EAC5B,WAAW,MAAM,WAAW;EAC7B;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema369 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/settings/settings.enum.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Settings scope enum.
|
|
6
|
+
*/
|
|
7
|
+
declare const SettingsScopeEnum: _contractspec_lib_schema369.EntityEnumDef;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SettingsScopeEnum };
|
|
10
|
+
//# sourceMappingURL=settings.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.enum.d.ts","names":[],"sources":["../../src/settings/settings.enum.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,iBAKX,EAAA,2BAAA,CAL4B,aAK5B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineEntityEnum } from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/settings/settings.enum.ts
|
|
4
|
+
/**
|
|
5
|
+
* Settings scope enum.
|
|
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."
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { SettingsScopeEnum };
|
|
21
|
+
//# sourceMappingURL=settings.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.enum.js","names":[],"sources":["../../src/settings/settings.enum.ts"],"sourcesContent":["import { defineEntityEnum } from '@contractspec/lib.schema';\n\n/**\n * Settings scope enum.\n */\nexport const SettingsScopeEnum = defineEntityEnum({\n name: 'SettingsScope',\n values: ['APP', 'ORG', 'USER', 'PROJECT'] as const,\n schema: 'saas_app',\n description: 'Scope of a setting.',\n});\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,iBAAiB;CAChD,MAAM;CACN,QAAQ;EAAC;EAAO;EAAO;EAAQ;EAAU;CACzC,QAAQ;CACR,aAAa;CACd,CAAC"}
|