@anthusai/papyrus 1.0.0-next.9 → 1.1.0
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/auth/prospectus-google-client.js +66 -0
- package/amplify/auth/prospectus-google-client.ts +71 -0
- package/amplify/auth/redirect-urls.js +54 -0
- package/amplify/auth/redirect-urls.ts +66 -0
- package/amplify/auth/resource.js +23 -5
- package/amplify/auth/resource.ts +31 -5
- package/amplify/data/resource.js +42 -80
- package/amplify/data/resource.ts +42 -80
- package/amplify/data/schema.js +45 -62
- package/amplify/data/schema.ts +47 -62
- package/amplify/functions/category-action/handler.ts +5 -3
- package/amplify/functions/console-chat-responder/py/execute_tactus_runner.py +0 -10
- package/amplify/functions/console-chat-responder/resource.js +0 -7
- package/amplify/functions/console-chat-responder/resource.ts +0 -8
- package/amplify/functions/console-chat-responder/src/main.rs +0 -9
- package/amplify/functions/content-actions/handler.py +143 -1
- package/amplify/functions/content-actions/requirements.txt +2 -1
- package/amplify/functions/content-actions/resource.js +6 -1
- package/amplify/functions/content-actions/resource.ts +9 -2
- package/amplify/functions/email-submission-processor/handler.py +3 -1
- package/amplify/functions/renditions/handler.py +120 -0
- package/amplify/functions/renditions/requirements.txt +4 -0
- package/amplify/functions/ses-inbound-receive/handler.ts +32 -4
- package/amplify/functions/shared/email-submission.ts +109 -1
- package/amplify/functions/shared/python-bundle.js +42 -2
- package/amplify/functions/shared/python-bundle.ts +47 -2
- package/amplify/functions/shared/reference-curation-metadata.ts +29 -0
- package/amplify/inbound-email/ses-intake.js +86 -0
- package/amplify/inbound-email/ses-intake.ts +110 -0
- package/amplify/plugins/registry.js +19 -0
- package/amplify/plugins/registry.ts +23 -0
- package/amplify/plugins/signup/function/handler.py +200 -0
- package/amplify/plugins/signup/function/resource.js +27 -0
- package/amplify/plugins/signup/function/resource.ts +35 -0
- package/amplify/plugins/signup/papyrus.plugin.js +59 -0
- package/amplify/plugins/signup/papyrus.plugin.ts +74 -0
- package/amplify/plugins/signup/schema.js +40 -0
- package/amplify/plugins/signup/schema.ts +41 -0
- package/amplify/plugins/signup/waf.js +48 -0
- package/amplify/plugins/signup/waf.ts +51 -0
- package/amplify/plugins/types.js +1 -0
- package/amplify/plugins/types.ts +39 -0
- package/amplify/plugins/wire.js +24 -0
- package/amplify/plugins/wire.ts +26 -0
- package/amplify/publication/default-publication.js +18 -0
- package/amplify/publication/default-publication.ts +20 -0
- package/amplify/publication/invalidation-alarm.js +26 -0
- package/amplify/publication/invalidation-alarm.ts +30 -0
- package/amplify/publication/redirect-and-index.js +37 -0
- package/amplify/publication/renditions-function.js +74 -0
- package/amplify/publication/renditions-function.ts +112 -0
- package/amplify/publication/renditions-settings.js +51 -0
- package/amplify/publication/renditions-settings.ts +58 -0
- package/amplify/publication/reproject-on-deploy.js +73 -0
- package/amplify/publication/reproject-on-deploy.ts +78 -0
- package/amplify/publication/s3-projection-settings.js +67 -0
- package/amplify/publication/s3-projection-settings.ts +101 -0
- package/amplify/publication/s3-projection.js +151 -0
- package/amplify/publication/s3-projection.ts +201 -0
- package/amplify/resolver-waves.js +26 -0
- package/amplify/resolver-waves.ts +34 -0
- package/amplify/revalidate-invalidation-settings.js +30 -0
- package/amplify/revalidate-invalidation-settings.ts +35 -0
- package/amplify/revalidate-secret-policy.js +13 -0
- package/amplify/revalidate-secret-policy.ts +19 -0
- package/amplify/site-backend-config.js +65 -1
- package/amplify/site-backend-config.ts +153 -2
- package/amplify/site-backend-names.js +103 -0
- package/amplify/site-backend-names.ts +166 -0
- package/amplify/site-backend.js +150 -176
- package/amplify/site-backend.ts +189 -201
- package/amplify/storage-backups/construct.js +31 -0
- package/amplify/storage-backups/construct.ts +47 -0
- package/app/[year]/[month]/[day]/[articleSlug]/page.tsx +8 -1
- package/app/[year]/[month]/[day]/edition-route-page.tsx +2 -0
- package/app/[year]/[month]/[day]/page/[pageNumber]/page.tsx +6 -1
- package/app/[year]/[month]/[day]/page.tsx +1 -1
- package/app/[year]/[month]/[day]/section/[sectionKey]/page.tsx +6 -1
- package/app/api/archive/editions/route.ts +1 -1
- package/app/api/auth/prospectus/callback/route.ts +9 -0
- package/app/api/auth/prospectus/selection/route.ts +9 -0
- package/app/api/auth/prospectus/session/route.ts +9 -0
- package/app/api/auth/prospectus/sign-in/route.ts +9 -0
- package/app/api/auth/prospectus/sign-out/route.ts +9 -0
- package/app/api/cyclotron/priming-proof/route.ts +11 -0
- package/app/api/media/[...path]/route.ts +5 -16
- package/app/api/revalidate/route.ts +15 -7
- package/app/archive/page.tsx +1 -1
- package/app/articles/[slug]/page.tsx +7 -5
- package/app/blog-rhythm.css +278 -0
- package/app/cyclotron/page.tsx +13 -0
- package/app/globals.css +2 -0
- package/app/layout.tsx +16 -0
- package/app/newsroom/[section]/[...selection]/page.tsx +9 -6
- package/app/newsroom/[section]/page.tsx +6 -3
- package/app/newsroom/layout.tsx +4 -9
- package/app/newsroom/settings/page.tsx +6 -0
- package/app/newsroom/work/page.tsx +10 -0
- package/app/page.tsx +22 -8
- package/app/robots.ts +2 -5
- package/app/tailwind.css +1 -6
- package/components/amplify-client-provider.tsx +5 -22
- package/components/archive-shell.tsx +2 -22
- package/components/article-video.tsx +152 -5
- package/components/blog-page-background.tsx +23 -6
- package/components/news-desk-page.tsx +4 -15
- package/components/news-desk-taxonomy-client.ts +90 -3
- package/components/newspaper.tsx +6 -2
- package/components/newsroom-access-gate.tsx +2 -1
- package/components/newsroom-board-view.tsx +99 -0
- package/components/newsroom-client-shell.tsx +12 -0
- package/components/newsroom-curation-provider.tsx +17 -0
- package/components/newsroom-fonts/playfair-display-700.ttf +0 -0
- package/components/newsroom-fonts/playfair-display-900.ttf +0 -0
- package/components/newsroom-fonts/playfair-display-OFL.txt +93 -0
- package/components/newsroom-fonts/plus-jakarta-sans-400.ttf +0 -0
- package/components/newsroom-fonts/plus-jakarta-sans-600.ttf +0 -0
- package/components/newsroom-fonts/plus-jakarta-sans-OFL.txt +93 -0
- package/components/newsroom-newsprint-board.css +48 -0
- package/components/newsroom-ops-overview.tsx +28 -11
- package/components/newsroom-ops-shell.tsx +7 -1
- package/components/newsroom-organizer-shell.tsx +130 -0
- package/components/newsroom-organizer.css +63 -0
- package/components/newsroom-references-view.tsx +92 -8
- package/components/papyrus-console-shell.tsx +4 -2
- package/components/pictogram-figure.tsx +9 -2
- package/components/presentation-header.tsx +135 -0
- package/components/presentation-rhythm-hrule.tsx +17 -0
- package/components/priming-proof-page.tsx +94 -0
- package/components/publication-cyclotron-panel.tsx +57 -0
- package/components/reader-auth-control.tsx +8 -5
- package/components/reference-curation-controls.tsx +77 -0
- package/components/reference-cyclotron-status.tsx +109 -0
- package/components/reference-priming.tsx +18 -0
- package/components/reference-relevance-review.tsx +75 -0
- package/components/settings-page.tsx +2 -1
- package/components/signup-entries-panel.tsx +94 -0
- package/components/topic-steering-workspace.tsx +78 -8
- package/components/use-blog-header-obstacles.ts +81 -0
- package/components/use-brand-fonts-ready.ts +28 -0
- package/components/use-near-viewport.ts +30 -0
- package/components/use-rhythm-overlay.ts +29 -0
- package/infra/amplify-app-shell.js +166 -27
- package/infra/amplify-app-shell.ts +180 -31
- package/infra/build-specs.js +23 -7
- package/infra/build-specs.ts +27 -10
- package/infra/site-config.js +248 -36
- package/infra/site-config.ts +313 -51
- package/lib/amplify-outputs-path.ts +5 -1
- package/lib/amplify-server-runtime.ts +36 -1
- package/lib/approved-priming-proof-reports.ts +6 -0
- package/lib/blog-feature-solver.ts +459 -0
- package/lib/blog-rhythm.ts +134 -0
- package/lib/brand-fonts-watch.ts +43 -0
- package/lib/brand-fonts.ts +112 -0
- package/lib/cached-content-repository.ts +12 -0
- package/lib/category-repository.ts +43 -93
- package/lib/content-item-lifecycle.ts +55 -0
- package/lib/content-repository.ts +3 -0
- package/lib/content-types.ts +4 -0
- package/lib/curation-client.ts +61 -0
- package/lib/edition-routes.ts +31 -29
- package/lib/graphql-content-repository.ts +56 -22
- package/lib/media-route-response.ts +45 -0
- package/lib/newspaper-layout.ts +3 -2
- package/lib/newsroom-base-path.ts +12 -3
- package/lib/newsroom-board.ts +99 -0
- package/lib/newsroom-category-drilldown.ts +3 -2
- package/lib/newsroom-forum-routes.ts +6 -4
- package/lib/newsroom-index-filters.ts +14 -10
- package/lib/newsroom-nav.ts +3 -1
- package/lib/newsroom-organizer-nav.ts +37 -0
- package/lib/newsroom-section-routing.ts +20 -0
- package/lib/oauth-redirect-priority.ts +40 -0
- package/lib/papyrus-web-locations.ts +7 -6
- package/lib/plugin-settings.ts +11 -0
- package/lib/presentation-footer.ts +3 -2
- package/lib/pretext-layout.ts +12 -3
- package/lib/priming-proof-report.ts +90 -0
- package/lib/prospectus-publication-access.ts +53 -0
- package/lib/prospectus-session.ts +196 -0
- package/lib/prospectus-sign-in-routes.ts +284 -0
- package/lib/prospectus-site-identity.ts +303 -0
- package/lib/publication-cyclotron.ts +74 -0
- package/lib/rate-limit-retry.ts +55 -0
- package/lib/reader-base-path.ts +24 -0
- package/lib/reader-cache-lifetime.ts +5 -0
- package/lib/reader-static-params.ts +85 -4
- package/lib/reader-storage-url.ts +9 -12
- package/lib/reference-policy.ts +5 -0
- package/lib/relevance-decisions.ts +103 -0
- package/lib/relevance-status.ts +63 -0
- package/lib/renderer.ts +7 -0
- package/lib/revalidate-prewarm.ts +53 -0
- package/lib/revalidate-secret.ts +59 -0
- package/lib/robots-policy.ts +14 -0
- package/lib/root-route-redirect.ts +16 -0
- package/lib/semantic-graph.ts +7 -0
- package/lib/shared-credentials-provider.ts +61 -0
- package/lib/signup-csv.ts +24 -0
- package/lib/site-brand.ts +59 -0
- package/lib/staging-gated-path.ts +23 -0
- package/lib/staging-preview-object.ts +21 -5
- package/lib/test-editor-override.ts +4 -0
- package/lib/video-loading.ts +22 -0
- package/lib/video-script.ts +14 -0
- package/middleware.ts +11 -19
- package/package.json +73 -8
- package/renderers/pretext/article-page.tsx +39 -3
- package/renderers/pretext/presentation-shared.tsx +113 -0
- package/renderers/pretext/presentation-shell.tsx +15 -102
- package/renderers/pretext/rhythm-article-page.tsx +165 -0
- package/renderers/pretext/rhythm-blog-presentation.tsx +279 -0
- package/renderers/pretext/rhythm-shell-style.ts +35 -0
- package/routes.manifest.json +123 -12
- package/src/sync.mjs +30 -6
- package/src/with-papyrus.d.mts +9 -0
- package/src/with-papyrus.mjs +48 -3
- package/amplify/functions/graphql-jwt-authorizer/handler.ts +0 -193
- package/amplify/functions/graphql-jwt-authorizer/resource.js +0 -14
- package/amplify/functions/graphql-jwt-authorizer/resource.ts +0 -15
- package/components/ai-elements/message.tsx +0 -360
package/amplify/data/schema.ts
CHANGED
|
@@ -23,7 +23,7 @@ const modelWithoutSubscriptions = <Fields extends Parameters<typeof a.model>[0]>
|
|
|
23
23
|
a.model(fields).disableOperations(["subscriptions"]);
|
|
24
24
|
const realtimeModel = <Fields extends Parameters<typeof a.model>[0]>(fields: Fields) => a.model(fields);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const baseDefinitions = {
|
|
27
27
|
UserProfile: modelWithoutSubscriptions({
|
|
28
28
|
id: a.id().required(),
|
|
29
29
|
email: a.email(),
|
|
@@ -268,11 +268,12 @@ export const schema = a.schema({
|
|
|
268
268
|
actorLabel: a.string(),
|
|
269
269
|
note: a.string(),
|
|
270
270
|
reasonCode: a.string(),
|
|
271
|
+
decisionRelationId: a.id(),
|
|
272
|
+
shareable: a.boolean(),
|
|
271
273
|
})
|
|
272
274
|
.returns(a.ref("ReferenceCurationActionResult"))
|
|
273
275
|
.authorization((allow) => [
|
|
274
276
|
allow.groups(categoryWriteGroups),
|
|
275
|
-
allow.custom(),
|
|
276
277
|
])
|
|
277
278
|
.handler(a.handler.function(categoryAction)),
|
|
278
279
|
|
|
@@ -288,7 +289,6 @@ export const schema = a.schema({
|
|
|
288
289
|
.returns(a.ref("ReferenceQualityActionResult"))
|
|
289
290
|
.authorization((allow) => [
|
|
290
291
|
allow.groups(categoryWriteGroups),
|
|
291
|
-
allow.custom(),
|
|
292
292
|
])
|
|
293
293
|
.handler(a.handler.function(categoryAction)),
|
|
294
294
|
|
|
@@ -400,7 +400,7 @@ export const schema = a.schema({
|
|
|
400
400
|
getNewsroomSummary: a
|
|
401
401
|
.query()
|
|
402
402
|
.returns(a.ref("NewsroomSummary"))
|
|
403
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
403
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
404
404
|
.handler(a.handler.function(newsroomSummary)),
|
|
405
405
|
|
|
406
406
|
deriveMarkus: a
|
|
@@ -444,7 +444,7 @@ export const schema = a.schema({
|
|
|
444
444
|
input: a.json().required(),
|
|
445
445
|
})
|
|
446
446
|
.returns(a.json())
|
|
447
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
447
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
448
448
|
.handler(a.handler.function(knowledgeQuery)),
|
|
449
449
|
|
|
450
450
|
updateNewsroomSummary: a
|
|
@@ -455,7 +455,7 @@ export const schema = a.schema({
|
|
|
455
455
|
reason: a.string(),
|
|
456
456
|
})
|
|
457
457
|
.returns(a.ref("NewsroomSummary"))
|
|
458
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
458
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
459
459
|
.handler(a.handler.function(newsroomSummary)),
|
|
460
460
|
|
|
461
461
|
ModelAttachmentUploadSlot: a.customType({
|
|
@@ -515,7 +515,7 @@ export const schema = a.schema({
|
|
|
515
515
|
status: a.string(),
|
|
516
516
|
})
|
|
517
517
|
.returns(a.ref("ModelAttachmentUploadSlot"))
|
|
518
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
518
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
519
519
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
520
520
|
|
|
521
521
|
completeModelAttachmentUpload: a
|
|
@@ -537,7 +537,7 @@ export const schema = a.schema({
|
|
|
537
537
|
status: a.string(),
|
|
538
538
|
})
|
|
539
539
|
.returns(a.ref("ModelAttachment"))
|
|
540
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
540
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
541
541
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
542
542
|
|
|
543
543
|
abortModelAttachmentUpload: a
|
|
@@ -559,7 +559,7 @@ export const schema = a.schema({
|
|
|
559
559
|
status: a.string(),
|
|
560
560
|
})
|
|
561
561
|
.returns(a.ref("ModelAttachmentUploadAbortResult"))
|
|
562
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
562
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
563
563
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
564
564
|
|
|
565
565
|
createModelAttachmentDownload: a
|
|
@@ -568,7 +568,7 @@ export const schema = a.schema({
|
|
|
568
568
|
attachmentId: a.id().required(),
|
|
569
569
|
})
|
|
570
570
|
.returns(a.ref("ModelAttachmentDownloadSlot"))
|
|
571
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
571
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
572
572
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
573
573
|
|
|
574
574
|
AssignmentActionResult: a.customType({
|
|
@@ -662,7 +662,7 @@ export const schema = a.schema({
|
|
|
662
662
|
limit: a.integer(),
|
|
663
663
|
})
|
|
664
664
|
.returns(a.ref("AssignmentContext").array().required())
|
|
665
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
665
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
666
666
|
.handler(a.handler.function(assignmentAction)),
|
|
667
667
|
|
|
668
668
|
listAssignmentQueue: a
|
|
@@ -673,7 +673,7 @@ export const schema = a.schema({
|
|
|
673
673
|
limit: a.integer(),
|
|
674
674
|
})
|
|
675
675
|
.returns(a.ref("AssignmentContext").array().required())
|
|
676
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
676
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
677
677
|
.handler(a.handler.function(assignmentAction)),
|
|
678
678
|
|
|
679
679
|
getAssignmentContext: a
|
|
@@ -682,7 +682,7 @@ export const schema = a.schema({
|
|
|
682
682
|
assignmentId: a.id().required(),
|
|
683
683
|
})
|
|
684
684
|
.returns(a.ref("AssignmentContext"))
|
|
685
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
685
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
686
686
|
.handler(a.handler.function(assignmentAction)),
|
|
687
687
|
|
|
688
688
|
claimAssignment: a
|
|
@@ -699,7 +699,7 @@ export const schema = a.schema({
|
|
|
699
699
|
note: a.string(),
|
|
700
700
|
})
|
|
701
701
|
.returns(a.ref("AssignmentActionResult"))
|
|
702
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
702
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
703
703
|
.handler(a.handler.function(assignmentAction)),
|
|
704
704
|
|
|
705
705
|
releaseAssignment: a
|
|
@@ -711,7 +711,7 @@ export const schema = a.schema({
|
|
|
711
711
|
note: a.string(),
|
|
712
712
|
})
|
|
713
713
|
.returns(a.ref("AssignmentActionResult"))
|
|
714
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
714
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
715
715
|
.handler(a.handler.function(assignmentAction)),
|
|
716
716
|
|
|
717
717
|
completeAssignment: a
|
|
@@ -723,7 +723,7 @@ export const schema = a.schema({
|
|
|
723
723
|
note: a.string(),
|
|
724
724
|
})
|
|
725
725
|
.returns(a.ref("AssignmentActionResult"))
|
|
726
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
726
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
727
727
|
.handler(a.handler.function(assignmentAction)),
|
|
728
728
|
|
|
729
729
|
cancelAssignment: a
|
|
@@ -735,7 +735,7 @@ export const schema = a.schema({
|
|
|
735
735
|
note: a.string(),
|
|
736
736
|
})
|
|
737
737
|
.returns(a.ref("AssignmentActionResult"))
|
|
738
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
738
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
739
739
|
.handler(a.handler.function(assignmentAction)),
|
|
740
740
|
|
|
741
741
|
reopenAssignment: a
|
|
@@ -747,7 +747,7 @@ export const schema = a.schema({
|
|
|
747
747
|
note: a.string(),
|
|
748
748
|
})
|
|
749
749
|
.returns(a.ref("AssignmentActionResult"))
|
|
750
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
750
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
751
751
|
.handler(a.handler.function(assignmentAction)),
|
|
752
752
|
|
|
753
753
|
retryImmediateAssignment: a
|
|
@@ -759,7 +759,7 @@ export const schema = a.schema({
|
|
|
759
759
|
note: a.string(),
|
|
760
760
|
})
|
|
761
761
|
.returns(a.ref("AssignmentActionResult"))
|
|
762
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
762
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
763
763
|
.handler(a.handler.function(assignmentAction)),
|
|
764
764
|
|
|
765
765
|
listNewsroomProcedureDefinitions: a
|
|
@@ -775,7 +775,7 @@ export const schema = a.schema({
|
|
|
775
775
|
procedureKey: a.string(),
|
|
776
776
|
})
|
|
777
777
|
.returns(a.json())
|
|
778
|
-
.authorization((allow) => [allow.group(adminGroup)
|
|
778
|
+
.authorization((allow) => [allow.group(adminGroup)])
|
|
779
779
|
.handler(a.handler.function(procedureAction)),
|
|
780
780
|
|
|
781
781
|
saveNewsroomProcedureDefinition: a
|
|
@@ -817,7 +817,7 @@ export const schema = a.schema({
|
|
|
817
817
|
actorLabel: a.string(),
|
|
818
818
|
})
|
|
819
819
|
.returns(a.json())
|
|
820
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
820
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
821
821
|
.handler(a.handler.function(procedureAction)),
|
|
822
822
|
|
|
823
823
|
getNewsroomProcedureRun: a
|
|
@@ -826,7 +826,7 @@ export const schema = a.schema({
|
|
|
826
826
|
id: a.id().required(),
|
|
827
827
|
})
|
|
828
828
|
.returns(a.json())
|
|
829
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
829
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
830
830
|
.handler(a.handler.function(procedureAction)),
|
|
831
831
|
|
|
832
832
|
listNewsroomProcedureRunsByProcedure: a
|
|
@@ -835,7 +835,7 @@ export const schema = a.schema({
|
|
|
835
835
|
procedureId: a.id().required(),
|
|
836
836
|
})
|
|
837
837
|
.returns(a.json())
|
|
838
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
838
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
839
839
|
.handler(a.handler.function(procedureAction)),
|
|
840
840
|
|
|
841
841
|
Assignment: modelWithoutSubscriptions({
|
|
@@ -870,9 +870,11 @@ export const schema = a.schema({
|
|
|
870
870
|
createdAt: a.datetime().required(),
|
|
871
871
|
updatedAt: a.datetime().required(),
|
|
872
872
|
newsroomFeedKey: a.string(),
|
|
873
|
+
itemLineageId: a.id(),
|
|
873
874
|
})
|
|
874
875
|
.secondaryIndexes((index) => [
|
|
875
876
|
index("newsroomFeedKey").sortKeys(["createdAt"]).queryField("listAssignmentsByNewsroomFeedAndCreatedAt"),
|
|
877
|
+
index("itemLineageId").sortKeys(["createdAt"]).queryField("listAssignmentsByItemLineageAndCreatedAt"),
|
|
876
878
|
index("queueStatusKey").sortKeys(["priority", "createdAt"]).queryField("listAssignmentsByQueueStatusAndPriority"),
|
|
877
879
|
index("assignmentTypeKey").sortKeys(["status", "createdAt"]).queryField("listAssignmentsByTypeStatusAndCreatedAt"),
|
|
878
880
|
index("status").sortKeys(["updatedAt"]).queryField("listAssignmentsByStatusAndUpdatedAt"),
|
|
@@ -884,8 +886,6 @@ export const schema = a.schema({
|
|
|
884
886
|
])
|
|
885
887
|
.authorization((allow) => [
|
|
886
888
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
887
|
-
allow.authenticated("identityPool").to(authoringOperations),
|
|
888
|
-
allow.custom().to(authoringOperations),
|
|
889
889
|
]),
|
|
890
890
|
|
|
891
891
|
AssignmentEvent: modelWithoutSubscriptions({
|
|
@@ -908,7 +908,6 @@ export const schema = a.schema({
|
|
|
908
908
|
])
|
|
909
909
|
.authorization((allow) => [
|
|
910
910
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
911
|
-
allow.custom().to(authoringOperations),
|
|
912
911
|
]),
|
|
913
912
|
|
|
914
913
|
ProcedureDefinition: modelWithoutSubscriptions({
|
|
@@ -933,7 +932,6 @@ export const schema = a.schema({
|
|
|
933
932
|
])
|
|
934
933
|
.authorization((allow) => [
|
|
935
934
|
allow.group(adminGroup),
|
|
936
|
-
allow.custom().to(authoringOperations),
|
|
937
935
|
]),
|
|
938
936
|
|
|
939
937
|
ProcedureVersion: modelWithoutSubscriptions({
|
|
@@ -960,7 +958,6 @@ export const schema = a.schema({
|
|
|
960
958
|
])
|
|
961
959
|
.authorization((allow) => [
|
|
962
960
|
allow.group(adminGroup),
|
|
963
|
-
allow.custom().to(authoringOperations),
|
|
964
961
|
]),
|
|
965
962
|
|
|
966
963
|
ProcedureRun: modelWithoutSubscriptions({
|
|
@@ -993,7 +990,6 @@ export const schema = a.schema({
|
|
|
993
990
|
.authorization((allow) => [
|
|
994
991
|
allow.group("editor").to(["read"]),
|
|
995
992
|
allow.group(adminGroup).to(authoringOperations),
|
|
996
|
-
allow.custom().to(authoringOperations),
|
|
997
993
|
]),
|
|
998
994
|
|
|
999
995
|
NewsroomSection: modelWithoutSubscriptions({
|
|
@@ -1021,7 +1017,6 @@ export const schema = a.schema({
|
|
|
1021
1017
|
])
|
|
1022
1018
|
.authorization((allow) => [
|
|
1023
1019
|
allow.groups(categoryWriteGroups),
|
|
1024
|
-
allow.custom().to(authoringOperations),
|
|
1025
1020
|
]),
|
|
1026
1021
|
|
|
1027
1022
|
KnowledgeCorpus: modelWithoutSubscriptions({
|
|
@@ -1039,7 +1034,6 @@ export const schema = a.schema({
|
|
|
1039
1034
|
])
|
|
1040
1035
|
.authorization((allow) => [
|
|
1041
1036
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1042
|
-
allow.custom().to(authoringOperations),
|
|
1043
1037
|
]),
|
|
1044
1038
|
|
|
1045
1039
|
KnowledgeImportRun: modelWithoutSubscriptions({
|
|
@@ -1067,7 +1061,6 @@ export const schema = a.schema({
|
|
|
1067
1061
|
])
|
|
1068
1062
|
.authorization((allow) => [
|
|
1069
1063
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1070
|
-
allow.custom().to(authoringOperations),
|
|
1071
1064
|
]),
|
|
1072
1065
|
|
|
1073
1066
|
KnowledgeRawPayload: modelWithoutSubscriptions({
|
|
@@ -1085,7 +1078,6 @@ export const schema = a.schema({
|
|
|
1085
1078
|
])
|
|
1086
1079
|
.authorization((allow) => [
|
|
1087
1080
|
allow.groups(categoryWriteGroups),
|
|
1088
|
-
allow.custom().to(authoringOperations),
|
|
1089
1081
|
]),
|
|
1090
1082
|
|
|
1091
1083
|
KnowledgeArtifact: modelWithoutSubscriptions({
|
|
@@ -1105,7 +1097,6 @@ export const schema = a.schema({
|
|
|
1105
1097
|
])
|
|
1106
1098
|
.authorization((allow) => [
|
|
1107
1099
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1108
|
-
allow.custom().to(authoringOperations),
|
|
1109
1100
|
]),
|
|
1110
1101
|
|
|
1111
1102
|
CategorySet: modelWithoutSubscriptions({
|
|
@@ -1135,7 +1126,6 @@ export const schema = a.schema({
|
|
|
1135
1126
|
])
|
|
1136
1127
|
.authorization((allow) => [
|
|
1137
1128
|
allow.groups(categoryWriteGroups),
|
|
1138
|
-
allow.custom().to(authoringOperations),
|
|
1139
1129
|
]),
|
|
1140
1130
|
|
|
1141
1131
|
Category: modelWithoutSubscriptions({
|
|
@@ -1177,7 +1167,6 @@ export const schema = a.schema({
|
|
|
1177
1167
|
])
|
|
1178
1168
|
.authorization((allow) => [
|
|
1179
1169
|
allow.groups(categoryWriteGroups),
|
|
1180
|
-
allow.custom().to(authoringOperations),
|
|
1181
1170
|
]),
|
|
1182
1171
|
|
|
1183
1172
|
CategoryKeyword: modelWithoutSubscriptions({
|
|
@@ -1206,7 +1195,6 @@ export const schema = a.schema({
|
|
|
1206
1195
|
])
|
|
1207
1196
|
.authorization((allow) => [
|
|
1208
1197
|
allow.groups(categoryWriteGroups),
|
|
1209
|
-
allow.custom().to(authoringOperations),
|
|
1210
1198
|
]),
|
|
1211
1199
|
|
|
1212
1200
|
LexicalSteeringRule: modelWithoutSubscriptions({
|
|
@@ -1235,7 +1223,6 @@ export const schema = a.schema({
|
|
|
1235
1223
|
])
|
|
1236
1224
|
.authorization((allow) => [
|
|
1237
1225
|
allow.groups(categoryWriteGroups),
|
|
1238
|
-
allow.custom().to(authoringOperations),
|
|
1239
1226
|
]),
|
|
1240
1227
|
|
|
1241
1228
|
SteeringProposal: modelWithoutSubscriptions({
|
|
@@ -1273,7 +1260,6 @@ export const schema = a.schema({
|
|
|
1273
1260
|
])
|
|
1274
1261
|
.authorization((allow) => [
|
|
1275
1262
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1276
|
-
allow.custom().to(authoringOperations),
|
|
1277
1263
|
]),
|
|
1278
1264
|
|
|
1279
1265
|
SteeringDecision: modelWithoutSubscriptions({
|
|
@@ -1293,7 +1279,6 @@ export const schema = a.schema({
|
|
|
1293
1279
|
])
|
|
1294
1280
|
.authorization((allow) => [
|
|
1295
1281
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1296
|
-
allow.custom().to(authoringOperations),
|
|
1297
1282
|
]),
|
|
1298
1283
|
|
|
1299
1284
|
Reference: realtimeModel({
|
|
@@ -1345,7 +1330,6 @@ export const schema = a.schema({
|
|
|
1345
1330
|
])
|
|
1346
1331
|
.authorization((allow) => [
|
|
1347
1332
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1348
|
-
allow.custom().to(authoringOperations),
|
|
1349
1333
|
]),
|
|
1350
1334
|
|
|
1351
1335
|
ReferenceAttachment: modelWithoutSubscriptions({
|
|
@@ -1375,7 +1359,6 @@ export const schema = a.schema({
|
|
|
1375
1359
|
])
|
|
1376
1360
|
.authorization((allow) => [
|
|
1377
1361
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1378
|
-
allow.custom().to(authoringOperations),
|
|
1379
1362
|
]),
|
|
1380
1363
|
|
|
1381
1364
|
SemanticNode: modelWithoutSubscriptions({
|
|
@@ -1397,6 +1380,11 @@ export const schema = a.schema({
|
|
|
1397
1380
|
displayName: a.string(),
|
|
1398
1381
|
description: a.string(),
|
|
1399
1382
|
aliases: a.string().array(),
|
|
1383
|
+
authorityScore: a.float(),
|
|
1384
|
+
authorityRank: a.integer(),
|
|
1385
|
+
acceptedReferenceMentionCount: a.integer(),
|
|
1386
|
+
distinctSourceKindCount: a.integer(),
|
|
1387
|
+
relationCount: a.integer(),
|
|
1400
1388
|
status: a.string().required(),
|
|
1401
1389
|
importRunId: a.id(),
|
|
1402
1390
|
createdAt: a.datetime(),
|
|
@@ -1413,7 +1401,6 @@ export const schema = a.schema({
|
|
|
1413
1401
|
])
|
|
1414
1402
|
.authorization((allow) => [
|
|
1415
1403
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1416
|
-
allow.custom().to(authoringOperations),
|
|
1417
1404
|
]),
|
|
1418
1405
|
|
|
1419
1406
|
Message: realtimeModel({
|
|
@@ -1462,7 +1449,6 @@ export const schema = a.schema({
|
|
|
1462
1449
|
])
|
|
1463
1450
|
.authorization((allow) => [
|
|
1464
1451
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1465
|
-
allow.custom().to(authoringOperations),
|
|
1466
1452
|
]),
|
|
1467
1453
|
|
|
1468
1454
|
MessageThread: realtimeModel({
|
|
@@ -1499,8 +1485,6 @@ export const schema = a.schema({
|
|
|
1499
1485
|
])
|
|
1500
1486
|
.authorization((allow) => [
|
|
1501
1487
|
allow.groups(categoryWriteGroups).to(["read", "create", "update"]),
|
|
1502
|
-
allow.authenticated("identityPool").to(authoringOperations),
|
|
1503
|
-
allow.custom().to(authoringOperations),
|
|
1504
1488
|
]),
|
|
1505
1489
|
|
|
1506
1490
|
ModelAttachment: modelWithoutSubscriptions({
|
|
@@ -1532,7 +1516,6 @@ export const schema = a.schema({
|
|
|
1532
1516
|
])
|
|
1533
1517
|
.authorization((allow) => [
|
|
1534
1518
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1535
|
-
allow.custom().to(authoringOperations),
|
|
1536
1519
|
]),
|
|
1537
1520
|
|
|
1538
1521
|
SemanticRelationType: modelWithoutSubscriptions({
|
|
@@ -1560,7 +1543,6 @@ export const schema = a.schema({
|
|
|
1560
1543
|
])
|
|
1561
1544
|
.authorization((allow) => [
|
|
1562
1545
|
allow.groups(categoryWriteGroups),
|
|
1563
|
-
allow.custom().to(authoringOperations),
|
|
1564
1546
|
]),
|
|
1565
1547
|
|
|
1566
1548
|
SemanticRelation: modelWithoutSubscriptions({
|
|
@@ -1611,7 +1593,6 @@ export const schema = a.schema({
|
|
|
1611
1593
|
])
|
|
1612
1594
|
.authorization((allow) => [
|
|
1613
1595
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1614
|
-
allow.custom().to(authoringOperations),
|
|
1615
1596
|
]),
|
|
1616
1597
|
|
|
1617
1598
|
Item: modelWithoutSubscriptions({
|
|
@@ -1625,6 +1606,7 @@ export const schema = a.schema({
|
|
|
1625
1606
|
changeReason: a.string(),
|
|
1626
1607
|
contentHash: a.string(),
|
|
1627
1608
|
type: a.string().required(),
|
|
1609
|
+
stage: a.string(),
|
|
1628
1610
|
status: a.string().required(),
|
|
1629
1611
|
typeStatus: a.string().required(),
|
|
1630
1612
|
slug: a.string().required(),
|
|
@@ -1658,10 +1640,10 @@ export const schema = a.schema({
|
|
|
1658
1640
|
index("typeStatus").sortKeys(["publishedAt"]).queryField("listItemsByTypeStatusAndPublishedAt"),
|
|
1659
1641
|
index("sectionStatus").sortKeys(["publishedAt"]).queryField("listItemsBySectionStatusAndPublishedAt"),
|
|
1660
1642
|
index("versionState").sortKeys(["updatedAt"]).queryField("listItemsByVersionStateAndUpdatedAt"),
|
|
1643
|
+
index("stage").sortKeys(["updatedAt"]).queryField("listItemsByStageAndUpdatedAt"),
|
|
1661
1644
|
])
|
|
1662
1645
|
.authorization((allow) => [
|
|
1663
1646
|
allow.groups(contentWriteGroups),
|
|
1664
|
-
allow.custom().to(authoringOperations),
|
|
1665
1647
|
]),
|
|
1666
1648
|
|
|
1667
1649
|
Tag: modelWithoutSubscriptions({
|
|
@@ -1678,7 +1660,6 @@ export const schema = a.schema({
|
|
|
1678
1660
|
])
|
|
1679
1661
|
.authorization((allow) => [
|
|
1680
1662
|
allow.groups(contentWriteGroups),
|
|
1681
|
-
allow.custom().to(authoringOperations),
|
|
1682
1663
|
]),
|
|
1683
1664
|
|
|
1684
1665
|
ItemTag: modelWithoutSubscriptions({
|
|
@@ -1698,7 +1679,6 @@ export const schema = a.schema({
|
|
|
1698
1679
|
])
|
|
1699
1680
|
.authorization((allow) => [
|
|
1700
1681
|
allow.groups(contentWriteGroups),
|
|
1701
|
-
allow.custom().to(authoringOperations),
|
|
1702
1682
|
]),
|
|
1703
1683
|
|
|
1704
1684
|
MediaAsset: modelWithoutSubscriptions({
|
|
@@ -1731,7 +1711,6 @@ export const schema = a.schema({
|
|
|
1731
1711
|
])
|
|
1732
1712
|
.authorization((allow) => [
|
|
1733
1713
|
allow.groups(contentWriteGroups),
|
|
1734
|
-
allow.custom().to(authoringOperations),
|
|
1735
1714
|
]),
|
|
1736
1715
|
|
|
1737
1716
|
Edition: modelWithoutSubscriptions({
|
|
@@ -1763,7 +1742,6 @@ export const schema = a.schema({
|
|
|
1763
1742
|
])
|
|
1764
1743
|
.authorization((allow) => [
|
|
1765
1744
|
allow.groups(contentWriteGroups),
|
|
1766
|
-
allow.custom().to(authoringOperations),
|
|
1767
1745
|
]),
|
|
1768
1746
|
|
|
1769
1747
|
EditionItem: modelWithoutSubscriptions({
|
|
@@ -1786,7 +1764,6 @@ export const schema = a.schema({
|
|
|
1786
1764
|
])
|
|
1787
1765
|
.authorization((allow) => [
|
|
1788
1766
|
allow.groups(contentWriteGroups),
|
|
1789
|
-
allow.custom().to(authoringOperations),
|
|
1790
1767
|
]),
|
|
1791
1768
|
|
|
1792
1769
|
PublishedItem: modelWithoutSubscriptions({
|
|
@@ -1827,7 +1804,6 @@ export const schema = a.schema({
|
|
|
1827
1804
|
.authorization((allow) => [
|
|
1828
1805
|
allow.guest().to(["read"]),
|
|
1829
1806
|
allow.groups(contentWriteGroups),
|
|
1830
|
-
allow.custom().to(authoringOperations),
|
|
1831
1807
|
]),
|
|
1832
1808
|
|
|
1833
1809
|
PublishedMediaAsset: modelWithoutSubscriptions({
|
|
@@ -1863,7 +1839,6 @@ export const schema = a.schema({
|
|
|
1863
1839
|
.authorization((allow) => [
|
|
1864
1840
|
allow.guest().to(["read"]),
|
|
1865
1841
|
allow.groups(contentWriteGroups),
|
|
1866
|
-
allow.custom().to(authoringOperations),
|
|
1867
1842
|
]),
|
|
1868
1843
|
|
|
1869
1844
|
PublishedEdition: modelWithoutSubscriptions({
|
|
@@ -1889,7 +1864,6 @@ export const schema = a.schema({
|
|
|
1889
1864
|
.authorization((allow) => [
|
|
1890
1865
|
allow.guest().to(["read"]),
|
|
1891
1866
|
allow.groups(contentWriteGroups),
|
|
1892
|
-
allow.custom().to(authoringOperations),
|
|
1893
1867
|
]),
|
|
1894
1868
|
|
|
1895
1869
|
PublishedEditionItem: modelWithoutSubscriptions({
|
|
@@ -1914,7 +1888,6 @@ export const schema = a.schema({
|
|
|
1914
1888
|
.authorization((allow) => [
|
|
1915
1889
|
allow.guest().to(["read"]),
|
|
1916
1890
|
allow.groups(contentWriteGroups),
|
|
1917
|
-
allow.custom().to(authoringOperations),
|
|
1918
1891
|
]),
|
|
1919
1892
|
|
|
1920
1893
|
PublishedCategorySet: modelWithoutSubscriptions({
|
|
@@ -1940,7 +1913,6 @@ export const schema = a.schema({
|
|
|
1940
1913
|
.authorization((allow) => [
|
|
1941
1914
|
allow.guest().to(["read"]),
|
|
1942
1915
|
allow.groups(contentWriteGroups),
|
|
1943
|
-
allow.custom().to(authoringOperations),
|
|
1944
1916
|
]),
|
|
1945
1917
|
|
|
1946
1918
|
PublishedCategory: modelWithoutSubscriptions({
|
|
@@ -1976,9 +1948,10 @@ export const schema = a.schema({
|
|
|
1976
1948
|
.authorization((allow) => [
|
|
1977
1949
|
allow.guest().to(["read"]),
|
|
1978
1950
|
allow.groups(contentWriteGroups),
|
|
1979
|
-
allow.custom().to(authoringOperations),
|
|
1980
1951
|
]),
|
|
1981
|
-
}
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
export const schema = a.schema(baseDefinitions).authorization((allow) => [
|
|
1982
1955
|
allow.resource(categoryAction),
|
|
1983
1956
|
allow.resource(contentActions),
|
|
1984
1957
|
allow.resource(manageUserRole),
|
|
@@ -1987,4 +1960,16 @@ export const schema = a.schema({
|
|
|
1987
1960
|
allow.resource(procedureAction),
|
|
1988
1961
|
]);
|
|
1989
1962
|
|
|
1963
|
+
/** The deployed schema of a site that enables plugins: the base definitions plus what each plugin contributes (docs/plugins.md). */
|
|
1964
|
+
export function schemaWithPlugins(pluginDefinitions: Record<string, any>) {
|
|
1965
|
+
return a.schema({ ...baseDefinitions, ...pluginDefinitions } as typeof baseDefinitions).authorization((allow) => [
|
|
1966
|
+
allow.resource(categoryAction),
|
|
1967
|
+
allow.resource(contentActions),
|
|
1968
|
+
allow.resource(manageUserRole),
|
|
1969
|
+
allow.resource(modelAttachmentUpload),
|
|
1970
|
+
allow.resource(newsroomSummary),
|
|
1971
|
+
allow.resource(procedureAction),
|
|
1972
|
+
]);
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1990
1975
|
export type Schema = ClientSchema<typeof schema>;
|
|
@@ -4,6 +4,7 @@ import { Amplify } from "aws-amplify";
|
|
|
4
4
|
import { generateClient } from "aws-amplify/data";
|
|
5
5
|
import type { Schema } from "../../data/resource";
|
|
6
6
|
import { putJsonModelPayload, putTextModelPayload, readJsonModelPayload } from "../shared/model-payloads";
|
|
7
|
+
import { referenceCurationMetadata } from "../shared/reference-curation-metadata";
|
|
7
8
|
|
|
8
9
|
type ReviewHandler = Schema["reviewSteeringProposal"]["functionHandler"];
|
|
9
10
|
type ReferenceCurationHandler = Schema["reviewReferenceCuration"]["functionHandler"];
|
|
@@ -225,14 +226,15 @@ async function reviewReferenceCuration(event: Parameters<ReferenceCurationHandle
|
|
|
225
226
|
{ ownerKind: "message", ownerId: messageId, ownerLineageId: messageId },
|
|
226
227
|
"metadata",
|
|
227
228
|
"metadata",
|
|
228
|
-
{
|
|
229
|
+
referenceCurationMetadata({
|
|
229
230
|
action,
|
|
230
231
|
curationStatus: nextStatus,
|
|
231
232
|
reasonCode,
|
|
232
|
-
curationReasonCode: reasonCode,
|
|
233
233
|
referenceId,
|
|
234
234
|
referenceLineageId,
|
|
235
|
-
|
|
235
|
+
decisionRelationId: normalizeOptionalString(event.arguments.decisionRelationId),
|
|
236
|
+
shareable: event.arguments.shareable ?? null,
|
|
237
|
+
}),
|
|
236
238
|
{ filename: "metadata.json", now },
|
|
237
239
|
);
|
|
238
240
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
import json
|
|
5
|
-
import os
|
|
6
5
|
import sys
|
|
7
6
|
from pathlib import Path
|
|
8
7
|
from typing import Any
|
|
@@ -16,14 +15,6 @@ for root in SEARCH_PATHS:
|
|
|
16
15
|
sys.path.insert(0, str(root))
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
def _ensure_graphql_authoring_jwt() -> None:
|
|
20
|
-
if not os.environ.get("AWS_LAMBDA_FUNCTION_NAME", "").strip():
|
|
21
|
-
return
|
|
22
|
-
from papyrus_content.env import ensure_graphql_authoring_jwt # type: ignore
|
|
23
|
-
|
|
24
|
-
ensure_graphql_authoring_jwt()
|
|
25
|
-
|
|
26
|
-
|
|
27
18
|
def _error(code: str, message: str, *, retryable: bool = False) -> dict[str, Any]:
|
|
28
19
|
return {
|
|
29
20
|
"ok": False,
|
|
@@ -94,7 +85,6 @@ def _execute_tactus(arguments: dict[str, Any], web_ui_context: dict[str, Any] |
|
|
|
94
85
|
|
|
95
86
|
|
|
96
87
|
def main() -> None:
|
|
97
|
-
_ensure_graphql_authoring_jwt()
|
|
98
88
|
raw = sys.stdin.read()
|
|
99
89
|
payload = json.loads(raw or "{}")
|
|
100
90
|
mode = str(payload.get("mode") or "").strip()
|
|
@@ -19,11 +19,6 @@ export class ConsoleChatResponderStack extends NestedStack {
|
|
|
19
19
|
PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS: process.env.PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS || "900",
|
|
20
20
|
PAPYRUS_EXECUTE_TACTUS_RUNNER: process.env.PAPYRUS_EXECUTE_TACTUS_RUNNER || "/opt/papyrus/execute_tactus_runner.py",
|
|
21
21
|
PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS: process.env.PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS || "30",
|
|
22
|
-
PAPYRUS_JWT_ISSUER: process.env.PAPYRUS_JWT_ISSUER || "papyrus-cli",
|
|
23
|
-
PAPYRUS_JWT_SUBJECT: process.env.PAPYRUS_JWT_SUBJECT || "papyrus-cli",
|
|
24
|
-
PAPYRUS_JWT_AUDIENCE: process.env.PAPYRUS_JWT_AUDIENCE || "papyrus-authoring",
|
|
25
|
-
PAPYRUS_JWT_GROUPS: process.env.PAPYRUS_JWT_GROUPS || "editor",
|
|
26
|
-
...(props.amplifySsmEnvConfig ? { AMPLIFY_SSM_ENV_CONFIG: props.amplifySsmEnvConfig } : {}),
|
|
27
22
|
};
|
|
28
23
|
const imageUri = props.prebuiltImageUri?.trim() || process.env.PAPYRUS_CONSOLE_RESPONDER_IMAGE_URI?.trim() || "";
|
|
29
24
|
const allowLocalImageBuild = parseBooleanEnv(process.env.PAPYRUS_CONSOLE_RESPONDER_ALLOW_LOCAL_BUILD);
|
|
@@ -87,8 +82,6 @@ export class ConsoleChatResponderStack extends NestedStack {
|
|
|
87
82
|
],
|
|
88
83
|
}));
|
|
89
84
|
const stack = Stack.of(this);
|
|
90
|
-
// execute_tactus_runner mints PAPYRUS_GRAPHQL_JWT via boto3 get_parameters; branch policies
|
|
91
|
-
// often grant GetParameters on path prefixes, not GetParameter per secret name.
|
|
92
85
|
this.responderFunction.addToRolePolicy(new PolicyStatement({
|
|
93
86
|
effect: Effect.ALLOW,
|
|
94
87
|
actions: ["ssm:GetParameter", "ssm:GetParameters"],
|
|
@@ -12,7 +12,6 @@ export type ConsoleChatResponderStackProps = NestedStackProps & {
|
|
|
12
12
|
threadTable: ITable;
|
|
13
13
|
projectRoot: string;
|
|
14
14
|
graphqlEndpoint: string;
|
|
15
|
-
amplifySsmEnvConfig?: string;
|
|
16
15
|
responseTarget?: string;
|
|
17
16
|
model?: string;
|
|
18
17
|
prebuiltImageUri?: string;
|
|
@@ -36,11 +35,6 @@ export class ConsoleChatResponderStack extends NestedStack {
|
|
|
36
35
|
PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS: process.env.PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS || "900",
|
|
37
36
|
PAPYRUS_EXECUTE_TACTUS_RUNNER: process.env.PAPYRUS_EXECUTE_TACTUS_RUNNER || "/opt/papyrus/execute_tactus_runner.py",
|
|
38
37
|
PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS: process.env.PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS || "30",
|
|
39
|
-
PAPYRUS_JWT_ISSUER: process.env.PAPYRUS_JWT_ISSUER || "papyrus-cli",
|
|
40
|
-
PAPYRUS_JWT_SUBJECT: process.env.PAPYRUS_JWT_SUBJECT || "papyrus-cli",
|
|
41
|
-
PAPYRUS_JWT_AUDIENCE: process.env.PAPYRUS_JWT_AUDIENCE || "papyrus-authoring",
|
|
42
|
-
PAPYRUS_JWT_GROUPS: process.env.PAPYRUS_JWT_GROUPS || "editor",
|
|
43
|
-
...(props.amplifySsmEnvConfig ? { AMPLIFY_SSM_ENV_CONFIG: props.amplifySsmEnvConfig } : {}),
|
|
44
38
|
};
|
|
45
39
|
|
|
46
40
|
const imageUri = props.prebuiltImageUri?.trim() || process.env.PAPYRUS_CONSOLE_RESPONDER_IMAGE_URI?.trim() || "";
|
|
@@ -109,8 +103,6 @@ export class ConsoleChatResponderStack extends NestedStack {
|
|
|
109
103
|
],
|
|
110
104
|
}));
|
|
111
105
|
const stack = Stack.of(this);
|
|
112
|
-
// execute_tactus_runner mints PAPYRUS_GRAPHQL_JWT via boto3 get_parameters; branch policies
|
|
113
|
-
// often grant GetParameters on path prefixes, not GetParameter per secret name.
|
|
114
106
|
this.responderFunction.addToRolePolicy(new PolicyStatement({
|
|
115
107
|
effect: Effect.ALLOW,
|
|
116
108
|
actions: ["ssm:GetParameter", "ssm:GetParameters"],
|
|
@@ -3017,15 +3017,6 @@ fn optional_env(name: &str) -> Option<String> {
|
|
|
3017
3017
|
.filter(|value| !value.is_empty())
|
|
3018
3018
|
}
|
|
3019
3019
|
|
|
3020
|
-
fn normalize_jwt(token: String) -> String {
|
|
3021
|
-
token
|
|
3022
|
-
.trim()
|
|
3023
|
-
.trim_start_matches("Bearer ")
|
|
3024
|
-
.trim_start_matches("bearer ")
|
|
3025
|
-
.trim()
|
|
3026
|
-
.to_string()
|
|
3027
|
-
}
|
|
3028
|
-
|
|
3029
3020
|
fn format_error_chain(error: &anyhow::Error) -> String {
|
|
3030
3021
|
error
|
|
3031
3022
|
.chain()
|