@anthusai/papyrus 2.0.0-next.1 → 2.0.0-next.100

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 (252) hide show
  1. package/amplify/auth/resource.js +16 -1
  2. package/amplify/auth/resource.ts +19 -1
  3. package/amplify/data/function-handler.js +20 -0
  4. package/amplify/data/function-handler.ts +40 -0
  5. package/amplify/data/resource.js +158 -61
  6. package/amplify/data/resource.ts +165 -61
  7. package/amplify/data/schema.js +2103 -1979
  8. package/amplify/data/schema.ts +206 -68
  9. package/amplify/functions/assignment-action/data-access.js +90 -0
  10. package/amplify/functions/assignment-action/data-access.ts +89 -0
  11. package/amplify/functions/assignment-action/handler.ts +1 -1
  12. package/amplify/functions/automation-view/handler.py +17 -0
  13. package/amplify/functions/automation-view/resource.js +24 -0
  14. package/amplify/functions/automation-view/resource.ts +34 -0
  15. package/amplify/functions/automation-view/schema.js +26 -0
  16. package/amplify/functions/automation-view/schema.ts +28 -0
  17. package/amplify/functions/automation-view/wire.js +56 -0
  18. package/amplify/functions/automation-view/wire.ts +76 -0
  19. package/amplify/functions/content-actions/handler.py +70 -2
  20. package/amplify/functions/content-actions/requirements.txt +1 -0
  21. package/amplify/functions/content-actions/resource.js +1 -1
  22. package/amplify/functions/content-actions/resource.ts +1 -1
  23. package/amplify/functions/editorial-checks/handler.py +14 -0
  24. package/amplify/functions/editorial-checks/requirements.txt +1 -0
  25. package/amplify/functions/editorial-checks/resource.js +43 -0
  26. package/amplify/functions/editorial-checks/resource.ts +60 -0
  27. package/amplify/functions/editorial-checks/schema.js +122 -0
  28. package/amplify/functions/editorial-checks/schema.ts +124 -0
  29. package/amplify/functions/editorial-checks/wire.js +53 -0
  30. package/amplify/functions/editorial-checks/wire.ts +61 -0
  31. package/amplify/functions/model-attachment-upload/handler.ts +1 -0
  32. package/amplify/functions/monitoring-view/handler.py +11 -0
  33. package/amplify/functions/monitoring-view/resource.js +24 -0
  34. package/amplify/functions/monitoring-view/resource.ts +34 -0
  35. package/amplify/functions/monitoring-view/schema.js +29 -0
  36. package/amplify/functions/monitoring-view/schema.ts +31 -0
  37. package/amplify/functions/monitoring-view/wire.js +64 -0
  38. package/amplify/functions/monitoring-view/wire.ts +81 -0
  39. package/amplify/functions/public-forms/core.js +247 -0
  40. package/amplify/functions/public-forms/core.ts +310 -0
  41. package/amplify/functions/public-forms/handler.ts +41 -0
  42. package/amplify/functions/public-forms/origins.js +35 -0
  43. package/amplify/functions/public-forms/origins.ts +43 -0
  44. package/amplify/functions/public-forms/resource.js +9 -0
  45. package/amplify/functions/public-forms/resource.ts +10 -0
  46. package/amplify/functions/public-forms/wire.js +25 -0
  47. package/amplify/functions/public-forms/wire.ts +32 -0
  48. package/amplify/functions/shared/editorial-context.ts +63 -4
  49. package/amplify/functions/shared/python-bundle.js +20 -14
  50. package/amplify/functions/shared/python-bundle.ts +25 -18
  51. package/amplify/plugins/newsletter/config.js +245 -0
  52. package/amplify/plugins/newsletter/config.ts +305 -0
  53. package/amplify/plugins/newsletter/function/handler.py +6 -0
  54. package/amplify/plugins/newsletter/function/requirements.txt +5 -0
  55. package/amplify/plugins/newsletter/ops/handler.py +12 -0
  56. package/amplify/plugins/newsletter/ops/resource.js +27 -0
  57. package/amplify/plugins/newsletter/ops/resource.ts +37 -0
  58. package/amplify/plugins/newsletter/papyrus.plugin.js +263 -0
  59. package/amplify/plugins/newsletter/papyrus.plugin.ts +311 -0
  60. package/amplify/plugins/newsletter/schema.js +57 -0
  61. package/amplify/plugins/newsletter/schema.ts +62 -0
  62. package/amplify/plugins/newsletter/secure-string-parameter.js +107 -0
  63. package/amplify/plugins/newsletter/secure-string-parameter.ts +120 -0
  64. package/amplify/plugins/newsletter/sending.js +140 -0
  65. package/amplify/plugins/newsletter/sending.ts +186 -0
  66. package/amplify/plugins/reader-steering/config.js +182 -0
  67. package/amplify/plugins/reader-steering/config.ts +290 -0
  68. package/amplify/plugins/reader-steering/function/ai_moderation.py +246 -0
  69. package/amplify/plugins/reader-steering/function/handler.py +1567 -0
  70. package/amplify/plugins/reader-steering/function/moderation-prompt.md +27 -0
  71. package/amplify/plugins/reader-steering/function/moderation.py +316 -0
  72. package/amplify/plugins/reader-steering/function/proposals.py +458 -0
  73. package/amplify/plugins/reader-steering/function/resource.js +27 -0
  74. package/amplify/plugins/reader-steering/function/resource.ts +35 -0
  75. package/amplify/plugins/reader-steering/papyrus.plugin.js +186 -0
  76. package/amplify/plugins/reader-steering/papyrus.plugin.ts +212 -0
  77. package/amplify/plugins/reader-steering/schema.js +229 -0
  78. package/amplify/plugins/reader-steering/schema.ts +231 -0
  79. package/amplify/plugins/registry.js +4 -0
  80. package/amplify/plugins/registry.ts +4 -0
  81. package/amplify/plugins/signup/schema.js +2 -1
  82. package/amplify/plugins/signup/schema.ts +2 -1
  83. package/amplify/plugins/types.ts +5 -0
  84. package/amplify/plugins/wire.js +1 -0
  85. package/amplify/plugins/wire.ts +1 -0
  86. package/amplify/publication/projection-lease.js +30 -0
  87. package/amplify/publication/projection-lease.ts +39 -0
  88. package/amplify/publication/redirect-and-index.js +105 -0
  89. package/amplify/publication/redirect-rules.js +73 -0
  90. package/amplify/publication/redirect-rules.ts +93 -0
  91. package/amplify/publication/s3-projection.js +7 -1
  92. package/amplify/publication/s3-projection.ts +9 -1
  93. package/amplify/site-backend-config.js +19 -0
  94. package/amplify/site-backend-config.ts +45 -1
  95. package/amplify/site-backend-names.js +4 -2
  96. package/amplify/site-backend-names.ts +4 -2
  97. package/amplify/site-backend.js +51 -4
  98. package/amplify/site-backend.ts +60 -4
  99. package/app/api/auth/prospectus/sign-in/route.ts +4 -0
  100. package/app/api/newsletter/confirm/route.ts +13 -0
  101. package/app/api/newsletter/preferences/route.ts +13 -0
  102. package/app/api/newsletter/state/route.ts +9 -0
  103. package/app/api/newsletter/subscribe/route.ts +9 -0
  104. package/app/api/newsletter/unsubscribe/route.ts +13 -0
  105. package/app/api/newsroom/chat/[...path]/route.ts +17 -0
  106. package/app/api/newsroom/curation/context/route.ts +9 -0
  107. package/app/api/newsroom/curation/priming/route.ts +9 -0
  108. package/app/api/newsroom/curation/publication/route.ts +9 -0
  109. package/app/api/reader/comment/delete/route.ts +9 -0
  110. package/app/api/reader/comment/edit/route.ts +9 -0
  111. package/app/api/reader/comment/route.ts +9 -0
  112. package/app/api/reader/flag/route.ts +9 -0
  113. package/app/api/reader/handle/route.ts +9 -0
  114. package/app/api/reader/me/route.ts +9 -0
  115. package/app/api/reader/rating/route.ts +9 -0
  116. package/app/api/reader/report/route.ts +9 -0
  117. package/app/api/reader/retired/route.ts +9 -0
  118. package/app/api/reader/submit/route.ts +9 -0
  119. package/app/api/reader/vote/route.ts +9 -0
  120. package/app/layout.tsx +5 -1
  121. package/bin/papyrus-infra.mjs +20 -1
  122. package/components/automation-panel.tsx +49 -0
  123. package/components/automation-run-now.tsx +97 -0
  124. package/components/automation-view.tsx +195 -0
  125. package/components/editorial-checks-admin-panel.tsx +362 -0
  126. package/components/editorial-finding-card.tsx +162 -0
  127. package/components/editorial-findings-panel.tsx +91 -0
  128. package/components/editorial-preview-popover.tsx +103 -0
  129. package/components/markus-body-editor.tsx +213 -0
  130. package/components/markus-ir-preview.tsx +147 -6
  131. package/components/moderation-panel.tsx +248 -0
  132. package/components/monitoring-overview-view.tsx +414 -0
  133. package/components/monitoring-panel.tsx +60 -0
  134. package/components/news-desk-client-provider.tsx +18 -18
  135. package/components/news-desk-taxonomy-client.ts +28 -8
  136. package/components/newsletter-panel.tsx +474 -0
  137. package/components/newsletter-sections.tsx +163 -0
  138. package/components/newsroom-access-gate.tsx +16 -2
  139. package/components/newsroom-article-editor.tsx +145 -18
  140. package/components/newsroom-articles-view.tsx +6 -6
  141. package/components/newsroom-assignment-detail.tsx +6 -6
  142. package/components/newsroom-board-view.tsx +14 -10
  143. package/components/newsroom-curation-bootstrap.tsx +45 -0
  144. package/components/newsroom-ops-overview.tsx +26 -96
  145. package/components/newsroom-ops-shell.tsx +9 -5
  146. package/components/newsroom-organizer.css +90 -61
  147. package/components/newsroom-overview-skeleton.tsx +25 -0
  148. package/components/newsroom-references-view.tsx +192 -49
  149. package/components/newsroom-theme-fonts/broadsheet-green.css +10 -0
  150. package/components/newsroom-theme-fonts/broadsheet-green.tsx +6 -0
  151. package/components/newsroom-theme-fonts/newspaper-gothic.css +9 -0
  152. package/components/newsroom-theme-fonts/newspaper-gothic.tsx +6 -0
  153. package/components/newsroom-theme-fonts/night-desk.css +10 -0
  154. package/components/newsroom-theme-fonts/night-desk.tsx +6 -0
  155. package/components/newsroom-theme-fonts/refined-newsprint.css +11 -0
  156. package/components/newsroom-theme-fonts/refined-newsprint.tsx +6 -0
  157. package/components/newsroom-theme.css +39 -0
  158. package/components/newsroom-theme.tsx +33 -0
  159. package/components/notification-center.tsx +281 -0
  160. package/components/papyrus-console-conversation.css +14 -0
  161. package/components/papyrus-console-conversation.tsx +55 -0
  162. package/components/papyrus-console-shell.tsx +62 -420
  163. package/components/papyrus-private-chat-panel.tsx +134 -0
  164. package/components/publication-cyclotron-panel.tsx +15 -10
  165. package/components/reader-auth-state.ts +1 -1
  166. package/components/reference-add-entry.tsx +75 -0
  167. package/components/reference-curation-controls.tsx +31 -22
  168. package/components/reference-cyclotron-priming.tsx +63 -25
  169. package/components/reference-cyclotron-status.tsx +4 -4
  170. package/components/reference-cyclotron-suggestion.tsx +15 -11
  171. package/components/reference-live-agreement.tsx +10 -10
  172. package/components/reference-priming.tsx +14 -10
  173. package/components/reference-relevance-review.tsx +4 -4
  174. package/components/reference-section-suggestion.tsx +2 -2
  175. package/components/topic-steering-workspace.tsx +241 -144
  176. package/components/use-editorial-checks.ts +133 -0
  177. package/infra/amplify-app-shell.js +96 -16
  178. package/infra/amplify-app-shell.ts +108 -18
  179. package/infra/cloud-email-config.js +32 -0
  180. package/infra/cloud-email-config.ts +39 -0
  181. package/infra/cloud-email.js +57 -0
  182. package/infra/cloud-email.test.js +69 -0
  183. package/infra/cloud-email.test.ts +66 -0
  184. package/infra/cloud-email.ts +60 -0
  185. package/infra/index.js +1 -0
  186. package/infra/secure-string-parameter-handler.js +41 -0
  187. package/infra/secure-string-parameter-handler.ts +41 -0
  188. package/infra/secure-string-parameter.js +79 -0
  189. package/infra/secure-string-parameter.ts +91 -0
  190. package/infra/site-config.js +92 -6
  191. package/infra/site-config.ts +138 -6
  192. package/lib/automation-client.ts +54 -0
  193. package/lib/automation-fixture.ts +93 -0
  194. package/lib/automation-overview.ts +252 -0
  195. package/lib/category-repository.ts +14 -12
  196. package/lib/console-web-context.ts +1 -1
  197. package/lib/curation-routes.ts +345 -0
  198. package/lib/cyclotron-suggestions.ts +11 -11
  199. package/lib/editorial-checks-backend.ts +16 -0
  200. package/lib/editorial-checks-client.ts +212 -0
  201. package/lib/editorial-checks-demo.ts +147 -0
  202. package/lib/editorial-checks-settings.ts +27 -0
  203. package/lib/editorial-checks.ts +175 -0
  204. package/lib/editorial-preview.ts +228 -0
  205. package/lib/monitoring-client.ts +83 -0
  206. package/lib/monitoring-overview-fixture.ts +51 -0
  207. package/lib/monitoring-overview.ts +188 -0
  208. package/lib/news-desk-session.ts +12 -21
  209. package/lib/newsletter-api.ts +418 -0
  210. package/lib/newsletter-client.ts +46 -0
  211. package/lib/newsletter-fixture.ts +184 -0
  212. package/lib/newsletter-model.ts +202 -0
  213. package/lib/newsroom-board.ts +27 -2
  214. package/lib/newsroom-demo-dashboard.ts +1 -1
  215. package/lib/newsroom-nav.ts +1 -1
  216. package/lib/newsroom-organizer-nav.ts +2 -1
  217. package/lib/papyrus-chat-admission.ts +65 -0
  218. package/lib/papyrus-hosted-chat.ts +217 -0
  219. package/lib/papyrus-private-chat-client.ts +81 -0
  220. package/lib/prospectus-session.ts +30 -14
  221. package/lib/prospectus-sign-in-routes.ts +106 -31
  222. package/lib/prospectus-site-identity.ts +46 -6
  223. package/lib/reader-api.ts +145 -0
  224. package/lib/reader-moderation.ts +220 -0
  225. package/lib/reader-retirement-route.ts +89 -0
  226. package/lib/reader-subject.md +29 -0
  227. package/lib/reader-subject.ts +53 -0
  228. package/lib/reference-review-details.ts +71 -0
  229. package/lib/reference-review-request.ts +14 -0
  230. package/lib/relevance-decisions.ts +42 -10
  231. package/lib/relevance-status.ts +6 -6
  232. package/lib/review-client.ts +120 -0
  233. package/lib/review-fixture.ts +45 -0
  234. package/lib/review-requests.ts +246 -0
  235. package/lib/semantic-graph.ts +2 -0
  236. package/lib/shared-chat-admission.ts +182 -0
  237. package/lib/site-brand-tenant.ts +11 -6
  238. package/lib/site-brand.ts +23 -3
  239. package/lib/site-origin-value.ts +50 -0
  240. package/lib/site-origin.ts +8 -0
  241. package/lib/use-reference-review-data.ts +44 -0
  242. package/middleware.ts +14 -3
  243. package/package.json +98 -4
  244. package/routes.manifest.json +227 -2
  245. package/src/with-papyrus.mjs +1 -1
  246. package/components/newsroom-fonts/playfair-display-700.ttf +0 -0
  247. package/components/newsroom-fonts/playfair-display-900.ttf +0 -0
  248. package/components/newsroom-fonts/playfair-display-OFL.txt +0 -93
  249. package/components/newsroom-fonts/plus-jakarta-sans-400.ttf +0 -0
  250. package/components/newsroom-fonts/plus-jakarta-sans-600.ttf +0 -0
  251. package/components/newsroom-fonts/plus-jakarta-sans-OFL.txt +0 -93
  252. package/components/newsroom-newsprint-board.css +0 -7
