@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
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
// src/project/project.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var ProjectStatusSchemaEnum = defineEnum("ProjectStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"ARCHIVED",
|
|
7
|
+
"DELETED"
|
|
8
|
+
]);
|
|
9
|
+
var ProjectStatusFilterEnum = defineEnum("ProjectStatusFilter", [
|
|
10
|
+
"DRAFT",
|
|
11
|
+
"ACTIVE",
|
|
12
|
+
"ARCHIVED",
|
|
13
|
+
"all"
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
// src/project/project.schema.ts
|
|
17
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
18
|
+
var ProjectModel = defineSchemaModel({
|
|
19
|
+
name: "Project",
|
|
20
|
+
description: "A project within an organization",
|
|
21
|
+
fields: {
|
|
22
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
26
|
+
organizationId: {
|
|
27
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
28
|
+
isOptional: false
|
|
29
|
+
},
|
|
30
|
+
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: false },
|
|
32
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
33
|
+
tags: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isArray: true,
|
|
36
|
+
isOptional: false
|
|
37
|
+
},
|
|
38
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
39
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var CreateProjectInputModel = defineSchemaModel({
|
|
43
|
+
name: "CreateProjectInput",
|
|
44
|
+
description: "Input for creating a project",
|
|
45
|
+
fields: {
|
|
46
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
47
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
48
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
49
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
50
|
+
tags: {
|
|
51
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
+
isArray: true,
|
|
53
|
+
isOptional: true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
var UpdateProjectInputModel = defineSchemaModel({
|
|
58
|
+
name: "UpdateProjectInput",
|
|
59
|
+
description: "Input for updating a project",
|
|
60
|
+
fields: {
|
|
61
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
62
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
63
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
64
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
65
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
66
|
+
tags: {
|
|
67
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
+
isArray: true,
|
|
69
|
+
isOptional: true
|
|
70
|
+
},
|
|
71
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: true }
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var GetProjectInputModel = defineSchemaModel({
|
|
75
|
+
name: "GetProjectInput",
|
|
76
|
+
fields: {
|
|
77
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
var DeleteProjectInputModel = defineSchemaModel({
|
|
81
|
+
name: "DeleteProjectInput",
|
|
82
|
+
fields: {
|
|
83
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
var DeleteProjectOutputModel = defineSchemaModel({
|
|
87
|
+
name: "DeleteProjectOutput",
|
|
88
|
+
fields: {
|
|
89
|
+
success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var ProjectDeletedPayloadModel = defineSchemaModel({
|
|
93
|
+
name: "ProjectDeletedPayload",
|
|
94
|
+
fields: {
|
|
95
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var ListProjectsInputModel = defineSchemaModel({
|
|
99
|
+
name: "ListProjectsInput",
|
|
100
|
+
description: "Input for listing projects",
|
|
101
|
+
fields: {
|
|
102
|
+
status: { type: ProjectStatusFilterEnum, isOptional: true },
|
|
103
|
+
search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
104
|
+
limit: {
|
|
105
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
106
|
+
isOptional: true,
|
|
107
|
+
defaultValue: 20
|
|
108
|
+
},
|
|
109
|
+
offset: {
|
|
110
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
111
|
+
isOptional: true,
|
|
112
|
+
defaultValue: 0
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
var ListProjectsOutputModel = defineSchemaModel({
|
|
117
|
+
name: "ListProjectsOutput",
|
|
118
|
+
description: "Output for listing projects",
|
|
119
|
+
fields: {
|
|
120
|
+
projects: { type: ProjectModel, isArray: true, isOptional: false },
|
|
121
|
+
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// src/project/project.operations.ts
|
|
126
|
+
import {
|
|
127
|
+
defineCommand,
|
|
128
|
+
defineQuery
|
|
129
|
+
} from "@contractspec/lib.contracts/operations";
|
|
130
|
+
var OWNERS = ["example.saas-boilerplate"];
|
|
131
|
+
var CreateProjectContract = defineCommand({
|
|
132
|
+
meta: {
|
|
133
|
+
key: "saas.project.create",
|
|
134
|
+
version: "1.0.0",
|
|
135
|
+
stability: "stable",
|
|
136
|
+
owners: [...OWNERS],
|
|
137
|
+
tags: ["saas", "project", "create"],
|
|
138
|
+
description: "Create a new project in the organization.",
|
|
139
|
+
goal: "Allow users to create projects for organizing work.",
|
|
140
|
+
context: "Called from project creation UI or API."
|
|
141
|
+
},
|
|
142
|
+
io: {
|
|
143
|
+
input: CreateProjectInputModel,
|
|
144
|
+
output: ProjectModel,
|
|
145
|
+
errors: {
|
|
146
|
+
SLUG_EXISTS: {
|
|
147
|
+
description: "A project with this slug already exists",
|
|
148
|
+
http: 409,
|
|
149
|
+
gqlCode: "SLUG_EXISTS",
|
|
150
|
+
when: "Slug is already taken in the organization"
|
|
151
|
+
},
|
|
152
|
+
LIMIT_REACHED: {
|
|
153
|
+
description: "Project limit reached for this plan",
|
|
154
|
+
http: 403,
|
|
155
|
+
gqlCode: "LIMIT_REACHED",
|
|
156
|
+
when: "Organization has reached project limit"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
policy: {
|
|
161
|
+
auth: "user"
|
|
162
|
+
},
|
|
163
|
+
sideEffects: {
|
|
164
|
+
emits: [
|
|
165
|
+
{
|
|
166
|
+
key: "project.created",
|
|
167
|
+
version: "1.0.0",
|
|
168
|
+
when: "Project is created",
|
|
169
|
+
payload: ProjectModel
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
audit: ["project.created"]
|
|
173
|
+
},
|
|
174
|
+
acceptance: {
|
|
175
|
+
scenarios: [
|
|
176
|
+
{
|
|
177
|
+
key: "create-project-happy-path",
|
|
178
|
+
given: ["User is authenticated"],
|
|
179
|
+
when: ["User creates project"],
|
|
180
|
+
then: ["Project is created", "ProjectCreated event is emitted"]
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
examples: [
|
|
184
|
+
{
|
|
185
|
+
key: "create-basic",
|
|
186
|
+
input: { name: "Website Redesign", slug: "website-redesign" },
|
|
187
|
+
output: { id: "proj-123", name: "Website Redesign", isArchived: false }
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
var GetProjectContract = defineQuery({
|
|
193
|
+
meta: {
|
|
194
|
+
key: "saas.project.get",
|
|
195
|
+
version: "1.0.0",
|
|
196
|
+
stability: "stable",
|
|
197
|
+
owners: [...OWNERS],
|
|
198
|
+
tags: ["saas", "project", "get"],
|
|
199
|
+
description: "Get a project by ID.",
|
|
200
|
+
goal: "Retrieve project details.",
|
|
201
|
+
context: "Project detail page, API calls."
|
|
202
|
+
},
|
|
203
|
+
io: {
|
|
204
|
+
input: GetProjectInputModel,
|
|
205
|
+
output: ProjectModel,
|
|
206
|
+
errors: {
|
|
207
|
+
NOT_FOUND: {
|
|
208
|
+
description: "Project not found",
|
|
209
|
+
http: 404,
|
|
210
|
+
gqlCode: "NOT_FOUND",
|
|
211
|
+
when: "Project ID is invalid or user lacks access"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
policy: {
|
|
216
|
+
auth: "user"
|
|
217
|
+
},
|
|
218
|
+
acceptance: {
|
|
219
|
+
scenarios: [
|
|
220
|
+
{
|
|
221
|
+
key: "get-project-happy-path",
|
|
222
|
+
given: ["Project exists"],
|
|
223
|
+
when: ["User requests project"],
|
|
224
|
+
then: ["Project details are returned"]
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
examples: [
|
|
228
|
+
{
|
|
229
|
+
key: "get-existing",
|
|
230
|
+
input: { projectId: "proj-123" },
|
|
231
|
+
output: { id: "proj-123", name: "Website Redesign" }
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
var UpdateProjectContract = defineCommand({
|
|
237
|
+
meta: {
|
|
238
|
+
key: "saas.project.update",
|
|
239
|
+
version: "1.0.0",
|
|
240
|
+
stability: "stable",
|
|
241
|
+
owners: [...OWNERS],
|
|
242
|
+
tags: ["saas", "project", "update"],
|
|
243
|
+
description: "Update project details.",
|
|
244
|
+
goal: "Allow project owners/editors to modify project.",
|
|
245
|
+
context: "Project settings page."
|
|
246
|
+
},
|
|
247
|
+
io: {
|
|
248
|
+
input: UpdateProjectInputModel,
|
|
249
|
+
output: ProjectModel
|
|
250
|
+
},
|
|
251
|
+
policy: {
|
|
252
|
+
auth: "user"
|
|
253
|
+
},
|
|
254
|
+
sideEffects: {
|
|
255
|
+
emits: [
|
|
256
|
+
{
|
|
257
|
+
key: "project.updated",
|
|
258
|
+
version: "1.0.0",
|
|
259
|
+
when: "Project is updated",
|
|
260
|
+
payload: ProjectModel
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
audit: ["project.updated"]
|
|
264
|
+
},
|
|
265
|
+
acceptance: {
|
|
266
|
+
scenarios: [
|
|
267
|
+
{
|
|
268
|
+
key: "update-project-happy-path",
|
|
269
|
+
given: ["Project exists"],
|
|
270
|
+
when: ["User updates description"],
|
|
271
|
+
then: ["Project is updated", "ProjectUpdated event is emitted"]
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
examples: [
|
|
275
|
+
{
|
|
276
|
+
key: "update-desc",
|
|
277
|
+
input: { projectId: "proj-123", description: "New description" },
|
|
278
|
+
output: { id: "proj-123", description: "New description" }
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
var DeleteProjectContract = defineCommand({
|
|
284
|
+
meta: {
|
|
285
|
+
key: "saas.project.delete",
|
|
286
|
+
version: "1.0.0",
|
|
287
|
+
stability: "stable",
|
|
288
|
+
owners: [...OWNERS],
|
|
289
|
+
tags: ["saas", "project", "delete"],
|
|
290
|
+
description: "Delete a project (soft delete).",
|
|
291
|
+
goal: "Allow project owners to remove projects.",
|
|
292
|
+
context: "Project settings page."
|
|
293
|
+
},
|
|
294
|
+
io: {
|
|
295
|
+
input: DeleteProjectInputModel,
|
|
296
|
+
output: DeleteProjectOutputModel
|
|
297
|
+
},
|
|
298
|
+
policy: {
|
|
299
|
+
auth: "user"
|
|
300
|
+
},
|
|
301
|
+
sideEffects: {
|
|
302
|
+
emits: [
|
|
303
|
+
{
|
|
304
|
+
key: "project.deleted",
|
|
305
|
+
version: "1.0.0",
|
|
306
|
+
when: "Project is deleted",
|
|
307
|
+
payload: ProjectDeletedPayloadModel
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
audit: ["project.deleted"]
|
|
311
|
+
},
|
|
312
|
+
acceptance: {
|
|
313
|
+
scenarios: [
|
|
314
|
+
{
|
|
315
|
+
key: "delete-project-happy-path",
|
|
316
|
+
given: ["Project exists"],
|
|
317
|
+
when: ["User deletes project"],
|
|
318
|
+
then: ["Project is deleted", "ProjectDeleted event is emitted"]
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
examples: [
|
|
322
|
+
{
|
|
323
|
+
key: "delete-existing",
|
|
324
|
+
input: { projectId: "proj-123" },
|
|
325
|
+
output: { success: true }
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
var ListProjectsContract = defineQuery({
|
|
331
|
+
meta: {
|
|
332
|
+
key: "saas.project.list",
|
|
333
|
+
version: "1.0.0",
|
|
334
|
+
stability: "stable",
|
|
335
|
+
owners: [...OWNERS],
|
|
336
|
+
tags: ["saas", "project", "list"],
|
|
337
|
+
description: "List projects in the organization.",
|
|
338
|
+
goal: "Show all projects user has access to.",
|
|
339
|
+
context: "Project list page, dashboard."
|
|
340
|
+
},
|
|
341
|
+
io: {
|
|
342
|
+
input: ListProjectsInputModel,
|
|
343
|
+
output: ListProjectsOutputModel
|
|
344
|
+
},
|
|
345
|
+
policy: {
|
|
346
|
+
auth: "user"
|
|
347
|
+
},
|
|
348
|
+
acceptance: {
|
|
349
|
+
scenarios: [
|
|
350
|
+
{
|
|
351
|
+
key: "list-projects-happy-path",
|
|
352
|
+
given: ["Projects exist"],
|
|
353
|
+
when: ["User lists projects"],
|
|
354
|
+
then: ["List of projects is returned"]
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
examples: [
|
|
358
|
+
{
|
|
359
|
+
key: "list-all",
|
|
360
|
+
input: { limit: 10 },
|
|
361
|
+
output: { items: [], total: 5 }
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
export {
|
|
367
|
+
UpdateProjectContract,
|
|
368
|
+
ListProjectsContract,
|
|
369
|
+
GetProjectContract,
|
|
370
|
+
DeleteProjectContract,
|
|
371
|
+
CreateProjectContract
|
|
372
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// src/project/project.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var ProjectStatusSchemaEnum = defineEnum("ProjectStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"ARCHIVED",
|
|
7
|
+
"DELETED"
|
|
8
|
+
]);
|
|
9
|
+
var ProjectStatusFilterEnum = defineEnum("ProjectStatusFilter", [
|
|
10
|
+
"DRAFT",
|
|
11
|
+
"ACTIVE",
|
|
12
|
+
"ARCHIVED",
|
|
13
|
+
"all"
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
// src/project/project.schema.ts
|
|
17
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
18
|
+
var ProjectModel = defineSchemaModel({
|
|
19
|
+
name: "Project",
|
|
20
|
+
description: "A project within an organization",
|
|
21
|
+
fields: {
|
|
22
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
26
|
+
organizationId: {
|
|
27
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
28
|
+
isOptional: false
|
|
29
|
+
},
|
|
30
|
+
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: false },
|
|
32
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
33
|
+
tags: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isArray: true,
|
|
36
|
+
isOptional: false
|
|
37
|
+
},
|
|
38
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
39
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var CreateProjectInputModel = defineSchemaModel({
|
|
43
|
+
name: "CreateProjectInput",
|
|
44
|
+
description: "Input for creating a project",
|
|
45
|
+
fields: {
|
|
46
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
47
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
48
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
49
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
50
|
+
tags: {
|
|
51
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
+
isArray: true,
|
|
53
|
+
isOptional: true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
var UpdateProjectInputModel = defineSchemaModel({
|
|
58
|
+
name: "UpdateProjectInput",
|
|
59
|
+
description: "Input for updating a project",
|
|
60
|
+
fields: {
|
|
61
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
62
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
63
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
64
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
65
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
66
|
+
tags: {
|
|
67
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
+
isArray: true,
|
|
69
|
+
isOptional: true
|
|
70
|
+
},
|
|
71
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: true }
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var GetProjectInputModel = defineSchemaModel({
|
|
75
|
+
name: "GetProjectInput",
|
|
76
|
+
fields: {
|
|
77
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
var DeleteProjectInputModel = defineSchemaModel({
|
|
81
|
+
name: "DeleteProjectInput",
|
|
82
|
+
fields: {
|
|
83
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
var DeleteProjectOutputModel = defineSchemaModel({
|
|
87
|
+
name: "DeleteProjectOutput",
|
|
88
|
+
fields: {
|
|
89
|
+
success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var ProjectDeletedPayloadModel = defineSchemaModel({
|
|
93
|
+
name: "ProjectDeletedPayload",
|
|
94
|
+
fields: {
|
|
95
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var ListProjectsInputModel = defineSchemaModel({
|
|
99
|
+
name: "ListProjectsInput",
|
|
100
|
+
description: "Input for listing projects",
|
|
101
|
+
fields: {
|
|
102
|
+
status: { type: ProjectStatusFilterEnum, isOptional: true },
|
|
103
|
+
search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
104
|
+
limit: {
|
|
105
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
106
|
+
isOptional: true,
|
|
107
|
+
defaultValue: 20
|
|
108
|
+
},
|
|
109
|
+
offset: {
|
|
110
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
111
|
+
isOptional: true,
|
|
112
|
+
defaultValue: 0
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
var ListProjectsOutputModel = defineSchemaModel({
|
|
117
|
+
name: "ListProjectsOutput",
|
|
118
|
+
description: "Output for listing projects",
|
|
119
|
+
fields: {
|
|
120
|
+
projects: { type: ProjectModel, isArray: true, isOptional: false },
|
|
121
|
+
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// src/project/project.presentation.ts
|
|
126
|
+
import { definePresentation, StabilityEnum } from "@contractspec/lib.contracts";
|
|
127
|
+
var ProjectListPresentation = definePresentation({
|
|
128
|
+
meta: {
|
|
129
|
+
key: "saas.project.list",
|
|
130
|
+
version: "1.0.0",
|
|
131
|
+
title: "Project List",
|
|
132
|
+
description: "List view of projects with status, tags, and last updated info",
|
|
133
|
+
domain: "saas-boilerplate",
|
|
134
|
+
owners: ["@saas-team"],
|
|
135
|
+
tags: ["project", "list", "dashboard"],
|
|
136
|
+
stability: StabilityEnum.Beta,
|
|
137
|
+
goal: "Browse and manage projects",
|
|
138
|
+
context: "Project list page"
|
|
139
|
+
},
|
|
140
|
+
source: {
|
|
141
|
+
type: "component",
|
|
142
|
+
framework: "react",
|
|
143
|
+
componentKey: "ProjectListView",
|
|
144
|
+
props: ProjectModel
|
|
145
|
+
},
|
|
146
|
+
targets: ["react", "markdown", "application/json"],
|
|
147
|
+
policy: {
|
|
148
|
+
flags: ["saas.projects.enabled"]
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
var ProjectDetailPresentation = definePresentation({
|
|
152
|
+
meta: {
|
|
153
|
+
key: "saas.project.detail",
|
|
154
|
+
version: "1.0.0",
|
|
155
|
+
title: "Project Details",
|
|
156
|
+
description: "Detailed view of a project with settings and activity",
|
|
157
|
+
domain: "saas-boilerplate",
|
|
158
|
+
owners: ["@saas-team"],
|
|
159
|
+
tags: ["project", "detail"],
|
|
160
|
+
stability: StabilityEnum.Beta,
|
|
161
|
+
goal: "View and edit project details",
|
|
162
|
+
context: "Project detail page"
|
|
163
|
+
},
|
|
164
|
+
source: {
|
|
165
|
+
type: "component",
|
|
166
|
+
framework: "react",
|
|
167
|
+
componentKey: "ProjectDetailView"
|
|
168
|
+
},
|
|
169
|
+
targets: ["react", "markdown"],
|
|
170
|
+
policy: {
|
|
171
|
+
flags: ["saas.projects.enabled"]
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
ProjectListPresentation,
|
|
176
|
+
ProjectDetailPresentation
|
|
177
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// src/project/project.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var ProjectStatusSchemaEnum = defineEnum("ProjectStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"ARCHIVED",
|
|
7
|
+
"DELETED"
|
|
8
|
+
]);
|
|
9
|
+
var ProjectStatusFilterEnum = defineEnum("ProjectStatusFilter", [
|
|
10
|
+
"DRAFT",
|
|
11
|
+
"ACTIVE",
|
|
12
|
+
"ARCHIVED",
|
|
13
|
+
"all"
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
// src/project/project.schema.ts
|
|
17
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
18
|
+
var ProjectModel = defineSchemaModel({
|
|
19
|
+
name: "Project",
|
|
20
|
+
description: "A project within an organization",
|
|
21
|
+
fields: {
|
|
22
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
26
|
+
organizationId: {
|
|
27
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
28
|
+
isOptional: false
|
|
29
|
+
},
|
|
30
|
+
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: false },
|
|
32
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
33
|
+
tags: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isArray: true,
|
|
36
|
+
isOptional: false
|
|
37
|
+
},
|
|
38
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
39
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var CreateProjectInputModel = defineSchemaModel({
|
|
43
|
+
name: "CreateProjectInput",
|
|
44
|
+
description: "Input for creating a project",
|
|
45
|
+
fields: {
|
|
46
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
47
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
48
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
49
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
50
|
+
tags: {
|
|
51
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
+
isArray: true,
|
|
53
|
+
isOptional: true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
var UpdateProjectInputModel = defineSchemaModel({
|
|
58
|
+
name: "UpdateProjectInput",
|
|
59
|
+
description: "Input for updating a project",
|
|
60
|
+
fields: {
|
|
61
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
62
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
63
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
64
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
65
|
+
isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
66
|
+
tags: {
|
|
67
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
+
isArray: true,
|
|
69
|
+
isOptional: true
|
|
70
|
+
},
|
|
71
|
+
status: { type: ProjectStatusSchemaEnum, isOptional: true }
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var GetProjectInputModel = defineSchemaModel({
|
|
75
|
+
name: "GetProjectInput",
|
|
76
|
+
fields: {
|
|
77
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
var DeleteProjectInputModel = defineSchemaModel({
|
|
81
|
+
name: "DeleteProjectInput",
|
|
82
|
+
fields: {
|
|
83
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
var DeleteProjectOutputModel = defineSchemaModel({
|
|
87
|
+
name: "DeleteProjectOutput",
|
|
88
|
+
fields: {
|
|
89
|
+
success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var ProjectDeletedPayloadModel = defineSchemaModel({
|
|
93
|
+
name: "ProjectDeletedPayload",
|
|
94
|
+
fields: {
|
|
95
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var ListProjectsInputModel = defineSchemaModel({
|
|
99
|
+
name: "ListProjectsInput",
|
|
100
|
+
description: "Input for listing projects",
|
|
101
|
+
fields: {
|
|
102
|
+
status: { type: ProjectStatusFilterEnum, isOptional: true },
|
|
103
|
+
search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
104
|
+
limit: {
|
|
105
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
106
|
+
isOptional: true,
|
|
107
|
+
defaultValue: 20
|
|
108
|
+
},
|
|
109
|
+
offset: {
|
|
110
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
111
|
+
isOptional: true,
|
|
112
|
+
defaultValue: 0
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
var ListProjectsOutputModel = defineSchemaModel({
|
|
117
|
+
name: "ListProjectsOutput",
|
|
118
|
+
description: "Output for listing projects",
|
|
119
|
+
fields: {
|
|
120
|
+
projects: { type: ProjectModel, isArray: true, isOptional: false },
|
|
121
|
+
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
export {
|
|
125
|
+
UpdateProjectInputModel,
|
|
126
|
+
ProjectModel,
|
|
127
|
+
ProjectDeletedPayloadModel,
|
|
128
|
+
ListProjectsOutputModel,
|
|
129
|
+
ListProjectsInputModel,
|
|
130
|
+
GetProjectInputModel,
|
|
131
|
+
DeleteProjectOutputModel,
|
|
132
|
+
DeleteProjectInputModel,
|
|
133
|
+
CreateProjectInputModel
|
|
134
|
+
};
|