@anthusai/papyrus 2.0.0-next.6 → 2.0.0-next.60

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 (164) hide show
  1. package/amplify/data/resource.js +23 -3
  2. package/amplify/data/resource.ts +25 -3
  3. package/amplify/data/schema.js +2028 -1979
  4. package/amplify/data/schema.ts +72 -14
  5. package/amplify/functions/assignment-action/data-access.js +90 -0
  6. package/amplify/functions/assignment-action/data-access.ts +89 -0
  7. package/amplify/functions/assignment-action/handler.ts +1 -1
  8. package/amplify/functions/content-actions/handler.py +61 -2
  9. package/amplify/functions/content-actions/requirements.txt +1 -0
  10. package/amplify/functions/content-actions/resource.js +1 -1
  11. package/amplify/functions/content-actions/resource.ts +1 -1
  12. package/amplify/functions/editorial-checks/handler.py +14 -0
  13. package/amplify/functions/editorial-checks/requirements.txt +1 -0
  14. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.js +7 -7
  15. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.ts +7 -7
  16. package/amplify/functions/editorial-checks/schema.js +121 -0
  17. package/amplify/{plugins → functions}/editorial-checks/schema.ts +33 -6
  18. package/amplify/functions/editorial-checks/wire.js +53 -0
  19. package/amplify/functions/editorial-checks/wire.ts +61 -0
  20. package/amplify/functions/monitoring-view/handler.py +11 -0
  21. package/amplify/functions/monitoring-view/resource.js +24 -0
  22. package/amplify/functions/monitoring-view/resource.ts +34 -0
  23. package/amplify/functions/monitoring-view/schema.js +16 -0
  24. package/amplify/functions/monitoring-view/schema.ts +18 -0
  25. package/amplify/functions/monitoring-view/wire.js +37 -0
  26. package/amplify/functions/monitoring-view/wire.ts +47 -0
  27. package/amplify/functions/public-forms/core.js +247 -0
  28. package/amplify/functions/public-forms/core.ts +310 -0
  29. package/amplify/functions/public-forms/handler.ts +41 -0
  30. package/amplify/functions/public-forms/origins.js +35 -0
  31. package/amplify/functions/public-forms/origins.ts +43 -0
  32. package/amplify/functions/public-forms/resource.js +9 -0
  33. package/amplify/functions/public-forms/resource.ts +10 -0
  34. package/amplify/functions/public-forms/wire.js +25 -0
  35. package/amplify/functions/public-forms/wire.ts +32 -0
  36. package/amplify/functions/shared/editorial-context.ts +63 -4
  37. package/amplify/functions/shared/python-bundle.js +20 -14
  38. package/amplify/functions/shared/python-bundle.ts +25 -18
  39. package/amplify/plugins/newsletter/config.js +235 -0
  40. package/amplify/plugins/newsletter/config.ts +294 -0
  41. package/amplify/plugins/newsletter/function/handler.py +6 -0
  42. package/amplify/plugins/newsletter/function/requirements.txt +5 -0
  43. package/amplify/plugins/newsletter/ops/handler.py +12 -0
  44. package/amplify/plugins/newsletter/ops/resource.js +27 -0
  45. package/amplify/plugins/newsletter/ops/resource.ts +37 -0
  46. package/amplify/plugins/newsletter/papyrus.plugin.js +263 -0
  47. package/amplify/plugins/newsletter/papyrus.plugin.ts +311 -0
  48. package/amplify/plugins/newsletter/schema.js +56 -0
  49. package/amplify/plugins/newsletter/schema.ts +61 -0
  50. package/amplify/plugins/newsletter/secure-string-parameter.js +107 -0
  51. package/amplify/plugins/newsletter/secure-string-parameter.ts +120 -0
  52. package/amplify/plugins/newsletter/sending.js +140 -0
  53. package/amplify/plugins/newsletter/sending.ts +186 -0
  54. package/amplify/plugins/reader-steering/config.js +173 -0
  55. package/amplify/plugins/reader-steering/config.ts +268 -0
  56. package/amplify/plugins/reader-steering/function/ai_moderation.py +246 -0
  57. package/amplify/plugins/reader-steering/function/handler.py +1363 -0
  58. package/amplify/plugins/reader-steering/function/moderation-prompt.md +27 -0
  59. package/amplify/plugins/reader-steering/function/moderation.py +316 -0
  60. package/amplify/plugins/reader-steering/function/resource.js +27 -0
  61. package/amplify/plugins/reader-steering/function/resource.ts +35 -0
  62. package/amplify/plugins/reader-steering/papyrus.plugin.js +176 -0
  63. package/amplify/plugins/reader-steering/papyrus.plugin.ts +202 -0
  64. package/amplify/plugins/reader-steering/schema.js +140 -0
  65. package/amplify/plugins/reader-steering/schema.ts +142 -0
  66. package/amplify/plugins/registry.js +4 -2
  67. package/amplify/plugins/registry.ts +4 -2
  68. package/amplify/plugins/types.ts +5 -0
  69. package/amplify/plugins/wire.js +1 -0
  70. package/amplify/plugins/wire.ts +1 -0
  71. package/amplify/publication/projection-lease.js +30 -0
  72. package/amplify/publication/projection-lease.ts +39 -0
  73. package/amplify/publication/redirect-and-index.js +105 -0
  74. package/amplify/publication/redirect-rules.js +73 -0
  75. package/amplify/publication/redirect-rules.ts +93 -0
  76. package/amplify/publication/s3-projection.js +7 -1
  77. package/amplify/publication/s3-projection.ts +9 -1
  78. package/amplify/site-backend-config.ts +17 -0
  79. package/amplify/site-backend.js +38 -1
  80. package/amplify/site-backend.ts +46 -1
  81. package/app/api/auth/prospectus/sign-in/route.ts +4 -0
  82. package/app/api/newsletter/confirm/route.ts +13 -0
  83. package/app/api/newsletter/preferences/route.ts +13 -0
  84. package/app/api/newsletter/state/route.ts +9 -0
  85. package/app/api/newsletter/subscribe/route.ts +9 -0
  86. package/app/api/newsletter/unsubscribe/route.ts +13 -0
  87. package/app/api/newsroom/curation/context/route.ts +9 -0
  88. package/app/api/newsroom/curation/priming/route.ts +9 -0
  89. package/app/api/newsroom/curation/publication/route.ts +9 -0
  90. package/app/api/reader/comment/delete/route.ts +9 -0
  91. package/app/api/reader/comment/edit/route.ts +9 -0
  92. package/app/api/reader/comment/route.ts +9 -0
  93. package/app/api/reader/handle/route.ts +9 -0
  94. package/app/api/reader/me/route.ts +9 -0
  95. package/app/api/reader/rating/route.ts +9 -0
  96. package/app/api/reader/report/route.ts +9 -0
  97. package/app/api/reader/retired/route.ts +9 -0
  98. package/app/api/reader/submit/route.ts +9 -0
  99. package/app/api/reader/vote/route.ts +9 -0
  100. package/bin/papyrus-infra.mjs +20 -1
  101. package/components/editorial-checks-admin-panel.tsx +36 -11
  102. package/components/moderation-panel.tsx +248 -0
  103. package/components/monitoring-overview-view.tsx +241 -0
  104. package/components/monitoring-panel.tsx +40 -0
  105. package/components/newsletter-panel.tsx +474 -0
  106. package/components/newsletter-sections.tsx +163 -0
  107. package/components/newsroom-article-editor.tsx +2 -4
  108. package/components/newsroom-curation-bootstrap.tsx +45 -0
  109. package/components/newsroom-organizer.css +31 -0
  110. package/components/newsroom-references-view.tsx +14 -14
  111. package/components/publication-cyclotron-panel.tsx +15 -10
  112. package/components/reference-add-entry.tsx +75 -0
  113. package/components/reference-curation-controls.tsx +31 -22
  114. package/components/reference-cyclotron-priming.tsx +58 -19
  115. package/components/reference-cyclotron-suggestion.tsx +1 -1
  116. package/components/reference-priming.tsx +14 -10
  117. package/components/reference-section-suggestion.tsx +1 -1
  118. package/components/topic-steering-workspace.tsx +64 -20
  119. package/components/use-editorial-checks.ts +12 -10
  120. package/infra/amplify-app-shell.js +90 -16
  121. package/infra/amplify-app-shell.ts +102 -18
  122. package/infra/index.js +1 -0
  123. package/infra/secure-string-parameter-handler.js +41 -0
  124. package/infra/secure-string-parameter-handler.ts +41 -0
  125. package/infra/secure-string-parameter.js +79 -0
  126. package/infra/secure-string-parameter.ts +91 -0
  127. package/infra/site-config.js +86 -6
  128. package/infra/site-config.ts +129 -6
  129. package/lib/category-repository.ts +11 -9
  130. package/lib/curation-routes.ts +345 -0
  131. package/lib/editorial-checks-backend.ts +1 -1
  132. package/lib/editorial-checks-client.ts +19 -1
  133. package/lib/editorial-checks-demo.ts +2 -2
  134. package/lib/editorial-checks-settings.ts +3 -0
  135. package/lib/editorial-checks.ts +8 -11
  136. package/lib/editorial-preview.ts +5 -5
  137. package/lib/monitoring-client.ts +29 -0
  138. package/lib/monitoring-overview-fixture.ts +51 -0
  139. package/lib/monitoring-overview.ts +145 -0
  140. package/lib/newsletter-api.ts +410 -0
  141. package/lib/newsletter-client.ts +46 -0
  142. package/lib/newsletter-fixture.ts +184 -0
  143. package/lib/newsletter-model.ts +202 -0
  144. package/lib/prospectus-session.ts +15 -14
  145. package/lib/prospectus-sign-in-routes.ts +84 -19
  146. package/lib/prospectus-site-identity.ts +24 -1
  147. package/lib/reader-api.ts +145 -0
  148. package/lib/reader-moderation.ts +220 -0
  149. package/lib/reader-retirement-route.ts +89 -0
  150. package/lib/reader-subject.md +29 -0
  151. package/lib/reader-subject.ts +53 -0
  152. package/lib/relevance-status.ts +2 -2
  153. package/lib/semantic-graph.ts +2 -0
  154. package/lib/site-brand-tenant.ts +11 -6
  155. package/lib/site-brand.ts +6 -3
  156. package/lib/site-origin.ts +67 -0
  157. package/middleware.ts +14 -3
  158. package/package.json +41 -3
  159. package/routes.manifest.json +204 -2
  160. package/amplify/plugins/editorial-checks/function/handler.py +0 -11
  161. package/amplify/plugins/editorial-checks/function/requirements.txt +0 -1
  162. package/amplify/plugins/editorial-checks/papyrus.plugin.js +0 -50
  163. package/amplify/plugins/editorial-checks/papyrus.plugin.ts +0 -63
  164. package/amplify/plugins/editorial-checks/schema.js +0 -94