@@ -1,13 +1,18 @@
1
1
  import { type ClientSchema, a } from "@aws-amplify/backend";
2
2
  import { assignmentAction } from "../functions/assignment-action/resource";
3
3
  import { categoryAction } from "../functions/category-action/resource";
4
+ import { editorialChecksSchemaDefinitions } from "../functions/editorial-checks/schema";
5
+ import { automationViewSchemaDefinitions } from "../functions/automation-view/schema";
6
+ import { monitoringViewSchemaDefinitions } from "../functions/monitoring-view/schema";
4
7
  import { contentActions } from "../functions/content-actions/resource";
5
8
  import { knowledgeQuery } from "../functions/knowledge-query/resource";
6
9
  import { manageUserRole } from "../functions/manage-user-role/resource";
7
10
  import { modelAttachmentUpload } from "../functions/model-attachment-upload/resource";
8
11
  import { newsroomSummary } from "../functions/newsroom-summary/resource";
12
+ import { publicForms } from "../functions/public-forms/resource";
9
13
  import { procedureAction } from "../functions/procedure-action/resource";
10
14
  import { readerSettings } from "../functions/reader-settings/resource";
15
+ import { functionHandler } from "./function-handler";
11
16
 
12
17
  const authoringOperations: ("read" | "create" | "update" | "delete")[] = [
13
18
  "read",
@@ -23,7 +28,27 @@ const modelWithoutSubscriptions = <Fields extends Parameters<typeof a.model>[0]>
23
28
  a.model(fields).disableOperations(["subscriptions"]);
24
29
  const realtimeModel = <Fields extends Parameters<typeof a.model>[0]>(fields: Fields) => a.model(fields);
25
30
 
26
- const baseDefinitions = {
31
+ /**
32
+ * Model groups a site may leave out of its data API. CloudFormation creates at most 2,500 resources in one stack
33
+ * operation, nested stacks included, and the full model set exceeds that on a fresh create. A first deploy that
34
+ * excludes a group fits; a second deploy without the exclusion adds the models as an ordinary update.
35
+ */
36
+ export const OPTIONAL_MODEL_GROUPS = {
37
+ editions: ["Edition", "EditionItem", "PublishedEdition", "PublishedEditionItem"],
38
+ } as const;
39
+
40
+ export type OptionalModelGroup = keyof typeof OPTIONAL_MODEL_GROUPS;
41
+
42
+ export function assertKnownModelGroups(groups: readonly string[]): asserts groups is readonly OptionalModelGroup[] {
43
+ for (const group of groups) {
44
+ if (!(group in OPTIONAL_MODEL_GROUPS)) {
45
+ throw new Error(`Unknown model group "${group}"; known groups: ${Object.keys(OPTIONAL_MODEL_GROUPS).join(", ")}`);
46
+ }
47
+ }
48
+ }
49
+
50
+ function buildBaseDefinitions(includeEditions: boolean) {
51
+ const definitions = {
27
52
  UserProfile: modelWithoutSubscriptions({
28
53
  id: a.id().required(),
29
54
  email: a.email(),
@@ -138,7 +163,7 @@ const baseDefinitions = {
138
163
  .query()
139
164
  .returns(a.ref("UserDirectoryResult"))
140
165
  .authorization((allow) => [allow.group(adminGroup)])
141
- .handler(a.handler.function(manageUserRole)),
166
+ .handler(functionHandler("manageUserRole", manageUserRole)),
142
167
 
143
168
  grantUserRole: a
144
169
  .mutation()
@@ -150,7 +175,7 @@ const baseDefinitions = {
150
175
  })
151
176
  .returns(a.ref("UserRoleMutationResult"))
152
177
  .authorization((allow) => [allow.group(adminGroup)])
153
- .handler(a.handler.function(manageUserRole)),
178
+ .handler(functionHandler("manageUserRole", manageUserRole)),
154
179
 
155
180
  revokeUserRole: a
156
181
  .mutation()
@@ -162,7 +187,7 @@ const baseDefinitions = {
162
187
  })
163
188
  .returns(a.ref("UserRoleMutationResult"))
164
189
  .authorization((allow) => [allow.group(adminGroup)])
165
- .handler(a.handler.function(manageUserRole)),
190
+ .handler(functionHandler("manageUserRole", manageUserRole)),
166
191
 
167
192
  mergeUserProfiles: a
168
193
  .mutation()
@@ -175,13 +200,13 @@ const baseDefinitions = {
175
200
  })
176
201
  .returns(a.ref("UserDirectoryEntry"))
177
202
  .authorization((allow) => [allow.group(adminGroup)])
178
- .handler(a.handler.function(manageUserRole)),
203
+ .handler(functionHandler("manageUserRole", manageUserRole)),
179
204
 
180
205
  getReaderSettings: a
181
206
  .query()
182
207
  .returns(a.ref("ReaderSettingsResult"))
183
208
  .authorization((allow) => [allow.authenticated()])
184
- .handler(a.handler.function(readerSettings)),
209
+ .handler(functionHandler("readerSettings", readerSettings)),
185
210
 
186
211
  updateReaderSettings: a
187
212
  .mutation()
@@ -190,7 +215,7 @@ const baseDefinitions = {
190
215
  })
191
216
  .returns(a.ref("ReaderSettingsResult"))
192
217
  .authorization((allow) => [allow.authenticated()])
193
- .handler(a.handler.function(readerSettings)),
218
+ .handler(functionHandler("readerSettings", readerSettings)),
194
219
 
195
220
  SteeringActionResult: a.customType({
196
221
  ok: a.boolean().required(),
@@ -220,7 +245,7 @@ const baseDefinitions = {
220
245
  })
221
246
  .returns(a.ref("SteeringActionResult"))
222
247
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
223
- .handler(a.handler.function(categoryAction)),
248
+ .handler(functionHandler("categoryAction", categoryAction)),
224
249
 
225
250
  CurationDelegationResult: a.customType({
226
251
  ok: a.boolean().required(),
@@ -307,7 +332,7 @@ const baseDefinitions = {
307
332
  .authorization((allow) => [
308
333
  allow.groups(categoryWriteGroups),
309
334
  ])
310
- .handler(a.handler.function(categoryAction)),
335
+ .handler(functionHandler("categoryAction", categoryAction)),
311
336
 
312
337
  createCurationDelegation: a
313
338
  .mutation()
@@ -319,7 +344,7 @@ const baseDefinitions = {
319
344
  .authorization((allow) => [
320
345
  allow.groups(categoryWriteGroups),
321
346
  ])
322
- .handler(a.handler.function(categoryAction)),
347
+ .handler(functionHandler("categoryAction", categoryAction)),
323
348
 
324
349
  revokeCurationDelegation: a
325
350
  .mutation()
@@ -330,7 +355,7 @@ const baseDefinitions = {
330
355
  .authorization((allow) => [
331
356
  allow.groups(categoryWriteGroups),
332
357
  ])
333
- .handler(a.handler.function(categoryAction)),
358
+ .handler(functionHandler("categoryAction", categoryAction)),
334
359
 
335
360
  listCurationDelegations: a
336
361
  .query()
@@ -338,7 +363,7 @@ const baseDefinitions = {
338
363
  .authorization((allow) => [
339
364
  allow.groups(categoryWriteGroups),
340
365
  ])
341
- .handler(a.handler.function(categoryAction)),
366
+ .handler(functionHandler("categoryAction", categoryAction)),
342
367
 
343
368
  requestCurationDelegation: a
344
369
  .mutation()
@@ -352,7 +377,7 @@ const baseDefinitions = {
352
377
  .authorization((allow) => [
353
378
  allow.authenticated("identityPool"),
354
379
  ])
355
- .handler(a.handler.function(categoryAction)),
380
+ .handler(functionHandler("categoryAction", categoryAction)),
356
381
 
357
382
  approveCurationDelegation: a
358
383
  .mutation()
@@ -363,7 +388,7 @@ const baseDefinitions = {
363
388
  .authorization((allow) => [
364
389
  allow.groups(categoryWriteGroups),
365
390
  ])
366
- .handler(a.handler.function(categoryAction)),
391
+ .handler(functionHandler("categoryAction", categoryAction)),
367
392
 
368
393
  denyCurationDelegation: a
369
394
  .mutation()
@@ -374,7 +399,7 @@ const baseDefinitions = {
374
399
  .authorization((allow) => [
375
400
  allow.groups(categoryWriteGroups),
376
401
  ])
377
- .handler(a.handler.function(categoryAction)),
402
+ .handler(functionHandler("categoryAction", categoryAction)),
378
403
 
379
404
  getCurationDelegationStatus: a
380
405
  .query()
@@ -385,7 +410,7 @@ const baseDefinitions = {
385
410
  .authorization((allow) => [
386
411
  allow.authenticated("identityPool"),
387
412
  ])
388
- .handler(a.handler.function(categoryAction)),
413
+ .handler(functionHandler("categoryAction", categoryAction)),
389
414
 
390
415
  recordDelegatedCuration: a
391
416
  .mutation()
@@ -407,7 +432,7 @@ const baseDefinitions = {
407
432
  .authorization((allow) => [
408
433
  allow.authenticated("identityPool"),
409
434
  ])
410
- .handler(a.handler.function(categoryAction)),
435
+ .handler(functionHandler("categoryAction", categoryAction)),
411
436
 
412
437
  setReferenceQualityRating: a
413
438
  .mutation()
@@ -422,7 +447,7 @@ const baseDefinitions = {
422
447
  .authorization((allow) => [
423
448
  allow.groups(categoryWriteGroups),
424
449
  ])
425
- .handler(a.handler.function(categoryAction)),
450
+ .handler(functionHandler("categoryAction", categoryAction)),
426
451
 
427
452
  createCategorySetDraft: a
428
453
  .mutation()
@@ -434,7 +459,7 @@ const baseDefinitions = {
434
459
  })
435
460
  .returns(a.ref("CategorySetDraftActionResult"))
436
461
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
437
- .handler(a.handler.function(categoryAction)),
462
+ .handler(functionHandler("categoryAction", categoryAction)),
438
463
 
439
464
  promoteCategorySetDraft: a
440
465
  .mutation()
@@ -445,7 +470,7 @@ const baseDefinitions = {
445
470
  })
446
471
  .returns(a.ref("CategorySetDraftActionResult"))
447
472
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
448
- .handler(a.handler.function(categoryAction)),
473
+ .handler(functionHandler("categoryAction", categoryAction)),
449
474
 
450
475
  discardCategorySetDraft: a
451
476
  .mutation()
@@ -456,7 +481,7 @@ const baseDefinitions = {
456
481
  })
457
482
  .returns(a.ref("CategorySetDraftActionResult"))
458
483
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
459
- .handler(a.handler.function(categoryAction)),
484
+ .handler(functionHandler("categoryAction", categoryAction)),
460
485
 
461
486
  createDraftCategory: a
462
487
  .mutation()
@@ -472,7 +497,7 @@ const baseDefinitions = {
472
497
  })
473
498
  .returns(a.ref("SteeringActionResult"))
474
499
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
475
- .handler(a.handler.function(categoryAction)),
500
+ .handler(functionHandler("categoryAction", categoryAction)),
476
501
 
477
502
  updateDraftCategory: a
478
503
  .mutation()
@@ -488,7 +513,7 @@ const baseDefinitions = {
488
513
  })
489
514
  .returns(a.ref("SteeringActionResult"))
490
515
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
491
- .handler(a.handler.function(categoryAction)),
516
+ .handler(functionHandler("categoryAction", categoryAction)),
492
517
 
493
518
  archiveDraftCategory: a
494
519
  .mutation()
@@ -499,7 +524,7 @@ const baseDefinitions = {
499
524
  })
500
525
  .returns(a.ref("SteeringActionResult"))
501
526
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
502
- .handler(a.handler.function(categoryAction)),
527
+ .handler(functionHandler("categoryAction", categoryAction)),
503
528
 
504
529
  reviewReferenceTopicLabel: a
505
530
  .mutation()
@@ -513,7 +538,7 @@ const baseDefinitions = {
513
538
  })
514
539
  .returns(a.ref("TopicLabelActionResult"))
515
540
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
516
- .handler(a.handler.function(categoryAction)),
541
+ .handler(functionHandler("categoryAction", categoryAction)),
517
542
 
518
543
  NewsroomSummary: a.customType({
519
544
  generatedAt: a.datetime().required(),
@@ -533,42 +558,63 @@ const baseDefinitions = {
533
558
  .query()
534
559
  .returns(a.ref("NewsroomSummary"))
535
560
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
536
- .handler(a.handler.function(newsroomSummary)),
561
+ .handler(functionHandler("newsroomSummary", newsroomSummary)),
537
562
 
538
563
  deriveMarkus: a
539
564
  .query()
540
565
  .arguments({ input: a.json().required() })
541
566
  .returns(a.json())
542
567
  .authorization((allow) => [allow.groups(contentWriteGroups)])
543
- .handler(a.handler.function(contentActions)),
568
+ .handler(functionHandler("contentActions", contentActions)),
569
+
570
+ intakePendingReferences: a
571
+ .mutation()
572
+ .arguments({ input: a.json().required() })
573
+ .returns(a.json())
574
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
575
+ .handler(functionHandler("contentActions", contentActions)),
576
+
577
+ intakeEmailSubmissionReferences: a
578
+ .mutation()
579
+ .arguments({ input: a.json().required() })
580
+ .returns(a.json())
581
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
582
+ .handler(functionHandler("contentActions", contentActions)),
544
583
 
545
584
  saveItemDraft: a
546
585
  .mutation()
547
586
  .arguments({ input: a.json().required() })
548
587
  .returns(a.json())
549
588
  .authorization((allow) => [allow.groups(contentWriteGroups)])
550
- .handler(a.handler.function(contentActions)),
589
+ .handler(functionHandler("contentActions", contentActions)),
551
590
 
552
591
  publishItem: a
553
592
  .mutation()
554
593
  .arguments({ input: a.json().required() })
555
594
  .returns(a.json())
556
595
  .authorization((allow) => [allow.groups(contentWriteGroups)])
557
- .handler(a.handler.function(contentActions)),
596
+ .handler(functionHandler("contentActions", contentActions)),
597
+
598
+ moveStoryStage: a
599
+ .mutation()
600
+ .arguments({ input: a.json().required() })
601
+ .returns(a.json())
602
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
603
+ .handler(functionHandler("contentActions", contentActions)),
558
604
 
559
605
  unpublishItem: a
560
606
  .mutation()
561
607
  .arguments({ input: a.json().required() })
562
608
  .returns(a.json())
563
609
  .authorization((allow) => [allow.groups(contentWriteGroups)])
564
- .handler(a.handler.function(contentActions)),
610
+ .handler(functionHandler("contentActions", contentActions)),
565
611
 
566
612
  requestStagingBuild: a
567
613
  .mutation()
568
614
  .arguments({ input: a.json().required() })
569
615
  .returns(a.json())
570
616
  .authorization((allow) => [allow.groups(contentWriteGroups)])
571
- .handler(a.handler.function(contentActions)),
617
+ .handler(functionHandler("contentActions", contentActions)),
572
618
 
573
619
  knowledgeQuery: a
574
620
  .query()
@@ -577,7 +623,7 @@ const baseDefinitions = {
577
623
  })
578
624
  .returns(a.json())
579
625
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
580
- .handler(a.handler.function(knowledgeQuery)),
626
+ .handler(functionHandler("knowledgeQuery", knowledgeQuery)),
581
627
 
582
628
  updateNewsroomSummary: a
583
629
  .mutation()
@@ -588,7 +634,7 @@ const baseDefinitions = {
588
634
  })
589
635
  .returns(a.ref("NewsroomSummary"))
590
636
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
591
- .handler(a.handler.function(newsroomSummary)),
637
+ .handler(functionHandler("newsroomSummary", newsroomSummary)),
592
638
 
593
639
  ModelAttachmentUploadSlot: a.customType({
594
640
  ok: a.boolean().required(),
@@ -648,7 +694,7 @@ const baseDefinitions = {
648
694
  })
649
695
  .returns(a.ref("ModelAttachmentUploadSlot"))
650
696
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
651
- .handler(a.handler.function(modelAttachmentUpload)),
697
+ .handler(functionHandler("modelAttachmentUpload", modelAttachmentUpload)),
652
698
 
653
699
  completeModelAttachmentUpload: a
654
700
  .mutation()
@@ -670,7 +716,7 @@ const baseDefinitions = {
670
716
  })
671
717
  .returns(a.ref("ModelAttachment"))
672
718
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
673
- .handler(a.handler.function(modelAttachmentUpload)),
719
+ .handler(functionHandler("modelAttachmentUpload", modelAttachmentUpload)),
674
720
 
675
721
  abortModelAttachmentUpload: a
676
722
  .mutation()
@@ -692,7 +738,7 @@ const baseDefinitions = {
692
738
  })
693
739
  .returns(a.ref("ModelAttachmentUploadAbortResult"))
694
740
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
695
- .handler(a.handler.function(modelAttachmentUpload)),
741
+ .handler(functionHandler("modelAttachmentUpload", modelAttachmentUpload)),
696
742
 
697
743
  createModelAttachmentDownload: a
698
744
  .mutation()
@@ -701,7 +747,7 @@ const baseDefinitions = {
701
747
  })
702
748
  .returns(a.ref("ModelAttachmentDownloadSlot"))
703
749
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
704
- .handler(a.handler.function(modelAttachmentUpload)),
750
+ .handler(functionHandler("modelAttachmentUpload", modelAttachmentUpload)),
705
751
 
706
752
  AssignmentActionResult: a.customType({
707
753
  ok: a.boolean().required(),
@@ -796,7 +842,7 @@ const baseDefinitions = {
796
842
  })
797
843
  .returns(a.ref("AssignmentContext").array().required())
798
844
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
799
- .handler(a.handler.function(assignmentAction)),
845
+ .handler(functionHandler("assignmentAction", assignmentAction)),
800
846
 
801
847
  listAssignmentQueue: a
802
848
  .query()
@@ -807,7 +853,7 @@ const baseDefinitions = {
807
853
  })
808
854
  .returns(a.ref("AssignmentContext").array().required())
809
855
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
810
- .handler(a.handler.function(assignmentAction)),
856
+ .handler(functionHandler("assignmentAction", assignmentAction)),
811
857
 
812
858
  getEditorialContext: a
813
859
  .query()
@@ -817,10 +863,11 @@ const baseDefinitions = {
817
863
  storyLineageId: a.id(),
818
864
  assignmentId: a.id(),
819
865
  maxCharacters: a.integer(),
866
+ optionalPublicationDoctrine: a.boolean(),
820
867
  })
821
868
  .returns(a.json().required())
822
869
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
823
- .handler(a.handler.function(assignmentAction)),
870
+ .handler(functionHandler("assignmentAction", assignmentAction)),
824
871
 
825
872
  getAssignmentContext: a
826
873
  .query()
@@ -829,7 +876,7 @@ const baseDefinitions = {
829
876
  })
830
877
  .returns(a.ref("AssignmentContext"))
831
878
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
832
- .handler(a.handler.function(assignmentAction)),
879
+ .handler(functionHandler("assignmentAction", assignmentAction)),
833
880
 
834
881
  claimAssignment: a
835
882
  .mutation()
@@ -846,7 +893,7 @@ const baseDefinitions = {
846
893
  })
847
894
  .returns(a.ref("AssignmentActionResult"))
848
895
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
849
- .handler(a.handler.function(assignmentAction)),
896
+ .handler(functionHandler("assignmentAction", assignmentAction)),
850
897
 
851
898
  releaseAssignment: a
852
899
  .mutation()
@@ -858,7 +905,7 @@ const baseDefinitions = {
858
905
  })
859
906
  .returns(a.ref("AssignmentActionResult"))
860
907
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
861
- .handler(a.handler.function(assignmentAction)),
908
+ .handler(functionHandler("assignmentAction", assignmentAction)),
862
909
 
863
910
  completeAssignment: a
864
911
  .mutation()
@@ -870,7 +917,7 @@ const baseDefinitions = {
870
917
  })
871
918
  .returns(a.ref("AssignmentActionResult"))
872
919
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
873
- .handler(a.handler.function(assignmentAction)),
920
+ .handler(functionHandler("assignmentAction", assignmentAction)),
874
921
 
875
922
  cancelAssignment: a
876
923
  .mutation()
@@ -882,7 +929,7 @@ const baseDefinitions = {
882
929
  })
883
930
  .returns(a.ref("AssignmentActionResult"))
884
931
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
885
- .handler(a.handler.function(assignmentAction)),
932
+ .handler(functionHandler("assignmentAction", assignmentAction)),
886
933
 
887
934
  reopenAssignment: a
888
935
  .mutation()
@@ -894,7 +941,7 @@ const baseDefinitions = {
894
941
  })
895
942
  .returns(a.ref("AssignmentActionResult"))
896
943
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
897
- .handler(a.handler.function(assignmentAction)),
944
+ .handler(functionHandler("assignmentAction", assignmentAction)),
898
945
 
899
946
  retryImmediateAssignment: a
900
947
  .mutation()
@@ -906,13 +953,13 @@ const baseDefinitions = {
906
953
  })
