@contractspec/example.team-hub 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/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 +41 -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
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
3
|
-
|
|
4
|
-
//#region src/space/space.operations.d.ts
|
|
5
1
|
/**
|
|
6
2
|
* Create a new team space.
|
|
7
3
|
*/
|
|
8
|
-
declare const CreateSpaceContract:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
4
|
+
export declare const CreateSpaceContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
name: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
description: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: true;
|
|
12
|
+
};
|
|
13
|
+
orgId: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
ownerId: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
22
|
+
id: {
|
|
23
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
24
|
+
isOptional: false;
|
|
25
|
+
};
|
|
26
|
+
name: {
|
|
27
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
28
|
+
isOptional: false;
|
|
29
|
+
};
|
|
30
|
+
description: {
|
|
31
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: true;
|
|
33
|
+
};
|
|
34
|
+
orgId: {
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
37
|
+
};
|
|
38
|
+
ownerId: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
46
42
|
}>, undefined>;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { CreateSpaceContract };
|
|
49
43
|
//# sourceMappingURL=space.operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.operations.d.ts","
|
|
1
|
+
{"version":3,"file":"space.operations.d.ts","sourceRoot":"","sources":["../../src/space/space.operations.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiC9B,CAAC"}
|
|
@@ -1,52 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
io: {
|
|
25
|
-
input: CreateSpaceInputModel,
|
|
26
|
-
output: SpaceModel
|
|
27
|
-
},
|
|
28
|
-
policy: { auth: "user" },
|
|
29
|
-
acceptance: {
|
|
30
|
-
scenarios: [{
|
|
31
|
-
key: "create-space-happy-path",
|
|
32
|
-
given: ["User is authenticated"],
|
|
33
|
-
when: ["User creates a new space"],
|
|
34
|
-
then: ["Space is created"]
|
|
35
|
-
}],
|
|
36
|
-
examples: [{
|
|
37
|
-
key: "create-engineering",
|
|
38
|
-
input: {
|
|
39
|
-
name: "Engineering",
|
|
40
|
-
description: "Engineering team space"
|
|
41
|
-
},
|
|
42
|
-
output: {
|
|
43
|
-
id: "space-123",
|
|
44
|
-
name: "Engineering"
|
|
45
|
-
}
|
|
46
|
-
}]
|
|
47
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/space/space.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var SpaceModel = defineSchemaModel({
|
|
5
|
+
name: "Space",
|
|
6
|
+
description: "Team space/project",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
11
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var CreateSpaceInputModel = defineSchemaModel({
|
|
16
|
+
name: "CreateSpaceInput",
|
|
17
|
+
description: "Input for creating a space",
|
|
18
|
+
fields: {
|
|
19
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
21
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
23
|
+
}
|
|
48
24
|
});
|
|
49
25
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
26
|
+
// src/space/space.operations.ts
|
|
27
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
28
|
+
var OWNERS = ["@examples.team-hub"];
|
|
29
|
+
var CreateSpaceContract = defineCommand({
|
|
30
|
+
meta: {
|
|
31
|
+
key: "team.space.create",
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
stability: "stable",
|
|
34
|
+
owners: [...OWNERS],
|
|
35
|
+
tags: ["team-hub", "space", "create"],
|
|
36
|
+
description: "Create a new team space.",
|
|
37
|
+
goal: "Organize teams/projects.",
|
|
38
|
+
context: "Workspace creation."
|
|
39
|
+
},
|
|
40
|
+
io: {
|
|
41
|
+
input: CreateSpaceInputModel,
|
|
42
|
+
output: SpaceModel
|
|
43
|
+
},
|
|
44
|
+
policy: { auth: "user" },
|
|
45
|
+
acceptance: {
|
|
46
|
+
scenarios: [
|
|
47
|
+
{
|
|
48
|
+
key: "create-space-happy-path",
|
|
49
|
+
given: ["User is authenticated"],
|
|
50
|
+
when: ["User creates a new space"],
|
|
51
|
+
then: ["Space is created"]
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
examples: [
|
|
55
|
+
{
|
|
56
|
+
key: "create-engineering",
|
|
57
|
+
input: { name: "Engineering", description: "Engineering team space" },
|
|
58
|
+
output: { id: "space-123", name: "Engineering" }
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
CreateSpaceContract
|
|
65
|
+
};
|
|
@@ -1,52 +1,47 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/space/space.schema.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Team space/project.
|
|
6
3
|
*/
|
|
7
|
-
declare const SpaceModel:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
export declare const SpaceModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
id: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
name: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
description: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: true;
|
|
16
|
+
};
|
|
17
|
+
orgId: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
ownerId: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
28
25
|
}>;
|
|
29
26
|
/**
|
|
30
27
|
* Input for creating a space.
|
|
31
28
|
*/
|
|
32
|
-
declare const CreateSpaceInputModel:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
export declare const CreateSpaceInputModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
30
|
+
name: {
|
|
31
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: false;
|
|
33
|
+
};
|
|
34
|
+
description: {
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: true;
|
|
37
|
+
};
|
|
38
|
+
orgId: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
ownerId: {
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
49
46
|
}>;
|
|
50
|
-
//#endregion
|
|
51
|
-
export { CreateSpaceInputModel, SpaceModel };
|
|
52
47
|
//# sourceMappingURL=space.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.schema.d.ts","
|
|
1
|
+
{"version":3,"file":"space.schema.d.ts","sourceRoot":"","sources":["../../src/space/space.schema.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;EAShC,CAAC"}
|
|
@@ -1,61 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
name: {
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false
|
|
18
|
-
},
|
|
19
|
-
description: {
|
|
20
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
-
isOptional: true
|
|
22
|
-
},
|
|
23
|
-
orgId: {
|
|
24
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
ownerId: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: false
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/space/space.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var SpaceModel = defineSchemaModel({
|
|
5
|
+
name: "Space",
|
|
6
|
+
description: "Team space/project",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
11
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
13
|
+
}
|
|
32
14
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
isOptional: false
|
|
43
|
-
},
|
|
44
|
-
description: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: true
|
|
47
|
-
},
|
|
48
|
-
orgId: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: false
|
|
51
|
-
},
|
|
52
|
-
ownerId: {
|
|
53
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
-
isOptional: false
|
|
55
|
-
}
|
|
56
|
-
}
|
|
15
|
+
var CreateSpaceInputModel = defineSchemaModel({
|
|
16
|
+
name: "CreateSpaceInput",
|
|
17
|
+
description: "Input for creating a space",
|
|
18
|
+
fields: {
|
|
19
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
21
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
23
|
+
}
|
|
57
24
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
25
|
+
export {
|
|
26
|
+
SpaceModel,
|
|
27
|
+
CreateSpaceInputModel
|
|
28
|
+
};
|
package/dist/task/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Task domain - Task management.
|
|
3
|
+
*/
|
|
4
|
+
export { TaskModel, CreateTaskInputModel, UpdateTaskStatusInputModel, } from './task.schema';
|
|
5
|
+
export { CreateTaskContract, UpdateTaskStatusContract, ListTasksOperation, ListTasksInputModel, ListTasksOutputModel, } from './task.operations';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC"}
|
package/dist/task/index.js
CHANGED
|
@@ -1,4 +1,172 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/task/task.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var TaskModel = defineSchemaModel({
|
|
5
|
+
name: "Task",
|
|
6
|
+
description: "Task in a space",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
14
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var CreateTaskInputModel = defineSchemaModel({
|
|
18
|
+
name: "CreateTaskInput",
|
|
19
|
+
description: "Input for creating a task",
|
|
20
|
+
fields: {
|
|
21
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
priority: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
assigneeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
26
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var UpdateTaskStatusInputModel = defineSchemaModel({
|
|
30
|
+
name: "UpdateTaskStatusInput",
|
|
31
|
+
description: "Update task status",
|
|
32
|
+
fields: {
|
|
33
|
+
taskId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
34
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
35
|
+
}
|
|
36
|
+
});
|
|
3
37
|
|
|
4
|
-
|
|
38
|
+
// src/task/task.operations.ts
|
|
39
|
+
import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
|
|
40
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
41
|
+
var OWNERS = ["@examples.team-hub"];
|
|
42
|
+
var ListTasksInputModel = defineSchemaModel2({
|
|
43
|
+
name: "ListTasksInput",
|
|
44
|
+
description: "Input for listing tasks",
|
|
45
|
+
fields: {
|
|
46
|
+
spaceId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
47
|
+
status: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
48
|
+
assigneeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
49
|
+
limit: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
50
|
+
offset: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true }
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var ListTasksOutputModel = defineSchemaModel2({
|
|
54
|
+
name: "ListTasksOutput",
|
|
55
|
+
description: "Output for listing tasks",
|
|
56
|
+
fields: {
|
|
57
|
+
tasks: { type: TaskModel, isOptional: false, isList: true },
|
|
58
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var ListTasksOperation = defineQuery({
|
|
62
|
+
meta: {
|
|
63
|
+
key: "team.task.list",
|
|
64
|
+
version: "1.0.0",
|
|
65
|
+
stability: "stable",
|
|
66
|
+
owners: [...OWNERS],
|
|
67
|
+
tags: ["team-hub", "task", "list", "query"],
|
|
68
|
+
description: "List all tasks with filtering",
|
|
69
|
+
goal: "Retrieve list of tasks",
|
|
70
|
+
context: "Task management"
|
|
71
|
+
},
|
|
72
|
+
io: {
|
|
73
|
+
input: ListTasksInputModel,
|
|
74
|
+
output: ListTasksOutputModel
|
|
75
|
+
},
|
|
76
|
+
policy: { auth: "user" },
|
|
77
|
+
acceptance: {
|
|
78
|
+
scenarios: [
|
|
79
|
+
{
|
|
80
|
+
key: "list-tasks-happy-path",
|
|
81
|
+
given: ["Tasks exist"],
|
|
82
|
+
when: ["User lists tasks"],
|
|
83
|
+
then: ["List of tasks is returned"]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
examples: [
|
|
87
|
+
{
|
|
88
|
+
key: "list-my-tasks",
|
|
89
|
+
input: { assigneeId: "user-123", status: "open", limit: 10 },
|
|
90
|
+
output: { tasks: [], total: 3 }
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
var CreateTaskContract = defineCommand({
|
|
96
|
+
meta: {
|
|
97
|
+
key: "team.task.create",
|
|
98
|
+
version: "1.0.0",
|
|
99
|
+
stability: "stable",
|
|
100
|
+
owners: [...OWNERS],
|
|
101
|
+
tags: ["team-hub", "task", "create"],
|
|
102
|
+
description: "Create a task.",
|
|
103
|
+
goal: "Track work.",
|
|
104
|
+
context: "Task management."
|
|
105
|
+
},
|
|
106
|
+
io: {
|
|
107
|
+
input: CreateTaskInputModel,
|
|
108
|
+
output: TaskModel
|
|
109
|
+
},
|
|
110
|
+
policy: { auth: "user" },
|
|
111
|
+
acceptance: {
|
|
112
|
+
scenarios: [
|
|
113
|
+
{
|
|
114
|
+
key: "create-task-happy-path",
|
|
115
|
+
given: ["Space exists"],
|
|
116
|
+
when: ["User creates task"],
|
|
117
|
+
then: ["Task is created"]
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
examples: [
|
|
121
|
+
{
|
|
122
|
+
key: "create-bug",
|
|
123
|
+
input: { spaceId: "space-123", title: "Fix login bug", type: "bug" },
|
|
124
|
+
output: { id: "task-456", status: "todo" }
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
var UpdateTaskStatusContract = defineCommand({
|
|
130
|
+
meta: {
|
|
131
|
+
key: "team.task.updateStatus",
|
|
132
|
+
version: "1.0.0",
|
|
133
|
+
stability: "stable",
|
|
134
|
+
owners: [...OWNERS],
|
|
135
|
+
tags: ["team-hub", "task", "status"],
|
|
136
|
+
description: "Update task status.",
|
|
137
|
+
goal: "Track progress.",
|
|
138
|
+
context: "Task management."
|
|
139
|
+
},
|
|
140
|
+
io: {
|
|
141
|
+
input: UpdateTaskStatusInputModel,
|
|
142
|
+
output: TaskModel
|
|
143
|
+
},
|
|
144
|
+
policy: { auth: "user" },
|
|
145
|
+
acceptance: {
|
|
146
|
+
scenarios: [
|
|
147
|
+
{
|
|
148
|
+
key: "update-status-happy-path",
|
|
149
|
+
given: ["Task exists"],
|
|
150
|
+
when: ["User updates status"],
|
|
151
|
+
then: ["Status is updated"]
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
examples: [
|
|
155
|
+
{
|
|
156
|
+
key: "markup-done",
|
|
157
|
+
input: { taskId: "task-456", status: "done" },
|
|
158
|
+
output: { id: "task-456", status: "done" }
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
export {
|
|
164
|
+
UpdateTaskStatusInputModel,
|
|
165
|
+
UpdateTaskStatusContract,
|
|
166
|
+
TaskModel,
|
|
167
|
+
ListTasksOutputModel,
|
|
168
|
+
ListTasksOperation,
|
|
169
|
+
ListTasksInputModel,
|
|
170
|
+
CreateTaskInputModel,
|
|
171
|
+
CreateTaskContract
|
|
172
|
+
};
|