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