@contractspec/example.team-hub 1.57.0 → 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 +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,61 +1,55 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
3
|
-
|
|
4
|
-
//#region src/announcement/announcement.operations.d.ts
|
|
5
1
|
/**
|
|
6
2
|
* Post an announcement.
|
|
7
3
|
*/
|
|
8
|
-
declare const PostAnnouncementContract:
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
4
|
+
export declare const PostAnnouncementContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
title: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
body: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
audience: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
audienceRole: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: true;
|
|
20
|
+
};
|
|
21
|
+
spaceId: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
23
|
+
isOptional: true;
|
|
24
|
+
};
|
|
25
|
+
expiresAt: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
29
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
30
|
+
id: {
|
|
31
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: false;
|
|
33
|
+
};
|
|
34
|
+
title: {
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
37
|
+
};
|
|
38
|
+
body: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
audience: {
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
audienceRole: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: true;
|
|
49
|
+
};
|
|
50
|
+
spaceId: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
58
54
|
}>, undefined>;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { PostAnnouncementContract };
|
|
61
55
|
//# sourceMappingURL=announcement.operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcement.operations.d.ts","
|
|
1
|
+
{"version":3,"file":"announcement.operations.d.ts","sourceRoot":"","sources":["../../src/announcement/announcement.operations.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqCnC,CAAC"}
|
|
@@ -1,53 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
policy: { auth: "user" },
|
|
29
|
-
acceptance: {
|
|
30
|
-
scenarios: [{
|
|
31
|
-
key: "post-announcement-happy-path",
|
|
32
|
-
given: ["User is authenticated"],
|
|
33
|
-
when: ["User posts an announcement"],
|
|
34
|
-
then: ["Announcement is posted and distributed"]
|
|
35
|
-
}],
|
|
36
|
-
examples: [{
|
|
37
|
-
key: "post-general",
|
|
38
|
-
input: {
|
|
39
|
-
spaceId: "space-123",
|
|
40
|
-
title: "New Policy",
|
|
41
|
-
content: "Please read..."
|
|
42
|
-
},
|
|
43
|
-
output: {
|
|
44
|
-
id: "ann-456",
|
|
45
|
-
status: "posted"
|
|
46
|
-
}
|
|
47
|
-
}]
|
|
48
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/announcement/announcement.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var AnnouncementModel = defineSchemaModel({
|
|
5
|
+
name: "Announcement",
|
|
6
|
+
description: "Announcement to spaces/org",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
13
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var PostAnnouncementInputModel = defineSchemaModel({
|
|
17
|
+
name: "PostAnnouncementInput",
|
|
18
|
+
description: "Post an announcement",
|
|
19
|
+
fields: {
|
|
20
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
26
|
+
}
|
|
49
27
|
});
|
|
50
28
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
// src/announcement/announcement.operations.ts
|
|
30
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
31
|
+
var OWNERS = ["@examples.team-hub"];
|
|
32
|
+
var PostAnnouncementContract = defineCommand({
|
|
33
|
+
meta: {
|
|
34
|
+
key: "team.announcement.post",
|
|
35
|
+
version: "1.0.0",
|
|
36
|
+
stability: "stable",
|
|
37
|
+
owners: [...OWNERS],
|
|
38
|
+
tags: ["team-hub", "announcement", "post"],
|
|
39
|
+
description: "Post an announcement.",
|
|
40
|
+
goal: "Communicate with team.",
|
|
41
|
+
context: "Communication."
|
|
42
|
+
},
|
|
43
|
+
io: {
|
|
44
|
+
input: PostAnnouncementInputModel,
|
|
45
|
+
output: AnnouncementModel
|
|
46
|
+
},
|
|
47
|
+
policy: { auth: "user" },
|
|
48
|
+
acceptance: {
|
|
49
|
+
scenarios: [
|
|
50
|
+
{
|
|
51
|
+
key: "post-announcement-happy-path",
|
|
52
|
+
given: ["User is authenticated"],
|
|
53
|
+
when: ["User posts an announcement"],
|
|
54
|
+
then: ["Announcement is posted and distributed"]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
examples: [
|
|
58
|
+
{
|
|
59
|
+
key: "post-general",
|
|
60
|
+
input: {
|
|
61
|
+
spaceId: "space-123",
|
|
62
|
+
title: "New Policy",
|
|
63
|
+
content: "Please read..."
|
|
64
|
+
},
|
|
65
|
+
output: { id: "ann-456", status: "posted" }
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
PostAnnouncementContract
|
|
72
|
+
};
|
|
@@ -1,64 +1,59 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/announcement/announcement.schema.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Announcement to spaces/org.
|
|
6
3
|
*/
|
|
7
|
-
declare const AnnouncementModel:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
4
|
+
export declare const AnnouncementModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
id: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
title: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
body: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
audience: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
audienceRole: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
23
|
+
isOptional: true;
|
|
24
|
+
};
|
|
25
|
+
spaceId: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
32
29
|
}>;
|
|
33
30
|
/**
|
|
34
31
|
* Input for posting an announcement.
|
|
35
32
|
*/
|
|
36
|
-
declare const PostAnnouncementInputModel:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
33
|
+
export declare const PostAnnouncementInputModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
34
|
+
title: {
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
37
|
+
};
|
|
38
|
+
body: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
audience: {
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
audienceRole: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: true;
|
|
49
|
+
};
|
|
50
|
+
spaceId: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
54
|
+
expiresAt: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
56
|
+
isOptional: true;
|
|
57
|
+
};
|
|
61
58
|
}>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { AnnouncementModel, PostAnnouncementInputModel };
|
|
64
59
|
//# sourceMappingURL=announcement.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcement.schema.d.ts","
|
|
1
|
+
{"version":3,"file":"announcement.schema.d.ts","sourceRoot":"","sources":["../../src/announcement/announcement.schema.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;EAWrC,CAAC"}
|
|
@@ -1,73 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
title: {
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false
|
|
18
|
-
},
|
|
19
|
-
body: {
|
|
20
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
-
isOptional: false
|
|
22
|
-
},
|
|
23
|
-
audience: {
|
|
24
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
audienceRole: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: true
|
|
30
|
-
},
|
|
31
|
-
spaceId: {
|
|
32
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
33
|
-
isOptional: true
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/announcement/announcement.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var AnnouncementModel = defineSchemaModel({
|
|
5
|
+
name: "Announcement",
|
|
6
|
+
description: "Announcement to spaces/org",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
13
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
14
|
+
}
|
|
36
15
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
body: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: false
|
|
51
|
-
},
|
|
52
|
-
audience: {
|
|
53
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
-
isOptional: false
|
|
55
|
-
},
|
|
56
|
-
audienceRole: {
|
|
57
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
58
|
-
isOptional: true
|
|
59
|
-
},
|
|
60
|
-
spaceId: {
|
|
61
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
62
|
-
isOptional: true
|
|
63
|
-
},
|
|
64
|
-
expiresAt: {
|
|
65
|
-
type: ScalarTypeEnum.DateTime(),
|
|
66
|
-
isOptional: true
|
|
67
|
-
}
|
|
68
|
-
}
|
|
16
|
+
var PostAnnouncementInputModel = defineSchemaModel({
|
|
17
|
+
name: "PostAnnouncementInput",
|
|
18
|
+
description: "Post an announcement",
|
|
19
|
+
fields: {
|
|
20
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
26
|
+
}
|
|
69
27
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
28
|
+
export {
|
|
29
|
+
PostAnnouncementInputModel,
|
|
30
|
+
AnnouncementModel
|
|
31
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Announcement domain - Team announcement management.
|
|
3
|
+
*/
|
|
4
|
+
export { AnnouncementModel, PostAnnouncementInputModel, } from './announcement.schema';
|
|
5
|
+
export { PostAnnouncementContract } from './announcement.operations';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/announcement/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/announcement/announcement.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var AnnouncementModel = defineSchemaModel({
|
|
5
|
+
name: "Announcement",
|
|
6
|
+
description: "Announcement to spaces/org",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
13
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var PostAnnouncementInputModel = defineSchemaModel({
|
|
17
|
+
name: "PostAnnouncementInput",
|
|
18
|
+
description: "Post an announcement",
|
|
19
|
+
fields: {
|
|
20
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
3
28
|
|
|
4
|
-
|
|
29
|
+
// src/announcement/announcement.operations.ts
|
|
30
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
31
|
+
var OWNERS = ["@examples.team-hub"];
|
|
32
|
+
var PostAnnouncementContract = defineCommand({
|
|
33
|
+
meta: {
|
|
34
|
+
key: "team.announcement.post",
|
|
35
|
+
version: "1.0.0",
|
|
36
|
+
stability: "stable",
|
|
37
|
+
owners: [...OWNERS],
|
|
38
|
+
tags: ["team-hub", "announcement", "post"],
|
|
39
|
+
description: "Post an announcement.",
|
|
40
|
+
goal: "Communicate with team.",
|
|
41
|
+
context: "Communication."
|
|
42
|
+
},
|
|
43
|
+
io: {
|
|
44
|
+
input: PostAnnouncementInputModel,
|
|
45
|
+
output: AnnouncementModel
|
|
46
|
+
},
|
|
47
|
+
policy: { auth: "user" },
|
|
48
|
+
acceptance: {
|
|
49
|
+
scenarios: [
|
|
50
|
+
{
|
|
51
|
+
key: "post-announcement-happy-path",
|
|
52
|
+
given: ["User is authenticated"],
|
|
53
|
+
when: ["User posts an announcement"],
|
|
54
|
+
then: ["Announcement is posted and distributed"]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
examples: [
|
|
58
|
+
{
|
|
59
|
+
key: "post-general",
|
|
60
|
+
input: {
|
|
61
|
+
spaceId: "space-123",
|
|
62
|
+
title: "New Policy",
|
|
63
|
+
content: "Please read..."
|
|
64
|
+
},
|
|
65
|
+
output: { id: "ann-456", status: "posted" }
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
PostAnnouncementInputModel,
|
|
72
|
+
PostAnnouncementContract,
|
|
73
|
+
AnnouncementModel
|
|
74
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/announcement/announcement.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var AnnouncementModel = defineSchemaModel({
|
|
4
|
+
name: "Announcement",
|
|
5
|
+
description: "Announcement to spaces/org",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
12
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var PostAnnouncementInputModel = defineSchemaModel({
|
|
16
|
+
name: "PostAnnouncementInput",
|
|
17
|
+
description: "Post an announcement",
|
|
18
|
+
fields: {
|
|
19
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/announcement/announcement.operations.ts
|
|
29
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
30
|
+
var OWNERS = ["@examples.team-hub"];
|
|
31
|
+
var PostAnnouncementContract = defineCommand({
|
|
32
|
+
meta: {
|
|
33
|
+
key: "team.announcement.post",
|
|
34
|
+
version: "1.0.0",
|
|
35
|
+
stability: "stable",
|
|
36
|
+
owners: [...OWNERS],
|
|
37
|
+
tags: ["team-hub", "announcement", "post"],
|
|
38
|
+
description: "Post an announcement.",
|
|
39
|
+
goal: "Communicate with team.",
|
|
40
|
+
context: "Communication."
|
|
41
|
+
},
|
|
42
|
+
io: {
|
|
43
|
+
input: PostAnnouncementInputModel,
|
|
44
|
+
output: AnnouncementModel
|
|
45
|
+
},
|
|
46
|
+
policy: { auth: "user" },
|
|
47
|
+
acceptance: {
|
|
48
|
+
scenarios: [
|
|
49
|
+
{
|
|
50
|
+
key: "post-announcement-happy-path",
|
|
51
|
+
given: ["User is authenticated"],
|
|
52
|
+
when: ["User posts an announcement"],
|
|
53
|
+
then: ["Announcement is posted and distributed"]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
examples: [
|
|
57
|
+
{
|
|
58
|
+
key: "post-general",
|
|
59
|
+
input: {
|
|
60
|
+
spaceId: "space-123",
|
|
61
|
+
title: "New Policy",
|
|
62
|
+
content: "Please read..."
|
|
63
|
+
},
|
|
64
|
+
output: { id: "ann-456", status: "posted" }
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
PostAnnouncementContract
|
|
71
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/announcement/announcement.schema.ts
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var AnnouncementModel = defineSchemaModel({
|
|
4
|
+
name: "Announcement",
|
|
5
|
+
description: "Announcement to spaces/org",
|
|
6
|
+
fields: {
|
|
7
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
12
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var PostAnnouncementInputModel = defineSchemaModel({
|
|
16
|
+
name: "PostAnnouncementInput",
|
|
17
|
+
description: "Post an announcement",
|
|
18
|
+
fields: {
|
|
19
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
PostAnnouncementInputModel,
|
|
29
|
+
AnnouncementModel
|
|
30
|
+
};
|