@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.
Files changed (138) hide show
  1. package/dist/announcement/announcement.operations.d.ts +50 -56
  2. package/dist/announcement/announcement.operations.d.ts.map +1 -1
  3. package/dist/announcement/announcement.operations.js +70 -51
  4. package/dist/announcement/announcement.schema.d.ts +50 -55
  5. package/dist/announcement/announcement.schema.d.ts.map +1 -1
  6. package/dist/announcement/announcement.schema.js +29 -71
  7. package/dist/announcement/index.d.ts +6 -3
  8. package/dist/announcement/index.d.ts.map +1 -0
  9. package/dist/announcement/index.js +73 -3
  10. package/dist/browser/announcement/announcement.operations.js +71 -0
  11. package/dist/browser/announcement/announcement.schema.js +30 -0
  12. package/dist/browser/announcement/index.js +73 -0
  13. package/dist/browser/docs/index.js +94 -0
  14. package/dist/browser/docs/team-hub.docblock.js +94 -0
  15. package/dist/browser/entities/index.js +231 -0
  16. package/dist/browser/events.js +134 -0
  17. package/dist/browser/example.js +42 -0
  18. package/dist/browser/handlers/index.js +5 -0
  19. package/dist/browser/index.js +642 -0
  20. package/dist/browser/presentations/index.js +131 -0
  21. package/dist/browser/presentations/team-hub.presentation.js +131 -0
  22. package/dist/browser/presentations.js +148 -0
  23. package/dist/browser/ritual/index.js +124 -0
  24. package/dist/browser/ritual/ritual.operations.js +121 -0
  25. package/dist/browser/ritual/ritual.schema.js +41 -0
  26. package/dist/browser/space/index.js +66 -0
  27. package/dist/browser/space/space.operations.js +64 -0
  28. package/dist/browser/space/space.schema.js +27 -0
  29. package/dist/browser/task/index.js +171 -0
  30. package/dist/browser/task/task.operations.js +168 -0
  31. package/dist/browser/task/task.schema.js +40 -0
  32. package/dist/browser/team-hub.capability.js +40 -0
  33. package/dist/browser/team-hub.feature.js +69 -0
  34. package/dist/docs/index.d.ts +2 -1
  35. package/dist/docs/index.d.ts.map +1 -0
  36. package/dist/docs/index.js +95 -1
  37. package/dist/docs/team-hub.docblock.d.ts +2 -1
  38. package/dist/docs/team-hub.docblock.d.ts.map +1 -0
  39. package/dist/docs/team-hub.docblock.js +45 -56
  40. package/dist/entities/index.d.ts +138 -143
  41. package/dist/entities/index.d.ts.map +1 -1
  42. package/dist/entities/index.js +221 -252
  43. package/dist/events.d.ts +217 -223
  44. package/dist/events.d.ts.map +1 -1
  45. package/dist/events.js +122 -201
  46. package/dist/example.d.ts +2 -6
  47. package/dist/example.d.ts.map +1 -1
  48. package/dist/example.js +41 -55
  49. package/dist/handlers/index.d.ts +1 -4
  50. package/dist/handlers/index.d.ts.map +1 -1
  51. package/dist/handlers/index.js +5 -8
  52. package/dist/index.d.ts +12 -15
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +642 -15
  55. package/dist/node/announcement/announcement.operations.js +71 -0
  56. package/dist/node/announcement/announcement.schema.js +30 -0
  57. package/dist/node/announcement/index.js +73 -0
  58. package/dist/node/docs/index.js +94 -0
  59. package/dist/node/docs/team-hub.docblock.js +94 -0
  60. package/dist/node/entities/index.js +231 -0
  61. package/dist/node/events.js +134 -0
  62. package/dist/node/example.js +42 -0
  63. package/dist/node/handlers/index.js +5 -0
  64. package/dist/node/index.js +642 -0
  65. package/dist/node/presentations/index.js +131 -0
  66. package/dist/node/presentations/team-hub.presentation.js +131 -0
  67. package/dist/node/presentations.js +148 -0
  68. package/dist/node/ritual/index.js +124 -0
  69. package/dist/node/ritual/ritual.operations.js +121 -0
  70. package/dist/node/ritual/ritual.schema.js +41 -0
  71. package/dist/node/space/index.js +66 -0
  72. package/dist/node/space/space.operations.js +64 -0
  73. package/dist/node/space/space.schema.js +27 -0
  74. package/dist/node/task/index.js +171 -0
  75. package/dist/node/task/task.operations.js +168 -0
  76. package/dist/node/task/task.schema.js +40 -0
  77. package/dist/node/team-hub.capability.js +40 -0
  78. package/dist/node/team-hub.feature.js +69 -0
  79. package/dist/presentations/index.d.ts +2 -2
  80. package/dist/presentations/index.d.ts.map +1 -0
  81. package/dist/presentations/index.js +132 -3
  82. package/dist/presentations/team-hub.presentation.d.ts +6 -11
  83. package/dist/presentations/team-hub.presentation.d.ts.map +1 -1
  84. package/dist/presentations/team-hub.presentation.js +126 -125
  85. package/dist/presentations.d.ts +7 -11
  86. package/dist/presentations.d.ts.map +1 -1
  87. package/dist/presentations.js +142 -147
  88. package/dist/ritual/index.d.ts +6 -3
  89. package/dist/ritual/index.d.ts.map +1 -0
  90. package/dist/ritual/index.js +124 -3
  91. package/dist/ritual/ritual.operations.d.ts +92 -98
  92. package/dist/ritual/ritual.operations.d.ts.map +1 -1
  93. package/dist/ritual/ritual.operations.js +119 -95
  94. package/dist/ritual/ritual.schema.d.ts +67 -72
  95. package/dist/ritual/ritual.schema.d.ts.map +1 -1
  96. package/dist/ritual/ritual.schema.js +39 -95
  97. package/dist/space/index.d.ts +6 -3
  98. package/dist/space/index.d.ts.map +1 -0
  99. package/dist/space/index.js +66 -3
  100. package/dist/space/space.operations.d.ts +38 -44
  101. package/dist/space/space.operations.d.ts.map +1 -1
  102. package/dist/space/space.operations.js +63 -50
  103. package/dist/space/space.schema.d.ts +38 -43
  104. package/dist/space/space.schema.d.ts.map +1 -1
  105. package/dist/space/space.schema.js +26 -59
  106. package/dist/task/index.d.ts +6 -3
  107. package/dist/task/index.d.ts.map +1 -0
  108. package/dist/task/index.js +171 -3
  109. package/dist/task/task.operations.d.ts +212 -218
  110. package/dist/task/task.operations.d.ts.map +1 -1
  111. package/dist/task/task.operations.js +163 -174
  112. package/dist/task/task.schema.d.ts +63 -68
  113. package/dist/task/task.schema.d.ts.map +1 -1
  114. package/dist/task/task.schema.js +38 -91
  115. package/dist/team-hub.capability.d.ts +3 -8
  116. package/dist/team-hub.capability.d.ts.map +1 -1
  117. package/dist/team-hub.capability.js +41 -38
  118. package/dist/team-hub.feature.d.ts +1 -6
  119. package/dist/team-hub.feature.d.ts.map +1 -1
  120. package/dist/team-hub.feature.js +68 -159
  121. package/package.json +261 -57
  122. package/dist/announcement/announcement.operations.js.map +0 -1
  123. package/dist/announcement/announcement.schema.js.map +0 -1
  124. package/dist/docs/team-hub.docblock.js.map +0 -1
  125. package/dist/entities/index.js.map +0 -1
  126. package/dist/events.js.map +0 -1
  127. package/dist/example.js.map +0 -1
  128. package/dist/handlers/index.js.map +0 -1
  129. package/dist/presentations/team-hub.presentation.js.map +0 -1
  130. package/dist/presentations.js.map +0 -1
  131. package/dist/ritual/ritual.operations.js.map +0 -1
  132. package/dist/ritual/ritual.schema.js.map +0 -1
  133. package/dist/space/space.operations.js.map +0 -1
  134. package/dist/space/space.schema.js.map +0 -1
  135. package/dist/task/task.operations.js.map +0 -1
  136. package/dist/task/task.schema.js.map +0 -1
  137. package/dist/team-hub.capability.js.map +0 -1
  138. 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: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
