@cratis/showrunner.marquee.authoring 0.0.0-stage → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/AmendAnnouncement/AmendAnnouncement.ts +161 -0
  2. package/AmendAnnouncement/index.ts +4 -0
  3. package/Announcements/Announcement.ts +254 -0
  4. package/Announcements/Display.ts +13 -0
  5. package/Announcements/Importance.ts +13 -0
  6. package/Announcements/index.ts +6 -0
  7. package/Audiences/Audience.ts +37 -0
  8. package/Audiences/AudienceKind.ts +14 -0
  9. package/Audiences/index.ts +5 -0
  10. package/AuthorAnnouncement/AuthorAnnouncement.ts +219 -0
  11. package/AuthorAnnouncement/index.ts +4 -0
  12. package/README.md +71 -2
  13. package/RetargetAnnouncement/RetargetAnnouncement.ts +87 -0
  14. package/RetargetAnnouncement/index.ts +4 -0
  15. package/WithdrawAnnouncement/WithdrawAnnouncement.ts +61 -0
  16. package/WithdrawAnnouncement/index.ts +4 -0
  17. package/dist/cjs/AmendAnnouncement/AmendAnnouncement.d.ts +41 -0
  18. package/dist/cjs/AmendAnnouncement/AmendAnnouncement.d.ts.map +1 -0
  19. package/dist/cjs/AmendAnnouncement/AmendAnnouncement.js +109 -0
  20. package/dist/cjs/AmendAnnouncement/AmendAnnouncement.js.map +1 -0
  21. package/dist/cjs/AmendAnnouncement/index.d.ts +2 -0
  22. package/dist/cjs/AmendAnnouncement/index.d.ts.map +1 -0
  23. package/dist/cjs/Announcements/Announcement.d.ts +92 -0
  24. package/dist/cjs/Announcements/Announcement.d.ts.map +1 -0
  25. package/dist/cjs/Announcements/Announcement.js +253 -0
  26. package/dist/cjs/Announcements/Announcement.js.map +1 -0
  27. package/dist/cjs/Announcements/Display.d.ts +6 -0
  28. package/dist/cjs/Announcements/Display.d.ts.map +1 -0
  29. package/dist/cjs/Announcements/Display.js +17 -0
  30. package/dist/cjs/Announcements/Display.js.map +1 -0
  31. package/dist/cjs/Announcements/Importance.d.ts +6 -0
  32. package/dist/cjs/Announcements/Importance.d.ts.map +1 -0
  33. package/dist/cjs/Announcements/Importance.js +17 -0
  34. package/dist/cjs/Announcements/Importance.js.map +1 -0
  35. package/dist/cjs/Announcements/index.d.ts +4 -0
  36. package/dist/cjs/Announcements/index.d.ts.map +1 -0
  37. package/dist/cjs/Audiences/Audience.d.ts +8 -0
  38. package/dist/cjs/Audiences/Audience.d.ts.map +1 -0
  39. package/dist/cjs/Audiences/Audience.js +58 -0
  40. package/dist/cjs/Audiences/Audience.js.map +1 -0
  41. package/dist/cjs/Audiences/AudienceKind.d.ts +7 -0
  42. package/dist/cjs/Audiences/AudienceKind.d.ts.map +1 -0
  43. package/dist/cjs/Audiences/AudienceKind.js +18 -0
  44. package/dist/cjs/Audiences/AudienceKind.js.map +1 -0
  45. package/dist/cjs/Audiences/index.d.ts +3 -0
  46. package/dist/cjs/Audiences/index.d.ts.map +1 -0
  47. package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.d.ts +52 -0
  48. package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.d.ts.map +1 -0
  49. package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.js +145 -0
  50. package/dist/cjs/AuthorAnnouncement/AuthorAnnouncement.js.map +1 -0
  51. package/dist/cjs/AuthorAnnouncement/index.d.ts +2 -0
  52. package/dist/cjs/AuthorAnnouncement/index.d.ts.map +1 -0
  53. package/dist/cjs/Examples/AuthorMaintenanceNotice.d.ts +2 -0
  54. package/dist/cjs/Examples/AuthorMaintenanceNotice.d.ts.map +1 -0
  55. package/dist/cjs/Examples/ListAnnouncements.d.ts +2 -0
  56. package/dist/cjs/Examples/ListAnnouncements.d.ts.map +1 -0
  57. package/dist/cjs/RetargetAnnouncement/RetargetAnnouncement.d.ts +29 -0
  58. package/dist/cjs/RetargetAnnouncement/RetargetAnnouncement.d.ts.map +1 -0
  59. package/dist/cjs/RetargetAnnouncement/RetargetAnnouncement.js +64 -0
  60. package/dist/cjs/RetargetAnnouncement/RetargetAnnouncement.js.map +1 -0
  61. package/dist/cjs/RetargetAnnouncement/index.d.ts +2 -0
  62. package/dist/cjs/RetargetAnnouncement/index.d.ts.map +1 -0
  63. package/dist/cjs/WithdrawAnnouncement/WithdrawAnnouncement.d.ts +21 -0
  64. package/dist/cjs/WithdrawAnnouncement/WithdrawAnnouncement.d.ts.map +1 -0
  65. package/dist/cjs/WithdrawAnnouncement/WithdrawAnnouncement.js +44 -0
  66. package/dist/cjs/WithdrawAnnouncement/WithdrawAnnouncement.js.map +1 -0
  67. package/dist/cjs/WithdrawAnnouncement/index.d.ts +2 -0
  68. package/dist/cjs/WithdrawAnnouncement/index.d.ts.map +1 -0
  69. package/dist/cjs/index.d.ts +7 -0
  70. package/dist/cjs/index.d.ts.map +1 -0
  71. package/dist/cjs/index.js +28 -0
  72. package/dist/cjs/index.js.map +1 -0
  73. package/dist/cjs/package.json +3 -0
  74. package/dist/esm/AmendAnnouncement/AmendAnnouncement.d.ts +41 -0
  75. package/dist/esm/AmendAnnouncement/AmendAnnouncement.d.ts.map +1 -0
  76. package/dist/esm/AmendAnnouncement/AmendAnnouncement.js +106 -0
  77. package/dist/esm/AmendAnnouncement/AmendAnnouncement.js.map +1 -0
  78. package/dist/esm/AmendAnnouncement/index.d.ts +2 -0
  79. package/dist/esm/AmendAnnouncement/index.d.ts.map +1 -0
  80. package/dist/esm/AmendAnnouncement/index.js +2 -0
  81. package/dist/esm/AmendAnnouncement/index.js.map +1 -0
  82. package/dist/esm/Announcements/Announcement.d.ts +92 -0
  83. package/dist/esm/Announcements/Announcement.d.ts.map +1 -0
  84. package/dist/esm/Announcements/Announcement.js +250 -0
  85. package/dist/esm/Announcements/Announcement.js.map +1 -0
  86. package/dist/esm/Announcements/Display.d.ts +6 -0
  87. package/dist/esm/Announcements/Display.d.ts.map +1 -0
  88. package/dist/esm/Announcements/Display.js +15 -0
  89. package/dist/esm/Announcements/Display.js.map +1 -0
  90. package/dist/esm/Announcements/Importance.d.ts +6 -0
  91. package/dist/esm/Announcements/Importance.d.ts.map +1 -0
  92. package/dist/esm/Announcements/Importance.js +15 -0
  93. package/dist/esm/Announcements/Importance.js.map +1 -0
  94. package/dist/esm/Announcements/index.d.ts +4 -0
  95. package/dist/esm/Announcements/index.d.ts.map +1 -0
  96. package/dist/esm/Announcements/index.js +4 -0
  97. package/dist/esm/Announcements/index.js.map +1 -0
  98. package/dist/esm/Audiences/Audience.d.ts +8 -0
  99. package/dist/esm/Audiences/Audience.d.ts.map +1 -0
  100. package/dist/esm/Audiences/Audience.js +56 -0
  101. package/dist/esm/Audiences/Audience.js.map +1 -0
  102. package/dist/esm/Audiences/AudienceKind.d.ts +7 -0
  103. package/dist/esm/Audiences/AudienceKind.d.ts.map +1 -0
  104. package/dist/esm/Audiences/AudienceKind.js +16 -0
  105. package/dist/esm/Audiences/AudienceKind.js.map +1 -0
  106. package/dist/esm/Audiences/index.d.ts +3 -0
  107. package/dist/esm/Audiences/index.d.ts.map +1 -0
  108. package/dist/esm/Audiences/index.js +3 -0
  109. package/dist/esm/Audiences/index.js.map +1 -0
  110. package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.d.ts +52 -0
  111. package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.d.ts.map +1 -0
  112. package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.js +142 -0
  113. package/dist/esm/AuthorAnnouncement/AuthorAnnouncement.js.map +1 -0
  114. package/dist/esm/AuthorAnnouncement/index.d.ts +2 -0
  115. package/dist/esm/AuthorAnnouncement/index.d.ts.map +1 -0
  116. package/dist/esm/AuthorAnnouncement/index.js +2 -0
  117. package/dist/esm/AuthorAnnouncement/index.js.map +1 -0
  118. package/dist/esm/Examples/AuthorMaintenanceNotice.d.ts +2 -0
  119. package/dist/esm/Examples/AuthorMaintenanceNotice.d.ts.map +1 -0
  120. package/dist/esm/Examples/AuthorMaintenanceNotice.js +22 -0
  121. package/dist/esm/Examples/AuthorMaintenanceNotice.js.map +1 -0
  122. package/dist/esm/Examples/ListAnnouncements.d.ts +2 -0
  123. package/dist/esm/Examples/ListAnnouncements.d.ts.map +1 -0
  124. package/dist/esm/Examples/ListAnnouncements.js +7 -0
  125. package/dist/esm/Examples/ListAnnouncements.js.map +1 -0
  126. package/dist/esm/RetargetAnnouncement/RetargetAnnouncement.d.ts +29 -0
  127. package/dist/esm/RetargetAnnouncement/RetargetAnnouncement.d.ts.map +1 -0
  128. package/dist/esm/RetargetAnnouncement/RetargetAnnouncement.js +61 -0
  129. package/dist/esm/RetargetAnnouncement/RetargetAnnouncement.js.map +1 -0
  130. package/dist/esm/RetargetAnnouncement/index.d.ts +2 -0
  131. package/dist/esm/RetargetAnnouncement/index.d.ts.map +1 -0
  132. package/dist/esm/RetargetAnnouncement/index.js +2 -0
  133. package/dist/esm/RetargetAnnouncement/index.js.map +1 -0
  134. package/dist/esm/WithdrawAnnouncement/WithdrawAnnouncement.d.ts +21 -0
  135. package/dist/esm/WithdrawAnnouncement/WithdrawAnnouncement.d.ts.map +1 -0
  136. package/dist/esm/WithdrawAnnouncement/WithdrawAnnouncement.js +42 -0
  137. package/dist/esm/WithdrawAnnouncement/WithdrawAnnouncement.js.map +1 -0
  138. package/dist/esm/WithdrawAnnouncement/index.d.ts +2 -0
  139. package/dist/esm/WithdrawAnnouncement/index.d.ts.map +1 -0
  140. package/dist/esm/WithdrawAnnouncement/index.js +2 -0
  141. package/dist/esm/WithdrawAnnouncement/index.js.map +1 -0
  142. package/dist/esm/index.d.ts +7 -0
  143. package/dist/esm/index.d.ts.map +1 -0
  144. package/dist/esm/index.js +10 -0
  145. package/dist/esm/index.js.map +1 -0
  146. package/dist/esm/package.json +3 -0
  147. package/index.ts +9 -0
  148. package/package.json +71 -4