907
954
  .returns(a.ref("AssignmentActionResult"))
908
955
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
909
- .handler(a.handler.function(assignmentAction)),
956
+ .handler(functionHandler("assignmentAction", assignmentAction)),
910
957
 
911
958
  listNewsroomProcedureDefinitions: a
912
959
  .query()
913
960
  .returns(a.json())
914
961
  .authorization((allow) => [allow.group(adminGroup)])
915
- .handler(a.handler.function(procedureAction)),
962
+ .handler(functionHandler("procedureAction", procedureAction)),
916
963
 
917
964
  getNewsroomProcedureDefinition: a
918
965
  .query()
@@ -922,7 +969,7 @@ const baseDefinitions = {
922
969
  })
923
970
  .returns(a.json())
924
971
  .authorization((allow) => [allow.group(adminGroup)])
925
- .handler(a.handler.function(procedureAction)),
972
+ .handler(functionHandler("procedureAction", procedureAction)),
926
973
 
927
974
  saveNewsroomProcedureDefinition: a
928
975
  .mutation()
@@ -931,7 +978,7 @@ const baseDefinitions = {
931
978
  })
932
979
  .returns(a.json())
933
980
  .authorization((allow) => [allow.group(adminGroup)])
934
- .handler(a.handler.function(procedureAction)),
981
+ .handler(functionHandler("procedureAction", procedureAction)),
935
982
 
