@contractspec/example.saas-boilerplate 3.7.5 → 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/CHANGELOG.md +16 -0
- 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 +14 -14
- 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
|
@@ -4,33 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
// Billing presentations
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
SubscriptionPresentation,
|
|
8
|
+
UsageDashboardPresentation,
|
|
9
9
|
} from '../billing/billing.presentation';
|
|
10
|
-
|
|
11
|
-
// Project presentations
|
|
12
|
-
export {
|
|
13
|
-
ProjectListPresentation,
|
|
14
|
-
ProjectDetailPresentation,
|
|
15
|
-
} from '../project/project.presentation';
|
|
16
|
-
|
|
17
10
|
// Dashboard presentations
|
|
18
11
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
SaasDashboardPresentation,
|
|
13
|
+
SettingsPanelPresentation,
|
|
21
14
|
} from '../dashboard/dashboard.presentation';
|
|
15
|
+
// Project presentations
|
|
16
|
+
export {
|
|
17
|
+
ProjectDetailPresentation,
|
|
18
|
+
ProjectListPresentation,
|
|
19
|
+
} from '../project/project.presentation';
|
|
22
20
|
|
|
23
21
|
// All presentations collection
|
|
24
22
|
export const SaasBoilerplatePresentations = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
// Billing
|
|
24
|
+
SubscriptionPresentation: undefined,
|
|
25
|
+
UsageDashboardPresentation: undefined,
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
// Project
|
|
28
|
+
ProjectListPresentation: undefined,
|
|
29
|
+
ProjectDetailPresentation: undefined,
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
// Dashboard
|
|
32
|
+
SaasDashboardPresentation: undefined,
|
|
33
|
+
SettingsPanelPresentation: undefined,
|
|
36
34
|
};
|
package/src/project/index.ts
CHANGED
|
@@ -2,65 +2,60 @@
|
|
|
2
2
|
* Project domain - project management within organizations.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
// Entities
|
|
6
|
+
export {
|
|
7
|
+
ProjectEntity,
|
|
8
|
+
ProjectMemberEntity,
|
|
9
|
+
ProjectStatusEnum,
|
|
10
|
+
} from './project.entity';
|
|
5
11
|
// Enums
|
|
6
12
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
ProjectStatusFilterEnum,
|
|
14
|
+
ProjectStatusSchemaEnum,
|
|
9
15
|
} from './project.enum';
|
|
10
|
-
|
|
11
|
-
// Schema models
|
|
12
|
-
export {
|
|
13
|
-
ProjectModel,
|
|
14
|
-
CreateProjectInputModel,
|
|
15
|
-
UpdateProjectInputModel,
|
|
16
|
-
GetProjectInputModel,
|
|
17
|
-
DeleteProjectInputModel,
|
|
18
|
-
DeleteProjectOutputModel,
|
|
19
|
-
ProjectDeletedPayloadModel,
|
|
20
|
-
ListProjectsInputModel,
|
|
21
|
-
ListProjectsOutputModel,
|
|
22
|
-
} from './project.schema';
|
|
23
|
-
|
|
24
|
-
// Contracts
|
|
25
|
-
export {
|
|
26
|
-
CreateProjectContract,
|
|
27
|
-
GetProjectContract,
|
|
28
|
-
UpdateProjectContract,
|
|
29
|
-
DeleteProjectContract,
|
|
30
|
-
ListProjectsContract,
|
|
31
|
-
} from './project.operations';
|
|
32
|
-
|
|
33
16
|
// Events
|
|
34
17
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
ProjectArchivedEvent,
|
|
19
|
+
ProjectCreatedEvent,
|
|
20
|
+
ProjectDeletedEvent,
|
|
21
|
+
ProjectUpdatedEvent,
|
|
39
22
|
} from './project.event';
|
|
40
|
-
|
|
41
|
-
// Entities
|
|
23
|
+
// Handlers
|
|
42
24
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
type CreateProjectInput,
|
|
26
|
+
type ListProjectsInput,
|
|
27
|
+
type ListProjectsOutput,
|
|
28
|
+
mockCreateProjectHandler,
|
|
29
|
+
mockDeleteProjectHandler,
|
|
30
|
+
mockGetProjectHandler,
|
|
31
|
+
mockListProjectsHandler,
|
|
32
|
+
mockUpdateProjectHandler,
|
|
33
|
+
type Project,
|
|
34
|
+
type UpdateProjectInput,
|
|
35
|
+
} from './project.handler';
|
|
36
|
+
// Contracts
|
|
37
|
+
export {
|
|
38
|
+
CreateProjectContract,
|
|
39
|
+
DeleteProjectContract,
|
|
40
|
+
GetProjectContract,
|
|
41
|
+
ListProjectsContract,
|
|
42
|
+
UpdateProjectContract,
|
|
43
|
+
} from './project.operations';
|
|
47
44
|
|
|
48
45
|
// Presentations
|
|
49
46
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
ProjectDetailPresentation,
|
|
48
|
+
ProjectListPresentation,
|
|
52
49
|
} from './project.presentation';
|
|
53
|
-
|
|
54
|
-
// Handlers
|
|
50
|
+
// Schema models
|
|
55
51
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} from './project.handler';
|
|
52
|
+
CreateProjectInputModel,
|
|
53
|
+
DeleteProjectInputModel,
|
|
54
|
+
DeleteProjectOutputModel,
|
|
55
|
+
GetProjectInputModel,
|
|
56
|
+
ListProjectsInputModel,
|
|
57
|
+
ListProjectsOutputModel,
|
|
58
|
+
ProjectDeletedPayloadModel,
|
|
59
|
+
ProjectModel,
|
|
60
|
+
UpdateProjectInputModel,
|
|
61
|
+
} from './project.schema';
|
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
defineEntity,
|
|
3
|
+
defineEntityEnum,
|
|
4
|
+
field,
|
|
5
|
+
index,
|
|
6
6
|
} from '@contractspec/lib.schema';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Project status enum for entities.
|
|
10
10
|
*/
|
|
11
11
|
export const ProjectStatusEnum = defineEntityEnum({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
name: 'ProjectStatus',
|
|
13
|
+
values: ['DRAFT', 'ACTIVE', 'ARCHIVED', 'DELETED'] as const,
|
|
14
|
+
schema: 'saas_app',
|
|
15
|
+
description: 'Status of a project.',
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Project entity - team-scoped work container.
|
|
20
20
|
*/
|
|
21
21
|
export const ProjectEntity = defineEntity({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
name: 'Project',
|
|
23
|
+
description: 'A project belonging to an organization.',
|
|
24
|
+
schema: 'saas_app',
|
|
25
|
+
map: 'project',
|
|
26
|
+
fields: {
|
|
27
|
+
id: field.id({ description: 'Unique project ID' }),
|
|
28
|
+
name: field.string({ description: 'Project name' }),
|
|
29
|
+
description: field.string({
|
|
30
|
+
isOptional: true,
|
|
31
|
+
description: 'Project description',
|
|
32
|
+
}),
|
|
33
|
+
slug: field.string({
|
|
34
|
+
isOptional: true,
|
|
35
|
+
description: 'URL-friendly identifier',
|
|
36
|
+
}),
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
// Ownership
|
|
39
|
+
organizationId: field.foreignKey({ description: 'Owning organization' }),
|
|
40
|
+
createdBy: field.foreignKey({
|
|
41
|
+
description: 'User who created the project',
|
|
42
|
+
}),
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// Status
|
|
45
|
+
status: field.enum('ProjectStatus', { default: 'DRAFT' }),
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
// Settings
|
|
48
|
+
isPublic: field.boolean({
|
|
49
|
+
default: false,
|
|
50
|
+
description: 'Whether project is publicly visible',
|
|
51
|
+
}),
|
|
52
|
+
settings: field.json({
|
|
53
|
+
isOptional: true,
|
|
54
|
+
description: 'Project-specific settings',
|
|
55
|
+
}),
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
// Metadata
|
|
58
|
+
tags: field.string({ isArray: true, description: 'Project tags' }),
|
|
59
|
+
metadata: field.json({ isOptional: true }),
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
// Timestamps
|
|
62
|
+
createdAt: field.createdAt(),
|
|
63
|
+
updatedAt: field.updatedAt(),
|
|
64
|
+
archivedAt: field.dateTime({ isOptional: true }),
|
|
65
|
+
},
|
|
66
|
+
indexes: [
|
|
67
|
+
index.on(['organizationId', 'status']),
|
|
68
|
+
index.on(['organizationId', 'createdAt']),
|
|
69
|
+
index.unique(['organizationId', 'slug']),
|
|
70
|
+
],
|
|
71
|
+
enums: [ProjectStatusEnum],
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* ProjectMember entity - project-level access.
|
|
76
76
|
*/
|
|
77
77
|
export const ProjectMemberEntity = defineEntity({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
name: 'ProjectMember',
|
|
79
|
+
description: 'User access to a specific project.',
|
|
80
|
+
schema: 'saas_app',
|
|
81
|
+
map: 'project_member',
|
|
82
|
+
fields: {
|
|
83
|
+
id: field.id(),
|
|
84
|
+
projectId: field.foreignKey(),
|
|
85
|
+
userId: field.foreignKey(),
|
|
86
|
+
role: field.string({
|
|
87
|
+
description: 'Role in project (owner, editor, viewer)',
|
|
88
|
+
}),
|
|
89
|
+
addedBy: field.string({ isOptional: true }),
|
|
90
|
+
createdAt: field.createdAt(),
|
|
91
|
+
},
|
|
92
|
+
indexes: [index.unique(['projectId', 'userId'])],
|
|
93
93
|
});
|
|
@@ -5,18 +5,18 @@ import { defineEnum } from '@contractspec/lib.schema';
|
|
|
5
5
|
* Note: Entity enum is defined separately in project.entity.ts
|
|
6
6
|
*/
|
|
7
7
|
export const ProjectStatusSchemaEnum = defineEnum('ProjectStatus', [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
'DRAFT',
|
|
9
|
+
'ACTIVE',
|
|
10
|
+
'ARCHIVED',
|
|
11
|
+
'DELETED',
|
|
12
12
|
]);
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Project status filter enum (includes 'all' option).
|
|
16
16
|
*/
|
|
17
17
|
export const ProjectStatusFilterEnum = defineEnum('ProjectStatusFilter', [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
'DRAFT',
|
|
19
|
+
'ACTIVE',
|
|
20
|
+
'ARCHIVED',
|
|
21
|
+
'all',
|
|
22
22
|
]);
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';
|
|
2
1
|
import { defineEvent } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Payload when a project is created.
|
|
6
6
|
*/
|
|
7
7
|
const ProjectCreatedPayload = defineSchemaModel({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
name: 'ProjectCreatedPayload',
|
|
9
|
+
description: 'Payload when a project is created',
|
|
10
|
+
fields: {
|
|
11
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
organizationId: {
|
|
14
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
15
|
+
isOptional: false,
|
|
16
|
+
},
|
|
17
|
+
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
19
|
+
},
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Payload when a project is updated.
|
|
24
24
|
*/
|
|
25
25
|
const ProjectUpdatedPayload = defineSchemaModel({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
name: 'ProjectUpdatedPayload',
|
|
27
|
+
description: 'Payload when a project is updated',
|
|
28
|
+
fields: {
|
|
29
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
+
updatedFields: {
|
|
31
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
32
|
+
isArray: true,
|
|
33
|
+
isOptional: false,
|
|
34
|
+
},
|
|
35
|
+
updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
36
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
37
|
+
},
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Payload when a project is deleted.
|
|
42
42
|
*/
|
|
43
43
|
const ProjectDeletedPayload = defineSchemaModel({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
name: 'ProjectDeletedPayload',
|
|
45
|
+
description: 'Payload when a project is deleted',
|
|
46
|
+
fields: {
|
|
47
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
48
|
+
organizationId: {
|
|
49
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
+
isOptional: false,
|
|
51
|
+
},
|
|
52
|
+
deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
53
|
+
deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
54
|
+
},
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Payload when a project is archived.
|
|
59
59
|
*/
|
|
60
60
|
const ProjectArchivedPayload = defineSchemaModel({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
name: 'ProjectArchivedPayload',
|
|
62
|
+
description: 'Payload when a project is archived',
|
|
63
|
+
fields: {
|
|
64
|
+
projectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
65
|
+
archivedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
66
|
+
archivedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
67
|
+
},
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Event: A new project has been created.
|
|
72
72
|
*/
|
|
73
73
|
export const ProjectCreatedEvent = defineEvent({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
meta: {
|
|
75
|
+
key: 'project.created',
|
|
76
|
+
version: '1.0.0',
|
|
77
|
+
description: 'A new project has been created.',
|
|
78
|
+
stability: 'stable',
|
|
79
|
+
owners: ['@saas-team'],
|
|
80
|
+
tags: ['project', 'created'],
|
|
81
|
+
},
|
|
82
|
+
payload: ProjectCreatedPayload,
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Event: A project has been updated.
|
|
87
87
|
*/
|
|
88
88
|
export const ProjectUpdatedEvent = defineEvent({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
meta: {
|
|
90
|
+
key: 'project.updated',
|
|
91
|
+
version: '1.0.0',
|
|
92
|
+
description: 'A project has been updated.',
|
|
93
|
+
stability: 'stable',
|
|
94
|
+
owners: ['@saas-team'],
|
|
95
|
+
tags: ['project', 'updated'],
|
|
96
|
+
},
|
|
97
|
+
payload: ProjectUpdatedPayload,
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Event: A project has been deleted.
|
|
102
102
|
*/
|
|
103
103
|
export const ProjectDeletedEvent = defineEvent({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
meta: {
|
|
105
|
+
key: 'project.deleted',
|
|
106
|
+
version: '1.0.0',
|
|
107
|
+
description: 'A project has been deleted.',
|
|
108
|
+
stability: 'stable',
|
|
109
|
+
owners: ['@saas-team'],
|
|
110
|
+
tags: ['project', 'deleted'],
|
|
111
|
+
},
|
|
112
|
+
payload: ProjectDeletedPayload,
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Event: A project has been archived.
|
|
117
117
|
*/
|
|
118
118
|
export const ProjectArchivedEvent = defineEvent({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
meta: {
|
|
120
|
+
key: 'project.archived',
|
|
121
|
+
version: '1.0.0',
|
|
122
|
+
description: 'A project has been archived.',
|
|
123
|
+
stability: 'stable',
|
|
124
|
+
owners: ['@saas-team'],
|
|
125
|
+
tags: ['project', 'archived'],
|
|
126
|
+
},
|
|
127
|
+
payload: ProjectArchivedPayload,
|
|
128
128
|
});
|