@contractspec/example.saas-boilerplate 3.7.6 → 3.7.7
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 +8 -8
- package/AGENTS.md +50 -27
- package/README.md +64 -144
- package/dist/billing/billing.event.js +1 -1
- package/dist/billing/index.d.ts +6 -6
- package/dist/billing/index.js +1 -1
- package/dist/browser/billing/billing.event.js +1 -1
- package/dist/browser/billing/index.js +1 -1
- package/dist/browser/index.js +931 -932
- package/dist/browser/project/index.js +209 -209
- package/dist/browser/project/project.event.js +1 -1
- package/dist/browser/ui/SaasDashboard.js +45 -45
- package/dist/browser/ui/SaasProjectList.js +7 -7
- package/dist/browser/ui/SaasSettingsPanel.js +12 -12
- package/dist/browser/ui/hooks/index.js +2 -2
- package/dist/browser/ui/hooks/useProjectList.js +1 -1
- package/dist/browser/ui/hooks/useProjectMutations.js +1 -1
- package/dist/browser/ui/index.js +483 -484
- package/dist/browser/ui/modals/CreateProjectModal.js +10 -10
- package/dist/browser/ui/modals/ProjectActionsModal.js +13 -13
- package/dist/browser/ui/modals/index.js +23 -23
- package/dist/browser/ui/renderers/index.js +112 -112
- package/dist/browser/ui/renderers/project-list.renderer.js +7 -7
- package/dist/handlers/index.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +931 -932
- package/dist/node/billing/billing.event.js +1 -1
- package/dist/node/billing/index.js +1 -1
- package/dist/node/index.js +931 -932
- package/dist/node/project/index.js +209 -209
- package/dist/node/project/project.event.js +1 -1
- package/dist/node/ui/SaasDashboard.js +45 -45
- package/dist/node/ui/SaasProjectList.js +7 -7
- package/dist/node/ui/SaasSettingsPanel.js +12 -12
- package/dist/node/ui/hooks/index.js +2 -2
- package/dist/node/ui/hooks/useProjectList.js +1 -1
- package/dist/node/ui/hooks/useProjectMutations.js +1 -1
- package/dist/node/ui/index.js +483 -484
- package/dist/node/ui/modals/CreateProjectModal.js +10 -10
- package/dist/node/ui/modals/ProjectActionsModal.js +13 -13
- package/dist/node/ui/modals/index.js +23 -23
- package/dist/node/ui/renderers/index.js +112 -112
- package/dist/node/ui/renderers/project-list.renderer.js +7 -7
- package/dist/presentations/index.d.ts +1 -1
- package/dist/project/index.d.ts +7 -7
- package/dist/project/index.js +209 -209
- package/dist/project/project.event.js +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/ui/SaasDashboard.js +45 -45
- package/dist/ui/SaasProjectList.js +7 -7
- package/dist/ui/SaasSettingsPanel.js +12 -12
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.js +2 -2
- package/dist/ui/hooks/useProjectList.d.ts +5 -0
- package/dist/ui/hooks/useProjectList.js +1 -1
- package/dist/ui/hooks/useProjectMutations.d.ts +8 -0
- package/dist/ui/hooks/useProjectMutations.js +1 -1
- package/dist/ui/index.d.ts +4 -4
- package/dist/ui/index.js +483 -484
- package/dist/ui/modals/CreateProjectModal.js +10 -10
- package/dist/ui/modals/ProjectActionsModal.js +13 -13
- package/dist/ui/modals/index.js +23 -23
- package/dist/ui/renderers/index.d.ts +1 -1
- package/dist/ui/renderers/index.js +112 -112
- package/dist/ui/renderers/project-list.renderer.d.ts +1 -1
- package/dist/ui/renderers/project-list.renderer.js +7 -7
- package/package.json +10 -10
- package/src/billing/billing.entity.ts +132 -132
- package/src/billing/billing.enum.ts +9 -9
- package/src/billing/billing.event.ts +71 -71
- package/src/billing/billing.handler.ts +87 -87
- package/src/billing/billing.operations.ts +158 -158
- package/src/billing/billing.presentation.ts +45 -45
- package/src/billing/billing.schema.ts +76 -76
- package/src/billing/index.ts +43 -48
- package/src/dashboard/dashboard.presentation.ts +45 -45
- package/src/dashboard/index.ts +2 -2
- package/src/docs/saas-boilerplate.docblock.ts +43 -43
- package/src/example.ts +32 -32
- package/src/handlers/index.ts +9 -9
- package/src/handlers/saas.handlers.ts +250 -249
- package/src/index.ts +40 -41
- package/src/presentations/index.ts +18 -20
- package/src/project/index.ts +45 -50
- package/src/project/project.entity.ts +68 -68
- package/src/project/project.enum.ts +8 -8
- package/src/project/project.event.ts +79 -79
- package/src/project/project.handler.ts +103 -103
- package/src/project/project.operations.ts +236 -236
- package/src/project/project.presentation.ts +46 -46
- package/src/project/project.schema.ts +90 -90
- package/src/saas-boilerplate.feature.ts +100 -100
- package/src/seeders/index.ts +20 -20
- package/src/settings/index.ts +2 -3
- package/src/settings/settings.entity.ts +65 -65
- package/src/settings/settings.enum.ts +4 -4
- package/src/shared/mock-data.ts +92 -92
- package/src/shared/overlay-types.ts +23 -23
- package/src/tests/operations.test-spec.ts +96 -96
- package/src/ui/SaasDashboard.tsx +270 -270
- package/src/ui/SaasProjectList.tsx +90 -90
- package/src/ui/SaasSettingsPanel.tsx +84 -84
- package/src/ui/hooks/index.ts +3 -3
- package/src/ui/hooks/useProjectList.ts +69 -68
- package/src/ui/hooks/useProjectMutations.ts +144 -143
- package/src/ui/index.ts +8 -12
- package/src/ui/modals/CreateProjectModal.tsx +154 -154
- package/src/ui/modals/ProjectActionsModal.tsx +321 -321
- package/src/ui/overlays/demo-overlays.ts +49 -49
- package/src/ui/renderers/index.ts +5 -4
- package/src/ui/renderers/project-list.markdown.ts +204 -204
- package/src/ui/renderers/project-list.renderer.tsx +14 -13
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
package/dist/project/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project domain - project management within organizations.
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
4
|
+
export { ProjectEntity, ProjectMemberEntity, ProjectStatusEnum, } from './project.entity';
|
|
5
|
+
export { ProjectStatusFilterEnum, ProjectStatusSchemaEnum, } from './project.enum';
|
|
6
|
+
export { ProjectArchivedEvent, ProjectCreatedEvent, ProjectDeletedEvent, ProjectUpdatedEvent, } from './project.event';
|
|
7
|
+
export { type CreateProjectInput, type ListProjectsInput, type ListProjectsOutput, mockCreateProjectHandler, mockDeleteProjectHandler, mockGetProjectHandler, mockListProjectsHandler, mockUpdateProjectHandler, type Project, type UpdateProjectInput, } from './project.handler';
|
|
8
|
+
export { CreateProjectContract, DeleteProjectContract, GetProjectContract, ListProjectsContract, UpdateProjectContract, } from './project.operations';
|
|
9
|
+
export { ProjectDetailPresentation, ProjectListPresentation, } from './project.presentation';
|
|
10
|
+
export { CreateProjectInputModel, DeleteProjectInputModel, DeleteProjectOutputModel, GetProjectInputModel, ListProjectsInputModel, ListProjectsOutputModel, ProjectDeletedPayloadModel, ProjectModel, UpdateProjectInputModel, } from './project.schema';
|
package/dist/project/index.js
CHANGED
|
@@ -171,6 +171,79 @@ async function mockDeleteProjectHandler(input) {
|
|
|
171
171
|
return { success: true };
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
// src/project/project.entity.ts
|
|
175
|
+
import {
|
|
176
|
+
defineEntity,
|
|
177
|
+
defineEntityEnum,
|
|
178
|
+
field,
|
|
179
|
+
index
|
|
180
|
+
} from "@contractspec/lib.schema";
|
|
181
|
+
var ProjectStatusEnum = defineEntityEnum({
|
|
182
|
+
name: "ProjectStatus",
|
|
183
|
+
values: ["DRAFT", "ACTIVE", "ARCHIVED", "DELETED"],
|
|
184
|
+
schema: "saas_app",
|
|
185
|
+
description: "Status of a project."
|
|
186
|
+
});
|
|
187
|
+
var ProjectEntity = defineEntity({
|
|
188
|
+
name: "Project",
|
|
189
|
+
description: "A project belonging to an organization.",
|
|
190
|
+
schema: "saas_app",
|
|
191
|
+
map: "project",
|
|
192
|
+
fields: {
|
|
193
|
+
id: field.id({ description: "Unique project ID" }),
|
|
194
|
+
name: field.string({ description: "Project name" }),
|
|
195
|
+
description: field.string({
|
|
196
|
+
isOptional: true,
|
|
197
|
+
description: "Project description"
|
|
198
|
+
}),
|
|
199
|
+
slug: field.string({
|
|
200
|
+
isOptional: true,
|
|
201
|
+
description: "URL-friendly identifier"
|
|
202
|
+
}),
|
|
203
|
+
organizationId: field.foreignKey({ description: "Owning organization" }),
|
|
204
|
+
createdBy: field.foreignKey({
|
|
205
|
+
description: "User who created the project"
|
|
206
|
+
}),
|
|
207
|
+
status: field.enum("ProjectStatus", { default: "DRAFT" }),
|
|
208
|
+
isPublic: field.boolean({
|
|
209
|
+
default: false,
|
|
210
|
+
description: "Whether project is publicly visible"
|
|
211
|
+
}),
|
|
212
|
+
settings: field.json({
|
|
213
|
+
isOptional: true,
|
|
214
|
+
description: "Project-specific settings"
|
|
215
|
+
}),
|
|
216
|
+
tags: field.string({ isArray: true, description: "Project tags" }),
|
|
217
|
+
metadata: field.json({ isOptional: true }),
|
|
218
|
+
createdAt: field.createdAt(),
|
|
219
|
+
updatedAt: field.updatedAt(),
|
|
220
|
+
archivedAt: field.dateTime({ isOptional: true })
|
|
221
|
+
},
|
|
222
|
+
indexes: [
|
|
223
|
+
index.on(["organizationId", "status"]),
|
|
224
|
+
index.on(["organizationId", "createdAt"]),
|
|
225
|
+
index.unique(["organizationId", "slug"])
|
|
226
|
+
],
|
|
227
|
+
enums: [ProjectStatusEnum]
|
|
228
|
+
});
|
|
229
|
+
var ProjectMemberEntity = defineEntity({
|
|
230
|
+
name: "ProjectMember",
|
|
231
|
+
description: "User access to a specific project.",
|
|
232
|
+
schema: "saas_app",
|
|
233
|
+
map: "project_member",
|
|
234
|
+
fields: {
|
|
235
|
+
id: field.id(),
|
|
236
|
+
projectId: field.foreignKey(),
|
|
237
|
+
userId: field.foreignKey(),
|
|
238
|
+
role: field.string({
|
|
239
|
+
description: "Role in project (owner, editor, viewer)"
|
|
240
|
+
}),
|
|
241
|
+
addedBy: field.string({ isOptional: true }),
|
|
242
|
+
createdAt: field.createdAt()
|
|
243
|
+
},
|
|
244
|
+
indexes: [index.unique(["projectId", "userId"])]
|
|
245
|
+
});
|
|
246
|
+
|
|
174
247
|
// src/project/project.enum.ts
|
|
175
248
|
import { defineEnum } from "@contractspec/lib.schema";
|
|
176
249
|
var ProjectStatusSchemaEnum = defineEnum("ProjectStatus", [
|
|
@@ -186,112 +259,210 @@ var ProjectStatusFilterEnum = defineEnum("ProjectStatusFilter", [
|
|
|
186
259
|
"all"
|
|
187
260
|
]);
|
|
188
261
|
|
|
189
|
-
// src/project/project.
|
|
262
|
+
// src/project/project.event.ts
|
|
263
|
+
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
190
264
|
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
191
|
-
var
|
|
192
|
-
name: "
|
|
193
|
-
description: "
|
|
265
|
+
var ProjectCreatedPayload = defineSchemaModel({
|
|
266
|
+
name: "ProjectCreatedPayload",
|
|
267
|
+
description: "Payload when a project is created",
|
|
194
268
|
fields: {
|
|
195
|
-
|
|
269
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
196
270
|
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
197
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
198
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
199
271
|
organizationId: {
|
|
200
272
|
type: ScalarTypeEnum.String_unsecure(),
|
|
201
273
|
isOptional: false
|
|
202
274
|
},
|
|
203
275
|
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
276
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
var ProjectUpdatedPayload = defineSchemaModel({
|
|
280
|
+
name: "ProjectUpdatedPayload",
|
|
281
|
+
description: "Payload when a project is updated",
|
|
282
|
+
fields: {
|
|
283
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
284
|
+
updatedFields: {
|
|
207
285
|
type: ScalarTypeEnum.String_unsecure(),
|
|
208
286
|
isArray: true,
|
|
209
287
|
isOptional: false
|
|
210
288
|
},
|
|
211
|
-
|
|
289
|
+
updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
212
290
|
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
213
291
|
}
|
|
214
292
|
});
|
|
215
|
-
var
|
|
293
|
+
var ProjectDeletedPayload = defineSchemaModel({
|
|
294
|
+
name: "ProjectDeletedPayload",
|
|
295
|
+
description: "Payload when a project is deleted",
|
|
296
|
+
fields: {
|
|
297
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
298
|
+
organizationId: {
|
|
299
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
300
|
+
isOptional: false
|
|
301
|
+
},
|
|
302
|
+
deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
303
|
+
deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
var ProjectArchivedPayload = defineSchemaModel({
|
|
307
|
+
name: "ProjectArchivedPayload",
|
|
308
|
+
description: "Payload when a project is archived",
|
|
309
|
+
fields: {
|
|
310
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
311
|
+
archivedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
312
|
+
archivedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
var ProjectCreatedEvent = defineEvent({
|
|
316
|
+
meta: {
|
|
317
|
+
key: "project.created",
|
|
318
|
+
version: "1.0.0",
|
|
319
|
+
description: "A new project has been created.",
|
|
320
|
+
stability: "stable",
|
|
321
|
+
owners: ["@saas-team"],
|
|
322
|
+
tags: ["project", "created"]
|
|
323
|
+
},
|
|
324
|
+
payload: ProjectCreatedPayload
|
|
325
|
+
});
|
|
326
|
+
var ProjectUpdatedEvent = defineEvent({
|
|
327
|
+
meta: {
|
|
328
|
+
key: "project.updated",
|
|
329
|
+
version: "1.0.0",
|
|
330
|
+
description: "A project has been updated.",
|
|
331
|
+
stability: "stable",
|
|
332
|
+
owners: ["@saas-team"],
|
|
333
|
+
tags: ["project", "updated"]
|
|
334
|
+
},
|
|
335
|
+
payload: ProjectUpdatedPayload
|
|
336
|
+
});
|
|
337
|
+
var ProjectDeletedEvent = defineEvent({
|
|
338
|
+
meta: {
|
|
339
|
+
key: "project.deleted",
|
|
340
|
+
version: "1.0.0",
|
|
341
|
+
description: "A project has been deleted.",
|
|
342
|
+
stability: "stable",
|
|
343
|
+
owners: ["@saas-team"],
|
|
344
|
+
tags: ["project", "deleted"]
|
|
345
|
+
},
|
|
346
|
+
payload: ProjectDeletedPayload
|
|
347
|
+
});
|
|
348
|
+
var ProjectArchivedEvent = defineEvent({
|
|
349
|
+
meta: {
|
|
350
|
+
key: "project.archived",
|
|
351
|
+
version: "1.0.0",
|
|
352
|
+
description: "A project has been archived.",
|
|
353
|
+
stability: "stable",
|
|
354
|
+
owners: ["@saas-team"],
|
|
355
|
+
tags: ["project", "archived"]
|
|
356
|
+
},
|
|
357
|
+
payload: ProjectArchivedPayload
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// src/project/project.schema.ts
|
|
361
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
362
|
+
var ProjectModel = defineSchemaModel2({
|
|
363
|
+
name: "Project",
|
|
364
|
+
description: "A project within an organization",
|
|
365
|
+
fields: {
|
|
366
|
+
id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
367
|
+
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
368
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
369
|
+
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
370
|
+
organizationId: {
|
|
371
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
372
|
+
isOptional: false
|
|
373
|
+
},
|
|
374
|
+
createdBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
375
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: false },
|
|
376
|
+
isPublic: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
377
|
+
tags: {
|
|
378
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
379
|
+
isArray: true,
|
|
380
|
+
isOptional: false
|
|
381
|
+
},
|
|
382
|
+
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
|
|
383
|
+
updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
var CreateProjectInputModel = defineSchemaModel2({
|
|
216
387
|
name: "CreateProjectInput",
|
|
217
388
|
description: "Input for creating a project",
|
|
218
389
|
fields: {
|
|
219
|
-
name: { type:
|
|
220
|
-
description: { type:
|
|
221
|
-
slug: { type:
|
|
222
|
-
isPublic: { type:
|
|
390
|
+
name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
391
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
392
|
+
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
393
|
+
isPublic: { type: ScalarTypeEnum2.Boolean(), isOptional: true },
|
|
223
394
|
tags: {
|
|
224
|
-
type:
|
|
395
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
225
396
|
isArray: true,
|
|
226
397
|
isOptional: true
|
|
227
398
|
}
|
|
228
399
|
}
|
|
229
400
|
});
|
|
230
|
-
var UpdateProjectInputModel =
|
|
401
|
+
var UpdateProjectInputModel = defineSchemaModel2({
|
|
231
402
|
name: "UpdateProjectInput",
|
|
232
403
|
description: "Input for updating a project",
|
|
233
404
|
fields: {
|
|
234
|
-
projectId: { type:
|
|
235
|
-
name: { type:
|
|
236
|
-
description: { type:
|
|
237
|
-
slug: { type:
|
|
238
|
-
isPublic: { type:
|
|
405
|
+
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
406
|
+
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
407
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
408
|
+
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
409
|
+
isPublic: { type: ScalarTypeEnum2.Boolean(), isOptional: true },
|
|
239
410
|
tags: {
|
|
240
|
-
type:
|
|
411
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
241
412
|
isArray: true,
|
|
242
413
|
isOptional: true
|
|
243
414
|
},
|
|
244
415
|
status: { type: ProjectStatusSchemaEnum, isOptional: true }
|
|
245
416
|
}
|
|
246
417
|
});
|
|
247
|
-
var GetProjectInputModel =
|
|
418
|
+
var GetProjectInputModel = defineSchemaModel2({
|
|
248
419
|
name: "GetProjectInput",
|
|
249
420
|
fields: {
|
|
250
|
-
projectId: { type:
|
|
421
|
+
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
251
422
|
}
|
|
252
423
|
});
|
|
253
|
-
var DeleteProjectInputModel =
|
|
424
|
+
var DeleteProjectInputModel = defineSchemaModel2({
|
|
254
425
|
name: "DeleteProjectInput",
|
|
255
426
|
fields: {
|
|
256
|
-
projectId: { type:
|
|
427
|
+
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
257
428
|
}
|
|
258
429
|
});
|
|
259
|
-
var DeleteProjectOutputModel =
|
|
430
|
+
var DeleteProjectOutputModel = defineSchemaModel2({
|
|
260
431
|
name: "DeleteProjectOutput",
|
|
261
432
|
fields: {
|
|
262
|
-
success: { type:
|
|
433
|
+
success: { type: ScalarTypeEnum2.Boolean(), isOptional: false }
|
|
263
434
|
}
|
|
264
435
|
});
|
|
265
|
-
var ProjectDeletedPayloadModel =
|
|
436
|
+
var ProjectDeletedPayloadModel = defineSchemaModel2({
|
|
266
437
|
name: "ProjectDeletedPayload",
|
|
267
438
|
fields: {
|
|
268
|
-
projectId: { type:
|
|
439
|
+
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
269
440
|
}
|
|
270
441
|
});
|
|
271
|
-
var ListProjectsInputModel =
|
|
442
|
+
var ListProjectsInputModel = defineSchemaModel2({
|
|
272
443
|
name: "ListProjectsInput",
|
|
273
444
|
description: "Input for listing projects",
|
|
274
445
|
fields: {
|
|
275
446
|
status: { type: ProjectStatusFilterEnum, isOptional: true },
|
|
276
|
-
search: { type:
|
|
447
|
+
search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
277
448
|
limit: {
|
|
278
|
-
type:
|
|
449
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
279
450
|
isOptional: true,
|
|
280
451
|
defaultValue: 20
|
|
281
452
|
},
|
|
282
453
|
offset: {
|
|
283
|
-
type:
|
|
454
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
284
455
|
isOptional: true,
|
|
285
456
|
defaultValue: 0
|
|
286
457
|
}
|
|
287
458
|
}
|
|
288
459
|
});
|
|
289
|
-
var ListProjectsOutputModel =
|
|
460
|
+
var ListProjectsOutputModel = defineSchemaModel2({
|
|
290
461
|
name: "ListProjectsOutput",
|
|
291
462
|
description: "Output for listing projects",
|
|
292
463
|
fields: {
|
|
293
464
|
projects: { type: ProjectModel, isArray: true, isOptional: false },
|
|
294
|
-
total: { type:
|
|
465
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
295
466
|
}
|
|
296
467
|
});
|
|
297
468
|
|
|
@@ -537,177 +708,6 @@ var ListProjectsContract = defineQuery({
|
|
|
537
708
|
}
|
|
538
709
|
});
|
|
539
710
|
|
|
540
|
-
// src/project/project.event.ts
|
|
541
|
-
import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
|
|
542
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
543
|
-
var ProjectCreatedPayload = defineSchemaModel2({
|
|
544
|
-
name: "ProjectCreatedPayload",
|
|
545
|
-
description: "Payload when a project is created",
|
|
546
|
-
fields: {
|
|
547
|
-
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
548
|
-
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
549
|
-
organizationId: {
|
|
550
|
-
type: ScalarTypeEnum2.String_unsecure(),
|
|
551
|
-
isOptional: false
|
|
552
|
-
},
|
|
553
|
-
createdBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
554
|
-
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
var ProjectUpdatedPayload = defineSchemaModel2({
|
|
558
|
-
name: "ProjectUpdatedPayload",
|
|
559
|
-
description: "Payload when a project is updated",
|
|
560
|
-
fields: {
|
|
561
|
-
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
562
|
-
updatedFields: {
|
|
563
|
-
type: ScalarTypeEnum2.String_unsecure(),
|
|
564
|
-
isArray: true,
|
|
565
|
-
isOptional: false
|
|
566
|
-
},
|
|
567
|
-
updatedBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
568
|
-
updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
var ProjectDeletedPayload = defineSchemaModel2({
|
|
572
|
-
name: "ProjectDeletedPayload",
|
|
573
|
-
description: "Payload when a project is deleted",
|
|
574
|
-
fields: {
|
|
575
|
-
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
576
|
-
organizationId: {
|
|
577
|
-
type: ScalarTypeEnum2.String_unsecure(),
|
|
578
|
-
isOptional: false
|
|
579
|
-
},
|
|
580
|
-
deletedBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
581
|
-
deletedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
var ProjectArchivedPayload = defineSchemaModel2({
|
|
585
|
-
name: "ProjectArchivedPayload",
|
|
586
|
-
description: "Payload when a project is archived",
|
|
587
|
-
fields: {
|
|
588
|
-
projectId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
589
|
-
archivedBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
590
|
-
archivedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
var ProjectCreatedEvent = defineEvent({
|
|
594
|
-
meta: {
|
|
595
|
-
key: "project.created",
|
|
596
|
-
version: "1.0.0",
|
|
597
|
-
description: "A new project has been created.",
|
|
598
|
-
stability: "stable",
|
|
599
|
-
owners: ["@saas-team"],
|
|
600
|
-
tags: ["project", "created"]
|
|
601
|
-
},
|
|
602
|
-
payload: ProjectCreatedPayload
|
|
603
|
-
});
|
|
604
|
-
var ProjectUpdatedEvent = defineEvent({
|
|
605
|
-
meta: {
|
|
606
|
-
key: "project.updated",
|
|
607
|
-
version: "1.0.0",
|
|
608
|
-
description: "A project has been updated.",
|
|
609
|
-
stability: "stable",
|
|
610
|
-
owners: ["@saas-team"],
|
|
611
|
-
tags: ["project", "updated"]
|
|
612
|
-
},
|
|
613
|
-
payload: ProjectUpdatedPayload
|
|
614
|
-
});
|
|
615
|
-
var ProjectDeletedEvent = defineEvent({
|
|
616
|
-
meta: {
|
|
617
|
-
key: "project.deleted",
|
|
618
|
-
version: "1.0.0",
|
|
619
|
-
description: "A project has been deleted.",
|
|
620
|
-
stability: "stable",
|
|
621
|
-
owners: ["@saas-team"],
|
|
622
|
-
tags: ["project", "deleted"]
|
|
623
|
-
},
|
|
624
|
-
payload: ProjectDeletedPayload
|
|
625
|
-
});
|
|
626
|
-
var ProjectArchivedEvent = defineEvent({
|
|
627
|
-
meta: {
|
|
628
|
-
key: "project.archived",
|
|
629
|
-
version: "1.0.0",
|
|
630
|
-
description: "A project has been archived.",
|
|
631
|
-
stability: "stable",
|
|
632
|
-
owners: ["@saas-team"],
|
|
633
|
-
tags: ["project", "archived"]
|
|
634
|
-
},
|
|
635
|
-
payload: ProjectArchivedPayload
|
|
636
|
-
});
|
|
637
|
-
|
|
638
|
-
// src/project/project.entity.ts
|
|
639
|
-
import {
|
|
640
|
-
defineEntity,
|
|
641
|
-
defineEntityEnum,
|
|
642
|
-
field,
|
|
643
|
-
index
|
|
644
|
-
} from "@contractspec/lib.schema";
|
|
645
|
-
var ProjectStatusEnum = defineEntityEnum({
|
|
646
|
-
name: "ProjectStatus",
|
|
647
|
-
values: ["DRAFT", "ACTIVE", "ARCHIVED", "DELETED"],
|
|
648
|
-
schema: "saas_app",
|
|
649
|
-
description: "Status of a project."
|
|
650
|
-
});
|
|
651
|
-
var ProjectEntity = defineEntity({
|
|
652
|
-
name: "Project",
|
|
653
|
-
description: "A project belonging to an organization.",
|
|
654
|
-
schema: "saas_app",
|
|
655
|
-
map: "project",
|
|
656
|
-
fields: {
|
|
657
|
-
id: field.id({ description: "Unique project ID" }),
|
|
658
|
-
name: field.string({ description: "Project name" }),
|
|
659
|
-
description: field.string({
|
|
660
|
-
isOptional: true,
|
|
661
|
-
description: "Project description"
|
|
662
|
-
}),
|
|
663
|
-
slug: field.string({
|
|
664
|
-
isOptional: true,
|
|
665
|
-
description: "URL-friendly identifier"
|
|
666
|
-
}),
|
|
667
|
-
organizationId: field.foreignKey({ description: "Owning organization" }),
|
|
668
|
-
createdBy: field.foreignKey({
|
|
669
|
-
description: "User who created the project"
|
|
670
|
-
}),
|
|
671
|
-
status: field.enum("ProjectStatus", { default: "DRAFT" }),
|
|
672
|
-
isPublic: field.boolean({
|
|
673
|
-
default: false,
|
|
674
|
-
description: "Whether project is publicly visible"
|
|
675
|
-
}),
|
|
676
|
-
settings: field.json({
|
|
677
|
-
isOptional: true,
|
|
678
|
-
description: "Project-specific settings"
|
|
679
|
-
}),
|
|
680
|
-
tags: field.string({ isArray: true, description: "Project tags" }),
|
|
681
|
-
metadata: field.json({ isOptional: true }),
|
|
682
|
-
createdAt: field.createdAt(),
|
|
683
|
-
updatedAt: field.updatedAt(),
|
|
684
|
-
archivedAt: field.dateTime({ isOptional: true })
|
|
685
|
-
},
|
|
686
|
-
indexes: [
|
|
687
|
-
index.on(["organizationId", "status"]),
|
|
688
|
-
index.on(["organizationId", "createdAt"]),
|
|
689
|
-
index.unique(["organizationId", "slug"])
|
|
690
|
-
],
|
|
691
|
-
enums: [ProjectStatusEnum]
|
|
692
|
-
});
|
|
693
|
-
var ProjectMemberEntity = defineEntity({
|
|
694
|
-
name: "ProjectMember",
|
|
695
|
-
description: "User access to a specific project.",
|
|
696
|
-
schema: "saas_app",
|
|
697
|
-
map: "project_member",
|
|
698
|
-
fields: {
|
|
699
|
-
id: field.id(),
|
|
700
|
-
projectId: field.foreignKey(),
|
|
701
|
-
userId: field.foreignKey(),
|
|
702
|
-
role: field.string({
|
|
703
|
-
description: "Role in project (owner, editor, viewer)"
|
|
704
|
-
}),
|
|
705
|
-
addedBy: field.string({ isOptional: true }),
|
|
706
|
-
createdAt: field.createdAt()
|
|
707
|
-
},
|
|
708
|
-
indexes: [index.unique(["projectId", "userId"])]
|
|
709
|
-
});
|
|
710
|
-
|
|
711
711
|
// src/project/project.presentation.ts
|
|
712
712
|
import {
|
|
713
713
|
definePresentation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/project/project.event.ts
|
|
3
|
-
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
4
3
|
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
4
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
5
5
|
var ProjectCreatedPayload = defineSchemaModel({
|
|
6
6
|
name: "ProjectCreatedPayload",
|
|
7
7
|
description: "Payload when a project is created",
|
package/dist/settings/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Settings domain - application, organization, and user settings.
|
|
3
3
|
*/
|
|
4
|
+
export { FeatureFlagEntity, SettingsEntity } from './settings.entity';
|
|
4
5
|
export { SettingsScopeEnum } from './settings.enum';
|
|
5
|
-
export { SettingsEntity, FeatureFlagEntity } from './settings.entity';
|