@anthusai/papyrus 1.0.0-next.2 → 1.0.0-next.20

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.
Files changed (139) hide show
  1. package/amplify/auth/resource.js +17 -4
  2. package/amplify/auth/resource.ts +21 -4
  3. package/amplify/data/resource.js +52 -70
  4. package/amplify/data/resource.ts +57 -70
  5. package/amplify/data/schema.js +52 -58
  6. package/amplify/data/schema.ts +57 -58
  7. package/amplify/functions/console-chat-responder/py/execute_tactus_runner.py +0 -10
  8. package/amplify/functions/console-chat-responder/resource.js +0 -7
  9. package/amplify/functions/console-chat-responder/resource.ts +0 -8
  10. package/amplify/functions/console-chat-responder/src/main.rs +0 -9
  11. package/amplify/functions/content-actions/handler.py +149 -0
  12. package/amplify/functions/content-actions/requirements.txt +4 -0
  13. package/amplify/functions/content-actions/resource.js +40 -0
  14. package/amplify/functions/content-actions/resource.ts +54 -0
  15. package/amplify/functions/shared/python-bundle.js +17 -2
  16. package/amplify/functions/shared/python-bundle.ts +23 -2
  17. package/amplify/rebuild-trigger-settings.js +22 -0
  18. package/amplify/rebuild-trigger-settings.ts +42 -0
  19. package/amplify/site-backend-config.ts +12 -1
  20. package/amplify/site-backend.js +51 -27
  21. package/amplify/site-backend.ts +66 -34
  22. package/amplify/storage/resource.js +3 -0
  23. package/amplify/storage/resource.ts +3 -0
  24. package/app/%5F_preview/[[...path]]/route.ts +8 -0
  25. package/app/[year]/[month]/[day]/[articleSlug]/page.tsx +4 -2
  26. package/app/[year]/[month]/[day]/edition-route-page.tsx +2 -0
  27. package/app/api/revalidate/route.ts +8 -7
  28. package/app/articles/[slug]/page.tsx +3 -1
  29. package/app/blog-rhythm.css +278 -0
  30. package/app/globals.css +22 -4
  31. package/app/layout.tsx +24 -12
  32. package/app/newsroom/articles/[id]/page.tsx +15 -0
  33. package/app/newsroom/articles/page.tsx +13 -0
  34. package/app/page.tsx +12 -4
  35. package/app/robots.ts +11 -0
  36. package/bin/papyrus-app.mjs +12 -2
  37. package/bin/papyrus-infra.mjs +74 -18
  38. package/components/archive-shell.tsx +2 -22
  39. package/components/article-video.tsx +247 -3
  40. package/components/blog-page-background.tsx +23 -6
  41. package/components/markus-ir-preview.tsx +300 -0
  42. package/components/news-desk-page.tsx +1 -4
  43. package/components/newspaper.tsx +2 -1
  44. package/components/newsroom-access-gate.tsx +66 -0
  45. package/components/newsroom-article-editor.tsx +741 -0
  46. package/components/newsroom-articles-view.tsx +129 -0
  47. package/components/newsroom-ops-overview.tsx +28 -11
  48. package/components/newsroom-ops-shell.tsx +3 -1
  49. package/components/pictogram-figure.tsx +9 -2
  50. package/components/presentation-header.tsx +135 -0
  51. package/components/presentation-rhythm-hrule.tsx +17 -0
  52. package/components/settings-page.tsx +2 -1
  53. package/components/staging-banner.tsx +11 -0
  54. package/components/topic-steering-workspace.tsx +1 -59
  55. package/components/use-blog-header-obstacles.ts +81 -0
  56. package/components/use-brand-fonts-ready.ts +31 -0
  57. package/components/use-rhythm-overlay.ts +29 -0
  58. package/infra/amplify-app-shell.js +285 -80
  59. package/infra/amplify-app-shell.ts +326 -113
  60. package/infra/build-specs.js +94 -0
  61. package/infra/build-specs.ts +141 -0
  62. package/infra/github-oidc-provider.js +24 -0
  63. package/infra/github-oidc-provider.ts +30 -0
  64. package/infra/index.js +3 -0
  65. package/infra/site-config.js +273 -0
  66. package/infra/site-config.ts +336 -0
  67. package/lib/blog-feature-solver.ts +459 -0
  68. package/lib/blog-rhythm.ts +134 -0
  69. package/lib/brand-fonts.ts +112 -0
  70. package/lib/cached-content-repository.ts +2 -1
  71. package/lib/category-repository.ts +1 -93
  72. package/lib/content-actions-client.ts +98 -0
  73. package/lib/content-actions-demo.ts +190 -0
  74. package/lib/content-repository.ts +3 -0
  75. package/lib/content-source-context.ts +26 -0
  76. package/lib/content-types.ts +3 -0
  77. package/lib/edition-routes.ts +31 -29
  78. package/lib/empty-theme.css +1 -0
  79. package/lib/graphql-content-repository.ts +201 -42
  80. package/lib/layout-scenarios.ts +8 -8
  81. package/lib/newspaper-layout.ts +3 -2
  82. package/lib/newsroom-articles.ts +325 -0
  83. package/lib/newsroom-demo-articles.ts +90 -0
  84. package/lib/newsroom-media-backend.ts +142 -0
  85. package/lib/newsroom-media.ts +182 -0
  86. package/lib/newsroom-nav.ts +3 -0
  87. package/lib/papyrus-web-locations.ts +7 -6
  88. package/lib/presentation-footer.ts +3 -2
  89. package/lib/pretext-layout.ts +7 -3
  90. package/lib/reader-base-path.ts +24 -0
  91. package/lib/reader-static-params.ts +8 -0
  92. package/lib/renderer.ts +7 -0
  93. package/lib/revalidate-secret.ts +59 -0
  94. package/lib/root-route-redirect.ts +16 -0
  95. package/lib/site-brand-tenant.ts +3 -22
  96. package/lib/site-brand.ts +95 -42
  97. package/lib/site-env.ts +52 -0
  98. package/lib/staging-gate.ts +37 -0
  99. package/lib/staging-gated-path.ts +22 -0
  100. package/lib/staging-preview-object.ts +98 -0
  101. package/lib/video-mode.ts +42 -0
  102. package/lib/video-script.ts +63 -0
  103. package/middleware.ts +56 -42
  104. package/package.json +39 -1
  105. package/renderers/pretext/article-page.tsx +40 -9
  106. package/renderers/pretext/presentation-shared.tsx +113 -0
  107. package/renderers/pretext/presentation-shell.tsx +18 -112
  108. package/renderers/pretext/rhythm-article-page.tsx +165 -0
  109. package/renderers/pretext/rhythm-blog-presentation.tsx +280 -0
  110. package/renderers/pretext/rhythm-shell-style.ts +35 -0
  111. package/routes.manifest.json +37 -2
  112. package/scripts/videoml/build-browser-bundle.mjs +22 -0
  113. package/scripts/videoml/build-preview-bundle.mjs +50 -0
  114. package/scripts/videoml/bundle-common.mjs +129 -0
  115. package/scripts/videoml/preview/preview-entry.tsx +381 -0
  116. package/scripts/videoml/preview/preview-stage-fit.ts +28 -0
  117. package/scripts/videoml/preview/preview-timing.ts +42 -0
  118. package/scripts/videoml/preview.html +77 -0
  119. package/scripts/videoml/standard-entry.tsx +46 -0
  120. package/src/sync.mjs +30 -6
  121. package/src/with-papyrus.mjs +15 -2
  122. package/amplify/functions/graphql-jwt-authorizer/handler.ts +0 -193
  123. package/amplify/functions/graphql-jwt-authorizer/resource.js +0 -14
  124. package/amplify/functions/graphql-jwt-authorizer/resource.ts +0 -15
  125. package/publications/anth_us/brand.ts +0 -68
  126. package/publications/anth_us/theme.css +0 -66
  127. package/publications/pilobol_us/brand.ts +0 -37
  128. package/publications/pilobol_us/theme.css +0 -140
  129. package/publications/threat_intelligence/blog-defense/graph.ts +0 -636
  130. package/publications/threat_intelligence/blog-defense/layout.ts +0 -934
  131. package/publications/threat_intelligence/blog-defense/page-background.tsx +0 -590
  132. package/publications/threat_intelligence/brand.ts +0 -40
  133. package/publications/threat_intelligence/pictograms/art.tsx +0 -608
  134. package/publications/threat_intelligence/pictograms/figure.tsx +0 -82
  135. package/publications/threat_intelligence/pictograms/registry.ts +0 -30
  136. package/publications/threat_intelligence/pictograms/system.tsx +0 -305
  137. package/publications/threat_intelligence/seed/seed-edition-content.json +0 -629
  138. package/publications/threat_intelligence/theme.css +0 -1440
  139. /package/{publications/papyrus/theme.css → app/papyrus-theme.css} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { defineAuth, secret } from "@aws-amplify/backend";