@@ -0,0 +1,161 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ // **DO NOT EDIT** - This file is an automatically generated file.
5
+ // @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.AmendAnnouncement.AmendAnnouncement. Time: 2026-10-31T10:10:27.5788130Z. Hash: 677DF69E621AAFA8482576CFFDA54AF82659BB7CF95FFBB8257E5057C55DB20A
6
+ import { Command, CommandValidator } from '@cratis/arc/commands';
7
+ import { ClearCommandValues, SetCommandValues, useCommand } from '@cratis/arc.react/commands';
8
+ import { SliceLocation as ArcSliceLocation, PropertyDescriptor } from '@cratis/arc/reflection';
9
+ import { Importance } from '../Announcements/Importance';
10
+ import { Guid } from '@cratis/fundamentals';
11
+
12
+ /**
13
+ * 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.
14
+ */
15
+ export interface IAmendAnnouncement {
16
+
17
+ /**
18
+ * When it starts to be shown; the default date means immediately.
19
+ */
20
+ activeFrom?: Date;
21
+
22
+ /**
23
+ * When it stops being shown; the default date means indefinitely.
24
+ */
25
+ activeUntil?: Date;
26
+
27
+ /**
28
+ * The announcement.
29
+ */
30
+ announcementId?: Guid;
31
+
32
+ /**
33
+ * What it says, up to 2,000 characters.
34
+ */
35
+ body?: string;
36
+
37
+ /**
38
+ * How important it is.
39
+ */
40
+ importance?: Importance;
41
+
42
+ /**
43
+ * Its title, up to 100 characters.
44
+ */
45
+ title?: string;
46
+ }
47
+
48
+ export class AmendAnnouncementValidator extends CommandValidator<IAmendAnnouncement> {
49
+ constructor() {
50
+ super();
51
+ this.ruleFor(c => c.body).maxLength(2000).withMessage('Keep the body within 2000 characters.');
52
+ this.ruleFor(c => c.title).notEmpty().withMessage('Give the announcement a title.');
53
+ this.ruleFor(c => c.title).maxLength(100).withMessage('Keep the title within 100 characters.');
54
+ }
55
+ }
56
+
57
+ /**
58
+ * 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.
59
+ */
60
+ export class AmendAnnouncement extends Command<IAmendAnnouncement> implements IAmendAnnouncement {
61
+ static readonly sliceLocation: ArcSliceLocation = new ArcSliceLocation('', '', 'AmendAnnouncement');
62
+ readonly route: string = '/api/amend-announcement';
63
+ readonly validation: CommandValidator = new AmendAnnouncementValidator();
64
+ readonly treatWarningsAsErrors: boolean = false;
65
+ readonly roles: string[] = [];
66
+ readonly propertyDescriptors: PropertyDescriptor[] = [
67
+ new PropertyDescriptor('activeFrom', Date, false),
68
+ new PropertyDescriptor('activeUntil', Date, false),
69
+ new PropertyDescriptor('announcementId', Guid, false),
70
+ new PropertyDescriptor('body', String, false),
71
+ new PropertyDescriptor('importance', Number, false),
72
+ new PropertyDescriptor('title', String, false),
73
+ ];
74
+
75
+ #activeFrom!: Date;
76
+ #activeUntil!: Date;
77
+ #announcementId!: Guid;
78
+ #body!: string;
79
+ #importance!: Importance;
80
+ #title!: string;
81
+
82
+ constructor() {
83
+ super(Object, false);
84
+ }
85
+
86
+ get requestParameters(): string[] {
87
+ return [
88
+ ];
89
+ }
90
+
91
+ /**
92
+ * When it starts to be shown; the default date means immediately.
93
+ */
94
+ get activeFrom(): Date {
95
+ return this.#activeFrom;
96
+ }
97
+
98
+ set activeFrom(value: Date) {
99
+ this.#activeFrom = value;
100
+ this.propertyChanged('activeFrom');
101
+ }
102
+ /**
103
+ * When it stops being shown; the default date means indefinitely.
104
+ */
105
+ get activeUntil(): Date {
106
+ return this.#activeUntil;
107
+ }
108
+
109
+ set activeUntil(value: Date) {
110
+ this.#activeUntil = value;
111
+ this.propertyChanged('activeUntil');
112
+ }
113
+ /**
114
+ * The announcement.
115
+ */
116
+ get announcementId(): Guid {
117
+ return this.#announcementId;
118
+ }
119
+
120
+ set announcementId(value: Guid) {
121
+ this.#announcementId = value;
122
+ this.propertyChanged('announcementId');
123
+ }
124
+ /**
125
+ * What it says, up to 2,000 characters.
126
+ */
127
+ get body(): string {
128
+ return this.#body;
129
+ }
130
+
131
+ set body(value: string) {
132
+ this.#body = value;
133
+ this.propertyChanged('body');
134
+ }
135
+ /**
136
+ * How important it is.
137
+ */
138
+ get importance(): Importance {
139
+ return this.#importance;
140
+ }
141
+
142
+ set importance(value: Importance) {
143
+ this.#importance = value;
144
+ this.propertyChanged('importance');
145
+ }
146
+ /**
147
+ * Its title, up to 100 characters.
148
+ */
149
+ get title(): string {
150
+ return this.#title;
151
+ }
152
+
153
+ set title(value: string) {
154
+ this.#title = value;
155
+ this.propertyChanged('title');
156
+ }
157
+
158
+ static use(initialValues?: IAmendAnnouncement): [AmendAnnouncement, SetCommandValues<IAmendAnnouncement>, ClearCommandValues] {
159
+ return useCommand<AmendAnnouncement, IAmendAnnouncement>(AmendAnnouncement, initialValues);
160
+ }
161
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './AmendAnnouncement';
@@ -0,0 +1,254 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ // **DO NOT EDIT** - This file is an automatically generated file.
5
+ // @generated by Cratis. Source: Cratis.Showrunner.Marquee.Authoring.Announcements.Announcement, Cratis.Showrunner.Marquee.Authoring.Announcements.Announcement. Time: 2026-10-31T10:10:27.5788130Z. Hash: 436E17955F284D407442D2C55F19CD59A12B37C32969EAF545193A3DBF748EFF
6
+ import { ChangeSet, ObservableQueryFor, Paging, QueryResultWithState, Sorting, SortingActions, SortingActionsForObservableQuery } from '@cratis/arc/queries';
7
+ import { ObservableQueryWhen, SetPage, SetPageSize, SetSorting, useChangeStream, useObservableQuery, useObservableQueryWithPaging, useSuspenseObservableQuery, useSuspenseObservableQueryWithPaging } from '@cratis/arc.react/queries';
8
+ import { SliceLocation as ArcSliceLocation, ParameterDescriptor } from '@cratis/arc/reflection';
9
+ import { Guid, field } from '@cratis/fundamentals';
10
+ import { Audience } from '../Audiences/Audience';
11
+ import { Display } from './Display';
12
+ import { Importance } from './Importance';
13
+
14
+ class ForProductSortBy {
15
+ private _activeFrom: SortingActionsForObservableQuery<Announcement[]>;
16
+ private _activeUntil: SortingActionsForObservableQuery<Announcement[]>;
17
+ private _audience: SortingActionsForObservableQuery<Announcement[]>;
18
+ private _body: SortingActionsForObservableQuery<Announcement[]>;
19
+ private _display: SortingActionsForObservableQuery<Announcement[]>;
20
+ private _id: SortingActionsForObservableQuery<Announcement[]>;
21
+ private _importance: SortingActionsForObservableQuery<Announcement[]>;
22
+ private _product: SortingActionsForObservableQuery<Announcement[]>;
23
+ private _title: SortingActionsForObservableQuery<Announcement[]>;
24
+ private _withdrawn: SortingActionsForObservableQuery<Announcement[]>;
25
+
26
+ constructor(readonly query: ForProduct) {
27
+ this._activeFrom = new SortingActionsForObservableQuery<Announcement[]>('activeFrom', query);
28
+ this._activeUntil = new SortingActionsForObservableQuery<Announcement[]>('activeUntil', query);
29
+ this._audience = new SortingActionsForObservableQuery<Announcement[]>('audience', query);
30
+ this._body = new SortingActionsForObservableQuery<Announcement[]>('body', query);
31
+ this._display = new SortingActionsForObservableQuery<Announcement[]>('display', query);
32
+ this._id = new SortingActionsForObservableQuery<Announcement[]>('id', query);
33
+ this._importance = new SortingActionsForObservableQuery<Announcement[]>('importance', query);
34
+ this._product = new SortingActionsForObservableQuery<Announcement[]>('product', query);
35
+ this._title = new SortingActionsForObservableQuery<Announcement[]>('title', query);
36
+ this._withdrawn = new SortingActionsForObservableQuery<Announcement[]>('withdrawn', query);
37
+ }
38
+
39
+ get activeFrom(): SortingActionsForObservableQuery<Announcement[]> {
40
+ return this._activeFrom;
41
+ }
42
+ get activeUntil(): SortingActionsForObservableQuery<Announcement[]> {
43
+ return this._activeUntil;
44
+ }
45
+ get audience(): SortingActionsForObservableQuery<Announcement[]> {
46
+ return this._audience;
47
+ }
48
+ get body(): SortingActionsForObservableQuery<Announcement[]> {
49
+ return this._body;
50
+ }
51
+ get display(): SortingActionsForObservableQuery<Announcement[]> {
52
+ return this._display;
53
+ }
54
+ get id(): SortingActionsForObservableQuery<Announcement[]> {
55
+ return this._id;
56
+ }
57
+ get importance(): SortingActionsForObservableQuery<Announcement[]> {
58
+ return this._importance;
59
+ }
60
+ get product(): SortingActionsForObservableQuery<Announcement[]> {
61
+ return this._product;
62
+ }
63
+ get title(): SortingActionsForObservableQuery<Announcement[]> {
64
+ return this._title;
65
+ }
66
+ get withdrawn(): SortingActionsForObservableQuery<Announcement[]> {
67
+ return this._withdrawn;
68
+ }
69
+ }
70
+
71
+ class ForProductSortByWithoutQuery {
72
+ private _activeFrom: SortingActions = new SortingActions('activeFrom');
73
+ private _activeUntil: SortingActions = new SortingActions('activeUntil');
74
+ private _audience: SortingActions = new SortingActions('audience');
75
+ private _body: SortingActions = new SortingActions('body');
76
+ private _display: SortingActions = new SortingActions('display');
77
+ private _id: SortingActions = new SortingActions('id');
78
+ private _importance: SortingActions = new SortingActions('importance');
79
+ private _product: SortingActions = new SortingActions('product');
80
+ private _title: SortingActions = new SortingActions('title');
81
+ private _withdrawn: SortingActions = new SortingActions('withdrawn');
82
+
83
+ get activeFrom(): SortingActions {
84
+ return this._activeFrom;
85
+ }
86
+ get activeUntil(): SortingActions {
87
+ return this._activeUntil;
88
+ }
89
+ get audience(): SortingActions {
90
+ return this._audience;
91
+ }
92
+ get body(): SortingActions {
93
+ return this._body;
94
+ }
95
+ get display(): SortingActions {
96
+ return this._display;
97
+ }
98
+ get id(): SortingActions {
99
+ return this._id;
100
+ }
101
+ get importance(): SortingActions {
102
+ return this._importance;
103
+ }
104
+ get product(): SortingActions {
105
+ return this._product;
106
+ }
107
+ get title(): SortingActions {
108
+ return this._title;
109
+ }
110
+ get withdrawn(): SortingActions {
111
+ return this._withdrawn;
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Observes the announcements of a product, withdrawn ones included, the newest window first.
117
+ */
118
+ export interface ForProductParameters {
119
+
120
+ /**
121
+ * The product.
122
+ */
123
+ product: string;
124
+ }
125
+
126
+
127
+ /**
128
+ * Observes the announcements of a product, withdrawn ones included, the newest window first.
129
+ */
130
+ export class ForProduct extends ObservableQueryFor<Announcement[], ForProductParameters> {
131
+ static readonly sliceLocation: ArcSliceLocation = new ArcSliceLocation('', '', 'Announcements');
132
+ readonly route: string = '/api/announcements/for-product';
133
+ readonly queryName: string = 'Cratis.Showrunner.Marquee.Authoring.Announcements.Announcement.ForProduct';
134
+ readonly treatWarningsAsErrors: boolean = false;
135
+ readonly roles: string[] = [];
136
+ readonly defaultValue: Announcement[] = [];
137
+ private readonly _sortBy: ForProductSortBy;
138
+ private static readonly _sortBy: ForProductSortByWithoutQuery = new ForProductSortByWithoutQuery();
139
+
140
+ constructor() {
141
+ super(Announcement, true);
142
+ this._sortBy = new ForProductSortBy(this);
143
+ }
144
+
145
+ get requiredRequestParameters(): string[] {
146
+ return [
147
+ 'product',
148
+ ];
149
+ }
150
+
151
+ readonly parameterDescriptors: ParameterDescriptor[] = [
152
+ new ParameterDescriptor('product', String, false),
153
+ ];
154
+
155
+ product!: string;
156
+
157
+ get sortBy(): ForProductSortBy {
158
+ return this._sortBy;
159
+ }
160
+
161
+ static get sortBy(): ForProductSortByWithoutQuery {
162
+ return this._sortBy;
163
+ }
164
+
165
+ static use(args?: ForProductParameters, sorting?: Sorting): [QueryResultWithState<Announcement[]>, SetSorting] {
166
+ return useObservableQuery<Announcement[], ForProduct, ForProductParameters>(ForProduct, args, sorting);
167
+ }
168
+
169
+ static useWithPaging(pageSize: number, args?: ForProductParameters, sorting?: Sorting): [QueryResultWithState<Announcement[]>, SetSorting, SetPage, SetPageSize] {
170
+ return useObservableQueryWithPaging<Announcement[], ForProduct>(ForProduct, new Paging(0, pageSize), args, sorting);
171
+ }
172
+
173
+ static useSuspense(args?: ForProductParameters, sorting?: Sorting): [QueryResultWithState<Announcement[]>, SetSorting] {
174
+ return useSuspenseObservableQuery<Announcement[], ForProduct, ForProductParameters>(ForProduct, args, sorting);
175
+ }
176
+
177
+ static useSuspenseWithPaging(pageSize: number, args?: ForProductParameters, sorting?: Sorting): [QueryResultWithState<Announcement[]>, SetSorting, SetPage, SetPageSize] {
178
+ return useSuspenseObservableQueryWithPaging<Announcement[], ForProduct>(ForProduct, new Paging(0, pageSize), args, sorting);
179
+ }
180
+
181
+ static useChangeStream(args?: ForProductParameters, getKey?: (item: Announcement) => unknown, sorting?: Sorting): ChangeSet<Announcement> {
182
+ return useChangeStream<Announcement, ForProduct, ForProductParameters>(ForProduct, args, getKey, sorting);
183
+ }
184
+
185
+ static when(condition: boolean): ObservableQueryWhen<ForProduct, Announcement[], ForProductParameters> {
186
+ return new ObservableQueryWhen<ForProduct, Announcement[], ForProductParameters>(ForProduct, condition);
187
+ }
188
+ }
189
+
190
+ /**
191
+ * An announcement as the authoring screen shows it and as the commands that change it read it.
192
+ */
193
+ export class Announcement {
194
+
195
+ /**
196
+ * The announcement.
197
+ */
198
+ @field(Guid)
199
+ id!: Guid;
200
+
201
+ /**
202
+ * The product it is for.
203
+ */
204
+ @field(String)
205
+ product!: string;
206
+
207
+ /**
208
+ * Who it is for.
209
+ */
210
+ @field(Audience)
211
+ audience!: Audience;
212
+
213
+ /**
214
+ * Its title.
215
+ */
216
+ @field(String)
217
+ title!: string;
218
+
219
+ /**
220
+ * What it says.
221
+ */
222
+ @field(String)
223
+ body!: string;
224
+
225
+ /**
226
+ * How it is shown.
227
+ */
228
+ @field(Number)
229
+ display!: Display;
230
+
231
+ /**
232
+ * How important it is.
233
+ */
234
+ @field(Number)
235
+ importance!: Importance;
236
+
237
+ /**
238
+ * When it starts to be shown.
239
+ */
240
+ @field(Date)
241
+ activeFrom!: Date;
242
+
243
+ /**
244
+ * When it stops being shown.
245
+ */
246
+ @field(Date)
247
+ activeUntil!: Date;
248
+
249
+ /**
250
+ * Whether it was withdrawn.
251
+ */
252
+ @field(Boolean)
253
+ withdrawn!: boolean;
254
+ }
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ // **DO NOT EDIT** - This file is an automatically generated file.
5
+ // @generated by Cratis. Source: Cratis.Showrunner.Marquee.Contracts.Announcements.Display. Time: 2026-10-31T10:10:27.5788130Z. Hash: 8138A7B492877AA7B8990D1C633B6B783F1DD9E31497F5A502CD4AA26C2B3A02
6
+ /**
7
+ * How an announcement is presented to the people it reaches.
8
+ */
9
+ export enum Display {
10
+ banner = 0,
11
+ dialogOnce = 1,
12
+ dialogEverySession = 2,
13
+ }
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ // **DO NOT EDIT** - This file is an automatically generated file.
5
+ // @generated by Cratis. Source: Cratis.Showrunner.Marquee.Contracts.Announcements.Importance. Time: 2026-10-31T10:10:27.5788130Z. Hash: 45D4C95C53A74F27B49CC472238A01A07AE80E8319DC7139C94B48A9727835E4
6
+ /**
7
+ * How much attention an announcement asks for.
8
+ */
9
+ export enum Importance {
10
+ information = 0,
11
+ warning = 1,
12
+ critical = 2,
13
+ }
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './Announcement';
5
+ export * from './Display';
6
+ export * from './Importance';
@@ -0,0 +1,37 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ // **DO NOT EDIT** - This file is an automatically generated file.
5
+ // @generated by Cratis. Source: Cratis.Showrunner.Marquee.Contracts.Audiences.Audience. Time: 2026-10-31T10:10:27.5788130Z. Hash: 92D69310DF2051F83FA4387DDF603A146F3916DE6F621011C2FFC5B121CDD17C
6
+ import { field } from '@cratis/fundamentals';
7
+ import { AudienceKind } from './AudienceKind';
8
+
9
+ /**
10
+ * Who an announcement reaches. {@link Kind} says which of the other values applies; the others are empty ({@link NotSet}, {@link NotSet}, no tenants) when they do not, so nothing in the payload is null. Build one with {@link Everyone}, {@link Tenants}, {@link HoldersOfModule} or {@link OnPlan}. Whether a tenant is in it is answered by {@link Includes}.
11
+ */
12
+ export class Audience {
13
+
14
+ /**
15
+ * Which kind of audience this is.
16
+ */
17
+ @field(Number)
18
+ kind!: AudienceKind;
19
+
20
+ /**
21
+ * The tenants named, for {@link Tenants}.
22
+ */
23
+ @field(String, true)
24
+ tenantIds!: string[];
25
+
26
+ /**
27
+ * The module held, for {@link HoldersOfModule}.
28
+ */
29
+ @field(String)
30
+ module!: string;
31
+
32
+ /**
33
+ * The plan, for {@link OnPlan}.
34
+ */
35
+ @field(String)
36
+ plan!: string;
37
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ // **DO NOT EDIT** - This file is an automatically generated file.
5
+ // @generated by Cratis. Source: Cratis.Showrunner.Marquee.Contracts.Audiences.AudienceKind. Time: 2026-10-31T10:10:27.5788130Z. Hash: E5E096D03649C545127A2FA1CFEBDDCAAF0A92E846E080B03FE768CAF99FAE71
6
+ /**
7
+ * Which kind of audience an {@link Audience} is. It decides which of the audience's other values apply.
8
+ */
9
+ export enum AudienceKind {
10
+ everyone = 0,
11
+ tenants = 1,
12
+ holdersOfModule = 2,
13
+ onPlan = 3,
14
+ }
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './Audience';
5
+ export * from './AudienceKind';