@anthusai/papyrus 0.0.0 → 1.0.0-next.10

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