@@ -6,13 +6,14 @@ import { knowledgeQuery } from "../functions/knowledge-query/resource.js";
6
6
  import { manageUserRole } from "../functions/manage-user-role/resource.js";
7
7
  import { modelAttachmentUpload } from "../functions/model-attachment-upload/resource.js";
8
8
  import { newsroomSummary } from "../functions/newsroom-summary/resource.js";
9
+ import { publicForms } from "../functions/public-forms/resource.js";
9
10
  import { procedureAction } from "../functions/procedure-action/resource.js";
10
11
  import { readerSettings } from "../functions/reader-settings/resource.js";
11
12
  import { emailSubmissionProcessor } from "../functions/email-submission-processor/resource.js";
12
13
  import { sesInboundReceive } from "../functions/ses-inbound-receive/resource.js";
13
14
  import { slackDelivery } from "../functions/slack-delivery/resource.js";
14
15
  import { slackEvents } from "../functions/slack-events/resource.js";
15
- import { schema as leanSchema, schemaWithPlugins } from "./schema.js";
16
+ import { assertKnownModelGroups, schema as leanSchema, schemaExcludingGroups, schemaWithPlugins } from "./schema.js";
16
17
  const authoringOperations = [
17
18
  "read",
18
19
  "create",
@@ -589,6 +590,12 @@ const schema = a.schema({
589
590
  .returns(a.json())
590
591
  .authorization((allow) => [allow.groups(contentWriteGroups)])
591
592
  .handler(a.handler.function(contentActions)),
593
+ intakePendingReferences: a
594
+ .mutation()
595
+ .arguments({ input: a.json().required() })
596
+ .returns(a.json())
597
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
598
+ .handler(a.handler.function(contentActions)),
592
599
  saveItemDraft: a
593
600
  .mutation()
594
601
  .arguments({ input: a.json().required() })
@@ -601,6 +608,12 @@ const schema = a.schema({
601
608
  .returns(a.json())
602
609
  .authorization((allow) => [allow.groups(contentWriteGroups)])
603
610
  .handler(a.handler.function(contentActions)),
611
+ moveStoryStage: a
612
+ .mutation()
613
+ .arguments({ input: a.json().required() })
614
+ .returns(a.json())
615
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
616
+ .handler(a.handler.function(contentActions)),
604
617
  unpublishItem: a
605
618
  .mutation()
606
619
  .arguments({ input: a.json().required() })
@@ -843,6 +856,7 @@ const schema = a.schema({
843
856
  storyLineageId: a.id(),
844
857
  assignmentId: a.id(),
845
858
  maxCharacters: a.integer(),
859
+ optionalPublicationDoctrine: a.boolean(),
846
860
  })
847
861
  .returns(a.json().required())
848
862
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
@@ -2146,12 +2160,14 @@ const schema = a.schema({
2146
2160
  allow.groups(contentWriteGroups),
2147
2161
  ]),
2148
2162
  }).authorization((allow) => [
2163
+ allow.resource(assignmentAction).to(["query", "mutate"]),
2149
2164
  allow.resource(categoryAction),
2150
2165
  allow.resource(contentActions),
2151
2166
  allow.resource(manageUserRole),
2152
2167
  allow.resource(modelAttachmentUpload),
2153
2168
  allow.resource(newsroomSummary),
2154
2169
  allow.resource(procedureAction),
2170
+ allow.resource(publicForms).to(["mutate"]),
2155
2171
  allow.resource(sesInboundReceive),
2156
2172
  allow.resource(emailSubmissionProcessor),
2157
2173
  allow.resource(slackEvents),
@@ -2161,10 +2177,14 @@ const schema = a.schema({
2161
2177
  * The site's data API. Amplify allows one `defineData` per backend and registers it when called, so this is
2162
2178
  * a function: a site without plugins passes none and gets exactly the base schema.
2163
2179
  */
2164
- export function defineSiteData(pluginDefinitions = {}) {
2180
+ export function defineSiteData(pluginDefinitions = {}, excludeModelGroups = []) {
2181
+ assertKnownModelGroups(excludeModelGroups);
2182
+ const hasPlugins = Object.keys(pluginDefinitions).length > 0;
2165
2183
  return defineData({
2166
2184
  name: "PapyrusCmsApi",
2167
- schema: Object.keys(pluginDefinitions).length === 0 ? leanSchema : schemaWithPlugins(pluginDefinitions),
2185
+ schema: excludeModelGroups.length > 0
2186
+ ? schemaExcludingGroups(excludeModelGroups, pluginDefinitions)
2187
+ : hasPlugins ? schemaWithPlugins(pluginDefinitions) : leanSchema,
2168
2188
  authorizationModes: {
2169
2189
  defaultAuthorizationMode: "userPool",
2170
2190
  apiKeyAuthorizationMode: {
@@ -6,13 +6,14 @@ import { knowledgeQuery } from "../functions/knowledge-query/resource";
6
6
  import { manageUserRole } from "../functions/manage-user-role/resource";
7
7
  import { modelAttachmentUpload } from "../functions/model-attachment-upload/resource";
8
8
  import { newsroomSummary } from "../functions/newsroom-summary/resource";
9
+ import { publicForms } from "../functions/public-forms/resource";
9
10
  import { procedureAction } from "../functions/procedure-action/resource";
10
11
  import { readerSettings } from "../functions/reader-settings/resource";
11
12
  import { emailSubmissionProcessor } from "../functions/email-submission-processor/resource";
12
13
  import { sesInboundReceive } from "../functions/ses-inbound-receive/resource";
13
14
  import { slackDelivery } from "../functions/slack-delivery/resource";
14
15
  import { slackEvents } from "../functions/slack-events/resource";
15
- import { schema as leanSchema, schemaWithPlugins } from "./schema";
16
+ import { assertKnownModelGroups, schema as leanSchema, schemaExcludingGroups, schemaWithPlugins } from "./schema";
16
17
  const authoringOperations: ("read" | "create" | "update" | "delete")[] = [
17
18
  "read",
18
19
  "create",
@@ -641,6 +642,13 @@ const schema = a.schema({
641
642
  .authorization((allow) => [allow.groups(contentWriteGroups)])
642
643
  .handler(a.handler.function(contentActions)),
643
644
 
645
+ intakePendingReferences: a
646
+ .mutation()
647
+ .arguments({ input: a.json().required() })
648
+ .returns(a.json())
649
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
650
+ .handler(a.handler.function(contentActions)),
651
+
644
652
  saveItemDraft: a
645
653
  .mutation()
646
654
  .arguments({ input: a.json().required() })
@@ -655,6 +663,13 @@ const schema = a.schema({
655
663
  .authorization((allow) => [allow.groups(contentWriteGroups)])
656
664
  .handler(a.handler.function(contentActions)),
657
665
 
666
+ moveStoryStage: a
667
+ .mutation()
668
+ .arguments({ input: a.json().required() })
669
+ .returns(a.json())
670
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
671
+ .handler(a.handler.function(contentActions)),
672
+
658
673
  unpublishItem: a
659
674
  .mutation()
660
675
  .arguments({ input: a.json().required() })
@@ -916,6 +931,7 @@ const schema = a.schema({
916
931
  storyLineageId: a.id(),
917
932
  assignmentId: a.id(),
918
933
  maxCharacters: a.integer(),
934
+ optionalPublicationDoctrine: a.boolean(),
919
935
  })
920
936
  .returns(a.json().required())
921
937
  .authorization((allow) => [allow.groups(categoryWriteGroups)])
@@ -2271,12 +2287,14 @@ const schema = a.schema({
2271
2287
  allow.groups(contentWriteGroups),
2272
2288
  ]),
2273
2289
  }).authorization((allow) => [
2290
+ allow.resource(assignmentAction).to(["query", "mutate"]),
2274
2291
  allow.resource(categoryAction),
2275
2292
  allow.resource(contentActions),
2276
2293
  allow.resource(manageUserRole),
2277
2294
  allow.resource(modelAttachmentUpload),
2278
2295
  allow.resource(newsroomSummary),
2279
2296
  allow.resource(procedureAction),
2297
+ allow.resource(publicForms).to(["mutate"]),
2280
2298
  allow.resource(sesInboundReceive),
2281
2299
  allow.resource(emailSubmissionProcessor),
2282
2300
  allow.resource(slackEvents),
@@ -2289,10 +2307,14 @@ export type Schema = ClientSchema<typeof schema>;
2289
2307
  * The site's data API. Amplify allows one `defineData` per backend and registers it when called, so this is
2290
2308
  * a function: a site without plugins passes none and gets exactly the base schema.
2291
2309
  */
2292
- export function defineSiteData(pluginDefinitions: Record<string, unknown> = {}) {
2310
+ export function defineSiteData(pluginDefinitions: Record<string, unknown> = {}, excludeModelGroups: readonly string[] = []) {
2311
+ assertKnownModelGroups(excludeModelGroups);
2312
+ const hasPlugins = Object.keys(pluginDefinitions).length > 0;
2293
2313
  return defineData({
2294
2314
  name: "PapyrusCmsApi",
2295
- schema: Object.keys(pluginDefinitions).length === 0 ? leanSchema : schemaWithPlugins(pluginDefinitions),
2315
+ schema: excludeModelGroups.length > 0
2316
+ ? schemaExcludingGroups(excludeModelGroups, pluginDefinitions)
2317
+ : hasPlugins ? schemaWithPlugins(pluginDefinitions) : leanSchema,
2296
2318
  authorizationModes: {
2297
2319
  defaultAuthorizationMode: "userPool",
2298
2320
  apiKeyAuthorizationMode: {