@anthusai/papyrus 3.2.0 → 3.3.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/data/resource.js +6 -0
- package/amplify/data/resource.ts +7 -0
- package/amplify/data/schema.js +6 -0
- package/amplify/data/schema.ts +7 -0
- package/amplify/functions/content-actions/handler.py +7 -0
- package/amplify/site-backend.js +3 -0
- package/amplify/site-backend.ts +6 -0
- package/package.json +1 -1
- package/routes.manifest.json +1 -1
package/amplify/data/resource.js
CHANGED
|
@@ -589,6 +589,12 @@ const schema = a.schema({
|
|
|
589
589
|
.returns(a.json())
|
|
590
590
|
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
591
591
|
.handler(a.handler.function(contentActions)),
|
|
592
|
+
intakePendingReferences: a
|
|
593
|
+
.mutation()
|
|
594
|
+
.arguments({ input: a.json().required() })
|
|
595
|
+
.returns(a.json())
|
|
596
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
597
|
+
.handler(a.handler.function(contentActions)),
|
|
592
598
|
saveItemDraft: a
|
|
593
599
|
.mutation()
|
|
594
600
|
.arguments({ input: a.json().required() })
|
package/amplify/data/resource.ts
CHANGED
|
@@ -641,6 +641,13 @@ const schema = a.schema({
|
|
|
641
641
|
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
642
642
|
.handler(a.handler.function(contentActions)),
|
|
643
643
|
|
|
644
|
+
intakePendingReferences: a
|
|
645
|
+
.mutation()
|
|
646
|
+
.arguments({ input: a.json().required() })
|
|
647
|
+
.returns(a.json())
|
|
648
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
649
|
+
.handler(a.handler.function(contentActions)),
|
|
650
|
+
|
|
644
651
|
saveItemDraft: a
|
|
645
652
|
.mutation()
|
|
646
653
|
.arguments({ input: a.json().required() })
|
package/amplify/data/schema.js
CHANGED
|
@@ -496,6 +496,12 @@ const baseDefinitions = {
|
|
|
496
496
|
.returns(a.json())
|
|
497
497
|
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
498
498
|
.handler(a.handler.function(contentActions)),
|
|
499
|
+
intakePendingReferences: a
|
|
500
|
+
.mutation()
|
|
501
|
+
.arguments({ input: a.json().required() })
|
|
502
|
+
.returns(a.json())
|
|
503
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
504
|
+
.handler(a.handler.function(contentActions)),
|
|
499
505
|
saveItemDraft: a
|
|
500
506
|
.mutation()
|
|
501
507
|
.arguments({ input: a.json().required() })
|
package/amplify/data/schema.ts
CHANGED
|
@@ -542,6 +542,13 @@ const baseDefinitions = {
|
|
|
542
542
|
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
543
543
|
.handler(a.handler.function(contentActions)),
|
|
544
544
|
|
|
545
|
+
intakePendingReferences: a
|
|
546
|
+
.mutation()
|
|
547
|
+
.arguments({ input: a.json().required() })
|
|
548
|
+
.returns(a.json())
|
|
549
|
+
.authorization((allow) => [allow.groups(contentWriteGroups)])
|
|
550
|
+
.handler(a.handler.function(contentActions)),
|
|
551
|
+
|
|
545
552
|
saveItemDraft: a
|
|
546
553
|
.mutation()
|
|
547
554
|
.arguments({ input: a.json().required() })
|
|
@@ -23,6 +23,7 @@ from papyrus_content.rebuild_trigger import (
|
|
|
23
23
|
trigger_staging_build,
|
|
24
24
|
)
|
|
25
25
|
from papyrus_content.story_reporting import save_story_version
|
|
26
|
+
from papyrus_content.reference_intake import IntakeError, intake_references
|
|
26
27
|
from papyrus_content.publishing import (
|
|
27
28
|
ItemFields,
|
|
28
29
|
PublishError,
|
|
@@ -299,6 +300,12 @@ def handler(event, context):
|
|
|
299
300
|
arguments = parse_input(event["arguments"]["input"])
|
|
300
301
|
actor = actor_from_event(event)
|
|
301
302
|
try:
|
|
303
|
+
if field == "intakePendingReferences":
|
|
304
|
+
client, _claims = create_authoring_client()
|
|
305
|
+
try:
|
|
306
|
+
return intake_references(client, arguments, event.get("identity") or {})
|
|
307
|
+
except IntakeError as error:
|
|
308
|
+
return {"ok": False, "errors": [{"code": "intake-rejected", "message": str(error)}]}
|
|
302
309
|
if field == "deriveMarkus":
|
|
303
310
|
return derive_markus_action(arguments)
|
|
304
311
|
if field == "saveItemDraft":
|
package/amplify/site-backend.js
CHANGED
|
@@ -310,6 +310,9 @@ export function defineSiteBackend(papyrusSite) {
|
|
|
310
310
|
grantNewsroomReadWrite(backend.newsroomSummary.resources.lambda);
|
|
311
311
|
const contentActionsLambda = backend.contentActions.resources.lambda;
|
|
312
312
|
grantNewsroomReadWriteDelete(contentActionsLambda);
|
|
313
|
+
// AppSync validates the token; pending intake additionally binds its actor
|
|
314
|
+
// and publication to this deployment's pool and existing API endpoint.
|
|
315
|
+
contentActionsLambda.addEnvironment("PAPYRUS_USER_POOL_ISSUER", `https://cognito-idp.${Stack.of(contentActionsLambda).region}.amazonaws.com/${backend.auth.resources.userPool.userPoolId}`);
|
|
313
316
|
contentActionsLambda.addEnvironment("PAPYRUS_GRAPHQL_ENDPOINT", backend.data.resources.cfnResources.cfnGraphqlApi.attrGraphQlUrl);
|
|
314
317
|
contentActionsLambda.addToRolePolicy(new PolicyStatement({
|
|
315
318
|
actions: ["appsync:GraphQL"],
|
package/amplify/site-backend.ts
CHANGED
|
@@ -396,6 +396,12 @@ export function defineSiteBackend(papyrusSite: PapyrusSite) {
|
|
|
396
396
|
grantNewsroomReadWrite(backend.newsroomSummary.resources.lambda as LambdaFunction);
|
|
397
397
|
const contentActionsLambda = backend.contentActions.resources.lambda as LambdaFunction;
|
|
398
398
|
grantNewsroomReadWriteDelete(contentActionsLambda);
|
|
399
|
+
// AppSync validates the token; pending intake additionally binds its actor
|
|
400
|
+
// and publication to this deployment's pool and existing API endpoint.
|
|
401
|
+
contentActionsLambda.addEnvironment(
|
|
402
|
+
"PAPYRUS_USER_POOL_ISSUER",
|
|
403
|
+
`https://cognito-idp.${Stack.of(contentActionsLambda).region}.amazonaws.com/${backend.auth.resources.userPool.userPoolId}`,
|
|
404
|
+
);
|
|
399
405
|
contentActionsLambda.addEnvironment(
|
|
400
406
|
"PAPYRUS_GRAPHQL_ENDPOINT",
|
|
401
407
|
backend.data.resources.cfnResources.cfnGraphqlApi.attrGraphQlUrl,
|
package/package.json
CHANGED
package/routes.manifest.json
CHANGED