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