@anthusai/papyrus 0.0.0 → 1.0.0-next.10

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 (282) hide show
  1. package/LICENSE +21 -0
  2. package/amplify/auth/resource.js +61 -0
  3. package/amplify/auth/resource.ts +65 -0
  4. package/amplify/data/resource.js +2069 -0
  5. package/amplify/data/resource.ts +2185 -0
  6. package/amplify/data/schema.js +1882 -0
  7. package/amplify/data/schema.ts +1990 -0
  8. package/amplify/functions/assignment-action/handler.ts +1416 -0
  9. package/amplify/functions/assignment-action/resource.js +8 -0
  10. package/amplify/functions/assignment-action/resource.ts +9 -0
  11. package/amplify/functions/category-action/handler.ts +2259 -0
  12. package/amplify/functions/category-action/resource.js +8 -0
  13. package/amplify/functions/category-action/resource.ts +9 -0
  14. package/amplify/functions/console-chat-responder/Cargo.lock +3456 -0
  15. package/amplify/functions/console-chat-responder/Cargo.toml +26 -0
  16. package/amplify/functions/console-chat-responder/Dockerfile +19 -0
  17. package/amplify/functions/console-chat-responder/py/execute_tactus_runner.py +116 -0
  18. package/amplify/functions/console-chat-responder/resource.js +153 -0
  19. package/amplify/functions/console-chat-responder/resource.ts +179 -0
  20. package/amplify/functions/console-chat-responder/src/main.rs +3242 -0
  21. package/amplify/functions/content-actions/handler.py +149 -0
  22. package/amplify/functions/content-actions/requirements.txt +4 -0
  23. package/amplify/functions/content-actions/resource.js +40 -0
  24. package/amplify/functions/content-actions/resource.ts +54 -0
  25. package/amplify/functions/email-submission-processor/handler.py +46 -0
  26. package/amplify/functions/email-submission-processor/requirements.txt +2 -0
  27. package/amplify/functions/email-submission-processor/resource.js +56 -0
  28. package/amplify/functions/email-submission-processor/resource.ts +69 -0
  29. package/amplify/functions/graphql-jwt-authorizer/handler.ts +193 -0
  30. package/amplify/functions/graphql-jwt-authorizer/resource.js +14 -0
  31. package/amplify/functions/graphql-jwt-authorizer/resource.ts +15 -0
  32. package/amplify/functions/knowledge-query/handler.py +1 -0
  33. package/amplify/functions/knowledge-query/requirements.txt +3 -0
  34. package/amplify/functions/knowledge-query/resource.js +50 -0
  35. package/amplify/functions/knowledge-query/resource.ts +61 -0
  36. package/amplify/functions/manage-user-role/handler.ts +799 -0
  37. package/amplify/functions/manage-user-role/resource.js +8 -0
  38. package/amplify/functions/manage-user-role/resource.ts +9 -0
  39. package/amplify/functions/model-attachment-upload/handler.ts +387 -0
  40. package/amplify/functions/model-attachment-upload/resource.js +8 -0
  41. package/amplify/functions/model-attachment-upload/resource.ts +9 -0
  42. package/amplify/functions/newsroom-summary/handler.ts +321 -0
  43. package/amplify/functions/newsroom-summary/resource.js +8 -0
  44. package/amplify/functions/newsroom-summary/resource.ts +9 -0
  45. package/amplify/functions/procedure-action/handler.ts +621 -0
  46. package/amplify/functions/procedure-action/resource.js +8 -0
  47. package/amplify/functions/procedure-action/resource.ts +9 -0
  48. package/amplify/functions/reader-settings/handler.ts +322 -0
  49. package/amplify/functions/reader-settings/resource.js +8 -0
  50. package/amplify/functions/reader-settings/resource.ts +9 -0
  51. package/amplify/functions/ses-inbound-receive/handler.ts +493 -0
  52. package/amplify/functions/ses-inbound-receive/resource.js +8 -0
  53. package/amplify/functions/ses-inbound-receive/resource.ts +9 -0
  54. package/amplify/functions/shared/amplify-secrets.ts +65 -0
  55. package/amplify/functions/shared/console-chat-enqueue.ts +117 -0
  56. package/amplify/functions/shared/email-mime-intake.ts +196 -0
  57. package/amplify/functions/shared/email-submission.ts +415 -0
  58. package/amplify/functions/shared/inbound-email-intake.ts +37 -0
  59. package/amplify/functions/shared/lambda-data-client.ts +21 -0
  60. package/amplify/functions/shared/model-payloads.ts +186 -0
  61. package/amplify/functions/shared/python-bundle.js +130 -0
  62. package/amplify/functions/shared/python-bundle.ts +162 -0
  63. package/amplify/functions/shared/slack-events.ts +111 -0
  64. package/amplify/functions/slack-delivery/handler.py +112 -0
  65. package/amplify/functions/slack-delivery/requirements.txt +2 -0
  66. package/amplify/functions/slack-delivery/resource.js +38 -0
  67. package/amplify/functions/slack-delivery/resource.ts +51 -0
  68. package/amplify/functions/slack-events/handler.ts +155 -0
  69. package/amplify/functions/slack-events/resource.js +11 -0
  70. package/amplify/functions/slack-events/resource.ts +12 -0
  71. package/amplify/inbound-email/stack.js +46 -0
  72. package/amplify/inbound-email/stack.ts +61 -0
  73. package/amplify/package.json +3 -0
  74. package/amplify/rebuild-trigger-settings.js +22 -0
  75. package/amplify/rebuild-trigger-settings.ts +42 -0
  76. package/amplify/site-backend-config.js +1 -0
  77. package/amplify/site-backend-config.ts +36 -0
  78. package/amplify/site-backend.js +615 -0
  79. package/amplify/site-backend.ts +739 -0
  80. package/amplify/storage/resource.js +21 -0
  81. package/amplify/storage/resource.ts +22 -0
  82. package/app/%5F_preview/[[...path]]/route.ts +8 -0
  83. package/app/[year]/[month]/[day]/[articleSlug]/page.tsx +62 -0
  84. package/app/[year]/[month]/[day]/edition-route-page.tsx +53 -0
  85. package/app/[year]/[month]/[day]/page/[pageNumber]/page.tsx +32 -0
  86. package/app/[year]/[month]/[day]/page.tsx +22 -0
  87. package/app/[year]/[month]/[day]/section/[sectionKey]/page.tsx +32 -0
  88. package/app/api/archive/editions/route.ts +18 -0
  89. package/app/api/media/[...path]/route.ts +35 -0
  90. package/app/api/revalidate/route.ts +94 -0
  91. package/app/archive/page.tsx +24 -0
  92. package/app/articles/[slug]/page.tsx +35 -0
  93. package/app/globals.css +10345 -0
  94. package/app/layout.tsx +142 -0
  95. package/app/newsroom/[section]/[...selection]/page.tsx +50 -0
  96. package/app/newsroom/[section]/page.tsx +47 -0
  97. package/app/newsroom/articles/[id]/page.tsx +15 -0
  98. package/app/newsroom/articles/page.tsx +13 -0
  99. package/app/newsroom/forum/[threadId]/page.tsx +35 -0
  100. package/app/newsroom/insights/[threadId]/page.tsx +22 -0
  101. package/app/newsroom/insights/page.tsx +14 -0
  102. package/app/newsroom/layout.tsx +12 -0
  103. package/app/newsroom/page.tsx +31 -0
  104. package/app/newsroom/sections/[sectionId]/page.tsx +17 -0
  105. package/app/page.tsx +272 -0
  106. package/app/papyrus-theme.css +11 -0
  107. package/app/robots.ts +11 -0
  108. package/app/settings/page.tsx +14 -0
  109. package/app/tailwind.css +65 -0
  110. package/bin/papyrus-app.mjs +20 -0
  111. package/bin/papyrus-infra.mjs +95 -0
  112. package/components/ai-elements/conversation.tsx +168 -0
  113. package/components/ai-elements/message.tsx +360 -0
  114. package/components/ai-elements/model-selector.tsx +30 -0
  115. package/components/ai-elements/prompt-input.tsx +1461 -0
  116. package/components/ai-elements/shimmer.tsx +76 -0
  117. package/components/ai-elements/suggestion.tsx +54 -0
  118. package/components/ai-elements/tool.tsx +173 -0
  119. package/components/amplify-client-provider.tsx +140 -0
  120. package/components/archive-grid.tsx +89 -0
  121. package/components/archive-shell.tsx +41 -0
  122. package/components/article-video.tsx +156 -0
  123. package/components/blog-page-background.tsx +20 -0
  124. package/components/dev-sandbox-editor-sign-in.tsx +60 -0
  125. package/components/markus-ir-preview.tsx +300 -0
  126. package/components/news-desk-client-provider.tsx +211 -0
  127. package/components/news-desk-page.tsx +116 -0
  128. package/components/news-desk-taxonomy-client.ts +3684 -0
  129. package/components/newspaper.tsx +1929 -0
  130. package/components/newsroom-access-gate.tsx +66 -0
  131. package/components/newsroom-article-editor.tsx +741 -0
  132. package/components/newsroom-articles-view.tsx +129 -0
  133. package/components/newsroom-assignments-view.tsx +664 -0
  134. package/components/newsroom-ops-overview.tsx +226 -0
  135. package/components/newsroom-ops-shell.tsx +321 -0
  136. package/components/newsroom-references-view.tsx +598 -0
  137. package/components/newsroom-topics-view.tsx +425 -0
  138. package/components/papyrus-console-shell.tsx +1912 -0
  139. package/components/pictogram-figure.tsx +65 -0
  140. package/components/presentation-footer.tsx +146 -0
  141. package/components/reader-auth-control.tsx +162 -0
  142. package/components/reader-auth-state.ts +122 -0
  143. package/components/reader-settings.ts +332 -0
  144. package/components/reader-theme-control.tsx +85 -0
  145. package/components/reference-source-preview.tsx +163 -0
  146. package/components/settings-page.tsx +239 -0
  147. package/components/staging-banner.tsx +11 -0
  148. package/components/topic-steering-workspace.tsx +18005 -0
  149. package/components/ui/badge.tsx +30 -0
  150. package/components/ui/button-group.tsx +87 -0
  151. package/components/ui/button.tsx +58 -0
  152. package/components/ui/card.tsx +32 -0
  153. package/components/ui/command.tsx +194 -0
  154. package/components/ui/dialog.tsx +158 -0
  155. package/components/ui/dropdown-menu.tsx +266 -0
  156. package/components/ui/hover-card.tsx +51 -0
  157. package/components/ui/input-group.tsx +158 -0
  158. package/components/ui/input.tsx +20 -0
  159. package/components/ui/scroll-area.tsx +16 -0
  160. package/components/ui/select.tsx +199 -0
  161. package/components/ui/separator.tsx +23 -0
  162. package/components/ui/sheet.tsx +92 -0
  163. package/components/ui/spinner.tsx +10 -0
  164. package/components/ui/tabs.tsx +113 -0
  165. package/components/ui/textarea.tsx +18 -0
  166. package/components/ui/tooltip.tsx +66 -0
  167. package/components/use-resolved-papyrus-theme.ts +47 -0
  168. package/infra/amplify-app-shell.js +234 -0
  169. package/infra/amplify-app-shell.ts +284 -0
  170. package/infra/build-specs.js +85 -0
  171. package/infra/build-specs.ts +131 -0
  172. package/infra/github-oidc-provider.js +24 -0
  173. package/infra/github-oidc-provider.ts +30 -0
  174. package/infra/index.js +15 -0
  175. package/infra/site-config.js +186 -0
  176. package/infra/site-config.ts +235 -0
  177. package/lib/amplify-outputs-guard.ts +24 -0
  178. package/lib/amplify-outputs-path.ts +16 -0
  179. package/lib/amplify-server-runtime.ts +63 -0
  180. package/lib/archive-data.ts +30 -0
  181. package/lib/archive-types.ts +15 -0
  182. package/lib/articles.ts +320 -0
  183. package/lib/cached-content-repository.ts +90 -0
  184. package/lib/category-dashboard.ts +37 -0
  185. package/lib/category-repository.ts +1907 -0
  186. package/lib/console-chat-client.ts +1316 -0
  187. package/lib/console-web-context.ts +118 -0
  188. package/lib/content-actions-client.ts +98 -0
  189. package/lib/content-actions-demo.ts +190 -0
  190. package/lib/content-load-timing.ts +23 -0
  191. package/lib/content-repository.ts +43 -0
  192. package/lib/content-source-context.ts +26 -0
  193. package/lib/content-types.ts +104 -0
  194. package/lib/define-site.js +3 -0
  195. package/lib/define-site.ts +21 -0
  196. package/lib/demo-amplify-outputs.ts +15 -0
  197. package/lib/dev-sandbox-editor-auth.ts +18 -0
  198. package/lib/doctrine.ts +128 -0
  199. package/lib/edition-routes.ts +155 -0
  200. package/lib/edition-sections.ts +111 -0
  201. package/lib/empty-edition-layout-plan.ts +109 -0
  202. package/lib/empty-theme.css +1 -0
  203. package/lib/excerpts.ts +8 -0
  204. package/lib/graphql-content-repository.ts +1140 -0
  205. package/lib/image-url.ts +10 -0
  206. package/lib/layout-plan.ts +981 -0
  207. package/lib/layout-scenarios.ts +564 -0
  208. package/lib/markus-body.ts +168 -0
  209. package/lib/markus-ir.ts +235 -0
  210. package/lib/markus-projection.ts +243 -0
  211. package/lib/markus-to-article.ts +93 -0
  212. package/lib/news-desk-session.ts +160 -0
  213. package/lib/newspaper-layout.ts +3459 -0
  214. package/lib/newsroom-articles.ts +325 -0
  215. package/lib/newsroom-assignments.ts +173 -0
  216. package/lib/newsroom-base-path.ts +48 -0
  217. package/lib/newsroom-card-layout.ts +102 -0
  218. package/lib/newsroom-category-drilldown.ts +133 -0
  219. package/lib/newsroom-demo-articles.ts +90 -0
  220. package/lib/newsroom-demo-dashboard.ts +267 -0
  221. package/lib/newsroom-demo-profile.ts +46 -0
  222. package/lib/newsroom-forum-routes.ts +153 -0
  223. package/lib/newsroom-index-filters.ts +202 -0
  224. package/lib/newsroom-knowledge-query-request.ts +51 -0
  225. package/lib/newsroom-list-selection.ts +42 -0
  226. package/lib/newsroom-media-backend.ts +142 -0
  227. package/lib/newsroom-media.ts +182 -0
  228. package/lib/newsroom-nav.ts +44 -0
  229. package/lib/newsroom-references.ts +116 -0
  230. package/lib/newsroom-sections.ts +52 -0
  231. package/lib/newsroom-topics.ts +118 -0
  232. package/lib/papyrus-object-kinds.ts +24 -0
  233. package/lib/papyrus-web-locations.ts +480 -0
  234. package/lib/pilobol-sample.ts +167 -0
  235. package/lib/presentation-footer.ts +92 -0
  236. package/lib/pretext-layout.ts +179 -0
  237. package/lib/public-placeholder-config.ts +102 -0
  238. package/lib/publication-items.ts +181 -0
  239. package/lib/reader-route-config.ts +1 -0
  240. package/lib/reader-static-params.ts +56 -0
  241. package/lib/reader-storage-url.ts +63 -0
  242. package/lib/reference-display.ts +74 -0
  243. package/lib/reference-policy.ts +97 -0
  244. package/lib/reference-source-preview.ts +175 -0
  245. package/lib/renderer-config.ts +50 -0
  246. package/lib/renderer.ts +87 -0
  247. package/lib/reporting-story-budget.ts +638 -0
  248. package/lib/semantic-graph.ts +554 -0
  249. package/lib/site-brand-tenant.ts +22 -0
  250. package/lib/site-brand.ts +194 -0
  251. package/lib/site-env.ts +52 -0
  252. package/lib/site-renderer.ts +17 -0
  253. package/lib/site-stack.ts +195 -0
  254. package/lib/staging-gate.ts +37 -0
  255. package/lib/staging-preview-object.ts +98 -0
  256. package/lib/themed-image.ts +30 -0
  257. package/lib/utils.ts +6 -0
  258. package/lib/video-mode.ts +42 -0
  259. package/lib/video-script.ts +63 -0
  260. package/middleware.ts +103 -0
  261. package/package.json +318 -1
  262. package/renderers/markus/index.ts +25 -0
  263. package/renderers/markus/stubs.tsx +33 -0
  264. package/renderers/pretext/article-page.tsx +169 -0
  265. package/renderers/pretext/index.ts +30 -0
  266. package/renderers/pretext/layouts.ts +16 -0
  267. package/renderers/pretext/presentation-shell.tsx +470 -0
  268. package/routes.manifest.json +208 -0
  269. package/scripts/fixtures/pilobol-sample.ast.json +234 -0
  270. package/scripts/videoml/build-browser-bundle.mjs +22 -0
  271. package/scripts/videoml/build-preview-bundle.mjs +50 -0
  272. package/scripts/videoml/bundle-common.mjs +129 -0
  273. package/scripts/videoml/preview/preview-entry.tsx +381 -0
  274. package/scripts/videoml/preview/preview-stage-fit.ts +28 -0
  275. package/scripts/videoml/preview/preview-timing.ts +42 -0
  276. package/scripts/videoml/preview.html +77 -0
  277. package/scripts/videoml/standard-entry.tsx +46 -0
  278. package/src/backend.js +1 -0
  279. package/src/backend.ts +3 -0
  280. package/src/sync.mjs +87 -0
  281. package/src/with-papyrus.d.mts +2 -0
  282. package/src/with-papyrus.mjs +60 -0
