@anthusai/papyrus 1.0.0-next.2 → 1.0.0-next.21
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/resource.js +17 -4
- package/amplify/auth/resource.ts +21 -4
- package/amplify/data/resource.js +52 -70
- package/amplify/data/resource.ts +57 -70
- package/amplify/data/schema.js +52 -58
- package/amplify/data/schema.ts +57 -58
- 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 +149 -0
- package/amplify/functions/content-actions/requirements.txt +4 -0
- package/amplify/functions/content-actions/resource.js +40 -0
- package/amplify/functions/content-actions/resource.ts +54 -0
- package/amplify/functions/shared/python-bundle.js +17 -2
- package/amplify/functions/shared/python-bundle.ts +23 -2
- package/amplify/rebuild-trigger-settings.js +22 -0
- package/amplify/rebuild-trigger-settings.ts +42 -0
- package/amplify/site-backend-config.ts +12 -1
- package/amplify/site-backend.js +51 -27
- package/amplify/site-backend.ts +66 -34
- package/amplify/storage/resource.js +3 -0
- package/amplify/storage/resource.ts +3 -0
- package/app/%5F_preview/[[...path]]/route.ts +8 -0
- package/app/[year]/[month]/[day]/[articleSlug]/page.tsx +4 -2
- package/app/[year]/[month]/[day]/edition-route-page.tsx +2 -0
- package/app/api/revalidate/route.ts +8 -7
- package/app/articles/[slug]/page.tsx +6 -4
- package/app/blog-rhythm.css +278 -0
- package/app/globals.css +22 -4
- package/app/layout.tsx +24 -12
- package/app/newsroom/articles/[id]/page.tsx +15 -0
- package/app/newsroom/articles/page.tsx +13 -0
- package/app/page.tsx +12 -4
- package/app/robots.ts +11 -0
- package/bin/papyrus-app.mjs +12 -2
- package/bin/papyrus-infra.mjs +74 -18
- package/components/archive-shell.tsx +2 -22
- package/components/article-video.tsx +247 -3
- package/components/blog-page-background.tsx +23 -6
- package/components/markus-ir-preview.tsx +300 -0
- package/components/news-desk-page.tsx +1 -4
- package/components/newspaper.tsx +6 -2
- package/components/newsroom-access-gate.tsx +66 -0
- package/components/newsroom-article-editor.tsx +741 -0
- package/components/newsroom-articles-view.tsx +129 -0
- package/components/newsroom-ops-overview.tsx +28 -11
- package/components/newsroom-ops-shell.tsx +3 -1
- package/components/pictogram-figure.tsx +9 -2
- package/components/presentation-header.tsx +135 -0
- package/components/presentation-rhythm-hrule.tsx +17 -0
- package/components/settings-page.tsx +2 -1
- package/components/staging-banner.tsx +11 -0
- package/components/topic-steering-workspace.tsx +1 -59
- package/components/use-blog-header-obstacles.ts +81 -0
- package/components/use-brand-fonts-ready.ts +28 -0
- package/components/use-rhythm-overlay.ts +29 -0
- package/infra/amplify-app-shell.js +285 -80
- package/infra/amplify-app-shell.ts +326 -113
- package/infra/build-specs.js +94 -0
- package/infra/build-specs.ts +141 -0
- package/infra/github-oidc-provider.js +24 -0
- package/infra/github-oidc-provider.ts +30 -0
- package/infra/index.js +3 -0
- package/infra/site-config.js +273 -0
- package/infra/site-config.ts +336 -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 +14 -1
- package/lib/category-repository.ts +1 -93
- package/lib/content-actions-client.ts +98 -0
- package/lib/content-actions-demo.ts +190 -0
- package/lib/content-repository.ts +6 -0
- package/lib/content-source-context.ts +26 -0
- package/lib/content-types.ts +4 -0
- package/lib/edition-routes.ts +31 -29
- package/lib/empty-theme.css +1 -0
- package/lib/graphql-content-repository.ts +239 -43
- package/lib/layout-scenarios.ts +8 -8
- package/lib/newspaper-layout.ts +3 -2
- package/lib/newsroom-articles.ts +325 -0
- package/lib/newsroom-demo-articles.ts +90 -0
- package/lib/newsroom-media-backend.ts +142 -0
- package/lib/newsroom-media.ts +182 -0
- package/lib/newsroom-nav.ts +3 -0
- package/lib/papyrus-web-locations.ts +7 -6
- package/lib/presentation-footer.ts +3 -2
- package/lib/pretext-layout.ts +12 -3
- package/lib/reader-base-path.ts +24 -0
- package/lib/reader-static-params.ts +8 -0
- package/lib/renderer.ts +7 -0
- package/lib/revalidate-secret.ts +59 -0
- package/lib/root-route-redirect.ts +16 -0
- package/lib/site-brand-tenant.ts +3 -22
- package/lib/site-brand.ts +95 -42
- package/lib/site-env.ts +52 -0
- package/lib/staging-gate.ts +37 -0
- package/lib/staging-gated-path.ts +22 -0
- package/lib/staging-preview-object.ts +98 -0
- package/lib/video-mode.ts +42 -0
- package/lib/video-script.ts +77 -0
- package/middleware.ts +56 -42
- package/package.json +40 -1
- package/renderers/pretext/article-page.tsx +40 -9
- package/renderers/pretext/presentation-shared.tsx +113 -0
- package/renderers/pretext/presentation-shell.tsx +18 -112
- 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 +37 -2
- package/scripts/videoml/build-browser-bundle.mjs +22 -0
- package/scripts/videoml/build-preview-bundle.mjs +50 -0
- package/scripts/videoml/bundle-common.mjs +129 -0
- package/scripts/videoml/preview/preview-entry.tsx +381 -0
- package/scripts/videoml/preview/preview-stage-fit.ts +28 -0
- package/scripts/videoml/preview/preview-timing.ts +42 -0
- package/scripts/videoml/preview.html +77 -0
- package/scripts/videoml/standard-entry.tsx +46 -0
- package/src/sync.mjs +30 -6
- package/src/with-papyrus.mjs +15 -2
- 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/publications/anth_us/brand.ts +0 -68
- package/publications/anth_us/theme.css +0 -66
- package/publications/pilobol_us/brand.ts +0 -37
- package/publications/pilobol_us/theme.css +0 -140
- package/publications/threat_intelligence/blog-defense/graph.ts +0 -636
- package/publications/threat_intelligence/blog-defense/layout.ts +0 -934
- package/publications/threat_intelligence/blog-defense/page-background.tsx +0 -590
- package/publications/threat_intelligence/brand.ts +0 -40
- package/publications/threat_intelligence/pictograms/art.tsx +0 -608
- package/publications/threat_intelligence/pictograms/figure.tsx +0 -82
- package/publications/threat_intelligence/pictograms/registry.ts +0 -30
- package/publications/threat_intelligence/pictograms/system.tsx +0 -305
- package/publications/threat_intelligence/seed/seed-edition-content.json +0 -629
- package/publications/threat_intelligence/theme.css +0 -1440
- /package/{publications/papyrus/theme.css → app/papyrus-theme.css} +0 -0
package/amplify/data/schema.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ClientSchema, a } from "@aws-amplify/backend";
|
|
2
2
|
import { assignmentAction } from "../functions/assignment-action/resource";
|
|
3
3
|
import { categoryAction } from "../functions/category-action/resource";
|
|
4
|
+
import { contentActions } from "../functions/content-actions/resource";
|
|
4
5
|
import { knowledgeQuery } from "../functions/knowledge-query/resource";
|
|
5
6
|
import { manageUserRole } from "../functions/manage-user-role/resource";
|
|
6
7
|
import { modelAttachmentUpload } from "../functions/model-attachment-upload/resource";
|
|
@@ -271,7 +272,6 @@ export const schema = a.schema({
|
|
|
271
272
|
.returns(a.ref("ReferenceCurationActionResult"))
|
|
272
273
|
.authorization((allow) => [
|
|
273
274
|
allow.groups(categoryWriteGroups),
|
|
274
|
-
allow.custom(),
|
|
275
275
|
])
|
|
276
276
|
.handler(a.handler.function(categoryAction)),
|
|
277
277
|
|
|
@@ -287,7 +287,6 @@ export const schema = a.schema({
|
|
|
287
287
|
.returns(a.ref("ReferenceQualityActionResult"))
|
|
288
288
|
.authorization((allow) => [
|
|
289
289
|
allow.groups(categoryWriteGroups),
|
|
290
|
-
allow.custom(),
|
|
291
290
|
])
|
|
292
291
|
.handler(a.handler.function(categoryAction)),
|
|
293
292
|
|
|
@@ -399,16 +398,51 @@ export const schema = a.schema({
|
|
|
399
398
|
getNewsroomSummary: a
|
|
400
399
|
.query()
|
|
401
400
|
.returns(a.ref("NewsroomSummary"))
|
|
402
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
401
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
403
402
|
.handler(a.handler.function(newsroomSummary)),
|
|
404
403
|
|
|
404
|
+
deriveMarkus: a
|
|
405
|
+
.query()
|
|
406
|
+
.arguments({ input: a.json().required() })
|
|
407
|
+
.returns(a.json())
|
|
408
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
409
|
+
.handler(a.handler.function(contentActions)),
|
|
410
|
+
|
|
411
|
+
saveItemDraft: a
|
|
412
|
+
.mutation()
|
|
413
|
+
.arguments({ input: a.json().required() })
|
|
414
|
+
.returns(a.json())
|
|
415
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
416
|
+
.handler(a.handler.function(contentActions)),
|
|
417
|
+
|
|
418
|
+
publishItem: a
|
|
419
|
+
.mutation()
|
|
420
|
+
.arguments({ input: a.json().required() })
|
|
421
|
+
.returns(a.json())
|
|
422
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
423
|
+
.handler(a.handler.function(contentActions)),
|
|
424
|
+
|
|
425
|
+
unpublishItem: a
|
|
426
|
+
.mutation()
|
|
427
|
+
.arguments({ input: a.json().required() })
|
|
428
|
+
.returns(a.json())
|
|
429
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
430
|
+
.handler(a.handler.function(contentActions)),
|
|
431
|
+
|
|
432
|
+
requestStagingBuild: a
|
|
433
|
+
.mutation()
|
|
434
|
+
.arguments({ input: a.json().required() })
|
|
435
|
+
.returns(a.json())
|
|
436
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
437
|
+
.handler(a.handler.function(contentActions)),
|
|
438
|
+
|
|
405
439
|
knowledgeQuery: a
|
|
406
440
|
.query()
|
|
407
441
|
.arguments({
|
|
408
442
|
input: a.json().required(),
|
|
409
443
|
})
|
|
410
444
|
.returns(a.json())
|
|
411
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
445
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
412
446
|
.handler(a.handler.function(knowledgeQuery)),
|
|
413
447
|
|
|
414
448
|
updateNewsroomSummary: a
|
|
@@ -419,7 +453,7 @@ export const schema = a.schema({
|
|
|
419
453
|
reason: a.string(),
|
|
420
454
|
})
|
|
421
455
|
.returns(a.ref("NewsroomSummary"))
|
|
422
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
456
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
423
457
|
.handler(a.handler.function(newsroomSummary)),
|
|
424
458
|
|
|
425
459
|
ModelAttachmentUploadSlot: a.customType({
|
|
@@ -479,7 +513,7 @@ export const schema = a.schema({
|
|
|
479
513
|
status: a.string(),
|
|
480
514
|
})
|
|
481
515
|
.returns(a.ref("ModelAttachmentUploadSlot"))
|
|
482
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
516
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
483
517
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
484
518
|
|
|
485
519
|
completeModelAttachmentUpload: a
|
|
@@ -501,7 +535,7 @@ export const schema = a.schema({
|
|
|
501
535
|
status: a.string(),
|
|
502
536
|
})
|
|
503
537
|
.returns(a.ref("ModelAttachment"))
|
|
504
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
538
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
505
539
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
506
540
|
|
|
507
541
|
abortModelAttachmentUpload: a
|
|
@@ -523,7 +557,7 @@ export const schema = a.schema({
|
|
|
523
557
|
status: a.string(),
|
|
524
558
|
})
|
|
525
559
|
.returns(a.ref("ModelAttachmentUploadAbortResult"))
|
|
526
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
560
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
527
561
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
528
562
|
|
|
529
563
|
createModelAttachmentDownload: a
|
|
@@ -532,7 +566,7 @@ export const schema = a.schema({
|
|
|
532
566
|
attachmentId: a.id().required(),
|
|
533
567
|
})
|
|
534
568
|
.returns(a.ref("ModelAttachmentDownloadSlot"))
|
|
535
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
569
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
536
570
|
.handler(a.handler.function(modelAttachmentUpload)),
|
|
537
571
|
|
|
538
572
|
AssignmentActionResult: a.customType({
|
|
@@ -626,7 +660,7 @@ export const schema = a.schema({
|
|
|
626
660
|
limit: a.integer(),
|
|
627
661
|
})
|
|
628
662
|
.returns(a.ref("AssignmentContext").array().required())
|
|
629
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
663
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
630
664
|
.handler(a.handler.function(assignmentAction)),
|
|
631
665
|
|
|
632
666
|
listAssignmentQueue: a
|
|
@@ -637,7 +671,7 @@ export const schema = a.schema({
|
|
|
637
671
|
limit: a.integer(),
|
|
638
672
|
})
|
|
639
673
|
.returns(a.ref("AssignmentContext").array().required())
|
|
640
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
674
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
641
675
|
.handler(a.handler.function(assignmentAction)),
|
|
642
676
|
|
|
643
677
|
getAssignmentContext: a
|
|
@@ -646,7 +680,7 @@ export const schema = a.schema({
|
|
|
646
680
|
assignmentId: a.id().required(),
|
|
647
681
|
})
|
|
648
682
|
.returns(a.ref("AssignmentContext"))
|
|
649
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
683
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
650
684
|
.handler(a.handler.function(assignmentAction)),
|
|
651
685
|
|
|
652
686
|
claimAssignment: a
|
|
@@ -663,7 +697,7 @@ export const schema = a.schema({
|
|
|
663
697
|
note: a.string(),
|
|
664
698
|
})
|
|
665
699
|
.returns(a.ref("AssignmentActionResult"))
|
|
666
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
700
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
667
701
|
.handler(a.handler.function(assignmentAction)),
|
|
668
702
|
|
|
669
703
|
releaseAssignment: a
|
|
@@ -675,7 +709,7 @@ export const schema = a.schema({
|
|
|
675
709
|
note: a.string(),
|
|
676
710
|
})
|
|
677
711
|
.returns(a.ref("AssignmentActionResult"))
|
|
678
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
712
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
679
713
|
.handler(a.handler.function(assignmentAction)),
|
|
680
714
|
|
|
681
715
|
completeAssignment: a
|
|
@@ -687,7 +721,7 @@ export const schema = a.schema({
|
|
|
687
721
|
note: a.string(),
|
|
688
722
|
})
|
|
689
723
|
.returns(a.ref("AssignmentActionResult"))
|
|
690
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
724
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
691
725
|
.handler(a.handler.function(assignmentAction)),
|
|
692
726
|
|
|
693
727
|
cancelAssignment: a
|
|
@@ -699,7 +733,7 @@ export const schema = a.schema({
|
|
|
699
733
|
note: a.string(),
|
|
700
734
|
})
|
|
701
735
|
.returns(a.ref("AssignmentActionResult"))
|
|
702
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
736
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
703
737
|
.handler(a.handler.function(assignmentAction)),
|
|
704
738
|
|
|
705
739
|
reopenAssignment: a
|
|
@@ -711,7 +745,7 @@ export const schema = a.schema({
|
|
|
711
745
|
note: a.string(),
|
|
712
746
|
})
|
|
713
747
|
.returns(a.ref("AssignmentActionResult"))
|
|
714
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
748
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
715
749
|
.handler(a.handler.function(assignmentAction)),
|
|
716
750
|
|
|
717
751
|
retryImmediateAssignment: a
|
|
@@ -723,7 +757,7 @@ export const schema = a.schema({
|
|
|
723
757
|
note: a.string(),
|
|
724
758
|
})
|
|
725
759
|
.returns(a.ref("AssignmentActionResult"))
|
|
726
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
760
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
727
761
|
.handler(a.handler.function(assignmentAction)),
|
|
728
762
|
|
|
729
763
|
listNewsroomProcedureDefinitions: a
|
|
@@ -739,7 +773,7 @@ export const schema = a.schema({
|
|
|
739
773
|
procedureKey: a.string(),
|
|
740
774
|
})
|
|
741
775
|
.returns(a.json())
|
|
742
|
-
.authorization((allow) => [allow.group(adminGroup)
|
|
776
|
+
.authorization((allow) => [allow.group(adminGroup)])
|
|
743
777
|
.handler(a.handler.function(procedureAction)),
|
|
744
778
|
|
|
745
779
|
saveNewsroomProcedureDefinition: a
|
|
@@ -781,7 +815,7 @@ export const schema = a.schema({
|
|
|
781
815
|
actorLabel: a.string(),
|
|
782
816
|
})
|
|
783
817
|
.returns(a.json())
|
|
784
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
818
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
785
819
|
.handler(a.handler.function(procedureAction)),
|
|
786
820
|
|
|
787
821
|
getNewsroomProcedureRun: a
|
|
@@ -790,7 +824,7 @@ export const schema = a.schema({
|
|
|
790
824
|
id: a.id().required(),
|
|
791
825
|
})
|
|
792
826
|
.returns(a.json())
|
|
793
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
827
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
794
828
|
.handler(a.handler.function(procedureAction)),
|
|
795
829
|
|
|
796
830
|
listNewsroomProcedureRunsByProcedure: a
|
|
@@ -799,7 +833,7 @@ export const schema = a.schema({
|
|
|
799
833
|
procedureId: a.id().required(),
|
|
800
834
|
})
|
|
801
835
|
.returns(a.json())
|
|
802
|
-
.authorization((allow) => [allow.groups(categoryWriteGroups)
|
|
836
|
+
.authorization((allow) => [allow.groups(categoryWriteGroups)])
|
|
803
837
|
.handler(a.handler.function(procedureAction)),
|
|
804
838
|
|
|
805
839
|
Assignment: modelWithoutSubscriptions({
|
|
@@ -849,7 +883,6 @@ export const schema = a.schema({
|
|
|
849
883
|
.authorization((allow) => [
|
|
850
884
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
851
885
|
allow.authenticated("identityPool").to(authoringOperations),
|
|
852
|
-
allow.custom().to(authoringOperations),
|
|
853
886
|
]),
|
|
854
887
|
|
|
855
888
|
AssignmentEvent: modelWithoutSubscriptions({
|
|
@@ -872,7 +905,6 @@ export const schema = a.schema({
|
|
|
872
905
|
])
|
|
873
906
|
.authorization((allow) => [
|
|
874
907
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
875
|
-
allow.custom().to(authoringOperations),
|
|
876
908
|
]),
|
|
877
909
|
|
|
878
910
|
ProcedureDefinition: modelWithoutSubscriptions({
|
|
@@ -897,7 +929,6 @@ export const schema = a.schema({
|
|
|
897
929
|
])
|
|
898
930
|
.authorization((allow) => [
|
|
899
931
|
allow.group(adminGroup),
|
|
900
|
-
allow.custom().to(authoringOperations),
|
|
901
932
|
]),
|
|
902
933
|
|
|
903
934
|
ProcedureVersion: modelWithoutSubscriptions({
|
|
@@ -924,7 +955,6 @@ export const schema = a.schema({
|
|
|
924
955
|
])
|
|
925
956
|
.authorization((allow) => [
|
|
926
957
|
allow.group(adminGroup),
|
|
927
|
-
allow.custom().to(authoringOperations),
|
|
928
958
|
]),
|
|
929
959
|
|
|
930
960
|
ProcedureRun: modelWithoutSubscriptions({
|
|
@@ -957,7 +987,6 @@ export const schema = a.schema({
|
|
|
957
987
|
.authorization((allow) => [
|
|
958
988
|
allow.group("editor").to(["read"]),
|
|
959
989
|
allow.group(adminGroup).to(authoringOperations),
|
|
960
|
-
allow.custom().to(authoringOperations),
|
|
961
990
|
]),
|
|
962
991
|
|
|
963
992
|
NewsroomSection: modelWithoutSubscriptions({
|
|
@@ -985,7 +1014,6 @@ export const schema = a.schema({
|
|
|
985
1014
|
])
|
|
986
1015
|
.authorization((allow) => [
|
|
987
1016
|
allow.groups(categoryWriteGroups),
|
|
988
|
-
allow.custom().to(authoringOperations),
|
|
989
1017
|
]),
|
|
990
1018
|
|
|
991
1019
|
KnowledgeCorpus: modelWithoutSubscriptions({
|
|
@@ -1003,7 +1031,6 @@ export const schema = a.schema({
|
|
|
1003
1031
|
])
|
|
1004
1032
|
.authorization((allow) => [
|
|
1005
1033
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1006
|
-
allow.custom().to(authoringOperations),
|
|
1007
1034
|
]),
|
|
1008
1035
|
|
|
1009
1036
|
KnowledgeImportRun: modelWithoutSubscriptions({
|
|
@@ -1031,7 +1058,6 @@ export const schema = a.schema({
|
|
|
1031
1058
|
])
|
|
1032
1059
|
.authorization((allow) => [
|
|
1033
1060
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1034
|
-
allow.custom().to(authoringOperations),
|
|
1035
1061
|
]),
|
|
1036
1062
|
|
|
1037
1063
|
KnowledgeRawPayload: modelWithoutSubscriptions({
|
|
@@ -1049,7 +1075,6 @@ export const schema = a.schema({
|
|
|
1049
1075
|
])
|
|
1050
1076
|
.authorization((allow) => [
|
|
1051
1077
|
allow.groups(categoryWriteGroups),
|
|
1052
|
-
allow.custom().to(authoringOperations),
|
|
1053
1078
|
]),
|
|
1054
1079
|
|
|
1055
1080
|
KnowledgeArtifact: modelWithoutSubscriptions({
|
|
@@ -1069,7 +1094,6 @@ export const schema = a.schema({
|
|
|
1069
1094
|
])
|
|
1070
1095
|
.authorization((allow) => [
|
|
1071
1096
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1072
|
-
allow.custom().to(authoringOperations),
|
|
1073
1097
|
]),
|
|
1074
1098
|
|
|
1075
1099
|
CategorySet: modelWithoutSubscriptions({
|
|
@@ -1099,7 +1123,6 @@ export const schema = a.schema({
|
|
|
1099
1123
|
])
|
|
1100
1124
|
.authorization((allow) => [
|
|
1101
1125
|
allow.groups(categoryWriteGroups),
|
|
1102
|
-
allow.custom().to(authoringOperations),
|
|
1103
1126
|
]),
|
|
1104
1127
|
|
|
1105
1128
|
Category: modelWithoutSubscriptions({
|
|
@@ -1141,7 +1164,6 @@ export const schema = a.schema({
|
|
|
1141
1164
|
])
|
|
1142
1165
|
.authorization((allow) => [
|
|
1143
1166
|
allow.groups(categoryWriteGroups),
|
|
1144
|
-
allow.custom().to(authoringOperations),
|
|
1145
1167
|
]),
|
|
1146
1168
|
|
|
1147
1169
|
CategoryKeyword: modelWithoutSubscriptions({
|
|
@@ -1170,7 +1192,6 @@ export const schema = a.schema({
|
|
|
1170
1192
|
])
|
|
1171
1193
|
.authorization((allow) => [
|
|
1172
1194
|
allow.groups(categoryWriteGroups),
|
|
1173
|
-
allow.custom().to(authoringOperations),
|
|
1174
1195
|
]),
|
|
1175
1196
|
|
|
1176
1197
|
LexicalSteeringRule: modelWithoutSubscriptions({
|
|
@@ -1199,7 +1220,6 @@ export const schema = a.schema({
|
|
|
1199
1220
|
])
|
|
1200
1221
|
.authorization((allow) => [
|
|
1201
1222
|
allow.groups(categoryWriteGroups),
|
|
1202
|
-
allow.custom().to(authoringOperations),
|
|
1203
1223
|
]),
|
|
1204
1224
|
|
|
1205
1225
|
SteeringProposal: modelWithoutSubscriptions({
|
|
@@ -1237,7 +1257,6 @@ export const schema = a.schema({
|
|
|
1237
1257
|
])
|
|
1238
1258
|
.authorization((allow) => [
|
|
1239
1259
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1240
|
-
allow.custom().to(authoringOperations),
|
|
1241
1260
|
]),
|
|
1242
1261
|
|
|
1243
1262
|
SteeringDecision: modelWithoutSubscriptions({
|
|
@@ -1257,7 +1276,6 @@ export const schema = a.schema({
|
|
|
1257
1276
|
])
|
|
1258
1277
|
.authorization((allow) => [
|
|
1259
1278
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1260
|
-
allow.custom().to(authoringOperations),
|
|
1261
1279
|
]),
|
|
1262
1280
|
|
|
1263
1281
|
Reference: realtimeModel({
|
|
@@ -1309,7 +1327,6 @@ export const schema = a.schema({
|
|
|
1309
1327
|
])
|
|
1310
1328
|
.authorization((allow) => [
|
|
1311
1329
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1312
|
-
allow.custom().to(authoringOperations),
|
|
1313
1330
|
]),
|
|
1314
1331
|
|
|
1315
1332
|
ReferenceAttachment: modelWithoutSubscriptions({
|
|
@@ -1339,7 +1356,6 @@ export const schema = a.schema({
|
|
|
1339
1356
|
])
|
|
1340
1357
|
.authorization((allow) => [
|
|
1341
1358
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1342
|
-
allow.custom().to(authoringOperations),
|
|
1343
1359
|
]),
|
|
1344
1360
|
|
|
1345
1361
|
SemanticNode: modelWithoutSubscriptions({
|
|
@@ -1377,7 +1393,6 @@ export const schema = a.schema({
|
|
|
1377
1393
|
])
|
|
1378
1394
|
.authorization((allow) => [
|
|
1379
1395
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1380
|
-
allow.custom().to(authoringOperations),
|
|
1381
1396
|
]),
|
|
1382
1397
|
|
|
1383
1398
|
Message: realtimeModel({
|
|
@@ -1426,7 +1441,6 @@ export const schema = a.schema({
|
|
|
1426
1441
|
])
|
|
1427
1442
|
.authorization((allow) => [
|
|
1428
1443
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1429
|
-
allow.custom().to(authoringOperations),
|
|
1430
1444
|
]),
|
|
1431
1445
|
|
|
1432
1446
|
MessageThread: realtimeModel({
|
|
@@ -1464,7 +1478,6 @@ export const schema = a.schema({
|
|
|
1464
1478
|
.authorization((allow) => [
|
|
1465
1479
|
allow.groups(categoryWriteGroups).to(["read", "create", "update"]),
|
|
1466
1480
|
allow.authenticated("identityPool").to(authoringOperations),
|
|
1467
|
-
allow.custom().to(authoringOperations),
|
|
1468
1481
|
]),
|
|
1469
1482
|
|
|
1470
1483
|
ModelAttachment: modelWithoutSubscriptions({
|
|
@@ -1496,7 +1509,6 @@ export const schema = a.schema({
|
|
|
1496
1509
|
])
|
|
1497
1510
|
.authorization((allow) => [
|
|
1498
1511
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
1499
|
-
allow.custom().to(authoringOperations),
|
|
1500
1512
|
]),
|
|
1501
1513
|
|
|
1502
1514
|
SemanticRelationType: modelWithoutSubscriptions({
|
|
@@ -1524,7 +1536,6 @@ export const schema = a.schema({
|
|
|
1524
1536
|
])
|
|
1525
1537
|
.authorization((allow) => [
|
|
1526
1538
|
allow.groups(categoryWriteGroups),
|
|
1527
|
-
allow.custom().to(authoringOperations),
|
|
1528
1539
|
]),
|
|
1529
1540
|
|
|
1530
1541
|
SemanticRelation: modelWithoutSubscriptions({
|
|
@@ -1575,7 +1586,6 @@ export const schema = a.schema({
|
|
|
1575
1586
|
])
|
|
1576
1587
|
.authorization((allow) => [
|
|
1577
1588
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
1578
|
-
allow.custom().to(authoringOperations),
|
|
1579
1589
|
]),
|
|
1580
1590
|
|
|
1581
1591
|
Item: modelWithoutSubscriptions({
|
|
@@ -1625,7 +1635,6 @@ export const schema = a.schema({
|
|
|
1625
1635
|
])
|
|
1626
1636
|
.authorization((allow) => [
|
|
1627
1637
|
allow.groups(contentWriteGroups),
|
|
1628
|
-
allow.custom().to(authoringOperations),
|
|
1629
1638
|
]),
|
|
1630
1639
|
|
|
1631
1640
|
Tag: modelWithoutSubscriptions({
|
|
@@ -1642,7 +1651,6 @@ export const schema = a.schema({
|
|
|
1642
1651
|
])
|
|
1643
1652
|
.authorization((allow) => [
|
|
1644
1653
|
allow.groups(contentWriteGroups),
|
|
1645
|
-
allow.custom().to(authoringOperations),
|
|
1646
1654
|
]),
|
|
1647
1655
|
|
|
1648
1656
|
ItemTag: modelWithoutSubscriptions({
|
|
@@ -1662,7 +1670,6 @@ export const schema = a.schema({
|
|
|
1662
1670
|
])
|
|
1663
1671
|
.authorization((allow) => [
|
|
1664
1672
|
allow.groups(contentWriteGroups),
|
|
1665
|
-
allow.custom().to(authoringOperations),
|
|
1666
1673
|
]),
|
|
1667
1674
|
|
|
1668
1675
|
MediaAsset: modelWithoutSubscriptions({
|
|
@@ -1695,7 +1702,6 @@ export const schema = a.schema({
|
|
|
1695
1702
|
])
|
|
1696
1703
|
.authorization((allow) => [
|
|
1697
1704
|
allow.groups(contentWriteGroups),
|
|
1698
|
-
allow.custom().to(authoringOperations),
|
|
1699
1705
|
]),
|
|
1700
1706
|
|
|
1701
1707
|
Edition: modelWithoutSubscriptions({
|
|
@@ -1727,7 +1733,6 @@ export const schema = a.schema({
|
|
|
1727
1733
|
])
|
|
1728
1734
|
.authorization((allow) => [
|
|
1729
1735
|
allow.groups(contentWriteGroups),
|
|
1730
|
-
allow.custom().to(authoringOperations),
|
|
1731
1736
|
]),
|
|
1732
1737
|
|
|
1733
1738
|
EditionItem: modelWithoutSubscriptions({
|
|
@@ -1750,7 +1755,6 @@ export const schema = a.schema({
|
|
|
1750
1755
|
])
|
|
1751
1756
|
.authorization((allow) => [
|
|
1752
1757
|
allow.groups(contentWriteGroups),
|
|
1753
|
-
allow.custom().to(authoringOperations),
|
|
1754
1758
|
]),
|
|
1755
1759
|
|
|
1756
1760
|
PublishedItem: modelWithoutSubscriptions({
|
|
@@ -1791,7 +1795,6 @@ export const schema = a.schema({
|
|
|
1791
1795
|
.authorization((allow) => [
|
|
1792
1796
|
allow.guest().to(["read"]),
|
|
1793
1797
|
allow.groups(contentWriteGroups),
|
|
1794
|
-
allow.custom().to(authoringOperations),
|
|
1795
1798
|
]),
|
|
1796
1799
|
|
|
1797
1800
|
PublishedMediaAsset: modelWithoutSubscriptions({
|
|
@@ -1827,7 +1830,6 @@ export const schema = a.schema({
|
|
|
1827
1830
|
.authorization((allow) => [
|
|
1828
1831
|
allow.guest().to(["read"]),
|
|
1829
1832
|
allow.groups(contentWriteGroups),
|
|
1830
|
-
allow.custom().to(authoringOperations),
|
|
1831
1833
|
]),
|
|
1832
1834
|
|
|
1833
1835
|
PublishedEdition: modelWithoutSubscriptions({
|
|
@@ -1853,7 +1855,6 @@ export const schema = a.schema({
|
|
|
1853
1855
|
.authorization((allow) => [
|
|
1854
1856
|
allow.guest().to(["read"]),
|
|
1855
1857
|
allow.groups(contentWriteGroups),
|
|
1856
|
-
allow.custom().to(authoringOperations),
|
|
1857
1858
|
]),
|
|
1858
1859
|
|
|
1859
1860
|
PublishedEditionItem: modelWithoutSubscriptions({
|
|
@@ -1878,7 +1879,6 @@ export const schema = a.schema({
|
|
|
1878
1879
|
.authorization((allow) => [
|
|
1879
1880
|
allow.guest().to(["read"]),
|
|
1880
1881
|
allow.groups(contentWriteGroups),
|
|
1881
|
-
allow.custom().to(authoringOperations),
|
|
1882
1882
|
]),
|
|
1883
1883
|
|
|
1884
1884
|
PublishedCategorySet: modelWithoutSubscriptions({
|
|
@@ -1904,7 +1904,6 @@ export const schema = a.schema({
|
|
|
1904
1904
|
.authorization((allow) => [
|
|
1905
1905
|
allow.guest().to(["read"]),
|
|
1906
1906
|
allow.groups(contentWriteGroups),
|
|
1907
|
-
allow.custom().to(authoringOperations),
|
|
1908
1907
|
]),
|
|
1909
1908
|
|
|
1910
1909
|
PublishedCategory: modelWithoutSubscriptions({
|
|
@@ -1940,10 +1939,10 @@ export const schema = a.schema({
|
|
|
1940
1939
|
.authorization((allow) => [
|
|
1941
1940
|
allow.guest().to(["read"]),
|
|
1942
1941
|
allow.groups(contentWriteGroups),
|
|
1943
|
-
allow.custom().to(authoringOperations),
|
|
1944
1942
|
]),
|
|
1945
1943
|
}).authorization((allow) => [
|
|
1946
1944
|
allow.resource(categoryAction),
|
|
1945
|
+
allow.resource(contentActions),
|
|
1947
1946
|
allow.resource(manageUserRole),
|
|
1948
1947
|
allow.resource(modelAttachmentUpload),
|
|
1949
1948
|
allow.resource(newsroomSummary),
|
|
@@ -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()
|