2
2
  import { manageUserRole } from "../functions/manage-user-role/resource.js";
3
+ import { CfnUserPoolDomain } from "aws-cdk-lib/aws-cognito";
3
4
  // Default OAuth redirect URLs for the p.apyr.us app. Other publications pass
4
5
  // `auth.redirectUrls` to `defineSiteBackend` (or, for Papyrus's own backend,
5
6
  // the PAPYRUS_OAUTH_REDIRECT_URLS branch env var, comma-separated).
@@ -25,15 +26,13 @@ export function authConfigFromEnv() {
25
26
  return {
26
27
  redirectUrls: resolveAuthRedirectUrls(),
27
28
  disableGoogleOAuth: process.env.PAPYRUS_DISABLE_GOOGLE_OAUTH === "1",
28
- // Stable Cognito hosted-UI domain prefix for Google OAuth redirect URIs.
29
- // See docs/google-oauth-setup.md.
30
29
  cognitoDomainPrefix: (process.env.PAPYRUS_COGNITO_DOMAIN_PREFIX ?? "").trim(),
30
+ applyCognitoDomainPrefix: process.env.PAPYRUS_APPLY_COGNITO_DOMAIN_PREFIX === "true",
31
31
  };
32
32
  }
33
33
  export function defineSiteAuth(config) {
34
34
  const authRedirectUrls = config.redirectUrls ?? DEFAULT_AUTH_REDIRECT_URLS;
35
35
  const disableGoogleOAuth = config.disableGoogleOAuth === true;
36
- const cognitoDomainPrefix = (config.cognitoDomainPrefix ?? "").trim();
37
36
  return defineAuth({
38
37
  loginWith: {
39
38
  email: true,
@@ -49,7 +48,6 @@ export function defineSiteAuth(config) {
49
48
  scopes: ["EMAIL", "PROFILE", "OPENID"],
50
49
  callbackUrls: authRedirectUrls,
51
50
  logoutUrls: authRedirectUrls,
52
- ...(cognitoDomainPrefix ? { domainPrefix: cognitoDomainPrefix } : {}),
53
51
  },
54
52
  }),
55
53
  },
@@ -59,3 +57,18 @@ export function defineSiteAuth(config) {
59
57
  ],
60
58
  });