936
983
  saveNewsroomProcedureVersionDraft: a
937
984
  .mutation()
@@ -940,7 +987,7 @@ const baseDefinitions = {
940
987
  })
941
988
  .returns(a.json())
942
989
  .authorization((allow) => [allow.group(adminGroup)])
943
- .handler(a.handler.function(procedureAction)),
990
+ .handler(functionHandler("procedureAction", procedureAction)),
944
991
 
945
992
  publishNewsroomProcedureVersion: a
946
993
  .mutation()
@@ -949,7 +996,7 @@ const baseDefinitions = {
949
996
  })
950
997
  .returns(a.json())
951
998
  .authorization((allow) => [allow.group(adminGroup)])
952
- .handler(a.handler.function(procedureAction)),
999
+ .handler(functionHandler("procedureAction", procedureAction)),
953
1000
 
954
1001
  startNewsroomProcedureRun: a
955
1002
  .mutation()
@@ -964,7 +1011,7 @@ const baseDefinitions = {
964
1011
  })
965
1012
  .returns(a.json())
966
1013
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
967
- .handler(a.handler.function(procedureAction)),
1014
+ .handler(functionHandler("procedureAction", procedureAction)),
968
1015
 
969
1016
  getNewsroomProcedureRun: a
970
1017
  .query()
