@anthusai/papyrus 0.0.0 → 1.0.0-next.2

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