61
59
  }
60
+ // Amplify Gen2's auth factory overwrites `externalProviders.domainPrefix` with a
61
+ // hash of the backend id, so the prefix cannot be passed through `defineAuth`.
62
+ // This sets the user pool domain on the synthesized resource instead. Cognito
63
+ // cannot rename a pool domain in place: CloudFormation replaces the domain,
64
+ // which changes the hosted-UI URL and the Google redirect URI. Callers must
65
+ // only use it when the site opted in (see docs/google-oauth-setup.md).
66
+ export function applyCognitoDomainPrefix(authStack, cognitoDomainPrefix) {
67
+ const domainResources = authStack.node
68
+ .findAll()
69
+ .filter((construct) => construct instanceof CfnUserPoolDomain);
70
+ if (domainResources.length !== 1) {
71
+ throw new Error(`Expected exactly one Cognito user pool domain in the auth stack to apply cognitoDomainPrefix, found ${domainResources.length}`);
72
+ }
73
+ domainResources[0].domain = cognitoDomainPrefix;
74
+ }
@@ -1,5 +1,7 @@
1
1
  import { defineAuth, secret } from "@aws-amplify/backend";
2
2
  import { manageUserRole } from "../functions/manage-user-role/resource";
3
+ import { Stack } from "aws-cdk-lib";
4
+ import { CfnUserPoolDomain } from "aws-cdk-lib/aws-cognito";
3
5
  import type { PapyrusAuthConfig } from "../site-backend-config";
4
6
 
5
7
  // Default OAuth redirect URLs for the p.apyr.us app. Other publications pass
@@ -28,16 +30,14 @@ export function authConfigFromEnv(): PapyrusAuthConfig {
28
30
  return {
29
31
  redirectUrls: resolveAuthRedirectUrls(),
30
32
  disableGoogleOAuth: process.env.PAPYRUS_DISABLE_GOOGLE_OAUTH === "1",
31
- // Stable Cognito hosted-UI domain prefix for Google OAuth redirect URIs.
32
- // See docs/google-oauth-setup.md.
33
33
  cognitoDomainPrefix: (process.env.PAPYRUS_COGNITO_DOMAIN_PREFIX ?? "").trim(),
34
+ applyCognitoDomainPrefix: process.env.PAPYRUS_APPLY_COGNITO_DOMAIN_PREFIX === "true",
34
35
  };
35
36
  }
36
37
 
37
38
  export function defineSiteAuth(config: PapyrusAuthConfig) {
38
39
  const authRedirectUrls = config.redirectUrls ?? DEFAULT_AUTH_REDIRECT_URLS;
39
40
  const disableGoogleOAuth = config.disableGoogleOAuth === true;
40
- const cognitoDomainPrefix = (config.cognitoDomainPrefix ?? "").trim();
41
41
  return defineAuth({
42
42
  loginWith: {
43
43
  email: true,
@@ -53,7 +53,6 @@ export function defineSiteAuth(config: PapyrusAuthConfig) {
53
53
  scopes: ["EMAIL", "PROFILE", "OPENID"],
54
54
  callbackUrls: authRedirectUrls,
55
55
  logoutUrls: authRedirectUrls,
56
- ...(cognitoDomainPrefix ? { domainPrefix: cognitoDomainPrefix } : {}),
57
56
  },
58
57
  }),
59
58
  },
@@ -63,3 +62,21 @@ export function defineSiteAuth(config: PapyrusAuthConfig) {
63
62
  ],
64
63
  });
65
64
  }