@@ -973,7 +1020,7 @@ const baseDefinitions = {
973
1020
  })
974
1021
  .returns(a.json())
975
1022
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
976
- .handler(a.handler.function(procedureAction)),
1023
+ .handler(functionHandler("procedureAction", procedureAction)),
977
1024
 
978
1025
  listNewsroomProcedureRunsByProcedure: a
979
1026
  .query()
@@ -982,7 +1029,7 @@ const baseDefinitions = {
982
1029
  })
983
1030
  .returns(a.json())
984
1031
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
985
- .handler(a.handler.function(procedureAction)),
1032
+ .handler(functionHandler("procedureAction", procedureAction)),
986
1033
 
987
1034
  Assignment: modelWithoutSubscriptions({
988
1035
  id: a.id().required(),
@@ -1126,6 +1173,8 @@ const baseDefinitions = {
1126
1173
  error: a.json(),
1127
1174
  attempt: a.integer(),
1128
1175
  newsroomFeedKey: a.string(),
1176
+ usage: a.json(),
1177
+ costUsd: a.float(),
1129
1178
  })
1130
1179
  .secondaryIndexes((index) => [
1131
1180
  index("procedureId").sortKeys(["requestedAt"]).queryField("listProcedureRunsByProcedureAndRequestedAt"),
@@ -1138,6 +1187,74 @@ const baseDefinitions = {
1138
1187
  allow.group(adminGroup).to(authoringOperations),
1139
1188
  ]),
1140
1189
 
1190
+ /** A named "when X happens, run procedure Y" (PPY-9ff95b). Step 1 mirrors the monitoring router's procedureTriggers and starts nothing itself. */
1191
+ Automation: modelWithoutSubscriptions({
1192
+ id: a.id().required(),
1193
+ title: a.string().required(),
1194
+ description: a.string(),
1195
+ enabled: a.boolean().required(),
1196
+ trigger: a.json().required(),
1197
+ procedureKey: a.string().required(),
1198
+ inputTemplate: a.json(),
1199
+ limits: a.json(),
1200
+ createdBy: a.string(),
1201
+ createdAt: a.datetime().required(),
1202
+ updatedBy: a.string(),
1203
+ updatedAt: a.datetime().required(),
1204
+ })
1205
+ .authorization((allow) => [
1206
+ allow.group("editor").to(["read", "create", "update"]),
1207
+ allow.group(adminGroup).to(authoringOperations),
1208
+ ]),
1209
+
1210
+ /** A human review point raised by a step on any item (PPY-ab6a50). Review is not a story state. */
1211
+ ReviewRequest: modelWithoutSubscriptions({
1212
+ id: a.id().required(),
1213
+ subject: a.json().required(),
1214
+ mode: a.string().required(),
1215
+ reason: a.string().required(),
1216
+ ask: a.string(),
1217
+ raisedBy: a.string().required(),
1218
+ raisedAt: a.datetime().required(),
1219
+ deadline: a.datetime(),
1220
+ state: a.string().required(),
1221
+ answer: a.json(),
1222
+ links: a.json(),
1223
+ history: a.json(),
1224
+ appliedIn: a.json(),
1225
+ updatedAt: a.datetime().required(),
1226
+ })
1227
+ .authorization((allow) => [
1228
+ allow.group("editor").to(["read", "create", "update"]),
1229
+ allow.group(adminGroup).to(authoringOperations),
1230
+ ]),
1231
+
1232
+ /** One user's read mark on one review request; id is "<userKey>#<requestId>". */
1233
+ ReviewReadMark: modelWithoutSubscriptions({
1234
+ id: a.id().required(),
1235
+ requestId: a.string().required(),
1236
+ userKey: a.string().required(),
1237
+ readAt: a.datetime().required(),
1238
+ })
1239
+ .authorization((allow) => [
1240
+ allow.groups(["editor", adminGroup]).to(["read", "create", "update"]),
1241
+ ]),
1242
+
1243
+ /** Who is told about review requests: scope default, mode or automation. Changed by data, not code. */
1244
+ ReviewRecipientRule: modelWithoutSubscriptions({
1245
+ id: a.id().required(),
1246
+ scope: a.string().required(),
1247
+ key: a.string(),
1248
+ roles: a.string().array(),
1249
+ emails: a.string().array(),
1250
+ updatedBy: a.string(),
1251
+ updatedAt: a.datetime().required(),
1252
+ })
1253
+ .authorization((allow) => [
1254
+ allow.group("editor").to(["read"]),
1255
+ allow.group(adminGroup).to(authoringOperations),
1256
+ ]),
1257
+
1141
1258
  NewsroomSection: modelWithoutSubscriptions({
1142
1259
  id: a.id().required(),
1143
1260
  tenantId: a.string(),
@@ -1782,7 +1899,7 @@ const baseDefinitions = {
1782
1899
  updatedAt: a.datetime(),
1783
1900
  tags: a.hasMany("ItemTag", "itemId"),
1784
1901
  mediaAssets: a.hasMany("MediaAsset", "itemId"),
1785
- editionItems: a.hasMany("EditionItem", "itemId"),
1902
+ ...(includeEditions ? { editionItems: a.hasMany("EditionItem", "itemId") } : {}),
1786
1903
  })
1787
1904
  .secondaryIndexes((index) => [
1788
1905
  index("lineageId").sortKeys(["versionNumber"]).queryField("listItemsByLineageAndVersion"),
@@ -2105,27 +2222,48 @@ const baseDefinitions = {
2105
2222
  allow.guest().to(["read"]),
2106
2223
  allow.groups(contentWriteGroups),
2107
2224
  ]),
2225
+ ...editorialChecksSchemaDefinitions,
2226
+ ...monitoringViewSchemaDefinitions,
2227
+ ...automationViewSchemaDefinitions,
2108
2228
  };
2229
+ if (!includeEditions) {
2230
+ const mutableDefinitions = definitions as Record<string, unknown>;
2231
+ for (const modelName of OPTIONAL_MODEL_GROUPS.editions) delete mutableDefinitions[modelName];
2232
+ }
2233
+ return definitions;
2234
+ }
2109
2235
 
2110
- export const schema = a.schema(baseDefinitions).authorization((allow) => [
2111
- allow.resource(categoryAction),
2112
- allow.resource(contentActions),
2113
- allow.resource(manageUserRole),
2114
- allow.resource(modelAttachmentUpload),
2115
- allow.resource(newsroomSummary),
2116
- allow.resource(procedureAction),
2117
- ]);
2236
+ export function baseModelNames(excludedGroups: readonly OptionalModelGroup[] = []): string[] {
2237
+ return Object.keys(buildBaseDefinitions(!excludedGroups.includes("editions")));
2238
+ }
2118
2239
 
2119
- /** The deployed schema of a site that enables plugins: the base definitions plus what each plugin contributes (docs/plugins.md). */
2120
- export function schemaWithPlugins(pluginDefinitions: Record<string, any>) {
2121
- return a.schema({ ...baseDefinitions, ...pluginDefinitions } as typeof baseDefinitions).authorization((allow) => [
2240
+ const baseDefinitions = buildBaseDefinitions(true);
2241
+
2242
+ /** Schema-level function grants shared by every deployed schema, with or without plugins, so none can drop one. */
2243
+ function functionGrants(allow: any) {
2244
+ return [
2245
+ allow.resource(assignmentAction).to(["query", "mutate"]),
2122
2246
  allow.resource(categoryAction),
2123
2247
  allow.resource(contentActions),
2124
2248
  allow.resource(manageUserRole),
2125
2249
  allow.resource(modelAttachmentUpload),
2126
2250
  allow.resource(newsroomSummary),
2127
2251
  allow.resource(procedureAction),
2128
- ]);
2252
+ allow.resource(publicForms).to(["mutate"]),
2253
+ ];
2254
+ }
2255
+
2256
+ export const schema = a.schema(baseDefinitions).authorization(functionGrants);
2257
+
2258
+ /** The deployed schema of a site that enables plugins: the base definitions plus what each plugin contributes (docs/plugins.md). */
2259
+ export function schemaWithPlugins(pluginDefinitions: Record<string, any>) {
2260
+ return a.schema({ ...baseDefinitions, ...pluginDefinitions } as typeof baseDefinitions).authorization(functionGrants);
2261
+ }
2262
+
2263
+ /** The schema of a site that leaves optional model groups out of its first deploy. */
2264
+ export function schemaExcludingGroups(excludedGroups: readonly OptionalModelGroup[], pluginDefinitions: Record<string, any> = {}) {
2265
+ const definitions = buildBaseDefinitions(!excludedGroups.includes("editions")) as unknown as typeof baseDefinitions;
2266
+ return a.schema({ ...definitions, ...pluginDefinitions } as typeof baseDefinitions).authorization(functionGrants);
2129
2267
  }
2130
2268
 
2131
2269
  export type Schema = ClientSchema<typeof schema>;