@anthusai/papyrus 3.3.0 → 5.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.
Files changed (38) hide show
  1. package/amplify/data/schema.js +2 -0
  2. package/amplify/data/schema.ts +2 -0
  3. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/handler.py +1 -1
  4. package/amplify/functions/editorial-checks/requirements.txt +1 -0
  5. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.js +7 -7
  6. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.ts +7 -7
  7. package/amplify/functions/editorial-checks/schema.js +92 -0
  8. package/amplify/{plugins → functions}/editorial-checks/schema.ts +4 -6
  9. package/amplify/functions/editorial-checks/wire.js +49 -0
  10. package/amplify/functions/editorial-checks/wire.ts +57 -0
  11. package/amplify/plugins/registry.js +0 -2
  12. package/amplify/plugins/registry.ts +0 -2
  13. package/amplify/publication/redirect-and-index.js +31 -0
  14. package/amplify/publication/redirect-rules.js +40 -0
  15. package/amplify/publication/redirect-rules.ts +47 -0
  16. package/amplify/publication/s3-projection.js +3 -1
  17. package/amplify/publication/s3-projection.ts +5 -1
  18. package/amplify/site-backend.js +4 -0
  19. package/amplify/site-backend.ts +4 -0
  20. package/components/editorial-checks-admin-panel.tsx +19 -9
  21. package/components/newsroom-article-editor.tsx +2 -4
  22. package/components/topic-steering-workspace.tsx +10 -17
  23. package/components/use-editorial-checks.ts +12 -10
  24. package/lib/category-repository.ts +10 -8
  25. package/lib/editorial-checks-backend.ts +1 -1
  26. package/lib/editorial-checks-client.ts +1 -1
  27. package/lib/editorial-checks-demo.ts +2 -2
  28. package/lib/editorial-checks-settings.ts +3 -0
  29. package/lib/editorial-checks.ts +2 -9
  30. package/lib/editorial-preview.ts +5 -5
  31. package/lib/site-brand-tenant.ts +11 -6
  32. package/lib/site-brand.ts +6 -3
  33. package/package.json +1 -1
  34. package/routes.manifest.json +1 -1
  35. package/amplify/plugins/editorial-checks/function/requirements.txt +0 -1
  36. package/amplify/plugins/editorial-checks/papyrus.plugin.js +0 -71
  37. package/amplify/plugins/editorial-checks/papyrus.plugin.ts +0 -87
  38. package/amplify/plugins/editorial-checks/schema.js +0 -94
@@ -1,94 +0,0 @@
1
- import { a } from "@aws-amplify/backend";
2
- import { editorialChecks } from "./function/resource.js";
3
- const editors = ["editor", "admin"];
4
- /**
5
- * Policies, settings and editors' decisions live in Papyrus; Limatus checks
6
- * content against them. Editors read policies and record decisions; admins
7
- * manage policies and settings. Only the function (IAM) calls Limatus.
8
- */
9
- export function editorialChecksSchemaDefinitions() {
10
- return {
11
- EditorialPolicy: a
12
- .model({
13
- id: a.id().required(),
14
- policyKey: a.string().required(),
15
- scope: a.string().required(),
16
- version: a.integer().required(),
17
- title: a.string().required(),
18
- guidance: a.string().required(),
19
- severity: a.string().required(),
20
- enabled: a.boolean().required(),
21
- detectors: a.json().required(),
22
- examples: a.json(),
23
- rewriteGuidance: a.string(),
24
- source: a.string().required(),
25
- })
26
- .disableOperations(["subscriptions"])
27
- .authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
28
- EditorialCheckSettings: a
29
- .model({
30
- id: a.id().required(),
31
- settings: a.json().required(),
32
- })
33
- .disableOperations(["subscriptions"])
34
- .authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
35
- EditorialFeedback: a
36
- .model({
37
- id: a.id().required(),
38
- itemId: a.string().required(),
39
- findingId: a.string().required(),
40
- policyId: a.string().required(),
41
- detectorId: a.string().required(),
42
- lane: a.string().required(),
43
- probability: a.float(),
44
- decision: a.string().required(),
45
- reason: a.string(),
46
- text: a.string(),
47
- })
48
- .disableOperations(["subscriptions"])
49
- .secondaryIndexes((index) => [index("itemId").queryField("listEditorialFeedbackByItem")])
50
- .authorization((allow) => [allow.group("editor").to(["create", "read"]), allow.group("admin")]),
51
- checkEditorial: a
52
- .query()
53
- .arguments({ body: a.string().required(), format: a.string(), section: a.string() })
54
- .returns(a.json())
55
- .authorization((allow) => [allow.groups(editors)])
56
- .handler(a.handler.function(editorialChecks)),
57
- suggestEditorialRewrite: a
58
- .query()
59
- .arguments({
60
- body: a.string().required(),
61
- format: a.string(),
62
- section: a.string(),
63
- finding: a.json(),
64
- selection: a.json(),
65
- note: a.string(),
66
- })
67
- .returns(a.json())
68
- .authorization((allow) => [allow.groups(editors)])
69
- .handler(a.handler.function(editorialChecks)),
70
- draftEditorialQuestions: a
71
- .query()
72
- .arguments({ title: a.string().required(), guidance: a.string().required(), examples: a.json() })
73
- .returns(a.json())
74
- .authorization((allow) => [allow.group("admin")])
75
- .handler(a.handler.function(editorialChecks)),
76
- tryEditorialPolicy: a
77
- .query()
78
- .arguments({ policy: a.json().required(), text: a.string().required(), format: a.string() })
79
- .returns(a.json())
80
- .authorization((allow) => [allow.group("admin")])
81
- .handler(a.handler.function(editorialChecks)),
82
- importEditorialStarterPack: a
83
- .mutation()
84
- .arguments({ name: a.string().required() })
85
- .returns(a.json())
86
- .authorization((allow) => [allow.group("admin")])
87
- .handler(a.handler.function(editorialChecks)),
88
- recalibrateEditorialPolicies: a
89
- .mutation()
90
- .returns(a.json())
91
- .authorization((allow) => [allow.group("admin")])
92
- .handler(a.handler.function(editorialChecks)),
93
- };
94
- }