@anthusai/papyrus 0.0.0 → 1.0.0-next.1

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