@anthusai/papyrus 1.0.0-next.9 → 1.0.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/redirect-urls.js +54 -0
- package/amplify/auth/redirect-urls.ts +66 -0
- package/amplify/auth/resource.js +20 -5
- package/amplify/auth/resource.ts +27 -5
- package/amplify/data/resource.js +42 -80
- package/amplify/data/resource.ts +42 -80
- package/amplify/data/schema.js +45 -60
- package/amplify/data/schema.ts +47 -60
- 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/renditions/handler.py +120 -0
- package/amplify/functions/renditions/requirements.txt +4 -0
- 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 +143 -176
- package/amplify/site-backend.ts +181 -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/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 -0
- 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 +92 -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 -6
- 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 +148 -27
- package/infra/amplify-app-shell.ts +160 -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 +89 -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 +64 -1
- 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 +68 -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/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"),
|
|
@@ -885,7 +887,6 @@ export const schema = a.schema({
|
|
|
885
887
|
.authorization((allow) => [
|
|
886
888
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
887
889
|
allow.authenticated("identityPool").to(authoringOperations),
|
|
888
|
-
allow.custom().to(authoringOperations),
|
|
889
890
|
]),
|
|
890
891
|
|
|
891
892
|
AssignmentEvent: modelWithoutSubscriptions({
|
|
@@ -908,7 +909,6 @@ export const schema = a.schema({
|
|
|
908
909
|
])
|
|
909
910
|
.authorization((allow) => [
|
|
910
911
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
911
|
-
allow.custom().to(authoringOperations),
|
|
912
912
|
]),
|
|
913
913
|
|
|
914
914
|
ProcedureDefinition: modelWithoutSubscriptions({
|
|
@@ -933,7 +933,6 @@ export const schema = a.schema({
|
|
|
933
933
|
])
|
|
934
934
|
.authorization((allow) => [
|
|
935
935
|
allow.group(adminGroup),
|
|
936
|
-
allow.custom().to(authoringOperations),
|
|
937
936
|
]),
|
|
938
937
|
|
|
939
938
|
ProcedureVersion: modelWithoutSubscriptions({
|
|
@@ -960,7 +959,6 @@ export const schema = a.schema({
|
|
|
960
959
|
])
|
|
961
960
|
.authorization((allow) => [
|
|
962
961
|
allow.group(adminGroup),
|
|
963
|
-
allow.custom().to(authoringOperations),
|
|
964
962
|
]),
|
|
965
963
|
|
|
966
964
|
ProcedureRun: modelWithoutSubscriptions({
|
|
@@ -993,7 +991,6 @@ export const schema = a.schema({
|
|
|
993
991
|
.authorization((allow) => [
|
|
994
992
|
allow.group("editor").to(["read"]),
|
|
995
993
|
allow.group(adminGroup).to(authoringOperations),
|
|
996
|
-
allow.custom().to(authoringOperations),
|
|
997
994
|
]),
|
|
998
995
|
|
|
999
996
|
NewsroomSection: modelWithoutSubscriptions({
|
|
@@ -1021,7 +1018,6 @@ export const schema = a.schema({
|
|
|
1021
1018
|
])
|
|
1022
1019
|
.authorization((allow) => [
|
|
1023
1020
|
allow.groups(categoryWriteGroups),
|
|
1024
|
-
allow.custom().to(authoringOperations),
|
|
1025
1021
|
]),
|
|
1026
1022
|
|
|
1027
1023
|
KnowledgeCorpus: modelWithoutSubscriptions({
|
|
@@ -1039,7 +1035,6 @@ export const schema = a.schema({
|
|
|
1039
1035
|
])
|
|
1040
1036
|
.authorization((allow) => [
|
|
1041
1037
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1042
|
-
allow.custom().to(authoringOperations),
|
|
1043
1038
|
]),
|
|
1044
1039
|
|
|
1045
1040
|
KnowledgeImportRun: modelWithoutSubscriptions({
|
|
@@ -1067,7 +1062,6 @@ export const schema = a.schema({
|
|
|
1067
1062
|
])
|
|
1068
1063
|
.authorization((allow) => [
|
|
1069
1064
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1070
|
-
allow.custom().to(authoringOperations),
|
|
1071
1065
|
]),
|
|
1072
1066
|
|
|
1073
1067
|
KnowledgeRawPayload: modelWithoutSubscriptions({
|
|
@@ -1085,7 +1079,6 @@ export const schema = a.schema({
|
|
|
1085
1079
|
])
|
|
1086
1080
|
.authorization((allow) => [
|
|
1087
1081
|
allow.groups(categoryWriteGroups),
|
|
1088
|
-
allow.custom().to(authoringOperations),
|
|
1089
1082
|
]),
|
|
1090
1083
|
|
|
1091
1084
|
KnowledgeArtifact: modelWithoutSubscriptions({
|
|
@@ -1105,7 +1098,6 @@ export const schema = a.schema({
|
|
|
1105
1098
|
])
|
|
1106
1099
|
.authorization((allow) => [
|
|
1107
1100
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1108
|
-
allow.custom().to(authoringOperations),
|
|
1109
1101
|
]),
|
|
1110
1102
|
|
|
1111
1103
|
CategorySet: modelWithoutSubscriptions({
|
|
@@ -1135,7 +1127,6 @@ export const schema = a.schema({
|
|
|
1135
1127
|
])
|
|
1136
1128
|
.authorization((allow) => [
|
|
1137
1129
|
allow.groups(categoryWriteGroups),
|
|
1138
|
-
allow.custom().to(authoringOperations),
|
|
1139
1130
|
]),
|
|
1140
1131
|
|
|
1141
1132
|
Category: modelWithoutSubscriptions({
|
|
@@ -1177,7 +1168,6 @@ export const schema = a.schema({
|
|
|
1177
1168
|
])
|
|
1178
1169
|
.authorization((allow) => [
|
|
1179
1170
|
allow.groups(categoryWriteGroups),
|
|
1180
|
-
allow.custom().to(authoringOperations),
|
|
1181
1171
|
]),
|
|
1182
1172
|
|
|
1183
1173
|
CategoryKeyword: modelWithoutSubscriptions({
|
|
@@ -1206,7 +1196,6 @@ export const schema = a.schema({
|
|
|
1206
1196
|
])
|
|
1207
1197
|
.authorization((allow) => [
|
|
1208
1198
|
allow.groups(categoryWriteGroups),
|
|
1209
|
-
allow.custom().to(authoringOperations),
|
|
1210
1199
|
]),
|
|
1211
1200
|
|
|
1212
1201
|
LexicalSteeringRule: modelWithoutSubscriptions({
|
|
@@ -1235,7 +1224,6 @@ export const schema = a.schema({
|
|
|
1235
1224
|
])
|
|
1236
1225
|
.authorization((allow) => [
|
|
1237
1226
|
allow.groups(categoryWriteGroups),
|
|
1238
|
-
allow.custom().to(authoringOperations),
|
|
1239
1227
|
]),
|
|
1240
1228
|
|
|
1241
1229
|
SteeringProposal: modelWithoutSubscriptions({
|
|
@@ -1273,7 +1261,6 @@ export const schema = a.schema({
|
|
|
1273
1261
|
])
|
|
1274
1262
|
.authorization((allow) => [
|
|
1275
1263
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1276
|
-
allow.custom().to(authoringOperations),
|
|
1277
1264
|
]),
|
|
1278
1265
|
|
|
1279
1266
|
SteeringDecision: modelWithoutSubscriptions({
|
|
@@ -1293,7 +1280,6 @@ export const schema = a.schema({
|
|
|
1293
1280
|
])
|
|
1294
1281
|
.authorization((allow) => [
|
|
1295
1282
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1296
|
-
allow.custom().to(authoringOperations),
|
|
1297
1283
|
]),
|
|
1298
1284
|
|
|
1299
1285
|
Reference: realtimeModel({
|
|
@@ -1345,7 +1331,6 @@ export const schema = a.schema({
|
|
|
1345
1331
|
])
|
|
1346
1332
|
.authorization((allow) => [
|
|
1347
1333
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1348
|
-
allow.custom().to(authoringOperations),
|
|
1349
1334
|
]),
|
|
1350
1335
|
|
|
1351
1336
|
ReferenceAttachment: modelWithoutSubscriptions({
|
|
@@ -1375,7 +1360,6 @@ export const schema = a.schema({
|
|
|
1375
1360
|
])
|
|
1376
1361
|
.authorization((allow) => [
|
|
1377
1362
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1378
|
-
allow.custom().to(authoringOperations),
|
|
1379
1363
|
]),
|
|
1380
1364
|
|
|
1381
1365
|
SemanticNode: modelWithoutSubscriptions({
|
|
@@ -1397,6 +1381,11 @@ export const schema = a.schema({
|
|
|
1397
1381
|
displayName: a.string(),
|
|
1398
1382
|
description: a.string(),
|
|
1399
1383
|
aliases: a.string().array(),
|
|
1384
|
+
authorityScore: a.float(),
|
|
1385
|
+
authorityRank: a.integer(),
|
|
1386
|
+
acceptedReferenceMentionCount: a.integer(),
|
|
1387
|
+
distinctSourceKindCount: a.integer(),
|
|
1388
|
+
relationCount: a.integer(),
|
|
1400
1389
|
status: a.string().required(),
|
|
1401
1390
|
importRunId: a.id(),
|
|
1402
1391
|
createdAt: a.datetime(),
|
|
@@ -1413,7 +1402,6 @@ export const schema = a.schema({
|
|
|
1413
1402
|
])
|
|
1414
1403
|
.authorization((allow) => [
|
|
1415
1404
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1416
|
-
allow.custom().to(authoringOperations),
|
|
1417
1405
|
]),
|
|
1418
1406
|
|
|
1419
1407
|
Message: realtimeModel({
|
|
@@ -1462,7 +1450,6 @@ export const schema = a.schema({
|
|
|
1462
1450
|
])
|
|
1463
1451
|
.authorization((allow) => [
|
|
1464
1452
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1465
|
-
allow.custom().to(authoringOperations),
|
|
1466
1453
|
]),
|
|
1467
1454
|
|
|
1468
1455
|
MessageThread: realtimeModel({
|
|
@@ -1500,7 +1487,6 @@ export const schema = a.schema({
|
|
|
1500
1487
|
.authorization((allow) => [
|
|
1501
1488
|
allow.groups(categoryWriteGroups).to(["read", "create", "update"]),
|
|
1502
1489
|
allow.authenticated("identityPool").to(authoringOperations),
|
|
1503
|
-
allow.custom().to(authoringOperations),
|
|
1504
1490
|
]),
|
|
1505
1491
|
|
|
1506
1492
|
ModelAttachment: modelWithoutSubscriptions({
|
|
@@ -1532,7 +1518,6 @@ export const schema = a.schema({
|
|
|
1532
1518
|
])
|
|
1533
1519
|
.authorization((allow) => [
|
|
1534
1520
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1535
|
-
allow.custom().to(authoringOperations),
|
|
1536
1521
|
]),
|
|
1537
1522
|
|
|
1538
1523
|
SemanticRelationType: modelWithoutSubscriptions({
|
|
@@ -1560,7 +1545,6 @@ export const schema = a.schema({
|
|
|
1560
1545
|
])
|
|
1561
1546
|
.authorization((allow) => [
|
|
1562
1547
|
allow.groups(categoryWriteGroups),
|
|
1563
|
-
allow.custom().to(authoringOperations),
|
|
1564
1548
|
]),
|
|
1565
1549
|
|
|
1566
1550
|
SemanticRelation: modelWithoutSubscriptions({
|
|
@@ -1611,7 +1595,6 @@ export const schema = a.schema({
|
|
|
1611
1595
|
])
|
|
1612
1596
|
.authorization((allow) => [
|
|
1613
1597
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1614
|
-
allow.custom().to(authoringOperations),
|
|
1615
1598
|
]),
|
|
1616
1599
|
|
|
1617
1600
|
Item: modelWithoutSubscriptions({
|
|
@@ -1625,6 +1608,7 @@ export const schema = a.schema({
|
|
|
1625
1608
|
changeReason: a.string(),
|
|
1626
1609
|
contentHash: a.string(),
|
|
1627
1610
|
type: a.string().required(),
|
|
1611
|
+
stage: a.string(),
|
|
1628
1612
|
status: a.string().required(),
|
|
1629
1613
|
typeStatus: a.string().required(),
|
|
1630
1614
|
slug: a.string().required(),
|
|
@@ -1658,10 +1642,10 @@ export const schema = a.schema({
|
|
|
1658
1642
|
index("typeStatus").sortKeys(["publishedAt"]).queryField("listItemsByTypeStatusAndPublishedAt"),
|
|
1659
1643
|
index("sectionStatus").sortKeys(["publishedAt"]).queryField("listItemsBySectionStatusAndPublishedAt"),
|
|
1660
1644
|
index("versionState").sortKeys(["updatedAt"]).queryField("listItemsByVersionStateAndUpdatedAt"),
|
|
1645
|
+
index("stage").sortKeys(["updatedAt"]).queryField("listItemsByStageAndUpdatedAt"),
|
|
1661
1646
|
])
|
|
1662
1647
|
.authorization((allow) => [
|
|
1663
1648
|
allow.groups(contentWriteGroups),
|
|
1664
|
-
allow.custom().to(authoringOperations),
|
|
1665
1649
|
]),
|
|
1666
1650
|
|
|
1667
1651
|
Tag: modelWithoutSubscriptions({
|
|
@@ -1678,7 +1662,6 @@ export const schema = a.schema({
|
|
|
1678
1662
|
])
|
|
1679
1663
|
.authorization((allow) => [
|
|
1680
1664
|
allow.groups(contentWriteGroups),
|
|
1681
|
-
allow.custom().to(authoringOperations),
|
|
1682
1665
|
]),
|
|
1683
1666
|
|
|
1684
1667
|
ItemTag: modelWithoutSubscriptions({
|
|
@@ -1698,7 +1681,6 @@ export const schema = a.schema({
|
|
|
1698
1681
|
])
|
|
1699
1682
|
.authorization((allow) => [
|
|
1700
1683
|
allow.groups(contentWriteGroups),
|
|
1701
|
-
allow.custom().to(authoringOperations),
|
|
1702
1684
|
]),
|
|
1703
1685
|
|
|
1704
1686
|
MediaAsset: modelWithoutSubscriptions({
|
|
@@ -1731,7 +1713,6 @@ export const schema = a.schema({
|
|
|
1731
1713
|
])
|
|
1732
1714
|
.authorization((allow) => [
|
|
1733
1715
|
allow.groups(contentWriteGroups),
|
|
1734
|
-
allow.custom().to(authoringOperations),
|
|
1735
1716
|
]),
|
|
1736
1717
|
|
|
1737
1718
|
Edition: modelWithoutSubscriptions({
|
|
@@ -1763,7 +1744,6 @@ export const schema = a.schema({
|
|
|
1763
1744
|
])
|
|
1764
1745
|
.authorization((allow) => [
|
|
1765
1746
|
allow.groups(contentWriteGroups),
|
|
1766
|
-
allow.custom().to(authoringOperations),
|
|
1767
1747
|
]),
|
|
1768
1748
|
|
|
1769
1749
|
EditionItem: modelWithoutSubscriptions({
|
|
@@ -1786,7 +1766,6 @@ export const schema = a.schema({
|
|
|
1786
1766
|
])
|
|
1787
1767
|
.authorization((allow) => [
|
|
1788
1768
|
allow.groups(contentWriteGroups),
|
|
1789
|
-
allow.custom().to(authoringOperations),
|
|
1790
1769
|
]),
|
|
1791
1770
|
|
|
1792
1771
|
PublishedItem: modelWithoutSubscriptions({
|
|
@@ -1827,7 +1806,6 @@ export const schema = a.schema({
|
|
|
1827
1806
|
.authorization((allow) => [
|
|
1828
1807
|
allow.guest().to(["read"]),
|
|
1829
1808
|
allow.groups(contentWriteGroups),
|
|
1830
|
-
allow.custom().to(authoringOperations),
|
|
1831
1809
|
]),
|
|
1832
1810
|
|
|
1833
1811
|
PublishedMediaAsset: modelWithoutSubscriptions({
|
|
@@ -1863,7 +1841,6 @@ export const schema = a.schema({
|
|
|
1863
1841
|
.authorization((allow) => [
|
|
1864
1842
|
allow.guest().to(["read"]),
|
|
1865
1843
|
allow.groups(contentWriteGroups),
|
|
1866
|
-
allow.custom().to(authoringOperations),
|
|
1867
1844
|
]),
|
|
1868
1845
|
|
|
1869
1846
|
PublishedEdition: modelWithoutSubscriptions({
|
|
@@ -1889,7 +1866,6 @@ export const schema = a.schema({
|
|
|
1889
1866
|
.authorization((allow) => [
|
|
1890
1867
|
allow.guest().to(["read"]),
|
|
1891
1868
|
allow.groups(contentWriteGroups),
|
|
1892
|
-
allow.custom().to(authoringOperations),
|
|
1893
1869
|
]),
|
|
1894
1870
|
|
|
1895
1871
|
PublishedEditionItem: modelWithoutSubscriptions({
|
|
@@ -1914,7 +1890,6 @@ export const schema = a.schema({
|
|
|
1914
1890
|
.authorization((allow) => [
|
|
1915
1891
|
allow.guest().to(["read"]),
|
|
1916
1892
|
allow.groups(contentWriteGroups),
|
|
1917
|
-
allow.custom().to(authoringOperations),
|
|
1918
1893
|
]),
|
|
1919
1894
|
|
|
1920
1895
|
PublishedCategorySet: modelWithoutSubscriptions({
|
|
@@ -1940,7 +1915,6 @@ export const schema = a.schema({
|
|
|
1940
1915
|
.authorization((allow) => [
|
|
1941
1916
|
allow.guest().to(["read"]),
|
|
1942
1917
|
allow.groups(contentWriteGroups),
|
|
1943
|
-
allow.custom().to(authoringOperations),
|
|
1944
1918
|
]),
|
|
1945
1919
|
|
|
1946
1920
|
PublishedCategory: modelWithoutSubscriptions({
|
|
@@ -1976,9 +1950,10 @@ export const schema = a.schema({
|
|
|
1976
1950
|
.authorization((allow) => [
|
|
1977
1951
|
allow.guest().to(["read"]),
|
|
1978
1952
|
allow.groups(contentWriteGroups),
|
|
1979
|
-
allow.custom().to(authoringOperations),
|
|
1980
1953
|
]),
|
|
1981
|
-
}
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1956
|
+
export const schema = a.schema(baseDefinitions).authorization((allow) => [
|
|
1982
1957
|
allow.resource(categoryAction),
|
|
1983
1958
|
allow.resource(contentActions),
|
|
1984
1959
|
allow.resource(manageUserRole),
|
|
@@ -1987,4 +1962,16 @@ export const schema = a.schema({
|
|
|
1987
1962
|
allow.resource(procedureAction),
|
|
1988
1963
|
]);
|
|
1989
1964
|
|
|
1965
|
+
/** The deployed schema of a site that enables plugins: the base definitions plus what each plugin contributes (docs/plugins.md). */
|
|
1966
|
+
export function schemaWithPlugins(pluginDefinitions: Record<string, any>) {
|
|
1967
|
+
return a.schema({ ...baseDefinitions, ...pluginDefinitions } as typeof baseDefinitions).authorization((allow) => [
|
|
1968
|
+
allow.resource(categoryAction),
|
|
1969
|
+
allow.resource(contentActions),
|
|
1970
|
+
allow.resource(manageUserRole),
|
|
1971
|
+
allow.resource(modelAttachmentUpload),
|
|
1972
|
+
allow.resource(newsroomSummary),
|
|
1973
|
+
allow.resource(procedureAction),
|
|
1974
|
+
]);
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1990
1977
|
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()
|