@@ -0,0 +1,1990 @@
1
+ import { type ClientSchema, a } from "@aws-amplify/backend";
2
+ import { assignmentAction } from "../functions/assignment-action/resource";
3
+ import { categoryAction } from "../functions/category-action/resource";
4
+ import { contentActions } from "../functions/content-actions/resource";
5
+ import { knowledgeQuery } from "../functions/knowledge-query/resource";
6
+ import { manageUserRole } from "../functions/manage-user-role/resource";
7
+ import { modelAttachmentUpload } from "../functions/model-attachment-upload/resource";
8
+ import { newsroomSummary } from "../functions/newsroom-summary/resource";
9
+ import { procedureAction } from "../functions/procedure-action/resource";
10
+ import { readerSettings } from "../functions/reader-settings/resource";
11
+
12
+ const authoringOperations: ("read" | "create" | "update" | "delete")[] = [
13
+ "read",
14
+ "create",
15
+ "update",
16
+ "delete",
17
+ ];
18
+ const contentWriteGroups = ["editor", "admin"];
19
+ const adminGroup = "admin";
20
+ const categoryWriteGroups = ["editor", "admin"];
21
+ const categoryAppendOnlyOperations: ("read" | "create")[] = ["read", "create"];
22
+ const modelWithoutSubscriptions = <Fields extends Parameters<typeof a.model>[0]>(fields: Fields) =>
23
+ a.model(fields).disableOperations(["subscriptions"]);
24
+ const realtimeModel = <Fields extends Parameters<typeof a.model>[0]>(fields: Fields) => a.model(fields);
25
+
26
+ export const schema = a.schema({
27
+ UserProfile: modelWithoutSubscriptions({
28
+ id: a.id().required(),
29
+ email: a.email(),
30
+ displayName: a.string(),
31
+ avatarUrl: a.url(),
32
+ preferences: a.json(),
33
+ settings: a.json(),
34
+ status: a.string(),
35
+ mergedIntoProfileId: a.id(),
36
+ mergedAt: a.datetime(),
37
+ mergedBy: a.string(),
38
+ mergeReason: a.string(),
39
+ createdAt: a.datetime(),
40
+ updatedAt: a.datetime(),
41
+ })
42
+ .authorization((allow) => [
43
+ allow.owner(),
44
+ allow.group(adminGroup),
45
+ ]),
46
+
47
+ UserIdentity: modelWithoutSubscriptions({
48
+ id: a.id().required(),
49
+ userProfileId: a.id().required(),
50
+ cognitoSub: a.string().required(),
51
+ provider: a.string(),
52
+ email: a.email(),
53
+ status: a.string().required(),
54
+ linkedAt: a.datetime().required(),
55
+ lastSeenAt: a.datetime(),
56
+ })
57
+ .secondaryIndexes((index) => [
58
+ index("userProfileId").sortKeys(["linkedAt"]).queryField("listUserIdentitiesByProfileAndLinkedAt"),
59
+ index("cognitoSub").queryField("userIdentityByCognitoSub"),
60
+ index("email").sortKeys(["status"]).queryField("listUserIdentitiesByEmailAndStatus"),
61
+ ])
62
+ .authorization((allow) => [
63
+ allow.group(adminGroup),
64
+ ]),
65
+
66
+ UserRoleAssignment: modelWithoutSubscriptions({
67
+ id: a.id().required(),
68
+ userProfileId: a.id().required(),
69
+ userSub: a.string(),
70
+ email: a.email(),
71
+ role: a.string().required(),
72
+ status: a.string().required(),
73
+ grantedBy: a.string().required(),
74
+ grantedAt: a.datetime().required(),
75
+ revokedAt: a.datetime(),
76
+ notes: a.string(),
77
+ })
78
+ .secondaryIndexes((index) => [
79
+ index("userProfileId").sortKeys(["role"]).queryField("listUserRoleAssignmentsByProfileAndRole"),
80
+ index("userSub").sortKeys(["role"]).queryField("listUserRoleAssignmentsByUserAndRole"),
81
+ index("role").sortKeys(["status"]).queryField("listUserRoleAssignmentsByRoleAndStatus"),
82
+ ])
83
+ .authorization((allow) => [
84
+ allow.group(adminGroup),
85
+ ]),
86
+
87
+ UserRoleMutationResult: a.customType({
88
+ ok: a.boolean().required(),
89
+ userProfileId: a.id(),
90
+ userSub: a.string(),
91
+ username: a.string(),
92
+ role: a.string().required(),
93
+ userSubs: a.string().array(),
94
+ usernames: a.string().array(),
95
+ activeRoles: a.string().array().required(),
96
+ }),
97
+
98
+ UserDirectoryIdentity: a.customType({
99
+ id: a.id().required(),
100
+ userProfileId: a.id().required(),
101
+ cognitoSub: a.string().required(),
102
+ provider: a.string(),
103
+ email: a.email(),
104
+ status: a.string().required(),
105
+ linkedAt: a.datetime().required(),
106
+ lastSeenAt: a.datetime(),
107
+ }),
108
+
109
+ UserDirectoryEntry: a.customType({
110
+ userProfileId: a.id(),
111
+ userSub: a.string(),
112
+ username: a.string(),
113
+ email: a.email(),
114
+ displayName: a.string(),
115
+ provider: a.string(),
116
+ enabled: a.boolean(),
117
+ cognitoStatus: a.string(),
118
+ profileStatus: a.string(),
119
+ mergedIntoProfileId: a.id(),
120
+ identityStatus: a.string(),
121
+ activeRoles: a.string().array().required(),
122
+ identities: a.ref("UserDirectoryIdentity").array().required(),
123
+ }),
124
+
125
+ UserDirectoryResult: a.customType({
126
+ entries: a.ref("UserDirectoryEntry").array().required(),
127
+ profileCount: a.integer().required(),
128
+ identityCount: a.integer().required(),
129
+ cognitoUserCount: a.integer().required(),
130
+ }),
131
+
132
+ ReaderSettingsResult: a.customType({
133
+ userProfileId: a.id().required(),
134
+ settings: a.json(),
135
+ }),
136
+
137
+ listUserDirectory: a
138
+ .query()
139
+ .returns(a.ref("UserDirectoryResult"))
140
+ .authorization((allow) => [allow.group(adminGroup)])
141
+ .handler(a.handler.function(manageUserRole)),
142
+
143
+ grantUserRole: a
144
+ .mutation()
145
+ .arguments({
146
+ userProfileId: a.id(),
147
+ userSub: a.string(),
148
+ cognitoSubs: a.string().array(),
149
+ role: a.string().required(),
150
+ })
151
+ .returns(a.ref("UserRoleMutationResult"))
152
+ .authorization((allow) => [allow.group(adminGroup)])
153
+ .handler(a.handler.function(manageUserRole)),
154
+
155
+ revokeUserRole: a
156
+ .mutation()
157
+ .arguments({
158
+ userProfileId: a.id(),
159
+ userSub: a.string(),
160
+ cognitoSubs: a.string().array(),
161
+ role: a.string().required(),
162
+ })
163
+ .returns(a.ref("UserRoleMutationResult"))
164
+ .authorization((allow) => [allow.group(adminGroup)])
165
+ .handler(a.handler.function(manageUserRole)),
166
+
167
+ mergeUserProfiles: a
168
+ .mutation()
169
+ .arguments({
170
+ targetUserProfileId: a.id(),
171
+ targetUserSub: a.string(),
172
+ sourceUserProfileId: a.id(),
173
+ sourceUserSub: a.string(),
174
+ reason: a.string(),
175
+ })
176
+ .returns(a.ref("UserDirectoryEntry"))
177
+ .authorization((allow) => [allow.group(adminGroup)])
178
+ .handler(a.handler.function(manageUserRole)),
179
+
180
+ getReaderSettings: a
181
+ .query()
182
+ .returns(a.ref("ReaderSettingsResult"))
183
+ .authorization((allow) => [allow.authenticated()])
184
+ .handler(a.handler.function(readerSettings)),
185
+
186
+ updateReaderSettings: a
187
+ .mutation()
188
+ .arguments({
189
+ settings: a.json().required(),
190
+ })
191
+ .returns(a.ref("ReaderSettingsResult"))
192
+ .authorization((allow) => [allow.authenticated()])
193
+ .handler(a.handler.function(readerSettings)),
194
+
195
+ SteeringActionResult: a.customType({
196
+ ok: a.boolean().required(),
197
+ action: a.string().required(),
198
+ proposalId: a.id(),
199
+ categorySetId: a.id(),
200
+ categoryId: a.id(),
201
+ decisionId: a.id(),
202
+ status: a.string(),
203
+ }),
204
+
205
+ reviewSteeringProposal: a
206
+ .mutation()
207
+ .arguments({
208
+ proposalId: a.id().required(),
209
+ action: a.string().required(),
210
+ actorSub: a.string(),
211
+ actorLabel: a.string(),
212
+ note: a.string(),
213
+ displayName: a.string(),
214
+ shortTitle: a.string(),
215
+ subtitle: a.string(),
216
+ description: a.string(),
217
+ aliases: a.string().array(),
218
+ seedItemIds: a.string().array(),
219
+ holdoutItemIds: a.string().array(),
220
+ })
221
+ .returns(a.ref("SteeringActionResult"))
222
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
223
+ .handler(a.handler.function(categoryAction)),
224
+
225
+ ReferenceCurationActionResult: a.customType({
226
+ ok: a.boolean().required(),
227
+ action: a.string().required(),
228
+ referenceId: a.id().required(),
229
+ status: a.string().required(),
230
+ reasonCode: a.string(),
231
+ messageId: a.id(),
232
+ relationId: a.id(),
233
+ }),
234
+
235
+ ReferenceQualityActionResult: a.customType({
236
+ ok: a.boolean().required(),
237
+ referenceId: a.id().required(),
238
+ rating: a.integer().required(),
239
+ status: a.string().required(),
240
+ relationId: a.id(),
241
+ }),
242
+
243
+ CategorySetDraftActionResult: a.customType({
244
+ ok: a.boolean().required(),
245
+ action: a.string().required(),
246
+ categorySetId: a.id().required(),
247
+ sourceCategorySetId: a.id(),
248
+ categoryCount: a.integer(),
249
+ status: a.string(),
250
+ }),
251
+
252
+ TopicLabelActionResult: a.customType({
253
+ ok: a.boolean().required(),
254
+ action: a.string().required(),
255
+ referenceId: a.id(),
256
+ categoryId: a.id(),
257
+ relationId: a.id(),
258
+ sourceRelationId: a.id(),
259
+ status: a.string(),
260
+ }),
261
+
262
+ reviewReferenceCuration: a
263
+ .mutation()
264
+ .arguments({
265
+ referenceId: a.id().required(),
266
+ action: a.string().required(),
267
+ actorSub: a.string(),
268
+ actorLabel: a.string(),
269
+ note: a.string(),
270
+ reasonCode: a.string(),
271
+ })
272
+ .returns(a.ref("ReferenceCurationActionResult"))
273
+ .authorization((allow) => [
274
+ allow.groups(categoryWriteGroups),
275
+ allow.custom(),
276
+ ])
277
+ .handler(a.handler.function(categoryAction)),
278
+
279
+ setReferenceQualityRating: a
280
+ .mutation()
281
+ .arguments({
282
+ referenceId: a.id().required(),
283
+ rating: a.integer().required(),
284
+ actorSub: a.string(),
285
+ actorLabel: a.string(),
286
+ note: a.string(),
287
+ })
288
+ .returns(a.ref("ReferenceQualityActionResult"))
289
+ .authorization((allow) => [
290
+ allow.groups(categoryWriteGroups),
291
+ allow.custom(),
292
+ ])
293
+ .handler(a.handler.function(categoryAction)),
294
+
295
+ createCategorySetDraft: a
296
+ .mutation()
297
+ .arguments({
298
+ sourceCategorySetId: a.id().required(),
299
+ displayName: a.string(),
300
+ actorLabel: a.string(),
301
+ note: a.string(),
302
+ })
303
+ .returns(a.ref("CategorySetDraftActionResult"))
304
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
305
+ .handler(a.handler.function(categoryAction)),
306
+
307
+ promoteCategorySetDraft: a
308
+ .mutation()
309
+ .arguments({
310
+ categorySetId: a.id().required(),
311
+ actorLabel: a.string(),
312
+ note: a.string(),
313
+ })
314
+ .returns(a.ref("CategorySetDraftActionResult"))
315
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
316
+ .handler(a.handler.function(categoryAction)),
317
+
318
+ discardCategorySetDraft: a
319
+ .mutation()
320
+ .arguments({
321
+ categorySetId: a.id().required(),
322
+ actorLabel: a.string(),
323
+ note: a.string(),
324
+ })
325
+ .returns(a.ref("CategorySetDraftActionResult"))
326
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
327
+ .handler(a.handler.function(categoryAction)),
328
+
329
+ createDraftCategory: a
330
+ .mutation()
331
+ .arguments({
332
+ categorySetId: a.id().required(),
333
+ parentCategoryKey: a.string(),
334
+ displayName: a.string().required(),
335
+ shortTitle: a.string(),
336
+ subtitle: a.string(),
337
+ description: a.string(),
338
+ actorLabel: a.string(),
339
+ note: a.string(),
340
+ })
341
+ .returns(a.ref("SteeringActionResult"))
342
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
343
+ .handler(a.handler.function(categoryAction)),
344
+
345
+ updateDraftCategory: a
346
+ .mutation()
347
+ .arguments({
348
+ categoryId: a.id().required(),
349
+ displayName: a.string(),
350
+ shortTitle: a.string(),
351
+ subtitle: a.string(),
352
+ description: a.string(),
353
+ parentCategoryKey: a.string(),
354
+ actorLabel: a.string(),
355
+ note: a.string(),
356
+ })
357
+ .returns(a.ref("SteeringActionResult"))
358
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
359
+ .handler(a.handler.function(categoryAction)),
360
+
361
+ archiveDraftCategory: a
362
+ .mutation()
363
+ .arguments({
364
+ categoryId: a.id().required(),
365
+ actorLabel: a.string(),
366
+ note: a.string(),
367
+ })
368
+ .returns(a.ref("SteeringActionResult"))
369
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
370
+ .handler(a.handler.function(categoryAction)),
371
+
372
+ reviewReferenceTopicLabel: a
373
+ .mutation()
374
+ .arguments({
375
+ referenceId: a.id().required(),
376
+ categoryId: a.id().required(),
377
+ action: a.string().required(),
378
+ sourceRelationId: a.id(),
379
+ actorLabel: a.string(),
380
+ note: a.string(),
381
+ })
382
+ .returns(a.ref("TopicLabelActionResult"))
383
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
384
+ .handler(a.handler.function(categoryAction)),
385
+
386
+ NewsroomSummary: a.customType({
387
+ generatedAt: a.datetime().required(),
388
+ staleAt: a.datetime(),
389
+ source: a.string(),
390
+ latestImportRun: a.json(),
391
+ counts: a.json().required(),
392
+ facets: a.json(),
393
+ assignmentStatusCounts: a.json().required(),
394
+ assignmentTypeCounts: a.json().required(),
395
+ referenceStatusCounts: a.json().required(),
396
+ messageKindCounts: a.json().required(),
397
+ messageDomainCounts: a.json().required(),
398
+ }),
399
+
400
+ getNewsroomSummary: a
401
+ .query()
402
+ .returns(a.ref("NewsroomSummary"))
403
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
404
+ .handler(a.handler.function(newsroomSummary)),
405
+
406
+ deriveMarkus: a
407
+ .query()
408
+ .arguments({ input: a.json().required() })
409
+ .returns(a.json())
410
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
411
+ .handler(a.handler.function(contentActions)),
412
+
413
+ saveItemDraft: a
414
+ .mutation()
415
+ .arguments({ input: a.json().required() })
416
+ .returns(a.json())
417
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
418
+ .handler(a.handler.function(contentActions)),
419
+
420
+ publishItem: a
421
+ .mutation()
422
+ .arguments({ input: a.json().required() })
423
+ .returns(a.json())
424
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
425
+ .handler(a.handler.function(contentActions)),
426
+
427
+ unpublishItem: a
428
+ .mutation()
429
+ .arguments({ input: a.json().required() })
430
+ .returns(a.json())
431
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
432
+ .handler(a.handler.function(contentActions)),
433
+
434
+ requestStagingBuild: a
435
+ .mutation()
436
+ .arguments({ input: a.json().required() })
437
+ .returns(a.json())
438
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
439
+ .handler(a.handler.function(contentActions)),
440
+
441
+ knowledgeQuery: a
442
+ .query()
443
+ .arguments({
444
+ input: a.json().required(),
445
+ })
446
+ .returns(a.json())
447
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
448
+ .handler(a.handler.function(knowledgeQuery)),
449
+
450
+ updateNewsroomSummary: a
451
+ .mutation()
452
+ .arguments({
453
+ delta: a.json().required(),
454
+ actorLabel: a.string(),
455
+ reason: a.string(),
456
+ })
457
+ .returns(a.ref("NewsroomSummary"))
458
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
459
+ .handler(a.handler.function(newsroomSummary)),
460
+
461
+ ModelAttachmentUploadSlot: a.customType({
462
+ ok: a.boolean().required(),
463
+ uploadId: a.string().required(),
464
+ attachmentId: a.id().required(),
465
+ ownerKind: a.string().required(),
466
+ ownerId: a.id().required(),
467
+ role: a.string().required(),
468
+ sortKey: a.string().required(),
469
+ method: a.string().required(),
470
+ uploadUrl: a.string().required(),
471
+ storagePath: a.string().required(),
472
+ mediaType: a.string().required(),
473
+ byteSize: a.integer().required(),
474
+ sha256: a.string(),
475
+ expiresAt: a.datetime().required(),
476
+ requiredHeaders: a.json(),
477
+ }),
478
+
479
+ ModelAttachmentDownloadSlot: a.customType({
480
+ ok: a.boolean().required(),
481
+ attachmentId: a.id().required(),
482
+ method: a.string().required(),
483
+ downloadUrl: a.string().required(),
484
+ storagePath: a.string().required(),
485
+ mediaType: a.string().required(),
486
+ byteSize: a.integer().required(),
487
+ sha256: a.string(),
488
+ expiresAt: a.datetime().required(),
489
+ requiredHeaders: a.json(),
490
+ }),
491
+
492
+ ModelAttachmentUploadAbortResult: a.customType({
493
+ ok: a.boolean().required(),
494
+ uploadId: a.string().required(),
495
+ attachmentId: a.id().required(),
496
+ storagePath: a.string().required(),
497
+ status: a.string().required(),
498
+ }),
499
+
500
+ createModelAttachmentUpload: a
501
+ .mutation()
502
+ .arguments({
503
+ ownerKind: a.string().required(),
504
+ ownerId: a.id().required(),
505
+ ownerLineageId: a.id(),
506
+ ownerVersionNumber: a.integer(),
507
+ ownerVersionKey: a.string(),
508
+ role: a.string().required(),
509
+ sortKey: a.string(),
510
+ filename: a.string().required(),
511
+ mediaType: a.string().required(),
512
+ byteSize: a.integer().required(),
513
+ sha256: a.string(),
514
+ importRunId: a.id(),
515
+ status: a.string(),
516
+ })
517
+ .returns(a.ref("ModelAttachmentUploadSlot"))
518
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
519
+ .handler(a.handler.function(modelAttachmentUpload)),
520
+
521
+ completeModelAttachmentUpload: a
522
+ .mutation()
523
+ .arguments({
524
+ uploadId: a.string().required(),
525
+ ownerKind: a.string().required(),
526
+ ownerId: a.id().required(),
527
+ ownerLineageId: a.id(),
528
+ ownerVersionNumber: a.integer(),
529
+ ownerVersionKey: a.string(),
530
+ role: a.string().required(),
531
+ sortKey: a.string(),
532
+ filename: a.string().required(),
533
+ mediaType: a.string().required(),
534
+ byteSize: a.integer().required(),
535
+ sha256: a.string(),
536
+ importRunId: a.id(),
537
+ status: a.string(),
538
+ })
539
+ .returns(a.ref("ModelAttachment"))
540
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
541
+ .handler(a.handler.function(modelAttachmentUpload)),
542
+
543
+ abortModelAttachmentUpload: a
544
+ .mutation()
545
+ .arguments({
546
+ uploadId: a.string().required(),
547
+ ownerKind: a.string().required(),
548
+ ownerId: a.id().required(),
549
+ ownerLineageId: a.id(),
550
+ ownerVersionNumber: a.integer(),
551
+ ownerVersionKey: a.string(),
552
+ role: a.string().required(),
553
+ sortKey: a.string(),
554
+ filename: a.string().required(),
555
+ mediaType: a.string().required(),
556
+ byteSize: a.integer().required(),
557
+ sha256: a.string(),
558
+ importRunId: a.id(),
559
+ status: a.string(),
560
+ })
561
+ .returns(a.ref("ModelAttachmentUploadAbortResult"))
562
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
563
+ .handler(a.handler.function(modelAttachmentUpload)),
564
+
565
+ createModelAttachmentDownload: a
566
+ .mutation()
567
+ .arguments({
568
+ attachmentId: a.id().required(),
569
+ })
570
+ .returns(a.ref("ModelAttachmentDownloadSlot"))
571
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
572
+ .handler(a.handler.function(modelAttachmentUpload)),
573
+
574
+ AssignmentActionResult: a.customType({
575
+ ok: a.boolean().required(),
576
+ assignmentId: a.id(),
577
+ eventId: a.id(),
578
+ status: a.string(),
579
+ action: a.string().required(),
580
+ assigneeKey: a.string(),
581
+ claimExpiresAt: a.datetime(),
582
+ }),
583
+
584
+ AssignmentTargetSummary: a.customType({
585
+ kind: a.string().required(),
586
+ id: a.id().required(),
587
+ lineageId: a.id().required(),
588
+ label: a.string(),
589
+ detail: a.string(),
590
+ }),
591
+
592
+ AssignmentSummary: a.customType({
593
+ id: a.id().required(),
594
+ assignmentTypeKey: a.string().required(),
595
+ queueKey: a.string().required(),
596
+ queueStatusKey: a.string().required(),
597
+ status: a.string().required(),
598
+ priority: a.integer(),
599
+ title: a.string().required(),
600
+ summary: a.string(),
601
+ assigneeType: a.string(),
602
+ assigneeId: a.string(),
603
+ assigneeKey: a.string(),
604
+ claimedAt: a.datetime(),
605
+ claimExpiresAt: a.datetime(),
606
+ completedAt: a.datetime(),
607
+ canceledAt: a.datetime(),
608
+ corpusId: a.id(),
609
+ categorySetId: a.id(),
610
+ classifierId: a.string(),
611
+ sectionId: a.id(),
612
+ sectionKey: a.string(),
613
+ sectionType: a.string(),
614
+ sectionStatusKey: a.string(),
615
+ sectionQueueStatusKey: a.string(),
616
+ primaryFocusCategoryKey: a.string(),
617
+ topicScopeCategoryKeys: a.string().array(),
618
+ sourceSnapshotId: a.string(),
619
+ importRunId: a.id(),
620
+ createdBy: a.string(),
621
+ createdAt: a.datetime().required(),
622
+ updatedAt: a.datetime().required(),
623
+ }),
624
+
625
+ AssignmentEventSummary: a.customType({
626
+ id: a.id().required(),
627
+ assignmentId: a.id().required(),
628
+ assignmentTypeKey: a.string().required(),
629
+ queueKey: a.string().required(),
630
+ eventType: a.string().required(),
631
+ fromStatus: a.string(),
632
+ toStatus: a.string(),
633
+ actorSub: a.string(),
634
+ actorLabel: a.string(),
635
+ note: a.string(),
636
+ createdAt: a.datetime().required(),
637
+ }),
638
+
639
+ AssignmentDoctrineSummary: a.customType({
640
+ scope: a.string().required(),
641
+ kind: a.string().required(),
642
+ label: a.string().required(),
643
+ slug: a.string().required(),
644
+ body: a.string().array().required(),
645
+ categoryKey: a.string(),
646
+ categoryLineageId: a.id(),
647
+ }),
648
+
649
+ AssignmentContext: a.customType({
650
+ assignment: a.ref("AssignmentSummary"),
651
+ doctrine: a.ref("AssignmentDoctrineSummary").array().required(),
652
+ targets: a.ref("AssignmentTargetSummary").array().required(),
653
+ events: a.ref("AssignmentEventSummary").array().required(),
654
+ }),
655
+
656
+ listAssignmentsForObject: a
657
+ .query()
658
+ .arguments({
659
+ objectKind: a.string().required(),
660
+ objectLineageId: a.id().required(),
661
+ status: a.string(),
662
+ limit: a.integer(),
663
+ })
664
+ .returns(a.ref("AssignmentContext").array().required())
665
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
666
+ .handler(a.handler.function(assignmentAction)),
667
+
668
+ listAssignmentQueue: a
669
+ .query()
670
+ .arguments({
671
+ queueKey: a.string().required(),
672
+ status: a.string(),
673
+ limit: a.integer(),
674
+ })
675
+ .returns(a.ref("AssignmentContext").array().required())
676
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
677
+ .handler(a.handler.function(assignmentAction)),
678
+
679
+ getAssignmentContext: a
680
+ .query()
681
+ .arguments({
682
+ assignmentId: a.id().required(),
683
+ })
684
+ .returns(a.ref("AssignmentContext"))
685
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
686
+ .handler(a.handler.function(assignmentAction)),
687
+
688
+ claimAssignment: a
689
+ .mutation()
690
+ .arguments({
691
+ assignmentId: a.id().required(),
692
+ assigneeKey: a.string(),
693
+ assigneeType: a.string(),
694
+ assigneeId: a.string(),
695
+ claimExpiresAt: a.datetime(),
696
+ claimTtlSeconds: a.integer(),
697
+ actorSub: a.string(),
698
+ actorLabel: a.string(),
699
+ note: a.string(),
700
+ })
701
+ .returns(a.ref("AssignmentActionResult"))
702
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
703
+ .handler(a.handler.function(assignmentAction)),
704
+
705
+ releaseAssignment: a
706
+ .mutation()
707
+ .arguments({
708
+ assignmentId: a.id().required(),
709
+ actorSub: a.string(),
710
+ actorLabel: a.string(),
711
+ note: a.string(),
712
+ })
713
+ .returns(a.ref("AssignmentActionResult"))
714
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
715
+ .handler(a.handler.function(assignmentAction)),
716
+
717
+ completeAssignment: a
718
+ .mutation()
719
+ .arguments({
720
+ assignmentId: a.id().required(),
721
+ actorSub: a.string(),
722
+ actorLabel: a.string(),
723
+ note: a.string(),
724
+ })
725
+ .returns(a.ref("AssignmentActionResult"))
726
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
727
+ .handler(a.handler.function(assignmentAction)),
728
+
729
+ cancelAssignment: a
730
+ .mutation()
731
+ .arguments({
732
+ assignmentId: a.id().required(),
733
+ actorSub: a.string(),
734
+ actorLabel: a.string(),
735
+ note: a.string(),
736
+ })
737
+ .returns(a.ref("AssignmentActionResult"))
738
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
739
+ .handler(a.handler.function(assignmentAction)),
740
+
741
+ reopenAssignment: a
742
+ .mutation()
743
+ .arguments({
744
+ assignmentId: a.id().required(),
745
+ actorSub: a.string(),
746
+ actorLabel: a.string(),
747
+ note: a.string(),
748
+ })
749
+ .returns(a.ref("AssignmentActionResult"))
750
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
751
+ .handler(a.handler.function(assignmentAction)),
752
+
753
+ retryImmediateAssignment: a
754
+ .mutation()
755
+ .arguments({
756
+ assignmentId: a.id().required(),
757
+ actorSub: a.string(),
758
+ actorLabel: a.string(),
759
+ note: a.string(),
760
+ })
761
+ .returns(a.ref("AssignmentActionResult"))
762
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
763
+ .handler(a.handler.function(assignmentAction)),
764
+
765
+ listNewsroomProcedureDefinitions: a
766
+ .query()
767
+ .returns(a.json())
768
+ .authorization((allow) => [allow.group(adminGroup)])
769
+ .handler(a.handler.function(procedureAction)),
770
+
771
+ getNewsroomProcedureDefinition: a
772
+ .query()
773
+ .arguments({
774
+ id: a.id(),
775
+ procedureKey: a.string(),
776
+ })
777
+ .returns(a.json())
778
+ .authorization((allow) => [allow.group(adminGroup), allow.custom()])
779
+ .handler(a.handler.function(procedureAction)),
780
+
781
+ saveNewsroomProcedureDefinition: a
782
+ .mutation()
783
+ .arguments({
784
+ input: a.json().required(),
785
+ })
786
+ .returns(a.json())
787
+ .authorization((allow) => [allow.group(adminGroup)])
788
+ .handler(a.handler.function(procedureAction)),
789
+
790
+ saveNewsroomProcedureVersionDraft: a
791
+ .mutation()
792
+ .arguments({
793
+ input: a.json().required(),
794
+ })
795
+ .returns(a.json())
796
+ .authorization((allow) => [allow.group(adminGroup)])
797
+ .handler(a.handler.function(procedureAction)),
798
+
799
+ publishNewsroomProcedureVersion: a
800
+ .mutation()
801
+ .arguments({
802
+ versionId: a.id().required(),
803
+ })
804
+ .returns(a.json())
805
+ .authorization((allow) => [allow.group(adminGroup)])
806
+ .handler(a.handler.function(procedureAction)),
807
+
808
+ startNewsroomProcedureRun: a
809
+ .mutation()
810
+ .arguments({
811
+ procedureId: a.id(),
812
+ procedureKey: a.string(),
813
+ procedureVersionId: a.id(),
814
+ title: a.string(),
815
+ summary: a.string(),
816
+ input: a.json(),
817
+ actorLabel: a.string(),
818
+ })
819
+ .returns(a.json())
820
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
821
+ .handler(a.handler.function(procedureAction)),
822
+
823
+ getNewsroomProcedureRun: a
824
+ .query()
825
+ .arguments({
826
+ id: a.id().required(),
827
+ })
828
+ .returns(a.json())
829
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
830
+ .handler(a.handler.function(procedureAction)),
831
+
832
+ listNewsroomProcedureRunsByProcedure: a
833
+ .query()
834
+ .arguments({
835
+ procedureId: a.id().required(),
836
+ })
837
+ .returns(a.json())
838
+ .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
839
+ .handler(a.handler.function(procedureAction)),
840
+
841
+ Assignment: modelWithoutSubscriptions({
842
+ id: a.id().required(),
843
+ assignmentTypeKey: a.string().required(),
844
+ queueKey: a.string().required(),
845
+ queueStatusKey: a.string().required(),
846
+ status: a.string().required(),
847
+ priority: a.integer(),
848
+ title: a.string().required(),
849
+ summary: a.string(),
850
+ assigneeType: a.string(),
851
+ assigneeId: a.string(),
852
+ assigneeKey: a.string(),
853
+ claimedAt: a.datetime(),
854
+ claimExpiresAt: a.datetime(),
855
+ completedAt: a.datetime(),
856
+ canceledAt: a.datetime(),
857
+ corpusId: a.id(),
858
+ categorySetId: a.id(),
859
+ classifierId: a.string(),
860
+ sectionId: a.id(),
861
+ sectionKey: a.string(),
862
+ sectionType: a.string(),
863
+ sectionStatusKey: a.string(),
864
+ sectionQueueStatusKey: a.string(),
865
+ primaryFocusCategoryKey: a.string(),
866
+ topicScopeCategoryKeys: a.string().array(),
867
+ sourceSnapshotId: a.string(),
868
+ importRunId: a.id(),
869
+ createdBy: a.string(),
870
+ createdAt: a.datetime().required(),
871
+ updatedAt: a.datetime().required(),
872
+ newsroomFeedKey: a.string(),
873
+ })
874
+ .secondaryIndexes((index) => [
875
+ index("newsroomFeedKey").sortKeys(["createdAt"]).queryField("listAssignmentsByNewsroomFeedAndCreatedAt"),
876
+ index("queueStatusKey").sortKeys(["priority", "createdAt"]).queryField("listAssignmentsByQueueStatusAndPriority"),
877
+ index("assignmentTypeKey").sortKeys(["status", "createdAt"]).queryField("listAssignmentsByTypeStatusAndCreatedAt"),
878
+ index("status").sortKeys(["updatedAt"]).queryField("listAssignmentsByStatusAndUpdatedAt"),
879
+ index("assigneeKey").sortKeys(["status", "updatedAt"]).queryField("listAssignmentsByAssigneeStatusAndUpdatedAt"),
880
+ index("importRunId").sortKeys(["createdAt"]).queryField("listAssignmentsByImportRunAndCreatedAt"),
881
+ index("sectionStatusKey").sortKeys(["priority", "createdAt"]).queryField("listAssignmentsBySectionStatusAndPriority"),
882
+ index("sectionKey").sortKeys(["createdAt"]).queryField("listAssignmentsBySectionAndCreatedAt"),
883
+ index("sectionQueueStatusKey").sortKeys(["priority", "createdAt"]).queryField("listAssignmentsBySectionQueueStatusAndPriority"),
884
+ ])
885
+ .authorization((allow) => [
886
+ allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
887
+ allow.authenticated("identityPool").to(authoringOperations),
888
+ allow.custom().to(authoringOperations),
889
+ ]),
890
+
891
+ AssignmentEvent: modelWithoutSubscriptions({
892
+ id: a.id().required(),
893
+ assignmentId: a.id().required(),
894
+ assignmentTypeKey: a.string().required(),
895
+ queueKey: a.string().required(),
896
+ eventType: a.string().required(),
897
+ fromStatus: a.string(),
898
+ toStatus: a.string(),
899
+ actorSub: a.string(),
900
+ actorLabel: a.string(),
901
+ note: a.string(),
902
+ createdAt: a.datetime().required(),
903
+ })
904
+ .secondaryIndexes((index) => [
905
+ index("assignmentId").sortKeys(["createdAt"]).queryField("listAssignmentEventsByAssignmentAndCreatedAt"),
906
+ index("eventType").sortKeys(["createdAt"]).queryField("listAssignmentEventsByTypeAndCreatedAt"),
907
+ index("queueKey").sortKeys(["createdAt"]).queryField("listAssignmentEventsByQueueAndCreatedAt"),
908
+ ])
909
+ .authorization((allow) => [
910
+ allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
911
+ allow.custom().to(authoringOperations),
912
+ ]),
913
+
914
+ ProcedureDefinition: modelWithoutSubscriptions({
915
+ id: a.id().required(),
916
+ procedureKey: a.string().required(),
917
+ title: a.string().required(),
918
+ category: a.string().required(),
919
+ description: a.string(),
920
+ enabled: a.boolean().required(),
921
+ enabledStatus: a.string().required(),
922
+ currentVersionId: a.id(),
923
+ createdBy: a.string(),
924
+ createdAt: a.datetime().required(),
925
+ updatedBy: a.string(),
926
+ updatedAt: a.datetime().required(),
927
+ newsroomFeedKey: a.string(),
928
+ })
929
+ .secondaryIndexes((index) => [
930
+ index("procedureKey").sortKeys(["updatedAt"]).queryField("listProcedureDefinitionsByKeyAndUpdatedAt"),
931
+ index("enabledStatus").sortKeys(["updatedAt"]).queryField("listProcedureDefinitionsByEnabledAndUpdatedAt"),
932
+ index("newsroomFeedKey").sortKeys(["updatedAt"]).queryField("listProcedureDefinitionsByFeedAndUpdatedAt"),
933
+ ])
934
+ .authorization((allow) => [
935
+ allow.group(adminGroup),
936
+ allow.custom().to(authoringOperations),
937
+ ]),
938
+
939
+ ProcedureVersion: modelWithoutSubscriptions({
940
+ id: a.id().required(),
941
+ procedureId: a.id().required(),
942
+ procedureKey: a.string().required(),
943
+ versionNumber: a.integer().required(),
944
+ status: a.string().required(),
945
+ isCurrent: a.boolean().required(),
946
+ label: a.string(),
947
+ tactusSource: a.string().required(),
948
+ parameterSchema: a.json().required(),
949
+ defaults: a.json(),
950
+ changelog: a.string(),
951
+ createdBy: a.string(),
952
+ createdAt: a.datetime().required(),
953
+ updatedBy: a.string(),
954
+ updatedAt: a.datetime().required(),
955
+ })
956
+ .secondaryIndexes((index) => [
957
+ index("procedureId").sortKeys(["versionNumber"]).queryField("listProcedureVersionsByProcedureAndVersion"),
958
+ index("procedureId").sortKeys(["createdAt"]).queryField("listProcedureVersionsByProcedureAndCreatedAt"),
959
+ index("status").sortKeys(["updatedAt"]).queryField("listProcedureVersionsByStatusAndUpdatedAt"),
960
+ ])
961
+ .authorization((allow) => [
962
+ allow.group(adminGroup),
963
+ allow.custom().to(authoringOperations),
964
+ ]),
965
+
966
+ ProcedureRun: modelWithoutSubscriptions({
967
+ id: a.id().required(),
968
+ procedureId: a.id().required(),
969
+ procedureKey: a.string().required(),
970
+ procedureVersionId: a.id().required(),
971
+ procedureVersionNumber: a.integer(),
972
+ assignmentId: a.id(),
973
+ runStatus: a.string().required(),
974
+ requestedBy: a.string(),
975
+ requestedAt: a.datetime().required(),
976
+ startedAt: a.datetime(),
977
+ finishedAt: a.datetime(),
978
+ input: a.json(),
979
+ normalizedInput: a.json(),
980
+ resultSummary: a.string(),
981
+ errorSummary: a.string(),
982
+ output: a.json(),
983
+ error: a.json(),
984
+ attempt: a.integer(),
985
+ newsroomFeedKey: a.string(),
986
+ })
987
+ .secondaryIndexes((index) => [
988
+ index("procedureId").sortKeys(["requestedAt"]).queryField("listProcedureRunsByProcedureAndRequestedAt"),
989
+ index("assignmentId").sortKeys(["requestedAt"]).queryField("listProcedureRunsByAssignmentAndRequestedAt"),
990
+ index("runStatus").sortKeys(["requestedAt"]).queryField("listProcedureRunsByStatusAndRequestedAt"),
991
+ index("newsroomFeedKey").sortKeys(["requestedAt"]).queryField("listProcedureRunsByFeedAndRequestedAt"),
992
+ ])
993
+ .authorization((allow) => [
994
+ allow.group("editor").to(["read"]),
995
+ allow.group(adminGroup).to(authoringOperations),
996
+ allow.custom().to(authoringOperations),
997
+ ]),
998
+
999
+ NewsroomSection: modelWithoutSubscriptions({
1000
+ id: a.id().required(),
1001
+ title: a.string().required(),
1002
+ type: a.string().required(),
1003
+ editorialMission: a.string().required(),
1004
+ editorialPolicy: a.string().required(),
1005
+ enabled: a.boolean().required(),
1006
+ enabledStatus: a.string().required(),
1007
+ sortOrder: a.integer().required(),
1008
+ shortTitle: a.string().required(),
1009
+ defaultArticleTypes: a.string().array(),
1010
+ defaultPageBudget: a.integer(),
1011
+ assignmentGuidance: a.string(),
1012
+ killCriteria: a.string(),
1013
+ visualGuidance: a.string(),
1014
+ createdAt: a.datetime(),
1015
+ updatedAt: a.datetime(),
1016
+ })
1017
+ .secondaryIndexes((index) => [
1018
+ index("sortOrder").sortKeys(["id"]).queryField("listNewsroomSectionsBySortOrder"),
1019
+ index("type").sortKeys(["sortOrder"]).queryField("listNewsroomSectionsByTypeAndSortOrder"),
1020
+ index("enabledStatus").sortKeys(["sortOrder"]).queryField("listNewsroomSectionsByEnabledStatusAndSortOrder"),
1021
+ ])
1022
+ .authorization((allow) => [
1023
+ allow.groups(categoryWriteGroups),
1024
+ allow.custom().to(authoringOperations),
1025
+ ]),
1026
+
1027
+ KnowledgeCorpus: modelWithoutSubscriptions({
1028
+ id: a.id().required(),
1029
+ name: a.string().required(),
1030
+ role: a.string().required(),
1031
+ itemCount: a.integer(),
1032
+ generatedAt: a.datetime(),
1033
+ latestImportRunId: a.id(),
1034
+ createdAt: a.datetime(),
1035
+ updatedAt: a.datetime(),
1036
+ })
1037
+ .secondaryIndexes((index) => [
1038
+ index("role").sortKeys(["name"]).queryField("listKnowledgeCorporaByRoleAndName"),
1039
+ ])
1040
+ .authorization((allow) => [
1041
+ allow.groups(categoryWriteGroups).to(["read"]),
1042
+ allow.custom().to(authoringOperations),
1043
+ ]),
1044
+
1045
+ KnowledgeImportRun: modelWithoutSubscriptions({
1046
+ id: a.id().required(),
1047
+ corpusId: a.id().required(),
1048
+ importKind: a.string().required(),
1049
+ corpusImportKindKey: a.string(),
1050
+ classifierId: a.string(),
1051
+ sourceSnapshotId: a.string(),
1052
+ status: a.string().required(),
1053
+ generatedAt: a.datetime(),
1054
+ importedAt: a.datetime().required(),
1055
+ itemCount: a.integer(),
1056
+ categoryCount: a.integer(),
1057
+ proposalCount: a.integer(),
1058
+ artifactCount: a.integer(),
1059
+ referenceCount: a.integer(),
1060
+ relationCount: a.integer(),
1061
+ warningCount: a.integer(),
1062
+ })
1063
+ .secondaryIndexes((index) => [
1064
+ index("corpusId").sortKeys(["importedAt"]).queryField("listKnowledgeImportRunsByCorpusAndImportedAt"),
1065
+ index("importKind").sortKeys(["importedAt"]).queryField("listKnowledgeImportRunsByKindAndImportedAt"),
1066
+ index("corpusImportKindKey").sortKeys(["importedAt"]).queryField("listKnowledgeImportRunsByCorpusKindAndImportedAt"),
1067
+ ])
1068
+ .authorization((allow) => [
1069
+ allow.groups(categoryWriteGroups).to(["read"]),
1070
+ allow.custom().to(authoringOperations),
1071
+ ]),
1072
+
1073
+ KnowledgeRawPayload: modelWithoutSubscriptions({
1074
+ id: a.id().required(),
1075
+ ownerType: a.string().required(),
1076
+ ownerId: a.id().required(),
1077
+ payloadKind: a.string().required(),
1078
+ importRunId: a.id(),
1079
+ createdAt: a.datetime().required(),
1080
+ updatedAt: a.datetime(),
1081
+ })
1082
+ .secondaryIndexes((index) => [
1083
+ index("ownerId").sortKeys(["payloadKind"]).queryField("listKnowledgeRawPayloadsByOwnerAndKind"),
1084
+ index("importRunId").sortKeys(["ownerType"]).queryField("listKnowledgeRawPayloadsByImportRunAndOwner"),
1085
+ ])
1086
+ .authorization((allow) => [
1087
+ allow.groups(categoryWriteGroups),
1088
+ allow.custom().to(authoringOperations),
1089
+ ]),
1090
+
1091
+ KnowledgeArtifact: modelWithoutSubscriptions({
1092
+ id: a.id().required(),
1093
+ corpusId: a.id().required(),
1094
+ artifactKind: a.string().required(),
1095
+ artifactId: a.string().required(),
1096
+ snapshotId: a.string(),
1097
+ displayName: a.string(),
1098
+ createdAt: a.datetime(),
1099
+ importRunId: a.id(),
1100
+ })
1101
+ .secondaryIndexes((index) => [
1102
+ index("corpusId").sortKeys(["artifactKind"]).queryField("listKnowledgeArtifactsByCorpusAndKind"),
1103
+ index("artifactKind").sortKeys(["createdAt"]).queryField("listKnowledgeArtifactsByKindAndCreatedAt"),
1104
+ index("importRunId").sortKeys(["artifactKind"]).queryField("listKnowledgeArtifactsByImportRunAndKind"),
1105
+ ])
1106
+ .authorization((allow) => [
1107
+ allow.groups(categoryWriteGroups).to(["read"]),
1108
+ allow.custom().to(authoringOperations),
1109
+ ]),
1110
+
1111
+ CategorySet: modelWithoutSubscriptions({
1112
+ id: a.id().required(),
1113
+ lineageId: a.id().required(),
1114
+ versionNumber: a.integer().required(),
1115
+ previousVersionId: a.id(),
1116
+ versionState: a.string().required(),
1117
+ versionCreatedAt: a.datetime().required(),
1118
+ versionCreatedBy: a.string(),
1119
+ changeReason: a.string(),
1120
+ contentHash: a.string(),
1121
+ corpusId: a.id().required(),
1122
+ classifierId: a.string().required(),
1123
+ displayName: a.string().required(),
1124
+ description: a.string(),
1125
+ status: a.string().required(),
1126
+ generatedAt: a.datetime(),
1127
+ categoryCount: a.integer(),
1128
+ importRunId: a.id(),
1129
+ })
1130
+ .secondaryIndexes((index) => [
1131
+ index("lineageId").sortKeys(["versionNumber"]).queryField("listCategorySetsByLineageAndVersion"),
1132
+ index("corpusId").sortKeys(["classifierId"]).queryField("listCategorySetsByCorpusAndClassifier"),
1133
+ index("status").sortKeys(["displayName"]).queryField("listCategorySetsByStatusAndName"),
1134
+ index("versionState").sortKeys(["generatedAt"]).queryField("listCategorySetsByVersionStateAndGeneratedAt"),
1135
+ ])
1136
+ .authorization((allow) => [
1137
+ allow.groups(categoryWriteGroups),
1138
+ allow.custom().to(authoringOperations),
1139
+ ]),
1140
+
1141
+ Category: modelWithoutSubscriptions({
1142
+ id: a.id().required(),
1143
+ lineageId: a.id().required(),
1144
+ versionNumber: a.integer().required(),
1145
+ previousVersionId: a.id(),
1146
+ versionState: a.string().required(),
1147
+ versionCreatedAt: a.datetime().required(),
1148
+ versionCreatedBy: a.string(),
1149
+ changeReason: a.string(),
1150
+ contentHash: a.string(),
1151
+ categorySetId: a.id().required(),
1152
+ corpusId: a.id().required(),
1153
+ categoryKey: a.string().required(),
1154
+ parentCategoryId: a.id(),
1155
+ parentCategoryKey: a.string(),
1156
+ displayName: a.string().required(),
1157
+ shortTitle: a.string(),
1158
+ subtitle: a.string(),
1159
+ description: a.string(),
1160
+ aliases: a.string().array(),
1161
+ status: a.string().required(),
1162
+ seedItemIds: a.string().array(),
1163
+ holdoutItemIds: a.string().array(),
1164
+ rank: a.integer(),
1165
+ depth: a.integer(),
1166
+ isPinned: a.boolean(),
1167
+ importRunId: a.id(),
1168
+ updatedAt: a.datetime(),
1169
+ })
1170
+ .secondaryIndexes((index) => [
1171
+ index("lineageId").sortKeys(["versionNumber"]).queryField("listCategoriesByLineageAndVersion"),
1172
+ index("categorySetId").sortKeys(["categoryKey"]).queryField("listCategoriesBySetAndKey"),
1173
+ index("parentCategoryId").sortKeys(["rank"]).queryField("listCategoriesByParentAndRank"),
1174
+ index("parentCategoryKey").sortKeys(["rank"]).queryField("listCategoriesByParentKeyAndRank"),
1175
+ index("corpusId").sortKeys(["displayName"]).queryField("listCategoriesByCorpusAndName"),
1176
+ index("status").sortKeys(["displayName"]).queryField("listCategoriesByStatusAndName"),
1177
+ ])
1178
+ .authorization((allow) => [
1179
+ allow.groups(categoryWriteGroups),
1180
+ allow.custom().to(authoringOperations),
1181
+ ]),
1182
+
1183
+ CategoryKeyword: modelWithoutSubscriptions({
1184
+ id: a.id().required(),
1185
+ categorySetId: a.id().required(),
1186
+ corpusId: a.id().required(),
1187
+ categoryKey: a.string().required(),
1188
+ categoryLineageId: a.id(),
1189
+ categoryId: a.id(),
1190
+ keyword: a.string().required(),
1191
+ normalizedKeyword: a.string().required(),
1192
+ weight: a.float(),
1193
+ rank: a.integer(),
1194
+ source: a.string().required(),
1195
+ sourceTopicId: a.string(),
1196
+ importRunId: a.id(),
1197
+ metadata: a.json(),
1198
+ createdAt: a.datetime().required(),
1199
+ updatedAt: a.datetime(),
1200
+ })
1201
+ .secondaryIndexes((index) => [
1202
+ index("categorySetId").sortKeys(["categoryKey", "rank"]).queryField("listCategoryKeywordsBySetKeyAndRank"),
1203
+ index("categoryKey").sortKeys(["rank"]).queryField("listCategoryKeywordsByCategoryKeyAndRank"),
1204
+ index("normalizedKeyword").sortKeys(["categorySetId"]).queryField("listCategoryKeywordsByNormalizedKeywordAndSet"),
1205
+ index("importRunId").sortKeys(["rank"]).queryField("listCategoryKeywordsByImportRunAndRank"),
1206
+ ])
1207
+ .authorization((allow) => [
1208
+ allow.groups(categoryWriteGroups),
1209
+ allow.custom().to(authoringOperations),
1210
+ ]),
1211
+
1212
+ LexicalSteeringRule: modelWithoutSubscriptions({
1213
+ id: a.id().required(),
1214
+ ruleKind: a.string().required(),
1215
+ term: a.string().required(),
1216
+ normalizedTerm: a.string().required(),
1217
+ scope: a.string().required(),
1218
+ status: a.string().required(),
1219
+ corpusId: a.id(),
1220
+ classifierId: a.string(),
1221
+ categorySetId: a.id(),
1222
+ categoryKey: a.string(),
1223
+ note: a.string(),
1224
+ source: a.string(),
1225
+ createdBy: a.string(),
1226
+ createdAt: a.datetime().required(),
1227
+ updatedAt: a.datetime(),
1228
+ metadata: a.json(),
1229
+ })
1230
+ .secondaryIndexes((index) => [
1231
+ index("status").sortKeys(["normalizedTerm"]).queryField("listLexicalSteeringRulesByStatusAndTerm"),
1232
+ index("scope").sortKeys(["normalizedTerm"]).queryField("listLexicalSteeringRulesByScopeAndTerm"),
1233
+ index("categorySetId").sortKeys(["normalizedTerm"]).queryField("listLexicalSteeringRulesBySetAndTerm"),
1234
+ index("corpusId").sortKeys(["normalizedTerm"]).queryField("listLexicalSteeringRulesByCorpusAndTerm"),
1235
+ ])
1236
+ .authorization((allow) => [
1237
+ allow.groups(categoryWriteGroups),
1238
+ allow.custom().to(authoringOperations),
1239
+ ]),
1240
+
1241
+ SteeringProposal: modelWithoutSubscriptions({
1242
+ id: a.id().required(),
1243
+ categorySetId: a.id(),
1244
+ corpusId: a.id().required(),
1245
+ importRunId: a.id(),
1246
+ proposalKind: a.string().required(),
1247
+ steeringDomain: a.string().required(),
1248
+ status: a.string().required(),
1249
+ title: a.string().required(),
1250
+ summary: a.string(),
1251
+ categoryKey: a.string(),
1252
+ targetCategoryKey: a.string(),
1253
+ graphEntityId: a.string(),
1254
+ relationshipType: a.string(),
1255
+ displayName: a.string(),
1256
+ shortTitle: a.string(),
1257
+ subtitle: a.string(),
1258
+ description: a.string(),
1259
+ evidenceItemIds: a.string().array(),
1260
+ suggestedSeedItemIds: a.string().array(),
1261
+ suggestedHoldoutItemIds: a.string().array(),
1262
+ sourceSnapshotId: a.string(),
1263
+ proposedAt: a.datetime(),
1264
+ reviewedAt: a.datetime(),
1265
+ reviewedBy: a.string(),
1266
+ updatedAt: a.datetime(),
1267
+ })
1268
+ .secondaryIndexes((index) => [
1269
+ index("status").sortKeys(["proposedAt"]).queryField("listSteeringProposalsByStatusAndProposedAt"),
1270
+ index("categorySetId").sortKeys(["status"]).queryField("listSteeringProposalsBySetAndStatus"),
1271
+ index("corpusId").sortKeys(["proposalKind"]).queryField("listSteeringProposalsByCorpusAndKind"),
1272
+ index("steeringDomain").sortKeys(["status"]).queryField("listSteeringProposalsByDomainAndStatus"),
1273
+ ])
1274
+ .authorization((allow) => [
1275
+ allow.groups(categoryWriteGroups).to(["read"]),
1276
+ allow.custom().to(authoringOperations),
1277
+ ]),
1278
+
1279
+ SteeringDecision: modelWithoutSubscriptions({
1280
+ id: a.id().required(),
1281
+ proposalId: a.id().required(),
1282
+ categorySetId: a.id(),
1283
+ action: a.string().required(),
1284
+ actorSub: a.string(),
1285
+ actorLabel: a.string(),
1286
+ note: a.string(),
1287
+ selectedCategoryKey: a.string(),
1288
+ createdAt: a.datetime().required(),
1289
+ })
1290
+ .secondaryIndexes((index) => [
1291
+ index("proposalId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsByProposalAndCreatedAt"),
1292
+ index("categorySetId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsBySetAndCreatedAt"),
1293
+ ])
1294
+ .authorization((allow) => [
1295
+ allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1296
+ allow.custom().to(authoringOperations),
1297
+ ]),
1298
+
1299
+ Reference: realtimeModel({
1300
+ id: a.id().required(),
1301
+ lineageId: a.id().required(),
1302
+ versionNumber: a.integer().required(),
1303
+ previousVersionId: a.id(),
1304
+ versionState: a.string().required(),
1305
+ versionCreatedAt: a.datetime().required(),
1306
+ versionCreatedBy: a.string(),
1307
+ changeReason: a.string(),
1308
+ contentHash: a.string(),
1309
+ corpusId: a.id().required(),
1310
+ externalItemId: a.string().required(),
1311
+ title: a.string(),
1312
+ authors: a.string().array(),
1313
+ sourceUri: a.string(),
1314
+ storagePath: a.string(),
1315
+ mediaType: a.string(),
1316
+ byteSize: a.integer(),
1317
+ sha256: a.string(),
1318
+ sourcePublishedAt: a.string(),
1319
+ sourceUpdatedAt: a.string(),
1320
+ retrievedAt: a.string(),
1321
+ inboundCitationCount: a.integer(),
1322
+ outboundCitationCount: a.integer(),
1323
+ importRunId: a.id(),
1324
+ importedAt: a.datetime(),
1325
+ createdAt: a.datetime(),
1326
+ curationStatus: a.string(),
1327
+ curationStatusKey: a.string(),
1328
+ curationStatusUpdatedAt: a.datetime(),
1329
+ curationStatusUpdatedBy: a.string(),
1330
+ curationStatusReason: a.string(),
1331
+ newsroomFeedKey: a.string(),
1332
+ reviewedFeedKey: a.string(),
1333
+ updatedAt: a.datetime(),
1334
+ })
1335
+ .secondaryIndexes((index) => [
1336
+ index("newsroomFeedKey").sortKeys(["createdAt"]).queryField("listReferencesByNewsroomFeedAndCreatedAt"),
1337
+ index("newsroomFeedKey").sortKeys(["importedAt"]).queryField("listReferencesByNewsroomFeedAndImportedAt"),
1338
+ index("lineageId").sortKeys(["versionNumber"]).queryField("listReferencesByLineageAndVersion"),
1339
+ index("corpusId").sortKeys(["externalItemId"]).queryField("listReferencesByCorpusAndExternalItem"),
1340
+ index("versionState").sortKeys(["updatedAt"]).queryField("listReferencesByVersionStateAndUpdatedAt"),
1341
+ index("importRunId").sortKeys(["externalItemId"]).queryField("listReferencesByImportRunAndExternalItem"),
1342
+ index("curationStatus").sortKeys(["curationStatusUpdatedAt"]).queryField("listReferencesByCurationStatusAndUpdatedAt"),
1343
+ index("curationStatusKey").sortKeys(["curationStatusUpdatedAt"]).queryField("listReferencesByCurationStatusKeyAndUpdatedAt"),
1344
+ index("reviewedFeedKey").sortKeys(["updatedAt"]).queryField("listReferencesByReviewedFeedAndUpdatedAt"),
1345
+ ])
1346
+ .authorization((allow) => [
1347
+ allow.groups(categoryWriteGroups).to(["read"]),
1348
+ allow.custom().to(authoringOperations),
1349
+ ]),
1350
+
1351
+ ReferenceAttachment: modelWithoutSubscriptions({
1352
+ id: a.id().required(),
1353
+ referenceId: a.id().required(),
1354
+ referenceLineageId: a.id().required(),
1355
+ referenceVersionNumber: a.integer(),
1356
+ referenceVersionKey: a.string().required(),
1357
+ role: a.string().required(),
1358
+ sortKey: a.string().required(),
1359
+ storagePath: a.string(),
1360
+ sourceUri: a.string(),
1361
+ filename: a.string(),
1362
+ mediaType: a.string(),
1363
+ byteSize: a.integer(),
1364
+ sha256: a.string(),
1365
+ etag: a.string(),
1366
+ importRunId: a.id(),
1367
+ importedAt: a.datetime(),
1368
+ metadata: a.json(),
1369
+ })
1370
+ .secondaryIndexes((index) => [
1371
+ index("referenceVersionKey").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByReferenceVersionAndSortKey"),
1372
+ index("referenceLineageId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByReferenceLineageAndSortKey"),
1373
+ index("storagePath").queryField("referenceAttachmentByStoragePath"),
1374
+ index("importRunId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByImportRunAndSortKey"),
1375
+ ])
1376
+ .authorization((allow) => [
1377
+ allow.groups(categoryWriteGroups).to(["read"]),
1378
+ allow.custom().to(authoringOperations),
1379
+ ]),
1380
+
1381
+ SemanticNode: modelWithoutSubscriptions({
1382
+ id: a.id().required(),
1383
+ lineageId: a.id().required(),
1384
+ versionNumber: a.integer().required(),
1385
+ previousVersionId: a.id(),
1386
+ versionState: a.string().required(),
1387
+ versionCreatedAt: a.datetime().required(),
1388
+ versionCreatedBy: a.string(),
1389
+ changeReason: a.string(),
1390
+ contentHash: a.string(),
1391
+ nodeKey: a.string().required(),
1392
+ nodeKind: a.string().required(),
1393
+ corpusId: a.id(),
1394
+ categorySetId: a.id(),
1395
+ categoryLineageId: a.id(),
1396
+ categoryKey: a.string(),
1397
+ displayName: a.string(),
1398
+ description: a.string(),
1399
+ aliases: a.string().array(),
1400
+ status: a.string().required(),
1401
+ importRunId: a.id(),
1402
+ createdAt: a.datetime(),
1403
+ newsroomFeedKey: a.string(),
1404
+ updatedAt: a.datetime(),
1405
+ })
1406
+ .secondaryIndexes((index) => [
1407
+ index("newsroomFeedKey").sortKeys(["createdAt"]).queryField("listSemanticNodesByNewsroomFeedAndCreatedAt"),
1408
+ index("lineageId").sortKeys(["versionNumber"]).queryField("listSemanticNodesByLineageAndVersion"),
1409
+ index("nodeKey").sortKeys(["versionNumber"]).queryField("listSemanticNodesByNodeKeyAndVersion"),
1410
+ index("corpusId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByCorpusAndNodeKey"),
1411
+ index("importRunId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByImportRunAndNodeKey"),
1412
+ index("versionState").sortKeys(["updatedAt"]).queryField("listSemanticNodesByVersionStateAndUpdatedAt"),
1413
+ ])
1414
+ .authorization((allow) => [
1415
+ allow.groups(categoryWriteGroups).to(["read"]),
1416
+ allow.custom().to(authoringOperations),
1417
+ ]),
1418
+
1419
+ Message: realtimeModel({
1420
+ id: a.id().required(),
1421
+ messageKind: a.string().required(),
1422
+ messageDomain: a.string().required(),
1423
+ status: a.string().required(),
1424
+ summary: a.string(),
1425
+ source: a.string(),
1426
+ importRunId: a.id(),
1427
+ authorSub: a.string(),
1428
+ authorUserProfileId: a.id(),
1429
+ authorLabel: a.string(),
1430
+ threadId: a.id(),
1431
+ parentMessageId: a.id(),
1432
+ sequenceNumber: a.integer(),
1433
+ role: a.string(),
1434
+ messageType: a.string(),
1435
+ content: a.string(),
1436
+ semanticLayer: a.string(),
1437
+ searchVisibility: a.string(),
1438
+ responseTarget: a.string(),
1439
+ responseStatus: a.string(),
1440
+ responseOwner: a.string(),
1441
+ responseStartedAt: a.datetime(),
1442
+ responseCompletedAt: a.datetime(),
1443
+ responseError: a.string(),
1444
+ metadata: a.json(),
1445
+ createdAt: a.datetime().required(),
1446
+ updatedAt: a.datetime().required(),
1447
+ newsroomFeedKey: a.string(),
1448
+ })
1449
+ .secondaryIndexes((index) => [
1450
+ index("newsroomFeedKey").sortKeys(["createdAt"]).queryField("listMessagesByNewsroomFeedAndCreatedAt"),
1451
+ index("status").sortKeys(["createdAt"]).queryField("listMessagesByStatusAndCreatedAt"),
1452
+ index("messageKind").sortKeys(["createdAt"]).queryField("listMessagesByKindAndCreatedAt"),
1453
+ index("messageDomain").sortKeys(["createdAt"]).queryField("listMessagesByDomainAndCreatedAt"),
1454
+ index("authorSub").sortKeys(["createdAt"]).queryField("listMessagesByAuthorSubAndCreatedAt"),
1455
+ index("authorUserProfileId").sortKeys(["createdAt"]).queryField("listMessagesByAuthorProfileAndCreatedAt"),
1456
+ index("importRunId").sortKeys(["createdAt"]).queryField("listMessagesByImportRunAndCreatedAt"),
1457
+ index("threadId").sortKeys(["sequenceNumber"]).name("messagesByThreadSequence").queryField("listMessagesByThreadAndSequence"),
1458
+ index("threadId").sortKeys(["createdAt"]).name("messagesByThreadCreatedAt").queryField("listMessagesByThreadAndCreatedAt"),
1459
+ index("responseTarget").sortKeys(["responseStatus", "createdAt"]).name("messagesByResponseTargetStatusCreatedAt").queryField("listMessagesByResponseTargetStatusAndCreatedAt"),
1460
+ index("semanticLayer").sortKeys(["createdAt"]).name("messagesBySemanticLayerCreatedAt").queryField("listMessagesBySemanticLayerAndCreatedAt"),
1461
+ index("searchVisibility").sortKeys(["createdAt"]).name("messagesBySearchVisibilityCreatedAt").queryField("listMessagesBySearchVisibilityAndCreatedAt"),
1462
+ ])
1463
+ .authorization((allow) => [
1464
+ allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1465
+ allow.custom().to(authoringOperations),
1466
+ ]),
1467
+
1468
+ MessageThread: realtimeModel({
1469
+ id: a.id().required(),
1470
+ threadKind: a.string().required(),
1471
+ status: a.string().required(),
1472
+ title: a.string().required(),
1473
+ summary: a.string(),
1474
+ primaryAnchorKind: a.string(),
1475
+ primaryAnchorId: a.id(),
1476
+ primaryAnchorLineageId: a.id(),
1477
+ primaryAnchorKey: a.string(),
1478
+ createdBySub: a.string(),
1479
+ createdByUserProfileId: a.id(),
1480
+ createdByLabel: a.string(),
1481
+ messageCount: a.integer(),
1482
+ lastMessageId: a.id(),
1483
+ lastMessageAt: a.datetime(),
1484
+ contextDigest: a.string(),
1485
+ activeResponseMessageId: a.id(),
1486
+ responseLockOwner: a.string(),
1487
+ responseLockExpiresAt: a.datetime(),
1488
+ metadata: a.json(),
1489
+ createdAt: a.datetime().required(),
1490
+ updatedAt: a.datetime().required(),
1491
+ newsroomFeedKey: a.string(),
1492
+ })
1493
+ .secondaryIndexes((index) => [
1494
+ index("newsroomFeedKey").sortKeys(["updatedAt"]).queryField("listMessageThreadsByNewsroomFeedAndUpdatedAt"),
1495
+ index("threadKind").sortKeys(["updatedAt"]).queryField("listMessageThreadsByKindAndUpdatedAt"),
1496
+ index("status").sortKeys(["updatedAt"]).queryField("listMessageThreadsByStatusAndUpdatedAt"),
1497
+ index("primaryAnchorKey").sortKeys(["updatedAt"]).name("messageThreadsByAnchorUpdatedAt").queryField("listMessageThreadsByAnchorAndUpdatedAt"),
1498
+ index("createdBySub").sortKeys(["updatedAt"]).queryField("listMessageThreadsByCreatorAndUpdatedAt"),
1499
+ ])
1500
+ .authorization((allow) => [
1501
+ allow.groups(categoryWriteGroups).to(["read", "create", "update"]),
1502
+ allow.authenticated("identityPool").to(authoringOperations),
1503
+ allow.custom().to(authoringOperations),
1504
+ ]),
1505
+
1506
+ ModelAttachment: modelWithoutSubscriptions({
1507
+ id: a.id().required(),
1508
+ ownerKind: a.string().required(),
1509
+ ownerId: a.id().required(),
1510
+ ownerLineageId: a.id(),
1511
+ ownerVersionNumber: a.integer(),
1512
+ ownerVersionKey: a.string(),
1513
+ role: a.string().required(),
1514
+ sortKey: a.string().required(),
1515
+ storagePath: a.string().required(),
1516
+ filename: a.string(),
1517
+ mediaType: a.string().required(),
1518
+ byteSize: a.integer(),
1519
+ sha256: a.string(),
1520
+ etag: a.string(),
1521
+ importRunId: a.id(),
1522
+ createdAt: a.datetime().required(),
1523
+ updatedAt: a.datetime(),
1524
+ status: a.string().required(),
1525
+ })
1526
+ .secondaryIndexes((index) => [
1527
+ index("ownerId").sortKeys(["role", "sortKey"]).queryField("listModelAttachmentsByOwnerRoleAndSortKey"),
1528
+ index("ownerVersionKey").sortKeys(["role", "sortKey"]).queryField("listModelAttachmentsByOwnerVersionRoleAndSortKey"),
1529
+ index("storagePath").queryField("modelAttachmentByStoragePath"),
1530
+ index("importRunId").sortKeys(["ownerKind", "role"]).queryField("listModelAttachmentsByImportRunKindAndRole"),
1531
+ index("role").sortKeys(["status", "createdAt"]).queryField("listModelAttachmentsByRoleStatusAndCreatedAt"),
1532
+ ])
1533
+ .authorization((allow) => [
1534
+ allow.groups(categoryWriteGroups).to(["read"]),
1535
+ allow.custom().to(authoringOperations),
1536
+ ]),
1537
+
1538
+ SemanticRelationType: modelWithoutSubscriptions({
1539
+ id: a.id().required(),
1540
+ key: a.string().required(),
1541
+ label: a.string().required(),
1542
+ inverseLabel: a.string(),
1543
+ description: a.string(),
1544
+ domain: a.string().required(),
1545
+ status: a.string().required(),
1546
+ allowedSubjectKinds: a.string().array(),
1547
+ allowedObjectKinds: a.string().array(),
1548
+ isDirectional: a.boolean(),
1549
+ isSymmetric: a.boolean(),
1550
+ isTransitive: a.boolean(),
1551
+ contextPackTags: a.string().array(),
1552
+ createdAt: a.datetime().required(),
1553
+ updatedAt: a.datetime().required(),
1554
+ metadata: a.json(),
1555
+ })
1556
+ .secondaryIndexes((index) => [
1557
+ index("key").queryField("semanticRelationTypeByKey"),
1558
+ index("domain").sortKeys(["label"]).queryField("listSemanticRelationTypesByDomainAndLabel"),
1559
+ index("status").sortKeys(["label"]).queryField("listSemanticRelationTypesByStatusAndLabel"),
1560
+ ])
1561
+ .authorization((allow) => [
1562
+ allow.groups(categoryWriteGroups),
1563
+ allow.custom().to(authoringOperations),
1564
+ ]),
1565
+
1566
+ SemanticRelation: modelWithoutSubscriptions({
1567
+ id: a.id().required(),
1568
+ relationState: a.string().required(),
1569
+ predicate: a.string().required(),
1570
+ relationTypeId: a.id(),
1571
+ relationTypeKey: a.string(),
1572
+ relationDomain: a.string(),
1573
+ subjectKind: a.string().required(),
1574
+ subjectId: a.id().required(),
1575
+ subjectLineageId: a.id().required(),
1576
+ subjectVersionNumber: a.integer(),
1577
+ objectKind: a.string().required(),
1578
+ objectId: a.id().required(),
1579
+ objectLineageId: a.id().required(),
1580
+ objectVersionNumber: a.integer(),
1581
+ subjectStateKey: a.string().required(),
1582
+ objectStateKey: a.string().required(),
1583
+ objectSubjectStateKey: a.string().required(),
1584
+ predicateObjectStateKey: a.string().required(),
1585
+ subjectVersionKey: a.string().required(),
1586
+ objectVersionKey: a.string().required(),
1587
+ score: a.float(),
1588
+ confidence: a.float(),
1589
+ rank: a.integer(),
1590
+ classifierId: a.string(),
1591
+ modelVersion: a.string(),
1592
+ reviewRecommended: a.boolean(),
1593
+ sourceSnapshotId: a.string(),
1594
+ importRunId: a.id(),
1595
+ importedAt: a.datetime(),
1596
+ createdAt: a.datetime(),
1597
+ updatedAt: a.datetime(),
1598
+ newsroomFeedKey: a.string(),
1599
+ metadata: a.json(),
1600
+ })
1601
+ .secondaryIndexes((index) => [
1602
+ index("newsroomFeedKey").sortKeys(["createdAt"]).queryField("listSemanticRelationsByNewsroomFeedAndCreatedAt"),
1603
+ index("subjectStateKey").sortKeys(["predicateObjectStateKey"]).queryField("listSemanticRelationsBySubjectState"),
1604
+ index("objectStateKey").sortKeys(["predicate"]).queryField("listSemanticRelationsByObjectState"),
1605
+ index("objectSubjectStateKey").sortKeys(["score"]).queryField("listSemanticRelationsByObjectSubjectStateAndScore"),
1606
+ index("predicateObjectStateKey").sortKeys(["score"]).queryField("listSemanticRelationsByPredicateObjectStateAndScore"),
1607
+ index("subjectVersionKey").sortKeys(["predicateObjectStateKey"]).queryField("listSemanticRelationsBySubjectVersion"),
1608
+ index("importRunId").sortKeys(["importedAt"]).queryField("listSemanticRelationsByImportRunAndImportedAt"),
1609
+ index("relationTypeKey").sortKeys(["importedAt"]).queryField("listSemanticRelationsByTypeAndImportedAt"),
1610
+ index("relationDomain").sortKeys(["importedAt"]).queryField("listSemanticRelationsByDomainAndImportedAt"),
1611
+ ])
1612
+ .authorization((allow) => [
1613
+ allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1614
+ allow.custom().to(authoringOperations),
1615
+ ]),
1616
+
1617
+ Item: modelWithoutSubscriptions({
1618
+ id: a.id().required(),
1619
+ lineageId: a.id().required(),
1620
+ versionNumber: a.integer().required(),
1621
+ previousVersionId: a.id(),
1622
+ versionState: a.string().required(),
1623
+ versionCreatedAt: a.datetime().required(),
1624
+ versionCreatedBy: a.string(),
1625
+ changeReason: a.string(),
1626
+ contentHash: a.string(),
1627
+ type: a.string().required(),
1628
+ status: a.string().required(),
1629
+ typeStatus: a.string().required(),
1630
+ slug: a.string().required(),
1631
+ shortSlug: a.string(),
1632
+ section: a.string(),
1633
+ sectionStatus: a.string(),
1634
+ title: a.string(),
1635
+ headline: a.string(),
1636
+ deck: a.string(),
1637
+ body: a.string().array(),
1638
+ bodyMarkus: a.string(),
1639
+ bodyIr: a.json(),
1640
+ aliases: a.string().array(),
1641
+ metadata: a.json(),
1642
+ byline: a.string(),
1643
+ dateline: a.string(),
1644
+ publishedAt: a.datetime(),
1645
+ editionDate: a.string(),
1646
+ sortTitle: a.string(),
1647
+ pullQuotes: a.string().array(),
1648
+ layout: a.json(),
1649
+ editorial: a.json(),
1650
+ updatedAt: a.datetime(),
1651
+ tags: a.hasMany("ItemTag", "itemId"),
1652
+ mediaAssets: a.hasMany("MediaAsset", "itemId"),
1653
+ editionItems: a.hasMany("EditionItem", "itemId"),
1654
+ })
1655
+ .secondaryIndexes((index) => [
1656
+ index("lineageId").sortKeys(["versionNumber"]).queryField("listItemsByLineageAndVersion"),
1657
+ index("slug").queryField("itemBySlug"),
1658
+ index("typeStatus").sortKeys(["publishedAt"]).queryField("listItemsByTypeStatusAndPublishedAt"),
1659
+ index("sectionStatus").sortKeys(["publishedAt"]).queryField("listItemsBySectionStatusAndPublishedAt"),
1660
+ index("versionState").sortKeys(["updatedAt"]).queryField("listItemsByVersionStateAndUpdatedAt"),
1661
+ ])
1662
+ .authorization((allow) => [
1663
+ allow.groups(contentWriteGroups),
1664
+ allow.custom().to(authoringOperations),
1665
+ ]),
1666
+
1667
+ Tag: modelWithoutSubscriptions({
1668
+ id: a.id().required(),
1669
+ slug: a.string().required(),
1670
+ label: a.string().required(),
1671
+ type: a.string(),
1672
+ description: a.string(),
1673
+ items: a.hasMany("ItemTag", "tagId"),
1674
+ })
1675
+ .secondaryIndexes((index) => [
1676
+ index("slug").queryField("tagBySlug"),
1677
+ index("type").sortKeys(["label"]).queryField("listTagsByTypeAndLabel"),
1678
+ ])
1679
+ .authorization((allow) => [
1680
+ allow.groups(contentWriteGroups),
1681
+ allow.custom().to(authoringOperations),
1682
+ ]),
1683
+
1684
+ ItemTag: modelWithoutSubscriptions({
1685
+ id: a.id().required(),
1686
+ itemId: a.id().required(),
1687
+ tagId: a.id().required(),
1688
+ itemType: a.string().required(),
1689
+ itemStatus: a.string().required(),
1690
+ tagSlug: a.string().required(),
1691
+ publishedAt: a.datetime(),
1692
+ item: a.belongsTo("Item", "itemId"),
1693
+ tag: a.belongsTo("Tag", "tagId"),
1694
+ })
1695
+ .secondaryIndexes((index) => [
1696
+ index("itemId").sortKeys(["tagSlug"]).queryField("listItemTagsByItemAndTag"),
1697
+ index("tagId").sortKeys(["publishedAt"]).queryField("listItemTagsByTagAndPublishedAt"),
1698
+ ])
1699
+ .authorization((allow) => [
1700
+ allow.groups(contentWriteGroups),
1701
+ allow.custom().to(authoringOperations),
1702
+ ]),
1703
+
1704
+ MediaAsset: modelWithoutSubscriptions({
1705
+ id: a.id().required(),
1706
+ itemId: a.id().required(),
1707
+ type: a.string().required(),
1708
+ role: a.string().required(),
1709
+ sortKey: a.string().required(),
1710
+ storagePath: a.string(),
1711
+ externalUrl: a.string(),
1712
+ alt: a.string().required(),
1713
+ caption: a.string(),
1714
+ credit: a.string(),
1715
+ width: a.integer(),
1716
+ height: a.integer(),
1717
+ aspectRatio: a.float(),
1718
+ focalX: a.float(),
1719
+ focalY: a.float(),
1720
+ minHeight: a.integer(),
1721
+ preferredHeight: a.integer(),
1722
+ maxHeight: a.integer(),
1723
+ crop: a.string(),
1724
+ wrapsText: a.boolean(),
1725
+ metadata: a.json(),
1726
+ item: a.belongsTo("Item", "itemId"),
1727
+ })
1728
+ .secondaryIndexes((index) => [
1729
+ index("itemId").sortKeys(["sortKey"]).queryField("listMediaAssetsByItemAndSortKey"),
1730
+ index("role").sortKeys(["itemId"]).queryField("listMediaAssetsByRoleAndItem"),
1731
+ ])
1732
+ .authorization((allow) => [
1733
+ allow.groups(contentWriteGroups),
1734
+ allow.custom().to(authoringOperations),
1735
+ ]),
1736
+
1737
+ Edition: modelWithoutSubscriptions({
1738
+ id: a.id().required(),
1739
+ lineageId: a.id().required(),
1740
+ versionNumber: a.integer().required(),
1741
+ previousVersionId: a.id(),
1742
+ versionState: a.string().required(),
1743
+ versionCreatedAt: a.datetime().required(),
1744
+ versionCreatedBy: a.string(),
1745
+ changeReason: a.string(),
1746
+ contentHash: a.string(),
1747
+ slug: a.string().required(),
1748
+ title: a.string().required(),
1749
+ status: a.string().required(),
1750
+ editionDate: a.string().required(),
1751
+ publishedAt: a.datetime(),
1752
+ description: a.string(),
1753
+ layoutPlan: a.json(),
1754
+ metadata: a.json(),
1755
+ items: a.hasMany("EditionItem", "editionId"),
1756
+ })
1757
+ .secondaryIndexes((index) => [
1758
+ index("lineageId").sortKeys(["versionNumber"]).queryField("listEditionsByLineageAndVersion"),
1759
+ index("slug").queryField("editionBySlug"),
1760
+ index("status").sortKeys(["editionDate"]).queryField("listEditionsByStatusAndEditionDate"),
1761
+ index("status").sortKeys(["publishedAt"]).queryField("listEditionsByStatusAndPublishedAt"),
1762
+ index("versionState").sortKeys(["publishedAt"]).queryField("listEditionsByVersionStateAndPublishedAt"),
1763
+ ])
1764
+ .authorization((allow) => [
1765
+ allow.groups(contentWriteGroups),
1766
+ allow.custom().to(authoringOperations),
1767
+ ]),
1768
+
1769
+ EditionItem: modelWithoutSubscriptions({
1770
+ id: a.id().required(),
1771
+ editionId: a.id().required(),
1772
+ editionLineageId: a.id(),
1773
+ itemId: a.id().required(),
1774
+ itemLineageId: a.id(),
1775
+ placementKey: a.string().required(),
1776
+ sortKey: a.string().required(),
1777
+ pageNumber: a.integer(),
1778
+ priority: a.integer(),
1779
+ metadata: a.json(),
1780
+ edition: a.belongsTo("Edition", "editionId"),
1781
+ item: a.belongsTo("Item", "itemId"),
1782
+ })
1783
+ .secondaryIndexes((index) => [
1784
+ index("editionId").sortKeys(["sortKey"]).queryField("listEditionItemsByEditionAndSortKey"),
1785
+ index("itemId").sortKeys(["editionId"]).queryField("listEditionItemsByItemAndEdition"),
1786
+ ])
1787
+ .authorization((allow) => [
1788
+ allow.groups(contentWriteGroups),
1789
+ allow.custom().to(authoringOperations),
1790
+ ]),
1791
+
1792
+ PublishedItem: modelWithoutSubscriptions({
1793
+ id: a.id().required(),
1794
+ sourceItemId: a.id().required(),
1795
+ itemLineageId: a.id().required(),
1796
+ versionNumber: a.integer().required(),
1797
+ type: a.string().required(),
1798
+ status: a.string().required(),
1799
+ typeStatus: a.string().required(),
1800
+ slug: a.string().required(),
1801
+ shortSlug: a.string(),
1802
+ section: a.string(),
1803
+ sectionStatus: a.string(),
1804
+ title: a.string(),
1805
+ headline: a.string(),
1806
+ deck: a.string(),
1807
+ body: a.string().array(),
1808
+ bodyMarkus: a.string(),
1809
+ bodyIr: a.json(),
1810
+ aliases: a.string().array(),
1811
+ metadata: a.json(),
1812
+ byline: a.string(),
1813
+ dateline: a.string(),
1814
+ publishedAt: a.datetime(),
1815
+ editionDate: a.string(),
1816
+ sortTitle: a.string(),
1817
+ pullQuotes: a.string().array(),
1818
+ layout: a.json(),
1819
+ editorial: a.json(),
1820
+ })
1821
+ .secondaryIndexes((index) => [
1822
+ index("slug").queryField("publishedItemBySlug"),
1823
+ index("typeStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsByTypeStatusAndPublishedAt"),
1824
+ index("sectionStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsBySectionStatusAndPublishedAt"),
1825
+ index("itemLineageId").sortKeys(["versionNumber"]).queryField("listPublishedItemsByLineageAndVersion"),
1826
+ ])
1827
+ .authorization((allow) => [
1828
+ allow.guest().to(["read"]),
1829
+ allow.groups(contentWriteGroups),
1830
+ allow.custom().to(authoringOperations),
1831
+ ]),
1832
+
1833
+ PublishedMediaAsset: modelWithoutSubscriptions({
1834
+ id: a.id().required(),
1835
+ sourceMediaAssetId: a.id().required(),
1836
+ publishedItemId: a.id().required(),
1837
+ sourceItemId: a.id().required(),
1838
+ itemLineageId: a.id().required(),
1839
+ type: a.string().required(),
1840
+ role: a.string().required(),
1841
+ sortKey: a.string().required(),
1842
+ storagePath: a.string(),
1843
+ externalUrl: a.string(),
1844
+ alt: a.string().required(),
1845
+ caption: a.string(),
1846
+ credit: a.string(),
1847
+ width: a.integer(),
1848
+ height: a.integer(),
1849
+ aspectRatio: a.float(),
1850
+ focalX: a.float(),
1851
+ focalY: a.float(),
1852
+ minHeight: a.integer(),
1853
+ preferredHeight: a.integer(),
1854
+ maxHeight: a.integer(),
1855
+ crop: a.string(),
1856
+ wrapsText: a.boolean(),
1857
+ metadata: a.json(),
1858
+ })
1859
+ .secondaryIndexes((index) => [
1860
+ index("publishedItemId").sortKeys(["sortKey"]).queryField("listPublishedMediaAssetsByItemAndSortKey"),
1861
+ index("role").sortKeys(["publishedItemId"]).queryField("listPublishedMediaAssetsByRoleAndItem"),
1862
+ ])
1863
+ .authorization((allow) => [
1864
+ allow.guest().to(["read"]),
1865
+ allow.groups(contentWriteGroups),
1866
+ allow.custom().to(authoringOperations),
1867
+ ]),
1868
+
1869
+ PublishedEdition: modelWithoutSubscriptions({
1870
+ id: a.id().required(),
1871
+ sourceEditionId: a.id().required(),
1872
+ editionLineageId: a.id().required(),
1873
+ versionNumber: a.integer().required(),
1874
+ slug: a.string().required(),
1875
+ title: a.string().required(),
1876
+ status: a.string().required(),
1877
+ editionDate: a.string().required(),
1878
+ publishedAt: a.datetime(),
1879
+ description: a.string(),
1880
+ layoutPlan: a.json(),
1881
+ metadata: a.json(),
1882
+ })
1883
+ .secondaryIndexes((index) => [
1884
+ index("slug").queryField("publishedEditionBySlug"),
1885
+ index("status").sortKeys(["editionDate"]).queryField("listPublishedEditionsByStatusAndEditionDate"),
1886
+ index("status").sortKeys(["publishedAt"]).queryField("listPublishedEditionsByStatusAndPublishedAt"),
1887
+ index("editionLineageId").sortKeys(["versionNumber"]).queryField("listPublishedEditionsByLineageAndVersion"),
1888
+ ])
1889
+ .authorization((allow) => [
1890
+ allow.guest().to(["read"]),
1891
+ allow.groups(contentWriteGroups),
1892
+ allow.custom().to(authoringOperations),
1893
+ ]),
1894
+
1895
+ PublishedEditionItem: modelWithoutSubscriptions({
1896
+ id: a.id().required(),
1897
+ publishedEditionId: a.id().required(),
1898
+ publishedItemId: a.id().required(),
1899
+ sourceEditionItemId: a.id().required(),
1900
+ sourceEditionId: a.id().required(),
1901
+ sourceItemId: a.id().required(),
1902
+ editionLineageId: a.id().required(),
1903
+ itemLineageId: a.id().required(),
1904
+ placementKey: a.string().required(),
1905
+ sortKey: a.string().required(),
1906
+ pageNumber: a.integer(),
1907
+ priority: a.integer(),
1908
+ metadata: a.json(),
1909
+ })
1910
+ .secondaryIndexes((index) => [
1911
+ index("publishedEditionId").sortKeys(["sortKey"]).queryField("listPublishedEditionItemsByEditionAndSortKey"),
1912
+ index("publishedItemId").sortKeys(["publishedEditionId"]).queryField("listPublishedEditionItemsByItemAndEdition"),
1913
+ ])
1914
+ .authorization((allow) => [
1915
+ allow.guest().to(["read"]),
1916
+ allow.groups(contentWriteGroups),
1917
+ allow.custom().to(authoringOperations),
1918
+ ]),
1919
+
1920
+ PublishedCategorySet: modelWithoutSubscriptions({
1921
+ id: a.id().required(),
1922
+ sourceCategorySetId: a.id().required(),
1923
+ categorySetLineageId: a.id().required(),
1924
+ versionNumber: a.integer().required(),
1925
+ corpusId: a.id().required(),
1926
+ classifierId: a.string().required(),
1927
+ displayName: a.string().required(),
1928
+ description: a.string(),
1929
+ status: a.string().required(),
1930
+ generatedAt: a.datetime(),
1931
+ publishedAt: a.datetime(),
1932
+ categoryCount: a.integer(),
1933
+ metadata: a.json(),
1934
+ })
1935
+ .secondaryIndexes((index) => [
1936
+ index("status").sortKeys(["displayName"]).queryField("listPublishedCategorySetsByStatusAndName"),
1937
+ index("classifierId").sortKeys(["displayName"]).queryField("listPublishedCategorySetsByClassifierAndName"),
1938
+ index("categorySetLineageId").sortKeys(["versionNumber"]).queryField("listPublishedCategorySetsByLineageAndVersion"),
1939
+ ])
1940
+ .authorization((allow) => [
1941
+ allow.guest().to(["read"]),
1942
+ allow.groups(contentWriteGroups),
1943
+ allow.custom().to(authoringOperations),
1944
+ ]),
1945
+
1946
+ PublishedCategory: modelWithoutSubscriptions({
1947
+ id: a.id().required(),
1948
+ sourceCategoryId: a.id().required(),
1949
+ publishedCategorySetId: a.id().required(),
1950
+ categoryLineageId: a.id().required(),
1951
+ categorySetLineageId: a.id().required(),
1952
+ versionNumber: a.integer().required(),
1953
+ corpusId: a.id().required(),
1954
+ categoryKey: a.string().required(),
1955
+ parentCategoryId: a.id(),
1956
+ parentCategoryKey: a.string(),
1957
+ displayName: a.string().required(),
1958
+ shortTitle: a.string(),
1959
+ subtitle: a.string(),
1960
+ description: a.string(),
1961
+ aliases: a.string().array(),
1962
+ status: a.string().required(),
1963
+ seedItemIds: a.string().array(),
1964
+ holdoutItemIds: a.string().array(),
1965
+ rank: a.integer(),
1966
+ depth: a.integer(),
1967
+ isPinned: a.boolean(),
1968
+ metadata: a.json(),
1969
+ })
1970
+ .secondaryIndexes((index) => [
1971
+ index("publishedCategorySetId").sortKeys(["categoryKey"]).queryField("listPublishedCategoriesBySetAndKey"),
1972
+ index("parentCategoryId").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentAndRank"),
1973
+ index("parentCategoryKey").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentKeyAndRank"),
1974
+ index("categoryKey").sortKeys(["publishedCategorySetId"]).queryField("listPublishedCategoriesByKeyAndSet"),
1975
+ ])
1976
+ .authorization((allow) => [
1977
+ allow.guest().to(["read"]),
1978
+ allow.groups(contentWriteGroups),
1979
+ allow.custom().to(authoringOperations),
1980
+ ]),
1981
+ }).authorization((allow) => [
1982
+ allow.resource(categoryAction),
1983
+ allow.resource(contentActions),
1984
+ allow.resource(manageUserRole),
1985
+ allow.resource(modelAttachmentUpload),
1986
+ allow.resource(newsroomSummary),
1987
+ allow.resource(procedureAction),
1988
+ ]);
1989
+
1990
+ export type Schema = ClientSchema<typeof schema>;