9
- name: {
10
- type: _contractspec_lib_schema0.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- description: {
14
- type: _contractspec_lib_schema0.FieldType<string, string>;
15
- isOptional: true;
16
- };
17
- orgId: {
18
- type: _contractspec_lib_schema0.FieldType<string, string>;
19
- isOptional: false;
20
- };
21
- ownerId: {
22
- type: _contractspec_lib_schema0.FieldType<string, string>;
23
- isOptional: false;
24
- };
25
- }>, _contractspec_lib_schema0.SchemaModel<{
26
- id: {
27
- type: _contractspec_lib_schema0.FieldType<string, string>;
28
- isOptional: false;
29
- };
30
- name: {
31
- type: _contractspec_lib_schema0.FieldType<string, string>;
32
- isOptional: false;
33
- };
34
- description: {
35
- type: _contractspec_lib_schema0.FieldType<string, string>;
36
- isOptional: true;
37
- };
38
- orgId: {
39
- type: _contractspec_lib_schema0.FieldType<string, string>;
40
- isOptional: false;
41
- };
42
- ownerId: {
43
- type: _contractspec_lib_schema0.FieldType<string, string>;
44
- isOptional: false;
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","names":[],"sources":["../../src/space/space.operations.ts"],"mappings":";;;;;;;cAQa,mBAAA,+BAAmB,aAAA,2BAAA,WAAA;;UAiC9B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;UAjC8B,yBAAA,CAAA,SAAA"}
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
- import { CreateSpaceInputModel, SpaceModel } from "./space.schema.js";
2
- import { defineCommand } from "@contractspec/lib.contracts";
3
-
4
- //#region src/space/space.operations.ts
5
- const OWNERS = ["@examples.team-hub"];
6
- /**
7
- * Create a new team space.
8
- */
9
- const CreateSpaceContract = defineCommand({
10
- meta: {
11
- key: "team.space.create",
12
- version: "1.0.0",
13
- stability: "stable",
14
- owners: [...OWNERS],
15
- tags: [
16
- "team-hub",
17
- "space",
18
- "create"
19
- ],
20
- description: "Create a new team space.",
21
- goal: "Organize teams/projects.",
22
- context: "Workspace creation."
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
- //#endregion
51
- export { CreateSpaceContract };
52
- //# sourceMappingURL=space.operations.js.map
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: _contractspec_lib_schema0.SchemaModel<{
8
- id: {
9
- type: _contractspec_lib_schema0.FieldType<string, string>;
10
- isOptional: false;
11
- };
12
- name: {
13
- type: _contractspec_lib_schema0.FieldType<string, string>;
14
- isOptional: false;
15
- };
16
- description: {
17
- type: _contractspec_lib_schema0.FieldType<string, string>;
18
- isOptional: true;
19
- };
20
- orgId: {
21
- type: _contractspec_lib_schema0.FieldType<string, string>;
22
- isOptional: false;
23
- };
24
- ownerId: {
25
- type: _contractspec_lib_schema0.FieldType<string, string>;
26
- isOptional: false;
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: _contractspec_lib_schema0.SchemaModel<{
33
- name: {
34
- type: _contractspec_lib_schema0.FieldType<string, string>;
35
- isOptional: false;
36
- };
37
- description: {
38
- type: _contractspec_lib_schema0.FieldType<string, string>;
39
- isOptional: true;
40
- };
41
- orgId: {
42
- type: _contractspec_lib_schema0.FieldType<string, string>;
43
- isOptional: false;
44
- };
45
- ownerId: {
46
- type: _contractspec_lib_schema0.FieldType<string, string>;
47
- isOptional: false;
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","names":[],"sources":["../../src/space/space.schema.ts"],"mappings":";;;;;;cAKa,UAAA,4BAAU,WAAA;;UAUrB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;cAKW,qBAAA,4BAAqB,WAAA;;UAShC,yBAAA,CAAA,SAAA"}
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
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
-
3
- //#region src/space/space.schema.ts
4
- /**
5
- * Team space/project.
6
- */
7
- const SpaceModel = defineSchemaModel({
8
- name: "Space",
9
- description: "Team space/project",
10
- fields: {
11
- id: {
12
- type: ScalarTypeEnum.String_unsecure(),
13
- isOptional: false
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
- * Input for creating a space.
35
- */
36
- const CreateSpaceInputModel = defineSchemaModel({
37
- name: "CreateSpaceInput",
38
- description: "Input for creating a space",
39
- fields: {
40
- name: {
41
- type: ScalarTypeEnum.String_unsecure(),
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
- //#endregion
60
- export { CreateSpaceInputModel, SpaceModel };
61
- //# sourceMappingURL=space.schema.js.map
25
+ export {
26
+ SpaceModel,
27
+ CreateSpaceInputModel
28
+ };
@@ -1,3 +1,6 @@
1
- import { CreateTaskInputModel, TaskModel, UpdateTaskStatusInputModel } from "./task.schema.js";
2
- import { CreateTaskContract, ListTasksInputModel, ListTasksOperation, ListTasksOutputModel, UpdateTaskStatusContract } from "./task.operations.js";
3
- export { CreateTaskContract, CreateTaskInputModel, ListTasksInputModel, ListTasksOperation, ListTasksOutputModel, TaskModel, UpdateTaskStatusContract, UpdateTaskStatusInputModel };
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"}
@@ -1,4 +1,172 @@
1
- import { CreateTaskInputModel, TaskModel, UpdateTaskStatusInputModel } from "./task.schema.js";
2
- import { CreateTaskContract, ListTasksInputModel, ListTasksOperation, ListTasksOutputModel, UpdateTaskStatusContract } from "./task.operations.js";
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
- export { CreateTaskContract, CreateTaskInputModel, ListTasksInputModel, ListTasksOperation, ListTasksOutputModel, TaskModel, UpdateTaskStatusContract, UpdateTaskStatusInputModel };
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
+ };