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