65
+
66
+ // Amplify Gen2's auth factory overwrites `externalProviders.domainPrefix` with a
67
+ // hash of the backend id, so the prefix cannot be passed through `defineAuth`.
68
+ // This sets the user pool domain on the synthesized resource instead. Cognito
69
+ // cannot rename a pool domain in place: CloudFormation replaces the domain,
70
+ // which changes the hosted-UI URL and the Google redirect URI. Callers must
71
+ // only use it when the site opted in (see docs/google-oauth-setup.md).
72
+ export function applyCognitoDomainPrefix(authStack: Stack, cognitoDomainPrefix: string): void {
73
+ const domainResources = authStack.node
74
+ .findAll()
75
+ .filter((construct): construct is CfnUserPoolDomain => construct instanceof CfnUserPoolDomain);
76
+ if (domainResources.length !== 1) {
77
+ throw new Error(
78
+ `Expected exactly one Cognito user pool domain in the auth stack to apply cognitoDomainPrefix, found ${domainResources.length}`,
79
+ );
80
+ }
81
+ domainResources[0].domain = cognitoDomainPrefix;
82
+ }
@@ -1,7 +1,7 @@
1
1
  import { a, defineData } from "@aws-amplify/backend";
2
2
  import { assignmentAction } from "../functions/assignment-action/resource.js";
3
3
  import { categoryAction } from "../functions/category-action/resource.js";
4
- import { graphqlJwtAuthorizer } from "../functions/graphql-jwt-authorizer/resource.js";
4
+ import { contentActions } from "../functions/content-actions/resource.js";
5
5
  import { knowledgeQuery } from "../functions/knowledge-query/resource.js";
6
6
  import { manageUserRole } from "../functions/manage-user-role/resource.js";
7
7
  import { modelAttachmentUpload } from "../functions/model-attachment-upload/resource.js";
