@cratis/showrunner.marquee.authoring 2.10.1 → 2.11.1
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/AmendAnnouncement/AmendAnnouncement.ts +9 -10
- package/AuthorAnnouncement/AuthorAnnouncement.ts +9 -10
- package/dist/cjs/AmendAnnouncement/AmendAnnouncement.d.ts +2 -2
- package/dist/cjs/AmendAnnouncement/AmendAnnouncement.d.ts.map +1 -1
- package/dist/cjs/AmendAnnouncement/AmendAnnouncement.js +4 -5
- package/dist/cjs/AmendAnnouncement/AmendAnnouncement.js.map +1 -1
- package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.d.ts +2 -2
- package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.d.ts.map +1 -1
- package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.js +4 -5
- package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.js.map +1 -1
- package/dist/cjs/Examples/AuthorPermanentNotice.d.ts +2 -0
- package/dist/cjs/Examples/AuthorPermanentNotice.d.ts.map +1 -0
- package/dist/esm/AmendAnnouncement/AmendAnnouncement.d.ts +2 -2
- package/dist/esm/AmendAnnouncement/AmendAnnouncement.d.ts.map +1 -1
- package/dist/esm/AmendAnnouncement/AmendAnnouncement.js +4 -5
- package/dist/esm/AmendAnnouncement/AmendAnnouncement.js.map +1 -1
- package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.d.ts +2 -2
- package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.d.ts.map +1 -1
- package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.js +4 -5
- package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.js.map +1 -1
- package/dist/esm/Examples/AuthorPermanentNotice.d.ts +2 -0
- package/dist/esm/Examples/AuthorPermanentNotice.d.ts.map +1 -0
- package/dist/esm/Examples/AuthorPermanentNotice.js +19 -0
- package/dist/esm/Examples/AuthorPermanentNotice.js.map +1 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
4
|
// **DO NOT EDIT** - This file is an automatically generated file.
|
|
5
|
-
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-
|
|
5
|
+
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 322EBA92447B7DE5B2BDC6231A3ED4B7F3BAF6A9A18ACDFC4CEA1F81F3879615
|
|
6
6
|
import { Command, CommandValidator } from '@cratis/arc/commands';
|
|
7
7
|
import { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';
|
|
8
8
|
import { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';
|
|
@@ -30,7 +30,7 @@ export interface IAmendAnnouncement {
|
|
|
30
30
|
announcementId?: Guid;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* What it says, up to 2,000 characters.
|
|
33
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
34
34
|
*/
|
|
35
35
|
body?: string;
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ export interface IAmendAnnouncement {
|
|
|
40
40
|
importance?: Importance;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Its title, up to 100 characters.
|
|
43
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
44
44
|
*/
|
|
45
45
|
title?: string;
|
|
46
46
|
}
|
|
@@ -48,7 +48,6 @@ export interface IAmendAnnouncement {
|
|
|
48
48
|
export class AmendAnnouncementValidator extends CommandValidator<IAmendAnnouncement> {
|
|
49
49
|
constructor() {
|
|
50
50
|
super();
|
|
51
|
-
this.ruleFor(c => c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
|
|
52
51
|
this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');
|
|
53
52
|
this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
|
|
54
53
|
}
|
|
@@ -67,7 +66,7 @@ export class AmendAnnouncement extends Command<IAmendAnnouncement> implements IA
|
|
|
67
66
|
new PropertyDescriptor('activeFrom', Date, false),
|
|
68
67
|
new PropertyDescriptor('activeUntil', Date, false),
|
|
69
68
|
new PropertyDescriptor('announcementId', Guid, false),
|
|
70
|
-
new PropertyDescriptor('body', String,
|
|
69
|
+
new PropertyDescriptor('body', String, true),
|
|
71
70
|
new PropertyDescriptor('importance', Number, false),
|
|
72
71
|
new PropertyDescriptor('title', String, false),
|
|
73
72
|
];
|
|
@@ -75,7 +74,7 @@ export class AmendAnnouncement extends Command<IAmendAnnouncement> implements IA
|
|
|
75
74
|
#activeFrom!: Date;
|
|
76
75
|
#activeUntil!: Date;
|
|
77
76
|
#announcementId!: Guid;
|
|
78
|
-
#body
|
|
77
|
+
#body?: string;
|
|
79
78
|
#importance!: Importance;
|
|
80
79
|
#title!: string;
|
|
81
80
|
|
|
@@ -122,13 +121,13 @@ export class AmendAnnouncement extends Command<IAmendAnnouncement> implements IA
|
|
|
122
121
|
this.propertyChanged('announcementId');
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
|
-
* What it says, up to 2,000 characters.
|
|
124
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
126
125
|
*/
|
|
127
|
-
get body(): string {
|
|
126
|
+
get body(): string | undefined {
|
|
128
127
|
return this.#body;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
set body(value: string) {
|
|
130
|
+
set body(value: string | undefined) {
|
|
132
131
|
this.#body = value;
|
|
133
132
|
this.propertyChanged('body');
|
|
134
133
|
}
|
|
@@ -144,7 +143,7 @@ export class AmendAnnouncement extends Command<IAmendAnnouncement> implements IA
|
|
|
144
143
|
this.propertyChanged('importance');
|
|
145
144
|
}
|
|
146
145
|
/**
|
|
147
|
-
* Its title, up to 100 characters.
|
|
146
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
148
147
|
*/
|
|
149
148
|
get title(): string {
|
|
150
149
|
return this.#title;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
4
|
// **DO NOT EDIT** - This file is an automatically generated file.
|
|
5
|
-
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-
|
|
5
|
+
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 93148934CDB2AEC9F229AF58B9BB3F53C421972D580222998E86821B9392BCA9
|
|
6
6
|
import { Command, CommandValidator } from '@cratis/arc/commands';
|
|
7
7
|
import { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';
|
|
8
8
|
import { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';
|
|
@@ -37,7 +37,7 @@ export interface IAuthorAnnouncement {
|
|
|
37
37
|
audience?: Audience;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* What it says, up to 2,000 characters.
|
|
40
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
41
41
|
*/
|
|
42
42
|
body?: string;
|
|
43
43
|
|
|
@@ -57,7 +57,7 @@ export interface IAuthorAnnouncement {
|
|
|
57
57
|
product?: string;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Its title, up to 100 characters.
|
|
60
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
61
61
|
*/
|
|
62
62
|
title?: string;
|
|
63
63
|
}
|
|
@@ -66,7 +66,6 @@ export class AuthorAnnouncementValidator extends CommandValidator<IAuthorAnnounc
|
|
|
66
66
|
constructor() {
|
|
67
67
|
super();
|
|
68
68
|
this.ruleFor(c => c.audience).notNull().withMessage('Say who the announcement is for.');
|
|
69
|
-
this.ruleFor(c => c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
|
|
70
69
|
this.ruleFor(c => c.product).notEmpty().withMessage('Say which product the announcement is for.');
|
|
71
70
|
this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');
|
|
72
71
|
this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
|
|
@@ -87,7 +86,7 @@ export class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements
|
|
|
87
86
|
new PropertyDescriptor('activeUntil', Date, false),
|
|
88
87
|
new PropertyDescriptor('announcementId', Guid, false),
|
|
89
88
|
new PropertyDescriptor('audience', Audience, false),
|
|
90
|
-
new PropertyDescriptor('body', String,
|
|
89
|
+
new PropertyDescriptor('body', String, true),
|
|
91
90
|
new PropertyDescriptor('display', Number, false),
|
|
92
91
|
new PropertyDescriptor('importance', Number, false),
|
|
93
92
|
new PropertyDescriptor('product', String, false),
|
|
@@ -98,7 +97,7 @@ export class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements
|
|
|
98
97
|
#activeUntil!: Date;
|
|
99
98
|
#announcementId!: Guid;
|
|
100
99
|
#audience!: Audience;
|
|
101
|
-
#body
|
|
100
|
+
#body?: string;
|
|
102
101
|
#display!: Display;
|
|
103
102
|
#importance!: Importance;
|
|
104
103
|
#product!: string;
|
|
@@ -158,13 +157,13 @@ export class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements
|
|
|
158
157
|
this.propertyChanged('audience');
|
|
159
158
|
}
|
|
160
159
|
/**
|
|
161
|
-
* What it says, up to 2,000 characters.
|
|
160
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
162
161
|
*/
|
|
163
|
-
get body(): string {
|
|
162
|
+
get body(): string | undefined {
|
|
164
163
|
return this.#body;
|
|
165
164
|
}
|
|
166
165
|
|
|
167
|
-
set body(value: string) {
|
|
166
|
+
set body(value: string | undefined) {
|
|
168
167
|
this.#body = value;
|
|
169
168
|
this.propertyChanged('body');
|
|
170
169
|
}
|
|
@@ -202,7 +201,7 @@ export class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements
|
|
|
202
201
|
this.propertyChanged('product');
|
|
203
202
|
}
|
|
204
203
|
/**
|
|
205
|
-
* Its title, up to 100 characters.
|
|
204
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
206
205
|
*/
|
|
207
206
|
get title(): string {
|
|
208
207
|
return this.#title;
|
|
@@ -30,8 +30,8 @@ export declare class AmendAnnouncement extends Command<IAmendAnnouncement> imple
|
|
|
30
30
|
set activeUntil(value: Date);
|
|
31
31
|
get announcementId(): Guid;
|
|
32
32
|
set announcementId(value: Guid);
|
|
33
|
-
get body(): string;
|
|
34
|
-
set body(value: string);
|
|
33
|
+
get body(): string | undefined;
|
|
34
|
+
set body(value: string | undefined);
|
|
35
35
|
get importance(): Importance;
|
|
36
36
|
set importance(value: Importance);
|
|
37
37
|
get title(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmendAnnouncement.d.ts","sourceRoot":"","sources":["../../../AmendAnnouncement/AmendAnnouncement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAc,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAK5C,MAAM,WAAW,kBAAkB;IAK/B,UAAU,CAAC,EAAE,IAAI,CAAC;IAKlB,WAAW,CAAC,EAAE,IAAI,CAAC;IAKnB,cAAc,CAA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AE,MAAM,EAAE,CAAM;IAC9B,QAAQ,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,CAOhD;;IAaF,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAGhC;IAKD,IAAI,UAAU,IAAI,IAAI,CAErB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,EAGzB;IAID,IAAI,WAAW,IAAI,IAAI,CAEtB;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,EAG1B;IAID,IAAI,cAAc,IAAI,IAAI,CAEzB;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,IAAI,EAG7B;IAID,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAGjC;IAID,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,UAAU,EAG/B;IAID,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;IAED,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,kBAAkB,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CAGhI"}
|
|
@@ -8,11 +8,10 @@ var fundamentals = require('@cratis/fundamentals');
|
|
|
8
8
|
// Copyright (c) Cratis. All rights reserved.
|
|
9
9
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
10
|
// **DO NOT EDIT** - This file is an automatically generated file.
|
|
11
|
-
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-
|
|
11
|
+
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 322EBA92447B7DE5B2BDC6231A3ED4B7F3BAF6A9A18ACDFC4CEA1F81F3879615
|
|
12
12
|
class AmendAnnouncementValidator extends commands.CommandValidator {
|
|
13
13
|
constructor(){
|
|
14
14
|
super();
|
|
15
|
-
this.ruleFor((c)=>c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
|
|
16
15
|
this.ruleFor((c)=>c.title).notEmpty().withMessage('Give the announcement a title.');
|
|
17
16
|
this.ruleFor((c)=>c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
|
|
18
17
|
}
|
|
@@ -29,7 +28,7 @@ class AmendAnnouncementValidator extends commands.CommandValidator {
|
|
|
29
28
|
new reflection.PropertyDescriptor('activeFrom', Date, false),
|
|
30
29
|
new reflection.PropertyDescriptor('activeUntil', Date, false),
|
|
31
30
|
new reflection.PropertyDescriptor('announcementId', fundamentals.Guid, false),
|
|
32
|
-
new reflection.PropertyDescriptor('body', String,
|
|
31
|
+
new reflection.PropertyDescriptor('body', String, true),
|
|
33
32
|
new reflection.PropertyDescriptor('importance', Number, false),
|
|
34
33
|
new reflection.PropertyDescriptor('title', String, false)
|
|
35
34
|
];
|
|
@@ -73,7 +72,7 @@ class AmendAnnouncementValidator extends commands.CommandValidator {
|
|
|
73
72
|
this.propertyChanged('announcementId');
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
|
-
* What it says, up to 2,000 characters.
|
|
75
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
77
76
|
*/ get body() {
|
|
78
77
|
return this.#body;
|
|
79
78
|
}
|
|
@@ -91,7 +90,7 @@ class AmendAnnouncementValidator extends commands.CommandValidator {
|
|
|
91
90
|
this.propertyChanged('importance');
|
|
92
91
|
}
|
|
93
92
|
/**
|
|
94
|
-
* Its title, up to 100 characters.
|
|
93
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
95
94
|
*/ get title() {
|
|
96
95
|
return this.#title;
|
|
97
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmendAnnouncement.js","sources":["../../../AmendAnnouncement/AmendAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-
|
|
1
|
+
{"version":3,"file":"AmendAnnouncement.js","sources":["../../../AmendAnnouncement/AmendAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 322EBA92447B7DE5B2BDC6231A3ED4B7F3BAF6A9A18ACDFC4CEA1F81F3879615\nimport { Command, CommandValidator } from '@cratis/arc/commands';\nimport { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';\nimport { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';\nimport { Importance } from '../Announcements/Importance';\nimport { Guid } from '@cratis/fundamentals';\n\n/**\n * Amends what an announcement says, how important it is and when it is shown. How it is displayed cannot change, and who it is for changes with `RetargetAnnouncement`. Amending to what the announcement already says records nothing.\n */\nexport interface IAmendAnnouncement {\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n activeFrom?: Date;\n\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n activeUntil?: Date;\n\n /**\n * The announcement.\n */\n announcementId?: Guid;\n\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n body?: string;\n\n /**\n * How important it is.\n */\n importance?: Importance;\n\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n title?: string;\n}\n\nexport class AmendAnnouncementValidator extends CommandValidator<IAmendAnnouncement> {\n constructor() {\n super();\n this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');\n this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');\n }\n}\n\n/**\n * Amends what an announcement says, how important it is and when it is shown. How it is displayed cannot change, and who it is for changes with `RetargetAnnouncement`. Amending to what the announcement already says records nothing.\n */\nexport class AmendAnnouncement extends Command<IAmendAnnouncement> implements IAmendAnnouncement {\n static readonly sliceLocation: ArcSliceLocation = /*#__PURE__*/ new ArcSliceLocation('', '', 'AmendAnnouncement');\n readonly route: string = '/api/amend-announcement';\n readonly validation: CommandValidator = new AmendAnnouncementValidator();\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly propertyDescriptors: PropertyDescriptor[] = [\n new PropertyDescriptor('activeFrom', Date, false),\n new PropertyDescriptor('activeUntil', Date, false),\n new PropertyDescriptor('announcementId', Guid, false),\n new PropertyDescriptor('body', String, true),\n new PropertyDescriptor('importance', Number, false),\n new PropertyDescriptor('title', String, false),\n ];\n\n #activeFrom!: Date;\n #activeUntil!: Date;\n #announcementId!: Guid;\n #body?: string;\n #importance!: Importance;\n #title!: string;\n\n constructor() {\n super(Object, false);\n }\n\n get requestParameters(): string[] {\n return [\n ];\n }\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n get activeFrom(): Date {\n return this.#activeFrom;\n }\n\n set activeFrom(value: Date) {\n this.#activeFrom = value;\n this.propertyChanged('activeFrom');\n }\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n get activeUntil(): Date {\n return this.#activeUntil;\n }\n\n set activeUntil(value: Date) {\n this.#activeUntil = value;\n this.propertyChanged('activeUntil');\n }\n /**\n * The announcement.\n */\n get announcementId(): Guid {\n return this.#announcementId;\n }\n\n set announcementId(value: Guid) {\n this.#announcementId = value;\n this.propertyChanged('announcementId');\n }\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n get body(): string | undefined {\n return this.#body;\n }\n\n set body(value: string | undefined) {\n this.#body = value;\n this.propertyChanged('body');\n }\n /**\n * How important it is.\n */\n get importance(): Importance {\n return this.#importance;\n }\n\n set importance(value: Importance) {\n this.#importance = value;\n this.propertyChanged('importance');\n }\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n get title(): string {\n return this.#title;\n }\n\n set title(value: string) {\n this.#title = value;\n this.propertyChanged('title');\n }\n\n static use(initialValues?: IAmendAnnouncement): [AmendAnnouncement, SetCommandValues<IAmendAnnouncement>, ClearCommandValues] {\n return useCommand<AmendAnnouncement, IAmendAnnouncement>(AmendAnnouncement, initialValues);\n }\n}\n"],"names":["AmendAnnouncementValidator","CommandValidator","ruleFor","c","title","notEmpty","withMessage","maxLength","AmendAnnouncement","Command","sliceLocation","ArcSliceLocation","route","validation","treatWarningsAsErrors","roles","propertyDescriptors","PropertyDescriptor","Date","Guid","String","Number","Object","requestParameters","activeFrom","value","propertyChanged","activeUntil","announcementId","body","importance","use","initialValues","useCommand"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AA2CO,MAAMA,0BAAAA,SAAmCC,yBAAAA,CAAAA;IAC5C,WAAA,EAAc;QACV,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,KAAK,CAAA,CAAEC,QAAQ,EAAA,CAAGC,WAAW,CAAC,gCAAA,CAAA;AAClD,QAAA,IAAI,CAACJ,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,KAAK,CAAA,CAAEG,SAAS,CAAC,GAAA,CAAA,CAAKD,WAAW,CAAC,uCAAA,CAAA;AAC1D,IAAA;AACJ;AAEA;;IAGO,MAAME,iBAAAA,SAA0BC,gBAAAA,CAAAA;AACnC,IAAA,OAAgBC,8BAAgD,IAAIC,wBAAAA,CAAiB,EAAA,EAAI,IAAI,mBAAA,CAAA;AACpFC,IAAAA,KAAAA,GAAgB,yBAAA;AAChBC,IAAAA,UAAAA,GAA+B,IAAIb,0BAAAA,EAAAA;AACn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IAEA,IAAIA,cAAAA,CAAeH,KAAW,EAAE;QAC5B,IAAI,CAAC,eAAe,GAAGA,KAAAA;QACvB,IAAI,CAACC,eAAe,CAAC,gBAAA,CAAA;AACzB,IAAA;AACA;;AAEC,QACD,IAAIG,IAAAA,GAA2B;QAC3B,OAAO,IAAI,CAAC,KAAK;AACrB,IAAA;IAEA,IAAIA,IAAAA,CAAKJ,KAAyB,EAAE;QAChC,IAAI,CAAC,KAAK,GAAGA,KAAAA;QACb,IAAI,CAACC,eAAe,CAAC,MAAA,CAAA;AACzB,IAAA;AACA;;AAEC,QACD,IAAII,UAAAA,GAAyB;QACzB,OAAO,IAAI,CAAC,WAAW;AAC3B,IAAA;IAEA,IAAIA,UAAAA,CAAWL,KAAiB,EAAE;QAC9B,IAAI,CAAC,WAAW,GAAGA,KAAAA;QACnB,IAAI,CAACC,eAAe,CAAC,YAAA,CAAA;AACzB,IAAA;AACA;;AAEC,QACD,IAAItB,KAAAA,GAAgB;QAChB,OAAO,IAAI,CAAC,MAAM;AACtB,IAAA;IAEA,IAAIA,KAAAA,CAAMqB,KAAa,EAAE;QACrB,IAAI,CAAC,MAAM,GAAGA,KAAAA;QACd,IAAI,CAACC,eAAe,CAAC,OAAA,CAAA;AACzB,IAAA;IAEA,OAAOK,GAAAA,CAAIC,aAAkC,EAAiF;AAC1H,QAAA,OAAOC,sBAAkDzB,iBAAAA,EAAmBwB,aAAAA,CAAAA;AAChF,IAAA;AACJ;;;"}
|
|
@@ -37,8 +37,8 @@ export declare class AuthorAnnouncement extends Command<IAuthorAnnouncement> imp
|
|
|
37
37
|
set announcementId(value: Guid);
|
|
38
38
|
get audience(): Audience;
|
|
39
39
|
set audience(value: Audience);
|
|
40
|
-
get body(): string;
|
|
41
|
-
set body(value: string);
|
|
40
|
+
get body(): string | undefined;
|
|
41
|
+
set body(value: string | undefined);
|
|
42
42
|
get display(): Display;
|
|
43
43
|
set display(value: Display);
|
|
44
44
|
get importance(): Importance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorAnnouncement.d.ts","sourceRoot":"","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAc,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAK5C,MAAM,WAAW,mBAAmB;IAKhC,UAAU,CAAC,EAAE,IAAI,CAAC;IAKlB,WAAW,CAAC,EAAE,IAAI,CAAC;IAKnB,cAAc,CAAC,EAAE,IAAI,CAAC;IAKtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAKpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAKd,OAAO,CAAC,EAAE,OAAO,CAAC;IAKlB,UAAU,CAAC,EAAE,UAAU,CAAC;IAKxB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,2BAA4B,SAAQ,gBAAgB,CAAC,mBAAmB,CAAC;;
|
|
1
|
+
{"version":3,"file":"AuthorAnnouncement.d.ts","sourceRoot":"","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAc,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,aAAa,IAAI,gB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AED,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,EAG1B;IAID,IAAI,cAAc,IAAI,IAAI,CAEzB;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,IAAI,EAG7B;IAID,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAG3B;IAID,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAGjC;IAID,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IAID,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,UAAU,EAG/B;IAID,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAGxB;IAID,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;IAED,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,mBAAmB,GAAG,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;CAGnI"}
|
|
@@ -9,12 +9,11 @@ var fundamentals = require('@cratis/fundamentals');
|
|
|
9
9
|
// Copyright (c) Cratis. All rights reserved.
|
|
10
10
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
11
|
// **DO NOT EDIT** - This file is an automatically generated file.
|
|
12
|
-
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-
|
|
12
|
+
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 93148934CDB2AEC9F229AF58B9BB3F53C421972D580222998E86821B9392BCA9
|
|
13
13
|
class AuthorAnnouncementValidator extends commands.CommandValidator {
|
|
14
14
|
constructor(){
|
|
15
15
|
super();
|
|
16
16
|
this.ruleFor((c)=>c.audience).notNull().withMessage('Say who the announcement is for.');
|
|
17
|
-
this.ruleFor((c)=>c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
|
|
18
17
|
this.ruleFor((c)=>c.product).notEmpty().withMessage('Say which product the announcement is for.');
|
|
19
18
|
this.ruleFor((c)=>c.title).notEmpty().withMessage('Give the announcement a title.');
|
|
20
19
|
this.ruleFor((c)=>c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
|
|
@@ -33,7 +32,7 @@ class AuthorAnnouncementValidator extends commands.CommandValidator {
|
|
|
33
32
|
new reflection.PropertyDescriptor('activeUntil', Date, false),
|
|
34
33
|
new reflection.PropertyDescriptor('announcementId', fundamentals.Guid, false),
|
|
35
34
|
new reflection.PropertyDescriptor('audience', Audience.Audience, false),
|
|
36
|
-
new reflection.PropertyDescriptor('body', String,
|
|
35
|
+
new reflection.PropertyDescriptor('body', String, true),
|
|
37
36
|
new reflection.PropertyDescriptor('display', Number, false),
|
|
38
37
|
new reflection.PropertyDescriptor('importance', Number, false),
|
|
39
38
|
new reflection.PropertyDescriptor('product', String, false),
|
|
@@ -91,7 +90,7 @@ class AuthorAnnouncementValidator extends commands.CommandValidator {
|
|
|
91
90
|
this.propertyChanged('audience');
|
|
92
91
|
}
|
|
93
92
|
/**
|
|
94
|
-
* What it says, up to 2,000 characters.
|
|
93
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
95
94
|
*/ get body() {
|
|
96
95
|
return this.#body;
|
|
97
96
|
}
|
|
@@ -127,7 +126,7 @@ class AuthorAnnouncementValidator extends commands.CommandValidator {
|
|
|
127
126
|
this.propertyChanged('product');
|
|
128
127
|
}
|
|
129
128
|
/**
|
|
130
|
-
* Its title, up to 100 characters.
|
|
129
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
131
130
|
*/ get title() {
|
|
132
131
|
return this.#title;
|
|
133
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorAnnouncement.js","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-11T04:33:12.9221640Z. Hash: 32D050612DF35D8A45D7DA9E47882974F73D3BD2059CB63CD0AE28CE5BAC89E7\nimport { Command, CommandValidator } from '@cratis/arc/commands';\nimport { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';\nimport { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';\nimport { Display } from '../Announcements/Display';\nimport { Importance } from '../Announcements/Importance';\nimport { Audience } from '../Audiences/Audience';\nimport { Guid } from '@cratis/fundamentals';\n\n/**\n * Authors an announcement for a product.\n */\nexport interface IAuthorAnnouncement {\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n activeFrom?: Date;\n\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n activeUntil?: Date;\n\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n announcementId?: Guid;\n\n /**\n * Who it is for.\n */\n audience?: Audience;\n\n /**\n * What it says, up to 2,000 characters.\n */\n body?: string;\n\n /**\n * How it is shown; it cannot change afterwards.\n */\n display?: Display;\n\n /**\n * How important it is.\n */\n importance?: Importance;\n\n /**\n * The product the announcement is for.\n */\n product?: string;\n\n /**\n * Its title, up to 100 characters.\n */\n title?: string;\n}\n\nexport class AuthorAnnouncementValidator extends CommandValidator<IAuthorAnnouncement> {\n constructor() {\n super();\n this.ruleFor(c => c.audience).notNull().withMessage('Say who the announcement is for.');\n this.ruleFor(c => c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');\n this.ruleFor(c => c.product).notEmpty().withMessage('Say which product the announcement is for.');\n this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');\n this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');\n }\n}\n\n/**\n * Authors an announcement for a product.\n */\nexport class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements IAuthorAnnouncement {\n static readonly sliceLocation: ArcSliceLocation = /*#__PURE__*/ new ArcSliceLocation('', '', 'AuthorAnnouncement');\n readonly route: string = '/api/author-announcement';\n readonly validation: CommandValidator = new AuthorAnnouncementValidator();\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly propertyDescriptors: PropertyDescriptor[] = [\n new PropertyDescriptor('activeFrom', Date, false),\n new PropertyDescriptor('activeUntil', Date, false),\n new PropertyDescriptor('announcementId', Guid, false),\n new PropertyDescriptor('audience', Audience, false),\n new PropertyDescriptor('body', String, false),\n new PropertyDescriptor('display', Number, false),\n new PropertyDescriptor('importance', Number, false),\n new PropertyDescriptor('product', String, false),\n new PropertyDescriptor('title', String, false),\n ];\n\n #activeFrom!: Date;\n #activeUntil!: Date;\n #announcementId!: Guid;\n #audience!: Audience;\n #body!: string;\n #display!: Display;\n #importance!: Importance;\n #product!: string;\n #title!: string;\n\n constructor() {\n super(Object, false);\n }\n\n get requestParameters(): string[] {\n return [\n ];\n }\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n get activeFrom(): Date {\n return this.#activeFrom;\n }\n\n set activeFrom(value: Date) {\n this.#activeFrom = value;\n this.propertyChanged('activeFrom');\n }\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n get activeUntil(): Date {\n return this.#activeUntil;\n }\n\n set activeUntil(value: Date) {\n this.#activeUntil = value;\n this.propertyChanged('activeUntil');\n }\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n get announcementId(): Guid {\n return this.#announcementId;\n }\n\n set announcementId(value: Guid) {\n this.#announcementId = value;\n this.propertyChanged('announcementId');\n }\n /**\n * Who it is for.\n */\n get audience(): Audience {\n return this.#audience;\n }\n\n set audience(value: Audience) {\n this.#audience = value;\n this.propertyChanged('audience');\n }\n /**\n * What it says, up to 2,000 characters.\n */\n get body(): string {\n return this.#body;\n }\n\n set body(value: string) {\n this.#body = value;\n this.propertyChanged('body');\n }\n /**\n * How it is shown; it cannot change afterwards.\n */\n get display(): Display {\n return this.#display;\n }\n\n set display(value: Display) {\n this.#display = value;\n this.propertyChanged('display');\n }\n /**\n * How important it is.\n */\n get importance(): Importance {\n return this.#importance;\n }\n\n set importance(value: Importance) {\n this.#importance = value;\n this.propertyChanged('importance');\n }\n /**\n * The product the announcement is for.\n */\n get product(): string {\n return this.#product;\n }\n\n set product(value: string) {\n this.#product = value;\n this.propertyChanged('product');\n }\n /**\n * Its title, up to 100 characters.\n */\n get title(): string {\n return this.#title;\n }\n\n set title(value: string) {\n this.#title = value;\n this.propertyChanged('title');\n }\n\n static use(initialValues?: IAuthorAnnouncement): [AuthorAnnouncement, SetCommandValues<IAuthorAnnouncement>, ClearCommandValues] {\n return useCommand<AuthorAnnouncement, IAuthorAnnouncement>(AuthorAnnouncement, initialValues);\n }\n}\n"],"names":["AuthorAnnouncementValidator","CommandValidator","ruleFor","c","audience","notNull","withMessage","body","maxLength","product","notEmpty","title","AuthorAnnouncement","Command","sliceLocation","ArcSliceLocation","route","validation","treatWarningsAsErrors","roles","propertyDescriptors","PropertyDescriptor","Date","Guid","Audience","String","Number","Object","requestParameters","activeFrom","value","propertyChanged","activeUntil","announcementId","display","importance","use","initialValues","useCommand"],"mappings":";;;;;;;;AAAA;AACA;AAEA;AACA;AA4DO,MAAMA,2BAAAA,SAAoCC,yBAAAA,CAAAA;IAC7C,WAAA,EAAc;QACV,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,QAAQ,CAAA,CAAEC,OAAO,EAAA,CAAGC,WAAW,CAAC,k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AAe,CAAC,OAAA,CAAA;AACzB,IAAA;IAEA,OAAOK,GAAAA,CAAIC,aAAmC,EAAmF;AAC7H,QAAA,OAAOC,sBAAoD1B,kBAAAA,EAAoByB,aAAAA,CAAAA;AACnF,IAAA;AACJ;;;"}
|
|
1
|
+
{"version":3,"file":"AuthorAnnouncement.js","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 93148934CDB2AEC9F229AF58B9BB3F53C421972D580222998E86821B9392BCA9\nimport { Command, CommandValidator } from '@cratis/arc/commands';\nimport { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';\nimport { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';\nimport { Display } from '../Announcements/Display';\nimport { Importance } from '../Announcements/Importance';\nimport { Audience } from '../Audiences/Audience';\nimport { Guid } from '@cratis/fundamentals';\n\n/**\n * Authors an announcement for a product.\n */\nexport interface IAuthorAnnouncement {\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n activeFrom?: Date;\n\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n activeUntil?: Date;\n\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n announcementId?: Guid;\n\n /**\n * Who it is for.\n */\n audience?: Audience;\n\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n body?: string;\n\n /**\n * How it is shown; it cannot change afterwards.\n */\n display?: Display;\n\n /**\n * How important it is.\n */\n importance?: Importance;\n\n /**\n * The product the announcement is for.\n */\n product?: string;\n\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n title?: string;\n}\n\nexport class AuthorAnnouncementValidator extends CommandValidator<IAuthorAnnouncement> {\n constructor() {\n super();\n this.ruleFor(c => c.audience).notNull().withMessage('Say who the announcement is for.');\n this.ruleFor(c => c.product).notEmpty().withMessage('Say which product the announcement is for.');\n this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');\n this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');\n }\n}\n\n/**\n * Authors an announcement for a product.\n */\nexport class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements IAuthorAnnouncement {\n static readonly sliceLocation: ArcSliceLocation = /*#__PURE__*/ new ArcSliceLocation('', '', 'AuthorAnnouncement');\n readonly route: string = '/api/author-announcement';\n readonly validation: CommandValidator = new AuthorAnnouncementValidator();\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly propertyDescriptors: PropertyDescriptor[] = [\n new PropertyDescriptor('activeFrom', Date, false),\n new PropertyDescriptor('activeUntil', Date, false),\n new PropertyDescriptor('announcementId', Guid, false),\n new PropertyDescriptor('audience', Audience, false),\n new PropertyDescriptor('body', String, true),\n new PropertyDescriptor('display', Number, false),\n new PropertyDescriptor('importance', Number, false),\n new PropertyDescriptor('product', String, false),\n new PropertyDescriptor('title', String, false),\n ];\n\n #activeFrom!: Date;\n #activeUntil!: Date;\n #announcementId!: Guid;\n #audience!: Audience;\n #body?: string;\n #display!: Display;\n #importance!: Importance;\n #product!: string;\n #title!: string;\n\n constructor() {\n super(Object, false);\n }\n\n get requestParameters(): string[] {\n return [\n ];\n }\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n get activeFrom(): Date {\n return this.#activeFrom;\n }\n\n set activeFrom(value: Date) {\n this.#activeFrom = value;\n this.propertyChanged('activeFrom');\n }\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n get activeUntil(): Date {\n return this.#activeUntil;\n }\n\n set activeUntil(value: Date) {\n this.#activeUntil = value;\n this.propertyChanged('activeUntil');\n }\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n get announcementId(): Guid {\n return this.#announcementId;\n }\n\n set announcementId(value: Guid) {\n this.#announcementId = value;\n this.propertyChanged('announcementId');\n }\n /**\n * Who it is for.\n */\n get audience(): Audience {\n return this.#audience;\n }\n\n set audience(value: Audience) {\n this.#audience = value;\n this.propertyChanged('audience');\n }\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n get body(): string | undefined {\n return this.#body;\n }\n\n set body(value: string | undefined) {\n this.#body = value;\n this.propertyChanged('body');\n }\n /**\n * How it is shown; it cannot change afterwards.\n */\n get display(): Display {\n return this.#display;\n }\n\n set display(value: Display) {\n this.#display = value;\n this.propertyChanged('display');\n }\n /**\n * How important it is.\n */\n get importance(): Importance {\n return this.#importance;\n }\n\n set importance(value: Importance) {\n this.#importance = value;\n this.propertyChanged('importance');\n }\n /**\n * The product the announcement is for.\n */\n get product(): string {\n return this.#product;\n }\n\n set product(value: string) {\n this.#product = value;\n this.propertyChanged('product');\n }\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n get title(): string {\n return this.#title;\n }\n\n set title(value: string) {\n this.#title = value;\n this.propertyChanged('title');\n }\n\n static use(initialValues?: IAuthorAnnouncement): [AuthorAnnouncement, SetCommandValues<IAuthorAnnouncement>, ClearCommandValues] {\n return useCommand<AuthorAnnouncement, IAuthorAnnouncement>(AuthorAnnouncement, initialValues);\n }\n}\n"],"names":["AuthorAnnouncementValidator","CommandValidator","ruleFor","c","audience","notNull","withMessage","product","notEmpty","title","maxLength","AuthorAnnouncement","Command","sliceLocation","ArcSliceLocation","route","validation","treatWarningsAsErrors","roles","propertyDescriptors","PropertyDescriptor","Date","Guid","Audience","String","Number","Object","requestParameters","activeFrom","value","propertyChanged","activeUntil","announcementId","body","display","importance","use","initialValues","useCommand"],"mappings":";;;;;;;;AAAA;AACA;AAEA;AACA;AA4DO,MAAMA,2BAAAA,SAAoCC,yBAAAA,CAAAA;IAC7C,WAAA,EAAc;QACV,KAAK,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B,IAAA;IAEA,OAAOM,GAAAA,CAAIC,aAAmC,EAAmF;AAC7H,QAAA,OAAOC,sBAAoD3B,kBAAAA,EAAoB0B,aAAAA,CAAAA;AACnF,IAAA;AACJ;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorPermanentNotice.d.ts","sourceRoot":"","sources":["../../../Examples/AuthorPermanentNotice.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,wBAkBjC,CAAC"}
|
|
@@ -30,8 +30,8 @@ export declare class AmendAnnouncement extends Command<IAmendAnnouncement> imple
|
|
|
30
30
|
set activeUntil(value: Date);
|
|
31
31
|
get announcementId(): Guid;
|
|
32
32
|
set announcementId(value: Guid);
|
|
33
|
-
get body(): string;
|
|
34
|
-
set body(value: string);
|
|
33
|
+
get body(): string | undefined;
|
|
34
|
+
set body(value: string | undefined);
|
|
35
35
|
get importance(): Importance;
|
|
36
36
|
set importance(value: Importance);
|
|
37
37
|
get title(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmendAnnouncement.d.ts","sourceRoot":"","sources":["../../../AmendAnnouncement/AmendAnnouncement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAc,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAK5C,MAAM,WAAW,kBAAkB;IAK/B,UAAU,CAAC,EAAE,IAAI,CAAC;IAKlB,WAAW,CAAC,EAAE,IAAI,CAAC;IAKnB,cAAc,CAAC,EAAE,IAAI,CAAC;IAKtB,IAAI,CAAC,EAAE,MAAM,CA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E,kBAAkB,EAAE,CAOhD;;IAaF,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAGhC;IAKD,IAAI,UAAU,IAAI,IAAI,CAErB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,EAGzB;IAID,IAAI,WAAW,IAAI,IAAI,CAEtB;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,EAG1B;IAID,IAAI,cAAc,IAAI,IAAI,CAEzB;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,IAAI,EAG7B;IAID,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAGjC;IAID,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,UAAU,EAG/B;IAID,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;IAED,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,kBAAkB,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CAGhI"}
|
|
@@ -6,11 +6,10 @@ import { Guid } from '@cratis/fundamentals';
|
|
|
6
6
|
// Copyright (c) Cratis. All rights reserved.
|
|
7
7
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
8
|
// **DO NOT EDIT** - This file is an automatically generated file.
|
|
9
|
-
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-
|
|
9
|
+
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 322EBA92447B7DE5B2BDC6231A3ED4B7F3BAF6A9A18ACDFC4CEA1F81F3879615
|
|
10
10
|
class AmendAnnouncementValidator extends CommandValidator {
|
|
11
11
|
constructor(){
|
|
12
12
|
super();
|
|
13
|
-
this.ruleFor((c)=>c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
|
|
14
13
|
this.ruleFor((c)=>c.title).notEmpty().withMessage('Give the announcement a title.');
|
|
15
14
|
this.ruleFor((c)=>c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
|
|
16
15
|
}
|
|
@@ -27,7 +26,7 @@ class AmendAnnouncementValidator extends CommandValidator {
|
|
|
27
26
|
new PropertyDescriptor('activeFrom', Date, false),
|
|
28
27
|
new PropertyDescriptor('activeUntil', Date, false),
|
|
29
28
|
new PropertyDescriptor('announcementId', Guid, false),
|
|
30
|
-
new PropertyDescriptor('body', String,
|
|
29
|
+
new PropertyDescriptor('body', String, true),
|
|
31
30
|
new PropertyDescriptor('importance', Number, false),
|
|
32
31
|
new PropertyDescriptor('title', String, false)
|
|
33
32
|
];
|
|
@@ -71,7 +70,7 @@ class AmendAnnouncementValidator extends CommandValidator {
|
|
|
71
70
|
this.propertyChanged('announcementId');
|
|
72
71
|
}
|
|
73
72
|
/**
|
|
74
|
-
* What it says, up to 2,000 characters.
|
|
73
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
75
74
|
*/ get body() {
|
|
76
75
|
return this.#body;
|
|
77
76
|
}
|
|
@@ -89,7 +88,7 @@ class AmendAnnouncementValidator extends CommandValidator {
|
|
|
89
88
|
this.propertyChanged('importance');
|
|
90
89
|
}
|
|
91
90
|
/**
|
|
92
|
-
* Its title, up to 100 characters.
|
|
91
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
93
92
|
*/ get title() {
|
|
94
93
|
return this.#title;
|
|
95
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmendAnnouncement.js","sources":["../../../AmendAnnouncement/AmendAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-
|
|
1
|
+
{"version":3,"file":"AmendAnnouncement.js","sources":["../../../AmendAnnouncement/AmendAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 322EBA92447B7DE5B2BDC6231A3ED4B7F3BAF6A9A18ACDFC4CEA1F81F3879615\nimport { Command, CommandValidator } from '@cratis/arc/commands';\nimport { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';\nimport { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';\nimport { Importance } from '../Announcements/Importance';\nimport { Guid } from '@cratis/fundamentals';\n\n/**\n * Amends what an announcement says, how important it is and when it is shown. How it is displayed cannot change, and who it is for changes with `RetargetAnnouncement`. Amending to what the announcement already says records nothing.\n */\nexport interface IAmendAnnouncement {\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n activeFrom?: Date;\n\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n activeUntil?: Date;\n\n /**\n * The announcement.\n */\n announcementId?: Guid;\n\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n body?: string;\n\n /**\n * How important it is.\n */\n importance?: Importance;\n\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n title?: string;\n}\n\nexport class AmendAnnouncementValidator extends CommandValidator<IAmendAnnouncement> {\n constructor() {\n super();\n this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');\n this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');\n }\n}\n\n/**\n * Amends what an announcement says, how important it is and when it is shown. How it is displayed cannot change, and who it is for changes with `RetargetAnnouncement`. Amending to what the announcement already says records nothing.\n */\nexport class AmendAnnouncement extends Command<IAmendAnnouncement> implements IAmendAnnouncement {\n static readonly sliceLocation: ArcSliceLocation = /*#__PURE__*/ new ArcSliceLocation('', '', 'AmendAnnouncement');\n readonly route: string = '/api/amend-announcement';\n readonly validation: CommandValidator = new AmendAnnouncementValidator();\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly propertyDescriptors: PropertyDescriptor[] = [\n new PropertyDescriptor('activeFrom', Date, false),\n new PropertyDescriptor('activeUntil', Date, false),\n new PropertyDescriptor('announcementId', Guid, false),\n new PropertyDescriptor('body', String, true),\n new PropertyDescriptor('importance', Number, false),\n new PropertyDescriptor('title', String, false),\n ];\n\n #activeFrom!: Date;\n #activeUntil!: Date;\n #announcementId!: Guid;\n #body?: string;\n #importance!: Importance;\n #title!: string;\n\n constructor() {\n super(Object, false);\n }\n\n get requestParameters(): string[] {\n return [\n ];\n }\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n get activeFrom(): Date {\n return this.#activeFrom;\n }\n\n set activeFrom(value: Date) {\n this.#activeFrom = value;\n this.propertyChanged('activeFrom');\n }\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n get activeUntil(): Date {\n return this.#activeUntil;\n }\n\n set activeUntil(value: Date) {\n this.#activeUntil = value;\n this.propertyChanged('activeUntil');\n }\n /**\n * The announcement.\n */\n get announcementId(): Guid {\n return this.#announcementId;\n }\n\n set announcementId(value: Guid) {\n this.#announcementId = value;\n this.propertyChanged('announcementId');\n }\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n get body(): string | undefined {\n return this.#body;\n }\n\n set body(value: string | undefined) {\n this.#body = value;\n this.propertyChanged('body');\n }\n /**\n * How important it is.\n */\n get importance(): Importance {\n return this.#importance;\n }\n\n set importance(value: Importance) {\n this.#importance = value;\n this.propertyChanged('importance');\n }\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n get title(): string {\n return this.#title;\n }\n\n set title(value: string) {\n this.#title = value;\n this.propertyChanged('title');\n }\n\n static use(initialValues?: IAmendAnnouncement): [AmendAnnouncement, SetCommandValues<IAmendAnnouncement>, ClearCommandValues] {\n return useCommand<AmendAnnouncement, IAmendAnnouncement>(AmendAnnouncement, initialValues);\n }\n}\n"],"names":["AmendAnnouncementValidator","CommandValidator","ruleFor","c","title","notEmpty","withMessage","maxLength","AmendAnnouncement","Command","sliceLocation","ArcSliceLocation","route","validation","treatWarningsAsErrors","roles","propertyDescriptors","PropertyDescriptor","Date","Guid","String","Number","Object","requestParameters","activeFrom","value","propertyChanged","activeUntil","announcementId","body","importance","use","initialValues","useCommand"],"mappings":";;;;;AAAA;AACA;AAEA;AACA;AA2CO,MAAMA,0BAAAA,SAAmCC,gBAAAA,CAAAA;IAC5C,WAAA,EAAc;QACV,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,KAAK,CAAA,CAAEC,QAAQ,EAAA,CAAGC,WAAW,CAAC,gCAAA,CAAA;AAClD,QAAA,IAAI,CAACJ,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,KAAK,CAAA,CAAEG,SAAS,CAAC,GAAA,CAAA,CAAKD,WAAW,CAAC,uCAAA,CAAA;AAC1D,IAAA;AACJ;AAEA;;IAGO,MAAME,iBAAAA,SAA0BC,OAAAA,CAAAA;AACnC,IAAA,OAAgBC,8BAAgD,IAAIC,aAAAA,CAAiB,EAAA,EAAI,IAAI,mBAAA,CAAA;AACpFC,IAAAA,KAAAA,GAAgB,yBAAA;AAChBC,IAAAA,UAAAA,GAA+B,IAAIb,0BAAAA,EAAAA;AACnCc,IAAAA,qBAAAA,GAAiC,KAAA;AACjCC,IAAAA,KAAAA,GAAkB,EAAE;IACpBC,mBAAAA,GAA4C;QACjD,IAAIC,kBAAAA,CAA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CAAA;AACzB,IAAA;AACA;;AAEC,QACD,IAAIG,IAAAA,GAA2B;QAC3B,OAAO,IAAI,CAAC,KAAK;AACrB,IAAA;IAEA,IAAIA,IAAAA,CAAKJ,KAAyB,EAAE;QAChC,IAAI,CAAC,KAAK,GAAGA,KAAAA;QACb,IAAI,CAACC,eAAe,CAAC,MAAA,CAAA;AACzB,IAAA;AACA;;AAEC,QACD,IAAII,UAAAA,GAAyB;QACzB,OAAO,IAAI,CAAC,WAAW;AAC3B,IAAA;IAEA,IAAIA,UAAAA,CAAWL,KAAiB,EAAE;QAC9B,IAAI,CAAC,WAAW,GAAGA,KAAAA;QACnB,IAAI,CAACC,eAAe,CAAC,YAAA,CAAA;AACzB,IAAA;AACA;;AAEC,QACD,IAAItB,KAAAA,GAAgB;QAChB,OAAO,IAAI,CAAC,MAAM;AACtB,IAAA;IAEA,IAAIA,KAAAA,CAAMqB,KAAa,EAAE;QACrB,IAAI,CAAC,MAAM,GAAGA,KAAAA;QACd,IAAI,CAACC,eAAe,CAAC,OAAA,CAAA;AACzB,IAAA;IAEA,OAAOK,GAAAA,CAAIC,aAAkC,EAAiF;AAC1H,QAAA,OAAOC,WAAkDzB,iBAAAA,EAAmBwB,aAAAA,CAAAA;AAChF,IAAA;AACJ;;"}
|
|
@@ -37,8 +37,8 @@ export declare class AuthorAnnouncement extends Command<IAuthorAnnouncement> imp
|
|
|
37
37
|
set announcementId(value: Guid);
|
|
38
38
|
get audience(): Audience;
|
|
39
39
|
set audience(value: Audience);
|
|
40
|
-
get body(): string;
|
|
41
|
-
set body(value: string);
|
|
40
|
+
get body(): string | undefined;
|
|
41
|
+
set body(value: string | undefined);
|
|
42
42
|
get display(): Display;
|
|
43
43
|
set display(value: Display);
|
|
44
44
|
get importance(): Importance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorAnnouncement.d.ts","sourceRoot":"","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"names":[],"mappings":"AAKA,O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AAI,EAG7B;IAID,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAG3B;IAID,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAGjC;IAID,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IAID,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,UAAU,EAG/B;IAID,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAGxB;IAID,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;IAED,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,mBAAmB,GAAG,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;CAGnI"}
|
|
@@ -7,12 +7,11 @@ import { Guid } from '@cratis/fundamentals';
|
|
|
7
7
|
// Copyright (c) Cratis. All rights reserved.
|
|
8
8
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
9
|
// **DO NOT EDIT** - This file is an automatically generated file.
|
|
10
|
-
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-
|
|
10
|
+
// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 93148934CDB2AEC9F229AF58B9BB3F53C421972D580222998E86821B9392BCA9
|
|
11
11
|
class AuthorAnnouncementValidator extends CommandValidator {
|
|
12
12
|
constructor(){
|
|
13
13
|
super();
|
|
14
14
|
this.ruleFor((c)=>c.audience).notNull().withMessage('Say who the announcement is for.');
|
|
15
|
-
this.ruleFor((c)=>c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
|
|
16
15
|
this.ruleFor((c)=>c.product).notEmpty().withMessage('Say which product the announcement is for.');
|
|
17
16
|
this.ruleFor((c)=>c.title).notEmpty().withMessage('Give the announcement a title.');
|
|
18
17
|
this.ruleFor((c)=>c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
|
|
@@ -31,7 +30,7 @@ class AuthorAnnouncementValidator extends CommandValidator {
|
|
|
31
30
|
new PropertyDescriptor('activeUntil', Date, false),
|
|
32
31
|
new PropertyDescriptor('announcementId', Guid, false),
|
|
33
32
|
new PropertyDescriptor('audience', Audience, false),
|
|
34
|
-
new PropertyDescriptor('body', String,
|
|
33
|
+
new PropertyDescriptor('body', String, true),
|
|
35
34
|
new PropertyDescriptor('display', Number, false),
|
|
36
35
|
new PropertyDescriptor('importance', Number, false),
|
|
37
36
|
new PropertyDescriptor('product', String, false),
|
|
@@ -89,7 +88,7 @@ class AuthorAnnouncementValidator extends CommandValidator {
|
|
|
89
88
|
this.propertyChanged('audience');
|
|
90
89
|
}
|
|
91
90
|
/**
|
|
92
|
-
* What it says, up to 2,000 characters.
|
|
91
|
+
* What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.
|
|
93
92
|
*/ get body() {
|
|
94
93
|
return this.#body;
|
|
95
94
|
}
|
|
@@ -125,7 +124,7 @@ class AuthorAnnouncementValidator extends CommandValidator {
|
|
|
125
124
|
this.propertyChanged('product');
|
|
126
125
|
}
|
|
127
126
|
/**
|
|
128
|
-
* Its title, up to 100 characters.
|
|
127
|
+
* Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.
|
|
129
128
|
*/ get title() {
|
|
130
129
|
return this.#title;
|
|
131
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorAnnouncement.js","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-11T04:33:12.9221640Z. Hash: 32D050612DF35D8A45D7DA9E47882974F73D3BD2059CB63CD0AE28CE5BAC89E7\nimport { Command, CommandValidator } from '@cratis/arc/commands';\nimport { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';\nimport { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';\nimport { Display } from '../Announcements/Display';\nimport { Importance } from '../Announcements/Importance';\nimport { Audience } from '../Audiences/Audience';\nimport { Guid } from '@cratis/fundamentals';\n\n/**\n * Authors an announcement for a product.\n */\nexport interface IAuthorAnnouncement {\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n activeFrom?: Date;\n\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n activeUntil?: Date;\n\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n announcementId?: Guid;\n\n /**\n * Who it is for.\n */\n audience?: Audience;\n\n /**\n * What it says, up to 2,000 characters.\n */\n body?: string;\n\n /**\n * How it is shown; it cannot change afterwards.\n */\n display?: Display;\n\n /**\n * How important it is.\n */\n importance?: Importance;\n\n /**\n * The product the announcement is for.\n */\n product?: string;\n\n /**\n * Its title, up to 100 characters.\n */\n title?: string;\n}\n\nexport class AuthorAnnouncementValidator extends CommandValidator<IAuthorAnnouncement> {\n constructor() {\n super();\n this.ruleFor(c => c.audience).notNull().withMessage('Say who the announcement is for.');\n this.ruleFor(c => c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');\n this.ruleFor(c => c.product).notEmpty().withMessage('Say which product the announcement is for.');\n this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');\n this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');\n }\n}\n\n/**\n * Authors an announcement for a product.\n */\nexport class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements IAuthorAnnouncement {\n static readonly sliceLocation: ArcSliceLocation = /*#__PURE__*/ new ArcSliceLocation('', '', 'AuthorAnnouncement');\n readonly route: string = '/api/author-announcement';\n readonly validation: CommandValidator = new AuthorAnnouncementValidator();\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly propertyDescriptors: PropertyDescriptor[] = [\n new PropertyDescriptor('activeFrom', Date, false),\n new PropertyDescriptor('activeUntil', Date, false),\n new PropertyDescriptor('announcementId', Guid, false),\n new PropertyDescriptor('audience', Audience, false),\n new PropertyDescriptor('body', String, false),\n new PropertyDescriptor('display', Number, false),\n new PropertyDescriptor('importance', Number, false),\n new PropertyDescriptor('product', String, false),\n new PropertyDescriptor('title', String, false),\n ];\n\n #activeFrom!: Date;\n #activeUntil!: Date;\n #announcementId!: Guid;\n #audience!: Audience;\n #body!: string;\n #display!: Display;\n #importance!: Importance;\n #product!: string;\n #title!: string;\n\n constructor() {\n super(Object, false);\n }\n\n get requestParameters(): string[] {\n return [\n ];\n }\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n get activeFrom(): Date {\n return this.#activeFrom;\n }\n\n set activeFrom(value: Date) {\n this.#activeFrom = value;\n this.propertyChanged('activeFrom');\n }\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n get activeUntil(): Date {\n return this.#activeUntil;\n }\n\n set activeUntil(value: Date) {\n this.#activeUntil = value;\n this.propertyChanged('activeUntil');\n }\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n get announcementId(): Guid {\n return this.#announcementId;\n }\n\n set announcementId(value: Guid) {\n this.#announcementId = value;\n this.propertyChanged('announcementId');\n }\n /**\n * Who it is for.\n */\n get audience(): Audience {\n return this.#audience;\n }\n\n set audience(value: Audience) {\n this.#audience = value;\n this.propertyChanged('audience');\n }\n /**\n * What it says, up to 2,000 characters.\n */\n get body(): string {\n return this.#body;\n }\n\n set body(value: string) {\n this.#body = value;\n this.propertyChanged('body');\n }\n /**\n * How it is shown; it cannot change afterwards.\n */\n get display(): Display {\n return this.#display;\n }\n\n set display(value: Display) {\n this.#display = value;\n this.propertyChanged('display');\n }\n /**\n * How important it is.\n */\n get importance(): Importance {\n return this.#importance;\n }\n\n set importance(value: Importance) {\n this.#importance = value;\n this.propertyChanged('importance');\n }\n /**\n * The product the announcement is for.\n */\n get product(): string {\n return this.#product;\n }\n\n set product(value: string) {\n this.#product = value;\n this.propertyChanged('product');\n }\n /**\n * Its title, up to 100 characters.\n */\n get title(): string {\n return this.#title;\n }\n\n set title(value: string) {\n this.#title = value;\n this.propertyChanged('title');\n }\n\n static use(initialValues?: IAuthorAnnouncement): [AuthorAnnouncement, SetCommandValues<IAuthorAnnouncement>, ClearCommandValues] {\n return useCommand<AuthorAnnouncement, IAuthorAnnouncement>(AuthorAnnouncement, initialValues);\n }\n}\n"],"names":["AuthorAnnouncementValidator","CommandValidator","ruleFor","c","audience","notNull","withMessage","body","maxLength","product","notEmpty","title","AuthorAnnouncement","Command","sliceLocation","ArcSliceLocation","route","validation","treatWarningsAsErrors","roles","propertyDescriptors","PropertyDescriptor","Date","Guid","Audience","String","Number","Object","requestParameters","activeFrom","value","propertyChanged","activeUntil","announcementId","display","importance","use","initialValues","useCommand"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AA4DO,MAAMA,2BAAAA,SAAoCC,gBAAAA,CAAAA;IAC7C,WAAA,EAAc;QACV,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,QAAQ,CAAA,CAAEC,OAAO,EAAA,CAAGC,WAAW,CAAC,kCAAA,CAAA;AACpD,QAAA,IAAI,CAACJ,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEI,IAAI,CAAA,CAAEC,SAAS,CAAC,IAAA,CAAA,CAAMF,WAAW,CAAC,uCAAA,CAAA;QACtD,IAAI,CAACJ,OAAO,C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nouncement.js","sources":["../../../AuthorAnnouncement/AuthorAnnouncement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// **DO NOT EDIT** - This file is an automatically generated file.\n// @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AuthorAnnouncement.AuthorAnnouncement. Time: 2026-11-14T14:43:54.2027090Z. Hash: 93148934CDB2AEC9F229AF58B9BB3F53C421972D580222998E86821B9392BCA9\nimport { Command, CommandValidator } from '@cratis/arc/commands';\nimport { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';\nimport { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';\nimport { Display } from '../Announcements/Display';\nimport { Importance } from '../Announcements/Importance';\nimport { Audience } from '../Audiences/Audience';\nimport { Guid } from '@cratis/fundamentals';\n\n/**\n * Authors an announcement for a product.\n */\nexport interface IAuthorAnnouncement {\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n activeFrom?: Date;\n\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n activeUntil?: Date;\n\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n announcementId?: Guid;\n\n /**\n * Who it is for.\n */\n audience?: Audience;\n\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n body?: string;\n\n /**\n * How it is shown; it cannot change afterwards.\n */\n display?: Display;\n\n /**\n * How important it is.\n */\n importance?: Importance;\n\n /**\n * The product the announcement is for.\n */\n product?: string;\n\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n title?: string;\n}\n\nexport class AuthorAnnouncementValidator extends CommandValidator<IAuthorAnnouncement> {\n constructor() {\n super();\n this.ruleFor(c => c.audience).notNull().withMessage('Say who the announcement is for.');\n this.ruleFor(c => c.product).notEmpty().withMessage('Say which product the announcement is for.');\n this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');\n this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');\n }\n}\n\n/**\n * Authors an announcement for a product.\n */\nexport class AuthorAnnouncement extends Command<IAuthorAnnouncement> implements IAuthorAnnouncement {\n static readonly sliceLocation: ArcSliceLocation = /*#__PURE__*/ new ArcSliceLocation('', '', 'AuthorAnnouncement');\n readonly route: string = '/api/author-announcement';\n readonly validation: CommandValidator = new AuthorAnnouncementValidator();\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly propertyDescriptors: PropertyDescriptor[] = [\n new PropertyDescriptor('activeFrom', Date, false),\n new PropertyDescriptor('activeUntil', Date, false),\n new PropertyDescriptor('announcementId', Guid, false),\n new PropertyDescriptor('audience', Audience, false),\n new PropertyDescriptor('body', String, true),\n new PropertyDescriptor('display', Number, false),\n new PropertyDescriptor('importance', Number, false),\n new PropertyDescriptor('product', String, false),\n new PropertyDescriptor('title', String, false),\n ];\n\n #activeFrom!: Date;\n #activeUntil!: Date;\n #announcementId!: Guid;\n #audience!: Audience;\n #body?: string;\n #display!: Display;\n #importance!: Importance;\n #product!: string;\n #title!: string;\n\n constructor() {\n super(Object, false);\n }\n\n get requestParameters(): string[] {\n return [\n ];\n }\n\n /**\n * When it starts to be shown; the default date means immediately.\n */\n get activeFrom(): Date {\n return this.#activeFrom;\n }\n\n set activeFrom(value: Date) {\n this.#activeFrom = value;\n this.propertyChanged('activeFrom');\n }\n /**\n * When it stops being shown; the default date means indefinitely.\n */\n get activeUntil(): Date {\n return this.#activeUntil;\n }\n\n set activeUntil(value: Date) {\n this.#activeUntil = value;\n this.propertyChanged('activeUntil');\n }\n /**\n * The new announcement; create it with `AnnouncementId.New()`.\n */\n get announcementId(): Guid {\n return this.#announcementId;\n }\n\n set announcementId(value: Guid) {\n this.#announcementId = value;\n this.propertyChanged('announcementId');\n }\n /**\n * Who it is for.\n */\n get audience(): Audience {\n return this.#audience;\n }\n\n set audience(value: Audience) {\n this.#audience = value;\n this.propertyChanged('audience');\n }\n /**\n * What it says, in Markdown, up to 2,000 characters; optional, empty when the title says it all.\n */\n get body(): string | undefined {\n return this.#body;\n }\n\n set body(value: string | undefined) {\n this.#body = value;\n this.propertyChanged('body');\n }\n /**\n * How it is shown; it cannot change afterwards.\n */\n get display(): Display {\n return this.#display;\n }\n\n set display(value: Display) {\n this.#display = value;\n this.propertyChanged('display');\n }\n /**\n * How important it is.\n */\n get importance(): Importance {\n return this.#importance;\n }\n\n set importance(value: Importance) {\n this.#importance = value;\n this.propertyChanged('importance');\n }\n /**\n * The product the announcement is for.\n */\n get product(): string {\n return this.#product;\n }\n\n set product(value: string) {\n this.#product = value;\n this.propertyChanged('product');\n }\n /**\n * Its title, up to 100 characters; it can use inline Markdown such as a link, emphasis or code.\n */\n get title(): string {\n return this.#title;\n }\n\n set title(value: string) {\n this.#title = value;\n this.propertyChanged('title');\n }\n\n static use(initialValues?: IAuthorAnnouncement): [AuthorAnnouncement, SetCommandValues<IAuthorAnnouncement>, ClearCommandValues] {\n return useCommand<AuthorAnnouncement, IAuthorAnnouncement>(AuthorAnnouncement, initialValues);\n }\n}\n"],"names":["AuthorAnnouncementValidator","CommandValidator","ruleFor","c","audience","notNull","withMessage","product","notEmpty","title","maxLength","AuthorAnnouncement","Command","sliceLocation","ArcSliceLocation","route","validation","treatWarningsAsErrors","roles","propertyDescriptors","PropertyDescriptor","Date","Guid","Audience","String","Number","Object","requestParameters","activeFrom","value","propertyChanged","activeUntil","announcementId","body","display","importance","use","initialValues","useCommand"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AA4DO,MAAMA,2BAAAA,SAAoCC,gBAAAA,CAAAA;IAC7C,WAAA,EAAc;QACV,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,CAAEC,QAAQ,CAAA,CAAEC,OAAO,EAAA,CAAGC,WAAW,CAAC,kCAAA,CAAA;QACpD,IAAI,CAACJ,OAAO,CAACC,CAAAA,CAAAA,GAAKA,CAAAA,C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ts","sourceRoot":"","sources":["../../../Examples/AuthorPermanentNotice.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,wBAkBjC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Guid } from '@cratis/fundamentals';
|
|
2
|
+
import { AuthorAnnouncement, Audience, AudienceKind, Display, Importance } from '@cratis/showrunner.marquee.authoring';
|
|
3
|
+
export const authorPermanentNotice = async () => {
|
|
4
|
+
const audience = new Audience();
|
|
5
|
+
audience.kind = AudienceKind.everyone;
|
|
6
|
+
audience.tenantIds = [];
|
|
7
|
+
audience.module = '';
|
|
8
|
+
audience.plan = '';
|
|
9
|
+
const author = new AuthorAnnouncement();
|
|
10
|
+
author.announcementId = Guid.create();
|
|
11
|
+
author.product = 'ledger';
|
|
12
|
+
author.audience = audience;
|
|
13
|
+
author.title = 'Ledger moves to a new address. [Read more here.](https://status.example.com/new-address)';
|
|
14
|
+
author.display = Display.banner;
|
|
15
|
+
author.importance = Importance.information;
|
|
16
|
+
const result = await author.execute();
|
|
17
|
+
return result.isSuccess;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=AuthorPermanentNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorPermanentNotice.js","sourceRoot":"","sources":["../../../Examples/AuthorPermanentNotice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEvH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IAC5C,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;IACtC,QAAQ,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;IACrB,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;IAEnB,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACxC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC1B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,KAAK,GAAG,0FAA0F,CAAC;IAC1G,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC;IAG3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACtC,OAAO,MAAM,CAAC,SAAS,CAAC;AAC5B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@cratis/showrunner.marquee.authoring",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.11.1",
|
|
5
5
|
"description": "Generated TypeScript proxies for authoring Marquee announcements — the commands and the query for the screen where the people running a product write them, built on Cratis Arc.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cratis",
|