@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,98 +1,122 @@
1
- import { LogRitualOccurrenceInputModel, RitualModel, ScheduleRitualInputModel } from "./ritual.schema.js";
2
- import { defineCommand } from "@contractspec/lib.contracts";
3
-
4
- //#region src/ritual/ritual.operations.ts
5
- const OWNERS = ["@examples.team-hub"];
6
- /**
7
- * Schedule a ritual.
8
- */
9
- const ScheduleRitualContract = defineCommand({
10
- meta: {
11
- key: "team.ritual.schedule",
12
- version: "1.0.0",
13
- stability: "stable",
14
- owners: [...OWNERS],
15
- tags: [
16
- "team-hub",
17
- "ritual",
18
- "schedule"
19
- ],
20
- description: "Schedule a recurring ritual.",
21
- goal: "Team ceremonies.",
22
- context: "Ritual management."
23
- },
24
- io: {
25
- input: ScheduleRitualInputModel,
26
- output: RitualModel
27
- },
28
- policy: { auth: "user" },
29
- acceptance: {
30
- scenarios: [{
31
- key: "schedule-ritual-happy-path",
32
- given: ["Space exists"],
33
- when: ["User schedules ritual"],
34
- then: ["Ritual is scheduled"]
35
- }],
36
- examples: [{
37
- key: "schedule-standup",
38
- input: {
39
- spaceId: "space-123",
40
- name: "Daily Standup",
41
- interval: "daily",
42
- time: "10:00"
43
- },
44
- output: {
45
- id: "rit-123",
46
- status: "active"
47
- }
48
- }]
49
- }
1
+ // @bun
2
+ // src/ritual/ritual.schema.ts
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
+ var RitualModel = defineSchemaModel({
5
+ name: "Ritual",
6
+ description: "Recurring ritual",
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
+ cadence: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
+ dayOfWeek: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
13
+ time: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
14
+ }
15
+ });
16
+ var ScheduleRitualInputModel = defineSchemaModel({
17
+ name: "ScheduleRitualInput",
18
+ description: "Create a ritual",
19
+ fields: {
20
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ cadence: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ dayOfWeek: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ time: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ facilitatorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
26
+ }
50
27
  });
51
- /**
52
- * Log ritual occurrence.
53
- */
54
- const LogRitualOccurrenceContract = defineCommand({
55
- meta: {
56
- key: "team.ritual.logOccurrence",
57
- version: "1.0.0",
58
- stability: "stable",
59
- owners: [...OWNERS],
60
- tags: [
61
- "team-hub",
62
- "ritual",
63
- "log"
64
- ],
65
- description: "Log a ritual occurrence.",
66
- goal: "Record ritual history.",
67
- context: "Ritual management."
68
- },
69
- io: {
70
- input: LogRitualOccurrenceInputModel,
71
- output: RitualModel
72
- },
73
- policy: { auth: "user" },
74
- acceptance: {
75
- scenarios: [{
76
- key: "log-occurrence-happy-path",
77
- given: ["Ritual is scheduled"],
78
- when: ["User logs occurrence"],
79
- then: ["Occurrence is recorded"]
80
- }],
81
- examples: [{
82
- key: "log-standup",
83
- input: {
84
- ritualId: "rit-123",
85
- date: "2025-01-20",
86
- attendees: ["user-1", "user-2"]
87
- },
88
- output: {
89
- id: "rit-123",
90
- lastOccurrence: "2025-01-20"
91
- }
92
- }]
93
- }
28
+ var LogRitualOccurrenceInputModel = defineSchemaModel({
29
+ name: "LogRitualOccurrenceInput",
30
+ description: "Record ritual occurrence results",
31
+ fields: {
32
+ ritualId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
+ scheduledFor: { type: ScalarTypeEnum.DateTime(), isOptional: false },
34
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
35
+ summary: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
36
+ }
94
37
  });
95
38
 
96
- //#endregion
97
- export { LogRitualOccurrenceContract, ScheduleRitualContract };
98
- //# sourceMappingURL=ritual.operations.js.map
39
+ // src/ritual/ritual.operations.ts
40
+ import { defineCommand } from "@contractspec/lib.contracts";
41
+ var OWNERS = ["@examples.team-hub"];
42
+ var ScheduleRitualContract = defineCommand({
43
+ meta: {
44
+ key: "team.ritual.schedule",
45
+ version: "1.0.0",
46
+ stability: "stable",
47
+ owners: [...OWNERS],
48
+ tags: ["team-hub", "ritual", "schedule"],
49
+ description: "Schedule a recurring ritual.",
50
+ goal: "Team ceremonies.",
51
+ context: "Ritual management."
52
+ },
53
+ io: {
54
+ input: ScheduleRitualInputModel,
55
+ output: RitualModel
56
+ },
57
+ policy: { auth: "user" },
58
+ acceptance: {
59
+ scenarios: [
60
+ {
61
+ key: "schedule-ritual-happy-path",
62
+ given: ["Space exists"],
63
+ when: ["User schedules ritual"],
64
+ then: ["Ritual is scheduled"]
65
+ }
66
+ ],
67
+ examples: [
68
+ {
69
+ key: "schedule-standup",
70
+ input: {
71
+ spaceId: "space-123",
72
+ name: "Daily Standup",
73
+ interval: "daily",
74
+ time: "10:00"
75
+ },
76
+ output: { id: "rit-123", status: "active" }
77
+ }
78
+ ]
79
+ }
80
+ });
81
+ var LogRitualOccurrenceContract = defineCommand({
82
+ meta: {
83
+ key: "team.ritual.logOccurrence",
84
+ version: "1.0.0",
85
+ stability: "stable",
86
+ owners: [...OWNERS],
87
+ tags: ["team-hub", "ritual", "log"],
88
+ description: "Log a ritual occurrence.",
89
+ goal: "Record ritual history.",
90
+ context: "Ritual management."
91
+ },
92
+ io: {
93
+ input: LogRitualOccurrenceInputModel,
94
+ output: RitualModel
95
+ },
96
+ policy: { auth: "user" },
97
+ acceptance: {
98
+ scenarios: [
99
+ {
100
+ key: "log-occurrence-happy-path",
101
+ given: ["Ritual is scheduled"],
102
+ when: ["User logs occurrence"],
103
+ then: ["Occurrence is recorded"]
104
+ }
105
+ ],
106
+ examples: [
107
+ {
108
+ key: "log-standup",
109
+ input: {
110
+ ritualId: "rit-123",
111
+ date: "2025-01-20",
112
+ attendees: ["user-1", "user-2"]
113
+ },
114
+ output: { id: "rit-123", lastOccurrence: "2025-01-20" }
115
+ }
116
+ ]
117
+ }
118
+ });
119
+ export {
120
+ ScheduleRitualContract,
121
+ LogRitualOccurrenceContract
122
+ };
@@ -1,85 +1,80 @@
1
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
-
3
- //#region src/ritual/ritual.schema.d.ts
4
1
  /**
5
2
  * Recurring ritual.
6
3
  */
7
- declare const RitualModel: _contractspec_lib_schema0.SchemaModel<{
8
- id: {
9
- type: _contractspec_lib_schema0.FieldType<string, string>;
10
- isOptional: false;
11
- };
12
- spaceId: {
13
- type: _contractspec_lib_schema0.FieldType<string, string>;
14
- isOptional: false;
15
- };
16
- title: {
17
- type: _contractspec_lib_schema0.FieldType<string, string>;
18
- isOptional: false;
19
- };
20
- cadence: {
21
- type: _contractspec_lib_schema0.FieldType<string, string>;
22
- isOptional: false;
23
- };
24
- dayOfWeek: {
25
- type: _contractspec_lib_schema0.FieldType<string, string>;
26
- isOptional: true;
27
- };
28
- time: {
29
- type: _contractspec_lib_schema0.FieldType<string, string>;
30
- isOptional: true;
31
- };
4
+ export declare const RitualModel: import("@contractspec/lib.schema").SchemaModel<{
5
+ id: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ spaceId: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ title: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ cadence: {
18
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
19
+ isOptional: false;
20
+ };
21
+ dayOfWeek: {
22
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
23
+ isOptional: true;
24
+ };
25
+ time: {
26
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
27
+ isOptional: true;
28
+ };
32
29
  }>;
33
30
  /**
34
31
  * Input for scheduling a ritual.
35
32
  */
36
- declare const ScheduleRitualInputModel: _contractspec_lib_schema0.SchemaModel<{
37
- spaceId: {
38
- type: _contractspec_lib_schema0.FieldType<string, string>;
39
- isOptional: false;
40
- };
41
- title: {
42
- type: _contractspec_lib_schema0.FieldType<string, string>;
43
- isOptional: false;
44
- };
45
- cadence: {
46
- type: _contractspec_lib_schema0.FieldType<string, string>;
47
- isOptional: false;
48
- };
49
- dayOfWeek: {
50
- type: _contractspec_lib_schema0.FieldType<string, string>;
51
- isOptional: true;
52
- };
53
- time: {
54
- type: _contractspec_lib_schema0.FieldType<string, string>;
55
- isOptional: true;
56
- };
57
- facilitatorId: {
58
- type: _contractspec_lib_schema0.FieldType<string, string>;
59
- isOptional: true;
60
- };
33
+ export declare const ScheduleRitualInputModel: import("@contractspec/lib.schema").SchemaModel<{
34
+ spaceId: {
35
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ title: {
39
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ cadence: {
43
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ dayOfWeek: {
47
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
48
+ isOptional: true;
49
+ };
50
+ time: {
51
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
52
+ isOptional: true;
53
+ };
54
+ facilitatorId: {
55
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
56
+ isOptional: true;
57
+ };
61
58
  }>;
62
59
  /**
63
60
  * Input for logging ritual occurrence.
64
61
  */
65
- declare const LogRitualOccurrenceInputModel: _contractspec_lib_schema0.SchemaModel<{
66
- ritualId: {
67
- type: _contractspec_lib_schema0.FieldType<string, string>;
68
- isOptional: false;
69
- };
70
- scheduledFor: {
71
- type: _contractspec_lib_schema0.FieldType<Date, string>;
72
- isOptional: false;
73
- };
74
- status: {
75
- type: _contractspec_lib_schema0.FieldType<string, string>;
76
- isOptional: false;
77
- };
78
- summary: {
79
- type: _contractspec_lib_schema0.FieldType<string, string>;
80
- isOptional: true;
81
- };
62
+ export declare const LogRitualOccurrenceInputModel: import("@contractspec/lib.schema").SchemaModel<{
63
+ ritualId: {
64
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
65
+ isOptional: false;
66
+ };
67
+ scheduledFor: {
68
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
69
+ isOptional: false;
70
+ };
71
+ status: {
72
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
73
+ isOptional: false;
74
+ };
75
+ summary: {
76
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
77
+ isOptional: true;
78
+ };
82
79
  }>;
83
- //#endregion
84
- export { LogRitualOccurrenceInputModel, RitualModel, ScheduleRitualInputModel };
85
80
  //# sourceMappingURL=ritual.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ritual.schema.d.ts","names":[],"sources":["../../src/ritual/ritual.schema.ts"],"mappings":";;;;;;cAKa,WAAA,4BAAW,WAAA;;UAWtB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,wBAAA,4BAAwB,WAAA;;UAWnC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,6BAAA,4BAA6B,WAAA;;UASxC,yBAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"ritual.schema.d.ts","sourceRoot":"","sources":["../../src/ritual/ritual.schema.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;EAWtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;EAWnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;EASxC,CAAC"}
@@ -1,98 +1,42 @@
1
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
-
3
- //#region src/ritual/ritual.schema.ts
4
- /**
5
- * Recurring ritual.
6
- */
7
- const RitualModel = defineSchemaModel({
8
- name: "Ritual",
9
- description: "Recurring ritual",
10
- fields: {
11
- id: {
12
- type: ScalarTypeEnum.String_unsecure(),
13
- isOptional: false
14
- },
15
- spaceId: {
16
- type: ScalarTypeEnum.String_unsecure(),
17
- isOptional: false
18
- },
19
- title: {
20
- type: ScalarTypeEnum.String_unsecure(),
21
- isOptional: false
22
- },
23
- cadence: {
24
- type: ScalarTypeEnum.String_unsecure(),
25
- isOptional: false
26
- },
27
- dayOfWeek: {
28
- type: ScalarTypeEnum.String_unsecure(),
29
- isOptional: true
30
- },
31
- time: {
32
- type: ScalarTypeEnum.String_unsecure(),
33
- isOptional: true
34
- }
35
- }
1
+ // @bun
2
+ // src/ritual/ritual.schema.ts
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
+ var RitualModel = defineSchemaModel({
5
+ name: "Ritual",
6
+ description: "Recurring ritual",
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
+ cadence: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
+ dayOfWeek: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
13
+ time: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
14
+ }
36
15
  });
37
- /**
38
- * Input for scheduling a ritual.
39
- */
40
- const ScheduleRitualInputModel = defineSchemaModel({
41
- name: "ScheduleRitualInput",
42
- description: "Create a ritual",
43
- fields: {
44
- spaceId: {
45
- type: ScalarTypeEnum.String_unsecure(),
46
- isOptional: false
47
- },
48
- title: {
49
- type: ScalarTypeEnum.String_unsecure(),
50
- isOptional: false
51
- },
52
- cadence: {
53
- type: ScalarTypeEnum.String_unsecure(),
54
- isOptional: false
55
- },
56
- dayOfWeek: {
57
- type: ScalarTypeEnum.String_unsecure(),
58
- isOptional: true
59
- },
60
- time: {
61
- type: ScalarTypeEnum.String_unsecure(),
62
- isOptional: true
63
- },
64
- facilitatorId: {
65
- type: ScalarTypeEnum.String_unsecure(),
66
- isOptional: true
67
- }
68
- }
16
+ var ScheduleRitualInputModel = defineSchemaModel({
17
+ name: "ScheduleRitualInput",
18
+ description: "Create a ritual",
19
+ fields: {
20
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ cadence: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ dayOfWeek: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ time: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ facilitatorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
26
+ }
69
27
  });
70
- /**
71
- * Input for logging ritual occurrence.
72
- */
73
- const LogRitualOccurrenceInputModel = defineSchemaModel({
74
- name: "LogRitualOccurrenceInput",
75
- description: "Record ritual occurrence results",
76
- fields: {
77
- ritualId: {
78
- type: ScalarTypeEnum.String_unsecure(),
79
- isOptional: false
80
- },
81
- scheduledFor: {
82
- type: ScalarTypeEnum.DateTime(),
83
- isOptional: false
84
- },
85
- status: {
86
- type: ScalarTypeEnum.String_unsecure(),
87
- isOptional: false
88
- },
89
- summary: {
90
- type: ScalarTypeEnum.String_unsecure(),
91
- isOptional: true
92
- }
93
- }
28
+ var LogRitualOccurrenceInputModel = defineSchemaModel({
29
+ name: "LogRitualOccurrenceInput",
30
+ description: "Record ritual occurrence results",
31
+ fields: {
32
+ ritualId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
+ scheduledFor: { type: ScalarTypeEnum.DateTime(), isOptional: false },
34
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
35
+ summary: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
36
+ }
94
37
  });
95
-
96
- //#endregion
97
- export { LogRitualOccurrenceInputModel, RitualModel, ScheduleRitualInputModel };
98
- //# sourceMappingURL=ritual.schema.js.map
38
+ export {
39
+ ScheduleRitualInputModel,
40
+ RitualModel,
41
+ LogRitualOccurrenceInputModel
42
+ };
@@ -1,3 +1,6 @@
1
- import { CreateSpaceInputModel, SpaceModel } from "./space.schema.js";
2
- import { CreateSpaceContract } from "./space.operations.js";
3
- export { CreateSpaceContract, CreateSpaceInputModel, SpaceModel };
1
+ /**
2
+ * Space domain - Team space management.
3
+ */
4
+ export { SpaceModel, CreateSpaceInputModel } from './space.schema';
5
+ export { CreateSpaceContract } from './space.operations';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,4 +1,67 @@
1
- import { CreateSpaceInputModel, SpaceModel } from "./space.schema.js";
2
- import { CreateSpaceContract } from "./space.operations.js";
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
+ }
24
+ });
3
25
 
4
- export { CreateSpaceContract, CreateSpaceInputModel, SpaceModel };
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
+ SpaceModel,
65
+ CreateSpaceInputModel,
66
+ CreateSpaceContract
67
+ };