@@ -43,7 +43,6 @@ const schema = a.schema({
43
43
  .authorization((allow) => [
44
44
  allow.owner(),
45
45
  allow.group(adminGroup),
46
- allow.custom().to(["read"]),
47
46
  ]),
48
47
  UserIdentity: a
49
48
  .model({
@@ -63,7 +62,6 @@ const schema = a.schema({
63
62
  ])
64
63
  .authorization((allow) => [
65
64
  allow.group(adminGroup),
66
- allow.custom().to(["read"]),
67
65
  ]),
68
66
  UserRoleAssignment: a
69
67
  .model({
@@ -293,7 +291,6 @@ const schema = a.schema({
293
291
  .returns(a.ref("ReferenceCurationActionResult"))
294
292
  .authorization((allow) => [
295
293
  allow.groups(categoryWriteGroups),
296
- allow.custom(),
297
294
  ])
298
295
  .handler(a.handler.function(categoryAction)),
299
296
  setReferenceQualityRating: a
@@ -308,7 +305,6 @@ const schema = a.schema({
308
305
  .returns(a.ref("ReferenceQualityActionResult"))
309
306
  .authorization((allow) => [
310
307
  allow.groups(categoryWriteGroups),
311
- allow.custom(),
312
308
  ])
313
309
  .handler(a.handler.function(categoryAction)),
314
310
  createReferenceInsight: a
@@ -323,7 +319,6 @@ const schema = a.schema({
323
319
  .returns(a.ref("ReferenceInsightActionResult"))
324
320
  .authorization((allow) => [
325
321
  allow.groups(categoryWriteGroups),
326
- allow.custom(),
327
322
  ])
328
323
  .handler(a.handler.function(categoryAction)),
329
324
  moveReferenceCorpus: a
@@ -338,7 +333,6 @@ const schema = a.schema({
338
333
  .returns(a.ref("ReferenceCorpusMoveActionResult"))
339
334
  .authorization((allow) => [
340
335
  allow.groups(categoryWriteGroups),
341
- allow.custom(),
342
336
  ])
343
337
  .handler(a.handler.function(categoryAction)),
344
338
  startReferenceCuration: a
@@ -352,7 +346,6 @@ const schema = a.schema({
352
346
  .returns(a.ref("ReferenceCurationStartResult"))
353
347
  .authorization((allow) => [
354
348
  allow.groups(categoryWriteGroups),
355
- allow.custom(),
356
349
  ])
357
350
  .handler(a.handler.function(categoryAction)),
358
351
  getReferenceCurationStatus: a
@@ -363,7 +356,6 @@ const schema = a.schema({
363
356
  .returns(a.ref("ReferenceCurationStatusResult"))
364
357
  .authorization((allow) => [
365
358
  allow.groups(categoryWriteGroups),
366
- allow.custom(),
367
359
  ])
368
360
  .handler(a.handler.function(categoryAction)),
369
361
  createCategorySetDraft: a
@@ -466,15 +458,45 @@ const schema = a.schema({
466
458
  getNewsroomSummary: a
467
459
  .query()
468
460
  .returns(a.ref("NewsroomSummary"))
469
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
461
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
470
462
  .handler(a.handler.function(newsroomSummary)),
463
+ deriveMarkus: a
464
+ .query()
465
+ .arguments({ input: a.json().required() })
466
+ .returns(a.json())
467
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
468
+ .handler(a.handler.function(contentActions)),
469
+ saveItemDraft: a
470
+ .mutation()
471
+ .arguments({ input: a.json().required() })
472
+ .returns(a.json())
473
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
474
+ .handler(a.handler.function(contentActions)),
475
+ publishItem: a
476
+ .mutation()
477
+ .arguments({ input: a.json().required() })
478
+ .returns(a.json())
479
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
480
+ .handler(a.handler.function(contentActions)),
481
+ unpublishItem: a
482
+ .mutation()
483
+ .arguments({ input: a.json().required() })
484
+ .returns(a.json())
485
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
486
+ .handler(a.handler.function(contentActions)),
487
+ requestStagingBuild: a
488
+ .mutation()
489
+ .arguments({ input: a.json().required() })
490
+ .returns(a.json())
491
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
492
+ .handler(a.handler.function(contentActions)),
471
493
  knowledgeQuery: a
472
494
  .query()
473
495
  .arguments({
474
496
  input: a.json().required(),
475
497
  })
476
498
  .returns(a.json())
477
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
499
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
478
500
  .handler(a.handler.function(knowledgeQuery)),
479
501
  updateNewsroomSummary: a
480
502
  .mutation()
@@ -484,7 +506,7 @@ const schema = a.schema({
484
506
  reason: a.string(),
485
507
  })
486
508
  .returns(a.ref("NewsroomSummary"))
487
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
509
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
488
510
  .handler(a.handler.function(newsroomSummary)),
489
511
  ModelAttachmentUploadSlot: a.customType({
490
512
  ok: a.boolean().required(),
@@ -540,7 +562,7 @@ const schema = a.schema({
540
562
  status: a.string(),
541
563
  })
542
564
  .returns(a.ref("ModelAttachmentUploadSlot"))
543
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
565
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
544
566
  .handler(a.handler.function(modelAttachmentUpload)),
545
567
  completeModelAttachmentUpload: a
546
568
  .mutation()
@@ -561,7 +583,7 @@ const schema = a.schema({
561
583
  status: a.string(),
562
584
  })
563
585
  .returns(a.ref("ModelAttachment"))
564
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
586
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
565
587
  .handler(a.handler.function(modelAttachmentUpload)),
566
588
  abortModelAttachmentUpload: a
567
589
  .mutation()
@@ -582,7 +604,7 @@ const schema = a.schema({
582
604
  status: a.string(),
583
605
  })
584
606
  .returns(a.ref("ModelAttachmentUploadAbortResult"))
585
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
607
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
586
608
  .handler(a.handler.function(modelAttachmentUpload)),
587
609
  createModelAttachmentDownload: a
588
610
  .mutation()
@@ -590,7 +612,7 @@ const schema = a.schema({
590
612
  attachmentId: a.id().required(),
591
613
  })
592
614
  .returns(a.ref("ModelAttachmentDownloadSlot"))
593
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
615
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
594
616
  .handler(a.handler.function(modelAttachmentUpload)),
595
617
  AssignmentActionResult: a.customType({
596
618
  ok: a.boolean().required(),
@@ -677,7 +699,7 @@ const schema = a.schema({
677
699
  limit: a.integer(),
678
700
  })
679
701
  .returns(a.ref("AssignmentContext").array().required())
680
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
702
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
681
703
  .handler(a.handler.function(assignmentAction)),
682
704
  listAssignmentQueue: a
683
705
  .query()
@@ -687,7 +709,7 @@ const schema = a.schema({
687
709
  limit: a.integer(),
688
710
  })
689
711
  .returns(a.ref("AssignmentContext").array().required())
690
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
712
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
691
713
  .handler(a.handler.function(assignmentAction)),
692
714
  getAssignmentContext: a
693
715
  .query()
@@ -695,7 +717,7 @@ const schema = a.schema({
695
717
  assignmentId: a.id().required(),
696
718
  })
697
719
  .returns(a.ref("AssignmentContext"))
698
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
720
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
699
721
  .handler(a.handler.function(assignmentAction)),
700
722
  claimAssignment: a
701
723
  .mutation()
@@ -711,7 +733,7 @@ const schema = a.schema({
711
733
  note: a.string(),
712
734
  })
713
735
  .returns(a.ref("AssignmentActionResult"))
714
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
736
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
715
737
  .handler(a.handler.function(assignmentAction)),
716
738
  releaseAssignment: a
717
739
  .mutation()
@@ -722,7 +744,7 @@ const schema = a.schema({
722
744
  note: a.string(),
723
745
  })
724
746
  .returns(a.ref("AssignmentActionResult"))
725
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
747
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
726
748
  .handler(a.handler.function(assignmentAction)),
727
749
  completeAssignment: a
728
750
  .mutation()
@@ -733,7 +755,7 @@ const schema = a.schema({
733
755
  note: a.string(),
734
756
  })
735
757
  .returns(a.ref("AssignmentActionResult"))
736
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
758
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
737
759
  .handler(a.handler.function(assignmentAction)),
738
760
  cancelAssignment: a
739
761
  .mutation()
@@ -744,7 +766,7 @@ const schema = a.schema({
744
766
  note: a.string(),
745
767
  })
746
768
  .returns(a.ref("AssignmentActionResult"))
747
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
769
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
748
770
  .handler(a.handler.function(assignmentAction)),
749
771
  reopenAssignment: a
750
772
  .mutation()
@@ -755,7 +777,7 @@ const schema = a.schema({
755
777
  note: a.string(),
756
778
  })
757
779
  .returns(a.ref("AssignmentActionResult"))
758
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
780
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
759
781
  .handler(a.handler.function(assignmentAction)),
760
782
  retryImmediateAssignment: a
761
783
  .mutation()
@@ -766,7 +788,7 @@ const schema = a.schema({
766
788
  note: a.string(),
767
789
  })
768
790
  .returns(a.ref("AssignmentActionResult"))
769
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
791
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
770
792
  .handler(a.handler.function(assignmentAction)),
771
793
  listNewsroomProcedureDefinitions: a
772
794
  .query()
@@ -780,7 +802,7 @@ const schema = a.schema({
780
802
  procedureKey: a.string(),
781
803
  })
782
804
  .returns(a.json())
783
- .authorization((allow) => [allow.group(adminGroup), allow.custom()])
805
+ .authorization((allow) => [allow.group(adminGroup)])
784
806
  .handler(a.handler.function(procedureAction)),
785
807
  saveNewsroomProcedureDefinition: a
786
808
  .mutation()
@@ -818,7 +840,7 @@ const schema = a.schema({
818
840
  actorLabel: a.string(),
819
841
  })
820
842
  .returns(a.json())
821
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
843
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
822
844
  .handler(a.handler.function(procedureAction)),
823
845
  getNewsroomProcedureRun: a
824
846
  .query()
@@ -826,7 +848,7 @@ const schema = a.schema({
826
848
  id: a.id().required(),
827
849
  })
828
850
  .returns(a.json())
829
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
851
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
830
852
  .handler(a.handler.function(procedureAction)),
831
853
  listNewsroomProcedureRunsByProcedure: a
832
854
  .query()
@@ -834,7 +856,7 @@ const schema = a.schema({
834
856
  procedureId: a.id().required(),
835
857
  })
836
858
  .returns(a.json())
837
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
859
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
838
860
  .handler(a.handler.function(procedureAction)),
839
861
  Assignment: a
840
862
  .model({
@@ -884,7 +906,6 @@ const schema = a.schema({
884
906
  .authorization((allow) => [
885
907
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
886
908
  allow.authenticated("identityPool").to(authoringOperations),
887
- allow.custom().to(authoringOperations),
888
909
  ]),
889
910
  AssignmentEvent: a
890
911
  .model({
@@ -907,7 +928,6 @@ const schema = a.schema({
907
928
  ])
908
929
  .authorization((allow) => [
909
930
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
910
- allow.custom().to(authoringOperations),
911
931
  ]),
912
932
  ProcedureDefinition: a
913
933
  .model({
@@ -932,7 +952,6 @@ const schema = a.schema({
932
952
  ])
933
953
  .authorization((allow) => [
934
954
  allow.group(adminGroup),
935
- allow.custom().to(authoringOperations),
936
955
  ]),
937
956
  ProcedureVersion: a
938
957
  .model({
@@ -959,7 +978,6 @@ const schema = a.schema({
959
978
  ])
960
979
  .authorization((allow) => [
961
980
  allow.group(adminGroup),
962
- allow.custom().to(authoringOperations),
963
981
  ]),
964
982
  ProcedureRun: a
965
983
  .model({
@@ -992,7 +1010,6 @@ const schema = a.schema({
992
1010
  .authorization((allow) => [
993
1011
  allow.group("editor").to(["read"]),
994
1012
  allow.group(adminGroup).to(authoringOperations),
995
- allow.custom().to(authoringOperations),
996
1013
  ]),
997
1014
  NewsroomSection: a
998
1015
  .model({
@@ -1020,7 +1037,6 @@ const schema = a.schema({
1020
1037
  ])
1021
1038
  .authorization((allow) => [
1022
1039
  allow.groups(categoryWriteGroups),
1023
- allow.custom().to(authoringOperations),
1024
1040
  ]),
1025
1041
  KnowledgeCorpus: a
1026
1042
  .model({
@@ -1038,7 +1054,6 @@ const schema = a.schema({
1038
1054
  ])
1039
1055
  .authorization((allow) => [
1040
1056
  allow.groups(categoryWriteGroups).to(["read"]),
1041
- allow.custom().to(authoringOperations),
1042
1057
  ]),
1043
1058
  KnowledgeImportRun: a
1044
1059
  .model({
@@ -1066,7 +1081,6 @@ const schema = a.schema({
1066
1081
  ])
1067
1082
  .authorization((allow) => [
1068
1083
  allow.groups(categoryWriteGroups).to(["read"]),
1069
- allow.custom().to(authoringOperations),
1070
1084
  ]),
1071
1085
  KnowledgeRawPayload: a
1072
1086
  .model({
@@ -1084,7 +1098,6 @@ const schema = a.schema({
1084
1098
  ])
1085
1099
  .authorization((allow) => [
1086
1100
  allow.groups(categoryWriteGroups),
1087
- allow.custom().to(authoringOperations),
1088
1101
  ]),
1089
1102
  KnowledgeArtifact: a
1090
1103
  .model({
@@ -1104,7 +1117,6 @@ const schema = a.schema({
1104
1117
  ])
1105
1118
  .authorization((allow) => [
1106
1119
  allow.groups(categoryWriteGroups).to(["read"]),
1107
- allow.custom().to(authoringOperations),
1108
1120
  ]),
1109
1121
  CategorySet: a
1110
1122
  .model({
@@ -1134,7 +1146,6 @@ const schema = a.schema({
1134
1146
  ])
1135
1147
  .authorization((allow) => [
1136
1148
  allow.groups(categoryWriteGroups),
1137
- allow.custom().to(authoringOperations),
1138
1149
  ]),
1139
1150
  Category: a
1140
1151
  .model({
@@ -1176,7 +1187,6 @@ const schema = a.schema({
1176
1187
  ])
1177
1188
  .authorization((allow) => [
1178
1189
  allow.groups(categoryWriteGroups),
1179
- allow.custom().to(authoringOperations),
1180
1190
  ]),
1181
1191
  CategoryKeyword: a
1182
1192
  .model({
@@ -1205,7 +1215,6 @@ const schema = a.schema({
1205
1215
  ])
1206
1216
  .authorization((allow) => [
1207
1217
  allow.groups(categoryWriteGroups),
1208
- allow.custom().to(authoringOperations),
1209
1218
  ]),
1210
1219
  LexicalSteeringRule: a
1211
1220
  .model({
@@ -1234,7 +1243,6 @@ const schema = a.schema({
1234
1243
  ])
1235
1244
  .authorization((allow) => [
1236
1245
  allow.groups(categoryWriteGroups),
1237
- allow.custom().to(authoringOperations),
1238
1246
  ]),
1239
1247
  SteeringProposal: a
1240
1248
  .model({
@@ -1272,7 +1280,6 @@ const schema = a.schema({
1272
1280
  ])
1273
1281
  .authorization((allow) => [
1274
1282
  allow.groups(categoryWriteGroups).to(["read"]),
1275
- allow.custom().to(authoringOperations),
1276
1283
  ]),
1277
1284
  SteeringDecision: a
1278
1285
  .model({
@@ -1292,7 +1299,6 @@ const schema = a.schema({
1292
1299
  ])
1293
1300
  .authorization((allow) => [
1294
1301
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1295
- allow.custom().to(authoringOperations),
1296
1302
  ]),
1297
1303
  Reference: a
1298
1304
  .model({
@@ -1344,7 +1350,6 @@ const schema = a.schema({
1344
1350
  ])
1345
1351
  .authorization((allow) => [
1346
1352
  allow.groups(categoryWriteGroups).to(["read"]),
1347
- allow.custom().to(authoringOperations),
1348
1353
  ]),
1349
1354
  ReferenceAttachment: a
1350
1355
  .model({
@@ -1374,7 +1379,6 @@ const schema = a.schema({
1374
1379
  ])
1375
1380
  .authorization((allow) => [
1376
1381
  allow.groups(categoryWriteGroups).to(["read"]),
1377
- allow.custom().to(authoringOperations),
1378
1382
  ]),
1379
1383
  SemanticNode: a
1380
1384
  .model({
@@ -1417,7 +1421,6 @@ const schema = a.schema({
1417
1421
  ])
1418
1422
  .authorization((allow) => [
1419
1423
  allow.groups(categoryWriteGroups).to(["read"]),
1420
- allow.custom().to(authoringOperations),
1421
1424
  ]),
1422
1425
  Message: a
1423
1426
  .model({
@@ -1466,7 +1469,6 @@ const schema = a.schema({
1466
1469
  ])
1467
1470
  .authorization((allow) => [
1468
1471
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1469
- allow.custom().to(authoringOperations),
1470
1472
  allow.authenticated("identityPool").to(["read", "create", "update"]),
1471
1473
  ]),
1472
1474
  MessageThread: a
@@ -1505,7 +1507,6 @@ const schema = a.schema({
1505
1507
  .authorization((allow) => [
1506
1508
  allow.groups(categoryWriteGroups).to(["read", "create", "update"]),
1507
1509
  allow.authenticated("identityPool").to(authoringOperations),
1508
- allow.custom().to(authoringOperations),
1509
1510
  ]),
1510
1511
  ModelAttachment: a
1511
1512
  .model({
@@ -1537,7 +1538,6 @@ const schema = a.schema({
1537
1538
  ])
1538
1539
  .authorization((allow) => [
1539
1540
  allow.groups(categoryWriteGroups).to(["read"]),
1540
- allow.custom().to(authoringOperations),
1541
1541
  ]),
1542
1542
  SemanticRelationType: a
1543
1543
  .model({
@@ -1565,7 +1565,6 @@ const schema = a.schema({
1565
1565
  ])
1566
1566
  .authorization((allow) => [
1567
1567
  allow.groups(categoryWriteGroups),
1568
- allow.custom().to(authoringOperations),
1569
1568
  ]),
1570
1569
  SemanticRelation: a
1571
1570
  .model({
@@ -1616,7 +1615,6 @@ const schema = a.schema({
1616
1615
  ])
1617
1616
  .authorization((allow) => [
1618
1617
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1619
- allow.custom().to(authoringOperations),
1620
1618
  ]),
1621
1619
  Item: a
1622
1620
  .model({
@@ -1666,7 +1664,6 @@ const schema = a.schema({
1666
1664
  ])
1667
1665
  .authorization((allow) => [
1668
1666
  allow.groups(contentWriteGroups),
1669
- allow.custom().to(authoringOperations),
1670
1667
  ]),
1671
1668
  Tag: a
1672
1669
  .model({
@@ -1683,7 +1680,6 @@ const schema = a.schema({
1683
1680
  ])
1684
1681
  .authorization((allow) => [
1685
1682
  allow.groups(contentWriteGroups),
1686
- allow.custom().to(authoringOperations),
1687
1683
  ]),
1688
1684
  ItemTag: a
1689
1685
  .model({
@@ -1703,7 +1699,6 @@ const schema = a.schema({
1703
1699
  ])
1704
1700
  .authorization((allow) => [
1705
1701
  allow.groups(contentWriteGroups),
1706
- allow.custom().to(authoringOperations),
1707
1702
  ]),
1708
1703
  MediaAsset: a
1709
1704
  .model({
@@ -1736,7 +1731,6 @@ const schema = a.schema({
1736
1731
  ])
1737
1732
  .authorization((allow) => [
1738
1733
  allow.groups(contentWriteGroups),
1739
- allow.custom().to(authoringOperations),
1740
1734
  ]),
1741
1735
  Edition: a
1742
1736
  .model({
@@ -1769,7 +1763,6 @@ const schema = a.schema({
1769
1763
  ])
1770
1764
  .authorization((allow) => [
1771
1765
  allow.groups(contentWriteGroups),
1772
- allow.custom().to(authoringOperations),
1773
1766
  ]),
1774
1767
  EditionSlot: a
1775
1768
  .model({
@@ -1795,7 +1788,6 @@ const schema = a.schema({
1795
1788
  ])
1796
1789
  .authorization((allow) => [
1797
1790
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1798
- allow.custom().to(authoringOperations),
1799
1791
  ]),
1800
1792
  EditionItem: a
1801
1793
  .model({
@@ -1818,7 +1810,6 @@ const schema = a.schema({
1818
1810
  ])
1819
1811
  .authorization((allow) => [
1820
1812
  allow.groups(contentWriteGroups),
1821
- allow.custom().to(authoringOperations),
1822
1813
  ]),
1823
1814
  PublishedItem: a
1824
1815
  .model({
@@ -1859,7 +1850,6 @@ const schema = a.schema({
1859
1850
  .authorization((allow) => [
1860
1851
  allow.guest().to(["read"]),
1861
1852
  allow.groups(contentWriteGroups),
1862
- allow.custom().to(authoringOperations),
1863
1853
  ]),
1864
1854
  PublishedMediaAsset: a
1865
1855
  .model({
@@ -1895,7 +1885,6 @@ const schema = a.schema({
1895
1885
  .authorization((allow) => [
1896
1886
  allow.guest().to(["read"]),
1897
1887
  allow.groups(contentWriteGroups),
1898
- allow.custom().to(authoringOperations),
1899
1888
  ]),
1900
1889
  PublishedEdition: a
1901
1890
  .model({
@@ -1921,7 +1910,6 @@ const schema = a.schema({
1921
1910
  .authorization((allow) => [
1922
1911
  allow.guest().to(["read"]),
1923
1912
  allow.groups(contentWriteGroups),
1924
- allow.custom().to(authoringOperations),
1925
1913
  ]),
1926
1914
  PublishedEditionItem: a
1927
1915
  .model({
@@ -1946,7 +1934,6 @@ const schema = a.schema({
1946
1934
  .authorization((allow) => [
1947
1935
  allow.guest().to(["read"]),
1948
1936
  allow.groups(contentWriteGroups),
1949
- allow.custom().to(authoringOperations),
1950
1937
  ]),
1951
1938
  PublishedCategorySet: a
1952
1939
  .model({
@@ -1972,7 +1959,6 @@ const schema = a.schema({
1972
1959
  .authorization((allow) => [
1973
1960
  allow.guest().to(["read"]),
1974
1961
  allow.groups(contentWriteGroups),
1975
- allow.custom().to(authoringOperations),
1976
1962
  ]),
1977
1963
  PublishedCategory: a
1978
1964
  .model({
@@ -2008,10 +1994,10 @@ const schema = a.schema({
2008
1994
  .authorization((allow) => [
2009
1995
  allow.guest().to(["read"]),
2010
1996
  allow.groups(contentWriteGroups),
2011
- allow.custom().to(authoringOperations),
2012
1997
  ]),
2013
1998
  }).authorization((allow) => [
2014
1999
  allow.resource(categoryAction),
2000
+ allow.resource(contentActions),
2015
2001
  allow.resource(manageUserRole),
2016
2002
  allow.resource(modelAttachmentUpload),
2017
2003
  allow.resource(newsroomSummary),
@@ -2029,9 +2015,5 @@ export const data = defineData({
2029
2015
  apiKeyAuthorizationMode: {
2030
2016
  expiresInDays: 365,
2031
2017
  },
2032
- lambdaAuthorizationMode: {
2033
- function: graphqlJwtAuthorizer,
2034
- timeToLiveInSeconds: 300,
2035
- },
2036
2018
  },
2037
2019
  });