@anthusai/papyrus 2.0.0-next.6 → 2.0.0-next.61
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.
- package/amplify/data/resource.js +23 -3
- package/amplify/data/resource.ts +25 -3
- package/amplify/data/schema.js +2028 -1979
- package/amplify/data/schema.ts +72 -14
- package/amplify/functions/assignment-action/data-access.js +90 -0
- package/amplify/functions/assignment-action/data-access.ts +89 -0
- package/amplify/functions/assignment-action/handler.ts +1 -1
- package/amplify/functions/content-actions/handler.py +61 -2
- package/amplify/functions/content-actions/requirements.txt +1 -0
- package/amplify/functions/content-actions/resource.js +1 -1
- package/amplify/functions/content-actions/resource.ts +1 -1
- package/amplify/functions/editorial-checks/handler.py +14 -0
- package/amplify/functions/editorial-checks/requirements.txt +1 -0
- package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.js +7 -7
- package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.ts +7 -7
- package/amplify/functions/editorial-checks/schema.js +121 -0
- package/amplify/{plugins → functions}/editorial-checks/schema.ts +33 -6
- package/amplify/functions/editorial-checks/wire.js +53 -0
- package/amplify/functions/editorial-checks/wire.ts +61 -0
- package/amplify/functions/monitoring-view/handler.py +11 -0
- package/amplify/functions/monitoring-view/resource.js +24 -0
- package/amplify/functions/monitoring-view/resource.ts +34 -0
- package/amplify/functions/monitoring-view/schema.js +16 -0
- package/amplify/functions/monitoring-view/schema.ts +18 -0
- package/amplify/functions/monitoring-view/wire.js +37 -0
- package/amplify/functions/monitoring-view/wire.ts +47 -0
- package/amplify/functions/public-forms/core.js +247 -0
- package/amplify/functions/public-forms/core.ts +310 -0
- package/amplify/functions/public-forms/handler.ts +41 -0
- package/amplify/functions/public-forms/origins.js +35 -0
- package/amplify/functions/public-forms/origins.ts +43 -0
- package/amplify/functions/public-forms/resource.js +9 -0
- package/amplify/functions/public-forms/resource.ts +10 -0
- package/amplify/functions/public-forms/wire.js +25 -0
- package/amplify/functions/public-forms/wire.ts +32 -0
- package/amplify/functions/shared/editorial-context.ts +63 -4
- package/amplify/functions/shared/python-bundle.js +20 -14
- package/amplify/functions/shared/python-bundle.ts +25 -18
- package/amplify/plugins/newsletter/config.js +245 -0
- package/amplify/plugins/newsletter/config.ts +305 -0
- package/amplify/plugins/newsletter/function/handler.py +6 -0
- package/amplify/plugins/newsletter/function/requirements.txt +5 -0
- package/amplify/plugins/newsletter/ops/handler.py +12 -0
- package/amplify/plugins/newsletter/ops/resource.js +27 -0
- package/amplify/plugins/newsletter/ops/resource.ts +37 -0
- package/amplify/plugins/newsletter/papyrus.plugin.js +263 -0
- package/amplify/plugins/newsletter/papyrus.plugin.ts +311 -0
- package/amplify/plugins/newsletter/schema.js +56 -0
- package/amplify/plugins/newsletter/schema.ts +61 -0
- package/amplify/plugins/newsletter/secure-string-parameter.js +107 -0
- package/amplify/plugins/newsletter/secure-string-parameter.ts +120 -0
- package/amplify/plugins/newsletter/sending.js +140 -0
- package/amplify/plugins/newsletter/sending.ts +186 -0
- package/amplify/plugins/reader-steering/config.js +173 -0
- package/amplify/plugins/reader-steering/config.ts +268 -0
- package/amplify/plugins/reader-steering/function/ai_moderation.py +246 -0
- package/amplify/plugins/reader-steering/function/handler.py +1363 -0
- package/amplify/plugins/reader-steering/function/moderation-prompt.md +27 -0
- package/amplify/plugins/reader-steering/function/moderation.py +316 -0
- package/amplify/plugins/reader-steering/function/resource.js +27 -0
- package/amplify/plugins/reader-steering/function/resource.ts +35 -0
- package/amplify/plugins/reader-steering/papyrus.plugin.js +176 -0
- package/amplify/plugins/reader-steering/papyrus.plugin.ts +202 -0
- package/amplify/plugins/reader-steering/schema.js +140 -0
- package/amplify/plugins/reader-steering/schema.ts +142 -0
- package/amplify/plugins/registry.js +4 -2
- package/amplify/plugins/registry.ts +4 -2
- package/amplify/plugins/types.ts +5 -0
- package/amplify/plugins/wire.js +1 -0
- package/amplify/plugins/wire.ts +1 -0
- package/amplify/publication/projection-lease.js +30 -0
- package/amplify/publication/projection-lease.ts +39 -0
- package/amplify/publication/redirect-and-index.js +105 -0
- package/amplify/publication/redirect-rules.js +73 -0
- package/amplify/publication/redirect-rules.ts +93 -0
- package/amplify/publication/s3-projection.js +7 -1
- package/amplify/publication/s3-projection.ts +9 -1
- package/amplify/site-backend-config.ts +17 -0
- package/amplify/site-backend.js +38 -1
- package/amplify/site-backend.ts +46 -1
- package/app/api/auth/prospectus/sign-in/route.ts +4 -0
- package/app/api/newsletter/confirm/route.ts +13 -0
- package/app/api/newsletter/preferences/route.ts +13 -0
- package/app/api/newsletter/state/route.ts +9 -0
- package/app/api/newsletter/subscribe/route.ts +9 -0
- package/app/api/newsletter/unsubscribe/route.ts +13 -0
- package/app/api/newsroom/curation/context/route.ts +9 -0
- package/app/api/newsroom/curation/priming/route.ts +9 -0
- package/app/api/newsroom/curation/publication/route.ts +9 -0
- package/app/api/reader/comment/delete/route.ts +9 -0
- package/app/api/reader/comment/edit/route.ts +9 -0
- package/app/api/reader/comment/route.ts +9 -0
- package/app/api/reader/handle/route.ts +9 -0
- package/app/api/reader/me/route.ts +9 -0
- package/app/api/reader/rating/route.ts +9 -0
- package/app/api/reader/report/route.ts +9 -0
- package/app/api/reader/retired/route.ts +9 -0
- package/app/api/reader/submit/route.ts +9 -0
- package/app/api/reader/vote/route.ts +9 -0
- package/bin/papyrus-infra.mjs +20 -1
- package/components/editorial-checks-admin-panel.tsx +36 -11
- package/components/moderation-panel.tsx +248 -0
- package/components/monitoring-overview-view.tsx +241 -0
- package/components/monitoring-panel.tsx +40 -0
- package/components/newsletter-panel.tsx +474 -0
- package/components/newsletter-sections.tsx +163 -0
- package/components/newsroom-article-editor.tsx +2 -4
- package/components/newsroom-curation-bootstrap.tsx +45 -0
- package/components/newsroom-organizer.css +31 -0
- package/components/newsroom-references-view.tsx +14 -14
- package/components/publication-cyclotron-panel.tsx +15 -10
- package/components/reference-add-entry.tsx +75 -0
- package/components/reference-curation-controls.tsx +31 -22
- package/components/reference-cyclotron-priming.tsx +58 -19
- package/components/reference-cyclotron-suggestion.tsx +1 -1
- package/components/reference-priming.tsx +14 -10
- package/components/reference-section-suggestion.tsx +1 -1
- package/components/topic-steering-workspace.tsx +64 -20
- package/components/use-editorial-checks.ts +12 -10
- package/infra/amplify-app-shell.js +90 -16
- package/infra/amplify-app-shell.ts +102 -18
- package/infra/index.js +1 -0
- package/infra/secure-string-parameter-handler.js +41 -0
- package/infra/secure-string-parameter-handler.ts +41 -0
- package/infra/secure-string-parameter.js +79 -0
- package/infra/secure-string-parameter.ts +91 -0
- package/infra/site-config.js +86 -6
- package/infra/site-config.ts +129 -6
- package/lib/category-repository.ts +11 -9
- package/lib/curation-routes.ts +345 -0
- package/lib/editorial-checks-backend.ts +1 -1
- package/lib/editorial-checks-client.ts +19 -1
- package/lib/editorial-checks-demo.ts +2 -2
- package/lib/editorial-checks-settings.ts +3 -0
- package/lib/editorial-checks.ts +8 -11
- package/lib/editorial-preview.ts +5 -5
- package/lib/monitoring-client.ts +29 -0
- package/lib/monitoring-overview-fixture.ts +51 -0
- package/lib/monitoring-overview.ts +145 -0
- package/lib/newsletter-api.ts +418 -0
- package/lib/newsletter-client.ts +46 -0
- package/lib/newsletter-fixture.ts +184 -0
- package/lib/newsletter-model.ts +202 -0
- package/lib/prospectus-session.ts +15 -14
- package/lib/prospectus-sign-in-routes.ts +84 -19
- package/lib/prospectus-site-identity.ts +24 -1
- package/lib/reader-api.ts +145 -0
- package/lib/reader-moderation.ts +220 -0
- package/lib/reader-retirement-route.ts +89 -0
- package/lib/reader-subject.md +29 -0
- package/lib/reader-subject.ts +53 -0
- package/lib/relevance-status.ts +2 -2
- package/lib/semantic-graph.ts +2 -0
- package/lib/site-brand-tenant.ts +11 -6
- package/lib/site-brand.ts +6 -3
- package/lib/site-origin.ts +67 -0
- package/middleware.ts +14 -3
- package/package.json +41 -3
- package/routes.manifest.json +204 -2
- package/amplify/plugins/editorial-checks/function/handler.py +0 -11
- package/amplify/plugins/editorial-checks/function/requirements.txt +0 -1
- package/amplify/plugins/editorial-checks/papyrus.plugin.js +0 -50
- package/amplify/plugins/editorial-checks/papyrus.plugin.ts +0 -63
- package/amplify/plugins/editorial-checks/schema.js +0 -94
package/amplify/data/resource.js
CHANGED
|
@@ -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:
|
|
2185
|
+
schema: excludeModelGroups.length > 0
|
|
2186
|
+
? schemaExcludingGroups(excludeModelGroups, pluginDefinitions)
|
|
2187
|
+
: hasPlugins ? schemaWithPlugins(pluginDefinitions) : leanSchema,
|
|
2168
2188
|
authorizationModes: {
|
|
2169
2189
|
defaultAuthorizationMode: "userPool",
|
|
2170
2190
|
apiKeyAuthorizationMode: {
|
package/amplify/data/resource.ts
CHANGED
|
@@ -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:
|
|
2315
|
+
schema: excludeModelGroups.length > 0
|
|
2316
|
+
? schemaExcludingGroups(excludeModelGroups, pluginDefinitions)
|
|
2317
|
+
: hasPlugins ? schemaWithPlugins(pluginDefinitions) : leanSchema,
|
|
2296
2318
|
authorizationModes: {
|
|
2297
2319
|
defaultAuthorizationMode: "userPool",
|
|
2298
2320
|
apiKeyAuthorizationMode: {
|