@contractspec/example.team-hub 1.56.1 → 1.58.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/dist/announcement/announcement.operations.d.ts +50 -56
- package/dist/announcement/announcement.operations.d.ts.map +1 -1
- package/dist/announcement/announcement.operations.js +70 -51
- package/dist/announcement/announcement.schema.d.ts +50 -55
- package/dist/announcement/announcement.schema.d.ts.map +1 -1
- package/dist/announcement/announcement.schema.js +29 -71
- package/dist/announcement/index.d.ts +6 -3
- package/dist/announcement/index.d.ts.map +1 -0
- package/dist/announcement/index.js +73 -3
- package/dist/browser/announcement/announcement.operations.js +71 -0
- package/dist/browser/announcement/announcement.schema.js +30 -0
- package/dist/browser/announcement/index.js +73 -0
- package/dist/browser/docs/index.js +94 -0
- package/dist/browser/docs/team-hub.docblock.js +94 -0
- package/dist/browser/entities/index.js +231 -0
- package/dist/browser/events.js +134 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +5 -0
- package/dist/browser/index.js +642 -0
- package/dist/browser/presentations/index.js +131 -0
- package/dist/browser/presentations/team-hub.presentation.js +131 -0
- package/dist/browser/presentations.js +148 -0
- package/dist/browser/ritual/index.js +124 -0
- package/dist/browser/ritual/ritual.operations.js +121 -0
- package/dist/browser/ritual/ritual.schema.js +41 -0
- package/dist/browser/space/index.js +66 -0
- package/dist/browser/space/space.operations.js +64 -0
- package/dist/browser/space/space.schema.js +27 -0
- package/dist/browser/task/index.js +171 -0
- package/dist/browser/task/task.operations.js +168 -0
- package/dist/browser/task/task.schema.js +40 -0
- package/dist/browser/team-hub.capability.js +40 -0
- package/dist/browser/team-hub.feature.js +69 -0
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +95 -1
- package/dist/docs/team-hub.docblock.d.ts +2 -1
- package/dist/docs/team-hub.docblock.d.ts.map +1 -0
- package/dist/docs/team-hub.docblock.js +45 -56
- package/dist/entities/index.d.ts +138 -143
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +221 -252
- package/dist/events.d.ts +217 -223
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +122 -201
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +40 -55
- package/dist/handlers/index.d.ts +1 -4
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +5 -8
- package/dist/index.d.ts +12 -15
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +642 -15
- package/dist/node/announcement/announcement.operations.js +71 -0
- package/dist/node/announcement/announcement.schema.js +30 -0
- package/dist/node/announcement/index.js +73 -0
- package/dist/node/docs/index.js +94 -0
- package/dist/node/docs/team-hub.docblock.js +94 -0
- package/dist/node/entities/index.js +231 -0
- package/dist/node/events.js +134 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +5 -0
- package/dist/node/index.js +642 -0
- package/dist/node/presentations/index.js +131 -0
- package/dist/node/presentations/team-hub.presentation.js +131 -0
- package/dist/node/presentations.js +148 -0
- package/dist/node/ritual/index.js +124 -0
- package/dist/node/ritual/ritual.operations.js +121 -0
- package/dist/node/ritual/ritual.schema.js +41 -0
- package/dist/node/space/index.js +66 -0
- package/dist/node/space/space.operations.js +64 -0
- package/dist/node/space/space.schema.js +27 -0
- package/dist/node/task/index.js +171 -0
- package/dist/node/task/task.operations.js +168 -0
- package/dist/node/task/task.schema.js +40 -0
- package/dist/node/team-hub.capability.js +40 -0
- package/dist/node/team-hub.feature.js +69 -0
- package/dist/presentations/index.d.ts +2 -2
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +132 -3
- package/dist/presentations/team-hub.presentation.d.ts +6 -11
- package/dist/presentations/team-hub.presentation.d.ts.map +1 -1
- package/dist/presentations/team-hub.presentation.js +126 -125
- package/dist/presentations.d.ts +7 -11
- package/dist/presentations.d.ts.map +1 -1
- package/dist/presentations.js +142 -147
- package/dist/ritual/index.d.ts +6 -3
- package/dist/ritual/index.d.ts.map +1 -0
- package/dist/ritual/index.js +124 -3
- package/dist/ritual/ritual.operations.d.ts +92 -98
- package/dist/ritual/ritual.operations.d.ts.map +1 -1
- package/dist/ritual/ritual.operations.js +119 -95
- package/dist/ritual/ritual.schema.d.ts +67 -72
- package/dist/ritual/ritual.schema.d.ts.map +1 -1
- package/dist/ritual/ritual.schema.js +39 -95
- package/dist/space/index.d.ts +6 -3
- package/dist/space/index.d.ts.map +1 -0
- package/dist/space/index.js +66 -3
- package/dist/space/space.operations.d.ts +38 -44
- package/dist/space/space.operations.d.ts.map +1 -1
- package/dist/space/space.operations.js +63 -50
- package/dist/space/space.schema.d.ts +38 -43
- package/dist/space/space.schema.d.ts.map +1 -1
- package/dist/space/space.schema.js +26 -59
- package/dist/task/index.d.ts +6 -3
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +171 -3
- package/dist/task/task.operations.d.ts +212 -218
- package/dist/task/task.operations.d.ts.map +1 -1
- package/dist/task/task.operations.js +163 -174
- package/dist/task/task.schema.d.ts +63 -68
- package/dist/task/task.schema.d.ts.map +1 -1
- package/dist/task/task.schema.js +38 -91
- package/dist/team-hub.capability.d.ts +3 -8
- package/dist/team-hub.capability.d.ts.map +1 -1
- package/dist/team-hub.capability.js +41 -38
- package/dist/team-hub.feature.d.ts +1 -6
- package/dist/team-hub.feature.d.ts.map +1 -1
- package/dist/team-hub.feature.js +68 -159
- package/package.json +261 -57
- package/dist/announcement/announcement.operations.js.map +0 -1
- package/dist/announcement/announcement.schema.js.map +0 -1
- package/dist/docs/team-hub.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/index.js.map +0 -1
- package/dist/presentations/team-hub.presentation.js.map +0 -1
- package/dist/presentations.js.map +0 -1
- package/dist/ritual/ritual.operations.js.map +0 -1
- package/dist/ritual/ritual.schema.js.map +0 -1
- package/dist/space/space.operations.js.map +0 -1
- package/dist/space/space.schema.js.map +0 -1
- package/dist/task/task.operations.js.map +0 -1
- package/dist/task/task.schema.js.map +0 -1
- package/dist/team-hub.capability.js.map +0 -1
- package/dist/team-hub.feature.js.map +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// src/space/space.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var SpaceModel = defineSchemaModel({
|
|
4
|
+
name: "Space",
|
|
5
|
+
description: "Team space/project",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
10
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var CreateSpaceInputModel = defineSchemaModel({
|
|
15
|
+
name: "CreateSpaceInput",
|
|
16
|
+
description: "Input for creating a space",
|
|
17
|
+
fields: {
|
|
18
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// src/space/space.operations.ts
|
|
26
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
27
|
+
var OWNERS = ["@examples.team-hub"];
|
|
28
|
+
var CreateSpaceContract = defineCommand({
|
|
29
|
+
meta: {
|
|
30
|
+
key: "team.space.create",
|
|
31
|
+
version: "1.0.0",
|
|
32
|
+
stability: "stable",
|
|
33
|
+
owners: [...OWNERS],
|
|
34
|
+
tags: ["team-hub", "space", "create"],
|
|
35
|
+
description: "Create a new team space.",
|
|
36
|
+
goal: "Organize teams/projects.",
|
|
37
|
+
context: "Workspace creation."
|
|
38
|
+
},
|
|
39
|
+
io: {
|
|
40
|
+
input: CreateSpaceInputModel,
|
|
41
|
+
output: SpaceModel
|
|
42
|
+
},
|
|
43
|
+
policy: { auth: "user" },
|
|
44
|
+
acceptance: {
|
|
45
|
+
scenarios: [
|
|
46
|
+
{
|
|
47
|
+
key: "create-space-happy-path",
|
|
48
|
+
given: ["User is authenticated"],
|
|
49
|
+
when: ["User creates a new space"],
|
|
50
|
+
then: ["Space is created"]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
examples: [
|
|
54
|
+
{
|
|
55
|
+
key: "create-engineering",
|
|
56
|
+
input: { name: "Engineering", description: "Engineering team space" },
|
|
57
|
+
output: { id: "space-123", name: "Engineering" }
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
SpaceModel,
|
|
64
|
+
CreateSpaceInputModel,
|
|
65
|
+
CreateSpaceContract
|
|
66
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// src/space/space.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var SpaceModel = defineSchemaModel({
|
|
4
|
+
name: "Space",
|
|
5
|
+
description: "Team space/project",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
10
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var CreateSpaceInputModel = defineSchemaModel({
|
|
15
|
+
name: "CreateSpaceInput",
|
|
16
|
+
description: "Input for creating a space",
|
|
17
|
+
fields: {
|
|
18
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// src/space/space.operations.ts
|
|
26
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
27
|
+
var OWNERS = ["@examples.team-hub"];
|
|
28
|
+
var CreateSpaceContract = defineCommand({
|
|
29
|
+
meta: {
|
|
30
|
+
key: "team.space.create",
|
|
31
|
+
version: "1.0.0",
|
|
32
|
+
stability: "stable",
|
|
33
|
+
owners: [...OWNERS],
|
|
34
|
+
tags: ["team-hub", "space", "create"],
|
|
35
|
+
description: "Create a new team space.",
|
|
36
|
+
goal: "Organize teams/projects.",
|
|
37
|
+
context: "Workspace creation."
|
|
38
|
+
},
|
|
39
|
+
io: {
|
|
40
|
+
input: CreateSpaceInputModel,
|
|
41
|
+
output: SpaceModel
|
|
42
|
+
},
|
|
43
|
+
policy: { auth: "user" },
|
|
44
|
+
acceptance: {
|
|
45
|
+
scenarios: [
|
|
46
|
+
{
|
|
47
|
+
key: "create-space-happy-path",
|
|
48
|
+
given: ["User is authenticated"],
|
|
49
|
+
when: ["User creates a new space"],
|
|
50
|
+
then: ["Space is created"]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
examples: [
|
|
54
|
+
{
|
|
55
|
+
key: "create-engineering",
|
|
56
|
+
input: { name: "Engineering", description: "Engineering team space" },
|
|
57
|
+
output: { id: "space-123", name: "Engineering" }
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
CreateSpaceContract
|
|
64
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/space/space.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var SpaceModel = defineSchemaModel({
|
|
4
|
+
name: "Space",
|
|
5
|
+
description: "Team space/project",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
10
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var CreateSpaceInputModel = defineSchemaModel({
|
|
15
|
+
name: "CreateSpaceInput",
|
|
16
|
+
description: "Input for creating a space",
|
|
17
|
+
fields: {
|
|
18
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
SpaceModel,
|
|
26
|
+
CreateSpaceInputModel
|
|
27
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// src/task/task.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var TaskModel = defineSchemaModel({
|
|
4
|
+
name: "Task",
|
|
5
|
+
description: "Task in a space",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
13
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var CreateTaskInputModel = defineSchemaModel({
|
|
17
|
+
name: "CreateTaskInput",
|
|
18
|
+
description: "Input for creating a task",
|
|
19
|
+
fields: {
|
|
20
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var UpdateTaskStatusInputModel = defineSchemaModel({
|
|
29
|
+
name: "UpdateTaskStatusInput",
|
|
30
|
+
description: "Update task status",
|
|
31
|
+
fields: {
|
|
32
|
+
taskId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// src/task/task.operations.ts
|
|
38
|
+
import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
|
|
39
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
40
|
+
var OWNERS = ["@examples.team-hub"];
|
|
41
|
+
var ListTasksInputModel = defineSchemaModel2({
|
|
42
|
+
name: "ListTasksInput",
|
|
43
|
+
description: "Input for listing tasks",
|
|
44
|
+
fields: {
|
|
45
|
+
spaceId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
46
|
+
status: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
47
|
+
assigneeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
48
|
+
limit: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
49
|
+
offset: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true }
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var ListTasksOutputModel = defineSchemaModel2({
|
|
53
|
+
name: "ListTasksOutput",
|
|
54
|
+
description: "Output for listing tasks",
|
|
55
|
+
fields: {
|
|
56
|
+
tasks: { type: TaskModel, isOptional: false, isList: true },
|
|
57
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var ListTasksOperation = defineQuery({
|
|
61
|
+
meta: {
|
|
62
|
+
key: "team.task.list",
|
|
63
|
+
version: "1.0.0",
|
|
64
|
+
stability: "stable",
|
|
65
|
+
owners: [...OWNERS],
|
|
66
|
+
tags: ["team-hub", "task", "list", "query"],
|
|
67
|
+
description: "List all tasks with filtering",
|
|
68
|
+
goal: "Retrieve list of tasks",
|
|
69
|
+
context: "Task management"
|
|
70
|
+
},
|
|
71
|
+
io: {
|
|
72
|
+
input: ListTasksInputModel,
|
|
73
|
+
output: ListTasksOutputModel
|
|
74
|
+
},
|
|
75
|
+
policy: { auth: "user" },
|
|
76
|
+
acceptance: {
|
|
77
|
+
scenarios: [
|
|
78
|
+
{
|
|
79
|
+
key: "list-tasks-happy-path",
|
|
80
|
+
given: ["Tasks exist"],
|
|
81
|
+
when: ["User lists tasks"],
|
|
82
|
+
then: ["List of tasks is returned"]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
examples: [
|
|
86
|
+
{
|
|
87
|
+
key: "list-my-tasks",
|
|
88
|
+
input: { assigneeId: "user-123", status: "open", limit: 10 },
|
|
89
|
+
output: { tasks: [], total: 3 }
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
var CreateTaskContract = defineCommand({
|
|
95
|
+
meta: {
|
|
96
|
+
key: "team.task.create",
|
|
97
|
+
version: "1.0.0",
|
|
98
|
+
stability: "stable",
|
|
99
|
+
owners: [...OWNERS],
|
|
100
|
+
tags: ["team-hub", "task", "create"],
|
|
101
|
+
description: "Create a task.",
|
|
102
|
+
goal: "Track work.",
|
|
103
|
+
context: "Task management."
|
|
104
|
+
},
|
|
105
|
+
io: {
|
|
106
|
+
input: CreateTaskInputModel,
|
|
107
|
+
output: TaskModel
|
|
108
|
+
},
|
|
109
|
+
policy: { auth: "user" },
|
|
110
|
+
acceptance: {
|
|
111
|
+
scenarios: [
|
|
112
|
+
{
|
|
113
|
+
key: "create-task-happy-path",
|
|
114
|
+
given: ["Space exists"],
|
|
115
|
+
when: ["User creates task"],
|
|
116
|
+
then: ["Task is created"]
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
examples: [
|
|
120
|
+
{
|
|
121
|
+
key: "create-bug",
|
|
122
|
+
input: { spaceId: "space-123", title: "Fix login bug", type: "bug" },
|
|
123
|
+
output: { id: "task-456", status: "todo" }
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
var UpdateTaskStatusContract = defineCommand({
|
|
129
|
+
meta: {
|
|
130
|
+
key: "team.task.updateStatus",
|
|
131
|
+
version: "1.0.0",
|
|
132
|
+
stability: "stable",
|
|
133
|
+
owners: [...OWNERS],
|
|
134
|
+
tags: ["team-hub", "task", "status"],
|
|
135
|
+
description: "Update task status.",
|
|
136
|
+
goal: "Track progress.",
|
|
137
|
+
context: "Task management."
|
|
138
|
+
},
|
|
139
|
+
io: {
|
|
140
|
+
input: UpdateTaskStatusInputModel,
|
|
141
|
+
output: TaskModel
|
|
142
|
+
},
|
|
143
|
+
policy: { auth: "user" },
|
|
144
|
+
acceptance: {
|
|
145
|
+
scenarios: [
|
|
146
|
+
{
|
|
147
|
+
key: "update-status-happy-path",
|
|
148
|
+
given: ["Task exists"],
|
|
149
|
+
when: ["User updates status"],
|
|
150
|
+
then: ["Status is updated"]
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
examples: [
|
|
154
|
+
{
|
|
155
|
+
key: "markup-done",
|
|
156
|
+
input: { taskId: "task-456", status: "done" },
|
|
157
|
+
output: { id: "task-456", status: "done" }
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
export {
|
|
163
|
+
UpdateTaskStatusInputModel,
|
|
164
|
+
UpdateTaskStatusContract,
|
|
165
|
+
TaskModel,
|
|
166
|
+
ListTasksOutputModel,
|
|
167
|
+
ListTasksOperation,
|
|
168
|
+
ListTasksInputModel,
|
|
169
|
+
CreateTaskInputModel,
|
|
170
|
+
CreateTaskContract
|
|
171
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// src/task/task.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var TaskModel = defineSchemaModel({
|
|
4
|
+
name: "Task",
|
|
5
|
+
description: "Task in a space",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
13
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var CreateTaskInputModel = defineSchemaModel({
|
|
17
|
+
name: "CreateTaskInput",
|
|
18
|
+
description: "Input for creating a task",
|
|
19
|
+
fields: {
|
|
20
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var UpdateTaskStatusInputModel = defineSchemaModel({
|
|
29
|
+
name: "UpdateTaskStatusInput",
|
|
30
|
+
description: "Update task status",
|
|
31
|
+
fields: {
|
|
32
|
+
taskId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// src/task/task.operations.ts
|
|
38
|
+
import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
|
|
39
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
40
|
+
var OWNERS = ["@examples.team-hub"];
|
|
41
|
+
var ListTasksInputModel = defineSchemaModel2({
|
|
42
|
+
name: "ListTasksInput",
|
|
43
|
+
description: "Input for listing tasks",
|
|
44
|
+
fields: {
|
|
45
|
+
spaceId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
46
|
+
status: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
47
|
+
assigneeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
48
|
+
limit: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
49
|
+
offset: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true }
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var ListTasksOutputModel = defineSchemaModel2({
|
|
53
|
+
name: "ListTasksOutput",
|
|
54
|
+
description: "Output for listing tasks",
|
|
55
|
+
fields: {
|
|
56
|
+
tasks: { type: TaskModel, isOptional: false, isList: true },
|
|
57
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var ListTasksOperation = defineQuery({
|
|
61
|
+
meta: {
|
|
62
|
+
key: "team.task.list",
|
|
63
|
+
version: "1.0.0",
|
|
64
|
+
stability: "stable",
|
|
65
|
+
owners: [...OWNERS],
|
|
66
|
+
tags: ["team-hub", "task", "list", "query"],
|
|
67
|
+
description: "List all tasks with filtering",
|
|
68
|
+
goal: "Retrieve list of tasks",
|
|
69
|
+
context: "Task management"
|
|
70
|
+
},
|
|
71
|
+
io: {
|
|
72
|
+
input: ListTasksInputModel,
|
|
73
|
+
output: ListTasksOutputModel
|
|
74
|
+
},
|
|
75
|
+
policy: { auth: "user" },
|
|
76
|
+
acceptance: {
|
|
77
|
+
scenarios: [
|
|
78
|
+
{
|
|
79
|
+
key: "list-tasks-happy-path",
|
|
80
|
+
given: ["Tasks exist"],
|
|
81
|
+
when: ["User lists tasks"],
|
|
82
|
+
then: ["List of tasks is returned"]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
examples: [
|
|
86
|
+
{
|
|
87
|
+
key: "list-my-tasks",
|
|
88
|
+
input: { assigneeId: "user-123", status: "open", limit: 10 },
|
|
89
|
+
output: { tasks: [], total: 3 }
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
var CreateTaskContract = defineCommand({
|
|
95
|
+
meta: {
|
|
96
|
+
key: "team.task.create",
|
|
97
|
+
version: "1.0.0",
|
|
98
|
+
stability: "stable",
|
|
99
|
+
owners: [...OWNERS],
|
|
100
|
+
tags: ["team-hub", "task", "create"],
|
|
101
|
+
description: "Create a task.",
|
|
102
|
+
goal: "Track work.",
|
|
103
|
+
context: "Task management."
|
|
104
|
+
},
|
|
105
|
+
io: {
|
|
106
|
+
input: CreateTaskInputModel,
|
|
107
|
+
output: TaskModel
|
|
108
|
+
},
|
|
109
|
+
policy: { auth: "user" },
|
|
110
|
+
acceptance: {
|
|
111
|
+
scenarios: [
|
|
112
|
+
{
|
|
113
|
+
key: "create-task-happy-path",
|
|
114
|
+
given: ["Space exists"],
|
|
115
|
+
when: ["User creates task"],
|
|
116
|
+
then: ["Task is created"]
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
examples: [
|
|
120
|
+
{
|
|
121
|
+
key: "create-bug",
|
|
122
|
+
input: { spaceId: "space-123", title: "Fix login bug", type: "bug" },
|
|
123
|
+
output: { id: "task-456", status: "todo" }
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
var UpdateTaskStatusContract = defineCommand({
|
|
129
|
+
meta: {
|
|
130
|
+
key: "team.task.updateStatus",
|
|
131
|
+
version: "1.0.0",
|
|
132
|
+
stability: "stable",
|
|
133
|
+
owners: [...OWNERS],
|
|
134
|
+
tags: ["team-hub", "task", "status"],
|
|
135
|
+
description: "Update task status.",
|
|
136
|
+
goal: "Track progress.",
|
|
137
|
+
context: "Task management."
|
|
138
|
+
},
|
|
139
|
+
io: {
|
|
140
|
+
input: UpdateTaskStatusInputModel,
|
|
141
|
+
output: TaskModel
|
|
142
|
+
},
|
|
143
|
+
policy: { auth: "user" },
|
|
144
|
+
acceptance: {
|
|
145
|
+
scenarios: [
|
|
146
|
+
{
|
|
147
|
+
key: "update-status-happy-path",
|
|
148
|
+
given: ["Task exists"],
|
|
149
|
+
when: ["User updates status"],
|
|
150
|
+
then: ["Status is updated"]
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
examples: [
|
|
154
|
+
{
|
|
155
|
+
key: "markup-done",
|
|
156
|
+
input: { taskId: "task-456", status: "done" },
|
|
157
|
+
output: { id: "task-456", status: "done" }
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
export {
|
|
163
|
+
UpdateTaskStatusContract,
|
|
164
|
+
ListTasksOutputModel,
|
|
165
|
+
ListTasksOperation,
|
|
166
|
+
ListTasksInputModel,
|
|
167
|
+
CreateTaskContract
|
|
168
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/task/task.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var TaskModel = defineSchemaModel({
|
|
4
|
+
name: "Task",
|
|
5
|
+
description: "Task in a space",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
13
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var CreateTaskInputModel = defineSchemaModel({
|
|
17
|
+
name: "CreateTaskInput",
|
|
18
|
+
description: "Input for creating a task",
|
|
19
|
+
fields: {
|
|
20
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var UpdateTaskStatusInputModel = defineSchemaModel({
|
|
29
|
+
name: "UpdateTaskStatusInput",
|
|
30
|
+
description: "Update task status",
|
|
31
|
+
fields: {
|
|
32
|
+
taskId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
UpdateTaskStatusInputModel,
|
|
38
|
+
TaskModel,
|
|
39
|
+
CreateTaskInputModel
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/team-hub.capability.ts
|
|
2
|
+
import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
|
|
3
|
+
var TasksCapability = defineCapability({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "tasks",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
kind: "ui",
|
|
8
|
+
stability: StabilityEnum.Experimental,
|
|
9
|
+
description: "Task management for teams",
|
|
10
|
+
owners: ["platform.core"],
|
|
11
|
+
tags: ["tasks", "collaboration"]
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var RitualsCapability = defineCapability({
|
|
15
|
+
meta: {
|
|
16
|
+
key: "rituals",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
kind: "ui",
|
|
19
|
+
stability: StabilityEnum.Experimental,
|
|
20
|
+
description: "Team rituals like standups and retrospectives",
|
|
21
|
+
owners: ["platform.core"],
|
|
22
|
+
tags: ["rituals", "team", "meetings"]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var AnnouncementsCapability = defineCapability({
|
|
26
|
+
meta: {
|
|
27
|
+
key: "announcements",
|
|
28
|
+
version: "1.0.0",
|
|
29
|
+
kind: "ui",
|
|
30
|
+
stability: StabilityEnum.Experimental,
|
|
31
|
+
description: "Team announcements and communications",
|
|
32
|
+
owners: ["platform.messaging"],
|
|
33
|
+
tags: ["announcements", "messaging"]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
TasksCapability,
|
|
38
|
+
RitualsCapability,
|
|
39
|
+
AnnouncementsCapability
|
|
40
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/team-hub.feature.ts
|
|
2
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
3
|
+
var TeamHubFeature = defineFeature({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "team-hub",
|
|
6
|
+
title: "Team Hub",
|
|
7
|
+
description: "Tasks, rituals, and announcements for internal teams with ceremonies.",
|
|
8
|
+
domain: "collaboration",
|
|
9
|
+
owners: ["@team-hub"],
|
|
10
|
+
tags: ["tasks", "rituals", "announcements"],
|
|
11
|
+
stability: "experimental",
|
|
12
|
+
version: "1.0.0"
|
|
13
|
+
},
|
|
14
|
+
operations: [
|
|
15
|
+
{ key: "team.space.create", version: "1.0.0" },
|
|
16
|
+
{ key: "team.task.create", version: "1.0.0" },
|
|
17
|
+
{ key: "team.task.updateStatus", version: "1.0.0" },
|
|
18
|
+
{ key: "team.task.list", version: "1.0.0" },
|
|
19
|
+
{ key: "team.ritual.schedule", version: "1.0.0" },
|
|
20
|
+
{ key: "team.ritual.logOccurrence", version: "1.0.0" },
|
|
21
|
+
{ key: "team.announcement.post", version: "1.0.0" }
|
|
22
|
+
],
|
|
23
|
+
events: [
|
|
24
|
+
{ key: "team.space.created", version: "1.0.0" },
|
|
25
|
+
{ key: "team.task.created", version: "1.0.0" },
|
|
26
|
+
{ key: "team.task.status_changed", version: "1.0.0" },
|
|
27
|
+
{ key: "team.ritual.scheduled", version: "1.0.0" },
|
|
28
|
+
{ key: "team.ritual.occurred", version: "1.0.0" },
|
|
29
|
+
{ key: "team.announcement.posted", version: "1.0.0" }
|
|
30
|
+
],
|
|
31
|
+
presentations: [
|
|
32
|
+
{ key: "team-hub.dashboard", version: "1.0.0" },
|
|
33
|
+
{ key: "team-hub.space.list", version: "1.0.0" },
|
|
34
|
+
{ key: "team-hub.task.board", version: "1.0.0" },
|
|
35
|
+
{ key: "team-hub.task.detail", version: "1.0.0" },
|
|
36
|
+
{ key: "team-hub.ritual.calendar", version: "1.0.0" },
|
|
37
|
+
{ key: "team-hub.announcement.feed", version: "1.0.0" }
|
|
38
|
+
],
|
|
39
|
+
presentationsTargets: [
|
|
40
|
+
{
|
|
41
|
+
key: "team-hub.dashboard",
|
|
42
|
+
version: "1.0.0",
|
|
43
|
+
targets: ["react", "markdown"]
|
|
44
|
+
},
|
|
45
|
+
{ key: "team-hub.task.board", version: "1.0.0", targets: ["react"] },
|
|
46
|
+
{ key: "team-hub.ritual.calendar", version: "1.0.0", targets: ["react"] },
|
|
47
|
+
{
|
|
48
|
+
key: "team-hub.announcement.feed",
|
|
49
|
+
version: "1.0.0",
|
|
50
|
+
targets: ["react", "markdown"]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
capabilities: {
|
|
54
|
+
requires: [
|
|
55
|
+
{ key: "identity", version: "1.0.0" },
|
|
56
|
+
{ key: "audit-trail", version: "1.0.0" },
|
|
57
|
+
{ key: "notifications", version: "1.0.0" },
|
|
58
|
+
{ key: "feature-flags", version: "1.0.0" }
|
|
59
|
+
],
|
|
60
|
+
provides: [
|
|
61
|
+
{ key: "tasks", version: "1.0.0" },
|
|
62
|
+
{ key: "rituals", version: "1.0.0" },
|
|
63
|
+
{ key: "announcements", version: "1.0.0" }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
TeamHubFeature
|
|
69
|
+
};
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import './team-hub.docblock';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC"}
|