@anthusai/papyrus 2.0.0-next.5 → 2.0.0-next.50
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 +23 -3
- package/amplify/data/resource.ts +25 -3
- package/amplify/data/schema.js +2028 -1979
- package/amplify/data/schema.ts +72 -14
- package/amplify/functions/assignment-action/data-access.js +90 -0
- package/amplify/functions/assignment-action/data-access.ts +89 -0
- package/amplify/functions/assignment-action/handler.ts +1 -1
- package/amplify/functions/content-actions/handler.py +53 -2
- package/amplify/functions/content-actions/requirements.txt +1 -0
- package/amplify/functions/content-actions/resource.js +1 -1
- package/amplify/functions/content-actions/resource.ts +1 -1
- package/amplify/functions/editorial-checks/handler.py +14 -0
- package/amplify/functions/editorial-checks/requirements.txt +1 -0
- package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.js +7 -7
- package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.ts +7 -7
- package/amplify/functions/editorial-checks/schema.js +121 -0
- package/amplify/{plugins → functions}/editorial-checks/schema.ts +33 -6
- package/amplify/functions/editorial-checks/wire.js +53 -0
- package/amplify/functions/editorial-checks/wire.ts +61 -0
- package/amplify/functions/monitoring-view/handler.py +11 -0
- package/amplify/functions/monitoring-view/resource.js +24 -0
- package/amplify/functions/monitoring-view/resource.ts +34 -0
- package/amplify/functions/monitoring-view/schema.js +16 -0
- package/amplify/functions/monitoring-view/schema.ts +18 -0
- package/amplify/functions/monitoring-view/wire.js +37 -0
- package/amplify/functions/monitoring-view/wire.ts +47 -0
- package/amplify/functions/public-forms/core.js +247 -0
- package/amplify/functions/public-forms/core.ts +310 -0
- package/amplify/functions/public-forms/handler.ts +41 -0
- package/amplify/functions/public-forms/origins.js +35 -0
- package/amplify/functions/public-forms/origins.ts +43 -0
- package/amplify/functions/public-forms/resource.js +9 -0
- package/amplify/functions/public-forms/resource.ts +10 -0
- package/amplify/functions/public-forms/wire.js +25 -0
- package/amplify/functions/public-forms/wire.ts +32 -0
- package/amplify/functions/shared/editorial-context.ts +63 -4
- package/amplify/functions/shared/python-bundle.js +20 -14
- package/amplify/functions/shared/python-bundle.ts +25 -18
- package/amplify/plugins/newsletter/config.js +195 -0
- package/amplify/plugins/newsletter/config.ts +240 -0
- package/amplify/plugins/newsletter/function/handler.py +6 -0
- package/amplify/plugins/newsletter/function/requirements.txt +5 -0
- package/amplify/plugins/newsletter/ops/handler.py +12 -0
- package/amplify/plugins/newsletter/ops/resource.js +27 -0
- package/amplify/plugins/newsletter/ops/resource.ts +37 -0
- package/amplify/plugins/newsletter/papyrus.plugin.js +260 -0
- package/amplify/plugins/newsletter/papyrus.plugin.ts +308 -0
- package/amplify/plugins/newsletter/schema.js +56 -0
- package/amplify/plugins/newsletter/schema.ts +61 -0
- package/amplify/plugins/newsletter/secure-string-parameter.js +107 -0
- package/amplify/plugins/newsletter/secure-string-parameter.ts +120 -0
- package/amplify/plugins/newsletter/sending.js +140 -0
- package/amplify/plugins/newsletter/sending.ts +186 -0
- package/amplify/plugins/reader-steering/config.js +162 -0
- package/amplify/plugins/reader-steering/config.ts +248 -0
- package/amplify/plugins/reader-steering/function/ai_moderation.py +230 -0
- package/amplify/plugins/reader-steering/function/handler.py +1363 -0
- package/amplify/plugins/reader-steering/function/moderation-prompt.md +27 -0
- package/amplify/plugins/reader-steering/function/moderation.py +316 -0
- package/amplify/plugins/reader-steering/function/resource.js +27 -0
- package/amplify/plugins/reader-steering/function/resource.ts +35 -0
- package/amplify/plugins/reader-steering/papyrus.plugin.js +175 -0
- package/amplify/plugins/reader-steering/papyrus.plugin.ts +201 -0
- package/amplify/plugins/reader-steering/schema.js +140 -0
- package/amplify/plugins/reader-steering/schema.ts +142 -0
- package/amplify/plugins/registry.js +4 -2
- package/amplify/plugins/registry.ts +4 -2
- package/amplify/plugins/types.ts +5 -0
- package/amplify/plugins/wire.js +1 -0
- package/amplify/plugins/wire.ts +1 -0
- package/amplify/publication/redirect-and-index.js +105 -0
- package/amplify/publication/redirect-rules.js +73 -0
- package/amplify/publication/redirect-rules.ts +93 -0
- package/amplify/publication/s3-projection.js +7 -1
- package/amplify/publication/s3-projection.ts +9 -1
- package/amplify/site-backend-config.ts +17 -0
- package/amplify/site-backend.js +36 -1
- package/amplify/site-backend.ts +44 -1
- package/app/api/newsletter/confirm/route.ts +13 -0
- package/app/api/newsletter/preferences/route.ts +13 -0
- package/app/api/newsletter/subscribe/route.ts +9 -0
- package/app/api/newsletter/unsubscribe/route.ts +13 -0
- package/app/api/newsroom/curation/context/route.ts +9 -0
- package/app/api/newsroom/curation/priming/route.ts +9 -0
- package/app/api/newsroom/curation/publication/route.ts +9 -0
- package/app/api/reader/comment/delete/route.ts +9 -0
- package/app/api/reader/comment/edit/route.ts +9 -0
- package/app/api/reader/comment/route.ts +9 -0
- package/app/api/reader/handle/route.ts +9 -0
- package/app/api/reader/me/route.ts +9 -0
- package/app/api/reader/rating/route.ts +9 -0
- package/app/api/reader/report/route.ts +9 -0
- package/app/api/reader/retired/route.ts +9 -0
- package/app/api/reader/submit/route.ts +9 -0
- package/app/api/reader/vote/route.ts +9 -0
- package/bin/papyrus-infra.mjs +20 -1
- package/components/editorial-checks-admin-panel.tsx +36 -11
- package/components/moderation-panel.tsx +248 -0
- package/components/monitoring-overview-view.tsx +241 -0
- package/components/monitoring-panel.tsx +40 -0
- package/components/newsletter-panel.tsx +474 -0
- package/components/newsletter-sections.tsx +163 -0
- package/components/newsroom-article-editor.tsx +2 -4
- package/components/newsroom-board-view.tsx +4 -1
- package/components/newsroom-curation-bootstrap.tsx +45 -0
- package/components/newsroom-organizer.css +31 -0
- package/components/newsroom-references-view.tsx +14 -14
- package/components/publication-cyclotron-panel.tsx +15 -10
- package/components/reference-add-entry.tsx +75 -0
- package/components/reference-curation-controls.tsx +31 -22
- package/components/reference-cyclotron-priming.tsx +58 -19
- package/components/reference-cyclotron-suggestion.tsx +1 -1
- package/components/reference-priming.tsx +14 -10
- package/components/reference-section-suggestion.tsx +1 -1
- package/components/topic-steering-workspace.tsx +64 -20
- package/components/use-editorial-checks.ts +12 -10
- package/infra/amplify-app-shell.js +90 -16
- package/infra/amplify-app-shell.ts +102 -18
- package/infra/index.js +1 -0
- package/infra/secure-string-parameter-handler.js +41 -0
- package/infra/secure-string-parameter-handler.ts +41 -0
- package/infra/secure-string-parameter.js +79 -0
- package/infra/secure-string-parameter.ts +91 -0
- package/infra/site-config.js +85 -6
- package/infra/site-config.ts +123 -6
- package/lib/category-repository.ts +11 -9
- package/lib/curation-routes.ts +345 -0
- package/lib/editorial-checks-backend.ts +1 -1
- package/lib/editorial-checks-client.ts +19 -1
- package/lib/editorial-checks-demo.ts +2 -2
- package/lib/editorial-checks-settings.ts +3 -0
- package/lib/editorial-checks.ts +8 -11
- package/lib/editorial-preview.ts +5 -5
- package/lib/monitoring-client.ts +29 -0
- package/lib/monitoring-overview-fixture.ts +51 -0
- package/lib/monitoring-overview.ts +145 -0
- package/lib/newsletter-api.ts +391 -0
- package/lib/newsletter-client.ts +46 -0
- package/lib/newsletter-fixture.ts +184 -0
- package/lib/newsletter-model.ts +202 -0
- package/lib/newsletter-pages.ts +264 -0
- package/lib/newsroom-board.ts +27 -2
- package/lib/prospectus-session.ts +15 -14
- package/lib/prospectus-sign-in-routes.ts +54 -13
- package/lib/prospectus-site-identity.ts +24 -1
- package/lib/reader-api.ts +145 -0
- package/lib/reader-moderation.ts +220 -0
- package/lib/reader-retirement-route.ts +89 -0
- package/lib/reader-subject.md +29 -0
- package/lib/reader-subject.ts +53 -0
- package/lib/relevance-status.ts +2 -2
- package/lib/site-brand-tenant.ts +11 -6
- package/lib/site-brand.ts +6 -3
- package/lib/site-origin.ts +67 -0
- package/middleware.ts +14 -3
- package/package.json +42 -4
- package/routes.manifest.json +191 -1
- package/amplify/plugins/editorial-checks/function/handler.py +0 -11
- package/amplify/plugins/editorial-checks/function/requirements.txt +0 -1
- package/amplify/plugins/editorial-checks/papyrus.plugin.js +0 -50
- package/amplify/plugins/editorial-checks/papyrus.plugin.ts +0 -63
- package/amplify/plugins/editorial-checks/schema.js +0 -94
package/package.json
CHANGED
|
@@ -85,9 +85,14 @@
|
|
|
85
85
|
"./components/item-stream-view": "./components/item-stream-view.tsx",
|
|
86
86
|
"./components/markus-body-editor": "./components/markus-body-editor.tsx",
|
|
87
87
|
"./components/markus-ir-preview": "./components/markus-ir-preview.tsx",
|
|
88
|
+
"./components/moderation-panel": "./components/moderation-panel.tsx",
|
|
89
|
+
"./components/monitoring-overview-view": "./components/monitoring-overview-view.tsx",
|
|
90
|
+
"./components/monitoring-panel": "./components/monitoring-panel.tsx",
|
|
88
91
|
"./components/news-desk-client-provider": "./components/news-desk-client-provider.tsx",
|
|
89
92
|
"./components/news-desk-page": "./components/news-desk-page.tsx",
|
|
90
93
|
"./components/news-desk-taxonomy-client": "./components/news-desk-taxonomy-client.ts",
|
|
94
|
+
"./components/newsletter-panel": "./components/newsletter-panel.tsx",
|
|
95
|
+
"./components/newsletter-sections": "./components/newsletter-sections.tsx",
|
|
91
96
|
"./components/newspaper": "./components/newspaper.tsx",
|
|
92
97
|
"./components/newsroom-access-gate": "./components/newsroom-access-gate.tsx",
|
|
93
98
|
"./components/newsroom-article-editor": "./components/newsroom-article-editor.tsx",
|
|
@@ -96,6 +101,7 @@
|
|
|
96
101
|
"./components/newsroom-assignments-view": "./components/newsroom-assignments-view.tsx",
|
|
97
102
|
"./components/newsroom-board-view": "./components/newsroom-board-view.tsx",
|
|
98
103
|
"./components/newsroom-client-shell": "./components/newsroom-client-shell.tsx",
|
|
104
|
+
"./components/newsroom-curation-bootstrap": "./components/newsroom-curation-bootstrap.tsx",
|
|
99
105
|
"./components/newsroom-curation-provider": "./components/newsroom-curation-provider.tsx",
|
|
100
106
|
"./components/newsroom-ops-overview": "./components/newsroom-ops-overview.tsx",
|
|
101
107
|
"./components/newsroom-ops-shell": "./components/newsroom-ops-shell.tsx",
|
|
@@ -118,6 +124,7 @@
|
|
|
118
124
|
"./components/reader-auth-state": "./components/reader-auth-state.ts",
|
|
119
125
|
"./components/reader-settings": "./components/reader-settings.ts",
|
|
120
126
|
"./components/reader-theme-control": "./components/reader-theme-control.tsx",
|
|
127
|
+
"./components/reference-add-entry": "./components/reference-add-entry.tsx",
|
|
121
128
|
"./components/reference-curation-controls": "./components/reference-curation-controls.tsx",
|
|
122
129
|
"./components/reference-cyclotron-priming": "./components/reference-cyclotron-priming.tsx",
|
|
123
130
|
"./components/reference-cyclotron-status": "./components/reference-cyclotron-status.tsx",
|
|
@@ -188,6 +195,7 @@
|
|
|
188
195
|
"./lib/content-types": "./lib/content-types.ts",
|
|
189
196
|
"./lib/curation-client": "./lib/curation-client.ts",
|
|
190
197
|
"./lib/curation-delegation-helpers": "./lib/curation-delegation-helpers.ts",
|
|
198
|
+
"./lib/curation-routes": "./lib/curation-routes.ts",
|
|
191
199
|
"./lib/cyclotron-suggestions": "./lib/cyclotron-suggestions.ts",
|
|
192
200
|
"./lib/define-site": "./lib/define-site.ts",
|
|
193
201
|
"./lib/demo-amplify-outputs": "./lib/demo-amplify-outputs.ts",
|
|
@@ -224,7 +232,15 @@
|
|
|
224
232
|
"./lib/markus-projection": "./lib/markus-projection.ts",
|
|
225
233
|
"./lib/markus-to-article": "./lib/markus-to-article.ts",
|
|
226
234
|
"./lib/media-route-response": "./lib/media-route-response.ts",
|
|
235
|
+
"./lib/monitoring-client": "./lib/monitoring-client.ts",
|
|
236
|
+
"./lib/monitoring-overview-fixture": "./lib/monitoring-overview-fixture.ts",
|
|
237
|
+
"./lib/monitoring-overview": "./lib/monitoring-overview.ts",
|
|
227
238
|
"./lib/news-desk-session": "./lib/news-desk-session.ts",
|
|
239
|
+
"./lib/newsletter-api": "./lib/newsletter-api.ts",
|
|
240
|
+
"./lib/newsletter-client": "./lib/newsletter-client.ts",
|
|
241
|
+
"./lib/newsletter-fixture": "./lib/newsletter-fixture.ts",
|
|
242
|
+
"./lib/newsletter-model": "./lib/newsletter-model.ts",
|
|
243
|
+
"./lib/newsletter-pages": "./lib/newsletter-pages.ts",
|
|
228
244
|
"./lib/newspaper-layout": "./lib/newspaper-layout.ts",
|
|
229
245
|
"./lib/newsroom-articles": "./lib/newsroom-articles.ts",
|
|
230
246
|
"./lib/newsroom-assignments": "./lib/newsroom-assignments.ts",
|
|
@@ -265,11 +281,15 @@
|
|
|
265
281
|
"./lib/publication-cyclotron": "./lib/publication-cyclotron.ts",
|
|
266
282
|
"./lib/publication-items": "./lib/publication-items.ts",
|
|
267
283
|
"./lib/rate-limit-retry": "./lib/rate-limit-retry.ts",
|
|
284
|
+
"./lib/reader-api": "./lib/reader-api.ts",
|
|
268
285
|
"./lib/reader-base-path": "./lib/reader-base-path.ts",
|
|
269
286
|
"./lib/reader-cache-lifetime": "./lib/reader-cache-lifetime.ts",
|
|
287
|
+
"./lib/reader-moderation": "./lib/reader-moderation.ts",
|
|
288
|
+
"./lib/reader-retirement-route": "./lib/reader-retirement-route.ts",
|
|
270
289
|
"./lib/reader-route-config": "./lib/reader-route-config.ts",
|
|
271
290
|
"./lib/reader-static-params": "./lib/reader-static-params.ts",
|
|
272
291
|
"./lib/reader-storage-url": "./lib/reader-storage-url.ts",
|
|
292
|
+
"./lib/reader-subject": "./lib/reader-subject.ts",
|
|
273
293
|
"./lib/reference-display": "./lib/reference-display.ts",
|
|
274
294
|
"./lib/reference-policy": "./lib/reference-policy.ts",
|
|
275
295
|
"./lib/reference-source-preview": "./lib/reference-source-preview.ts",
|
|
@@ -288,6 +308,7 @@
|
|
|
288
308
|
"./lib/site-brand-tenant": "./lib/site-brand-tenant.ts",
|
|
289
309
|
"./lib/site-brand": "./lib/site-brand.ts",
|
|
290
310
|
"./lib/site-env": "./lib/site-env.ts",
|
|
311
|
+
"./lib/site-origin": "./lib/site-origin.ts",
|
|
291
312
|
"./lib/site-renderer": "./lib/site-renderer.ts",
|
|
292
313
|
"./lib/site-section-suggestions": "./lib/site-section-suggestions.ts",
|
|
293
314
|
"./lib/site-stack": "./lib/site-stack.ts",
|
|
@@ -330,6 +351,23 @@
|
|
|
330
351
|
"./app/api/local-preview/derive/route": "./app/api/local-preview/derive/route.ts",
|
|
331
352
|
"./app/api/local-preview/media/route": "./app/api/local-preview/media/route.ts",
|
|
332
353
|
"./app/api/media/[...path]/route": "./app/api/media/[...path]/route.ts",
|
|
354
|
+
"./app/api/newsletter/confirm/route": "./app/api/newsletter/confirm/route.ts",
|
|
355
|
+
"./app/api/newsletter/preferences/route": "./app/api/newsletter/preferences/route.ts",
|
|
356
|
+
"./app/api/newsletter/subscribe/route": "./app/api/newsletter/subscribe/route.ts",
|
|
357
|
+
"./app/api/newsletter/unsubscribe/route": "./app/api/newsletter/unsubscribe/route.ts",
|
|
358
|
+
"./app/api/newsroom/curation/context/route": "./app/api/newsroom/curation/context/route.ts",
|
|
359
|
+
"./app/api/newsroom/curation/priming/route": "./app/api/newsroom/curation/priming/route.ts",
|
|
360
|
+
"./app/api/newsroom/curation/publication/route": "./app/api/newsroom/curation/publication/route.ts",
|
|
361
|
+
"./app/api/reader/comment/delete/route": "./app/api/reader/comment/delete/route.ts",
|
|
362
|
+
"./app/api/reader/comment/edit/route": "./app/api/reader/comment/edit/route.ts",
|
|
363
|
+
"./app/api/reader/comment/route": "./app/api/reader/comment/route.ts",
|
|
364
|
+
"./app/api/reader/handle/route": "./app/api/reader/handle/route.ts",
|
|
365
|
+
"./app/api/reader/me/route": "./app/api/reader/me/route.ts",
|
|
366
|
+
"./app/api/reader/rating/route": "./app/api/reader/rating/route.ts",
|
|
367
|
+
"./app/api/reader/report/route": "./app/api/reader/report/route.ts",
|
|
368
|
+
"./app/api/reader/retired/route": "./app/api/reader/retired/route.ts",
|
|
369
|
+
"./app/api/reader/submit/route": "./app/api/reader/submit/route.ts",
|
|
370
|
+
"./app/api/reader/vote/route": "./app/api/reader/vote/route.ts",
|
|
333
371
|
"./app/api/revalidate/route": "./app/api/revalidate/route.ts",
|
|
334
372
|
"./app/archive/page": "./app/archive/page.tsx",
|
|
335
373
|
"./app/articles/[slug]/page": "./app/articles/[slug]/page.tsx",
|
|
@@ -395,14 +433,14 @@
|
|
|
395
433
|
"optional": true
|
|
396
434
|
}
|
|
397
435
|
},
|
|
398
|
-
"version": "2.0.0-next.
|
|
436
|
+
"version": "2.0.0-next.50",
|
|
399
437
|
"dependencies": {
|
|
400
438
|
"@aws-amplify/adapter-nextjs": "^1.7.3",
|
|
401
439
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
402
440
|
"@aws-sdk/client-cognito-identity-provider": "3.1045.0",
|
|
441
|
+
"@aws-sdk/client-dynamodb": "^3.1045.0",
|
|
403
442
|
"@aws-sdk/client-lambda": "^3.1045.0",
|
|
404
443
|
"@aws-sdk/client-s3": "^3.1045.0",
|
|
405
|
-
"@aws-sdk/client-secrets-manager": "3.1045.0",
|
|
406
444
|
"@aws-sdk/client-ssm": "^3.1045.0",
|
|
407
445
|
"@aws-sdk/credential-provider-node": "3.972.84",
|
|
408
446
|
"@aws-sdk/s3-request-presigner": "^3.1045.0",
|
|
@@ -422,7 +460,7 @@
|
|
|
422
460
|
"@fontsource-variable/source-serif-4": "5.3.1",
|
|
423
461
|
"@fontsource/ibm-plex-mono": "5.3.0",
|
|
424
462
|
"@fontsource/ibm-plex-sans": "5.3.0",
|
|
425
|
-
"@kanbus/ui": "https://github.com/AnthusAI/Kanbus/releases/download/ui-v0.4.
|
|
463
|
+
"@kanbus/ui": "https://github.com/AnthusAI/Kanbus/releases/download/ui-v0.4.1/kanbus-ui-0.4.1.tgz",
|
|
426
464
|
"@lezer/highlight": "^1.2.5",
|
|
427
465
|
"@radix-ui/colors": "3.0.0",
|
|
428
466
|
"@smithy/protocol-http": "5.4.1",
|
|
@@ -435,7 +473,7 @@
|
|
|
435
473
|
"class-variance-authority": "^0.7.1",
|
|
436
474
|
"clsx": "^2.1.1",
|
|
437
475
|
"cmdk": "^1.1.1",
|
|
438
|
-
"cyclotron": "https://github.com/AnthusAI/Cyclotron/releases/download/ui-v0.2.
|
|
476
|
+
"cyclotron": "https://github.com/AnthusAI/Cyclotron/releases/download/ui-v0.2.3/cyclotron-0.2.3.tgz",
|
|
439
477
|
"d3": "^7.9.0",
|
|
440
478
|
"esbuild": "^0.28.2",
|
|
441
479
|
"framer-motion": "^14.3.0",
|
package/routes.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0.0-next.
|
|
2
|
+
"version": "2.0.0-next.50",
|
|
3
3
|
"routes": [
|
|
4
4
|
{
|
|
5
5
|
"file": "app/%5F_preview/[[...path]]/route.ts",
|
|
@@ -170,6 +170,196 @@
|
|
|
170
170
|
"dynamic": "\"force-dynamic\""
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"file": "app/api/newsletter/confirm/route.ts",
|
|
175
|
+
"hasDefault": false,
|
|
176
|
+
"exports": [
|
|
177
|
+
"GET",
|
|
178
|
+
"POST"
|
|
179
|
+
],
|
|
180
|
+
"config": {
|
|
181
|
+
"dynamic": "\"force-dynamic\"",
|
|
182
|
+
"runtime": "\"nodejs\""
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"file": "app/api/newsletter/preferences/route.ts",
|
|
187
|
+
"hasDefault": false,
|
|
188
|
+
"exports": [
|
|
189
|
+
"GET",
|
|
190
|
+
"POST"
|
|
191
|
+
],
|
|
192
|
+
"config": {
|
|
193
|
+
"dynamic": "\"force-dynamic\"",
|
|
194
|
+
"runtime": "\"nodejs\""
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"file": "app/api/newsletter/subscribe/route.ts",
|
|
199
|
+
"hasDefault": false,
|
|
200
|
+
"exports": [
|
|
201
|
+
"POST"
|
|
202
|
+
],
|
|
203
|
+
"config": {
|
|
204
|
+
"dynamic": "\"force-dynamic\"",
|
|
205
|
+
"runtime": "\"nodejs\""
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"file": "app/api/newsletter/unsubscribe/route.ts",
|
|
210
|
+
"hasDefault": false,
|
|
211
|
+
"exports": [
|
|
212
|
+
"GET",
|
|
213
|
+
"POST"
|
|
214
|
+
],
|
|
215
|
+
"config": {
|
|
216
|
+
"dynamic": "\"force-dynamic\"",
|
|
217
|
+
"runtime": "\"nodejs\""
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"file": "app/api/newsroom/curation/context/route.ts",
|
|
222
|
+
"hasDefault": false,
|
|
223
|
+
"exports": [
|
|
224
|
+
"GET"
|
|
225
|
+
],
|
|
226
|
+
"config": {
|
|
227
|
+
"dynamic": "\"force-dynamic\"",
|
|
228
|
+
"runtime": "\"nodejs\""
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"file": "app/api/newsroom/curation/priming/route.ts",
|
|
233
|
+
"hasDefault": false,
|
|
234
|
+
"exports": [
|
|
235
|
+
"POST"
|
|
236
|
+
],
|
|
237
|
+
"config": {
|
|
238
|
+
"dynamic": "\"force-dynamic\"",
|
|
239
|
+
"runtime": "\"nodejs\""
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"file": "app/api/newsroom/curation/publication/route.ts",
|
|
244
|
+
"hasDefault": false,
|
|
245
|
+
"exports": [
|
|
246
|
+
"POST"
|
|
247
|
+
],
|
|
248
|
+
"config": {
|
|
249
|
+
"dynamic": "\"force-dynamic\"",
|
|
250
|
+
"runtime": "\"nodejs\""
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"file": "app/api/reader/comment/delete/route.ts",
|
|
255
|
+
"hasDefault": false,
|
|
256
|
+
"exports": [
|
|
257
|
+
"POST"
|
|
258
|
+
],
|
|
259
|
+
"config": {
|
|
260
|
+
"dynamic": "\"force-dynamic\"",
|
|
261
|
+
"runtime": "\"nodejs\""
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"file": "app/api/reader/comment/edit/route.ts",
|
|
266
|
+
"hasDefault": false,
|
|
267
|
+
"exports": [
|
|
268
|
+
"POST"
|
|
269
|
+
],
|
|
270
|
+
"config": {
|
|
271
|
+
"dynamic": "\"force-dynamic\"",
|
|
272
|
+
"runtime": "\"nodejs\""
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"file": "app/api/reader/comment/route.ts",
|
|
277
|
+
"hasDefault": false,
|
|
278
|
+
"exports": [
|
|
279
|
+
"POST"
|
|
280
|
+
],
|
|
281
|
+
"config": {
|
|
282
|
+
"dynamic": "\"force-dynamic\"",
|
|
283
|
+
"runtime": "\"nodejs\""
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"file": "app/api/reader/handle/route.ts",
|
|
288
|
+
"hasDefault": false,
|
|
289
|
+
"exports": [
|
|
290
|
+
"POST"
|
|
291
|
+
],
|
|
292
|
+
"config": {
|
|
293
|
+
"dynamic": "\"force-dynamic\"",
|
|
294
|
+
"runtime": "\"nodejs\""
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"file": "app/api/reader/me/route.ts",
|
|
299
|
+
"hasDefault": false,
|
|
300
|
+
"exports": [
|
|
301
|
+
"GET"
|
|
302
|
+
],
|
|
303
|
+
"config": {
|
|
304
|
+
"dynamic": "\"force-dynamic\"",
|
|
305
|
+
"runtime": "\"nodejs\""
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"file": "app/api/reader/rating/route.ts",
|
|
310
|
+
"hasDefault": false,
|
|
311
|
+
"exports": [
|
|
312
|
+
"POST"
|
|
313
|
+
],
|
|
314
|
+
"config": {
|
|
315
|
+
"dynamic": "\"force-dynamic\"",
|
|
316
|
+
"runtime": "\"nodejs\""
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"file": "app/api/reader/report/route.ts",
|
|
321
|
+
"hasDefault": false,
|
|
322
|
+
"exports": [
|
|
323
|
+
"POST"
|
|
324
|
+
],
|
|
325
|
+
"config": {
|
|
326
|
+
"dynamic": "\"force-dynamic\"",
|
|
327
|
+
"runtime": "\"nodejs\""
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"file": "app/api/reader/retired/route.ts",
|
|
332
|
+
"hasDefault": false,
|
|
333
|
+
"exports": [
|
|
334
|
+
"GET"
|
|
335
|
+
],
|
|
336
|
+
"config": {
|
|
337
|
+
"dynamic": "\"force-dynamic\"",
|
|
338
|
+
"runtime": "\"nodejs\""
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"file": "app/api/reader/submit/route.ts",
|
|
343
|
+
"hasDefault": false,
|
|
344
|
+
"exports": [
|
|
345
|
+
"POST"
|
|
346
|
+
],
|
|
347
|
+
"config": {
|
|
348
|
+
"dynamic": "\"force-dynamic\"",
|
|
349
|
+
"runtime": "\"nodejs\""
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"file": "app/api/reader/vote/route.ts",
|
|
354
|
+
"hasDefault": false,
|
|
355
|
+
"exports": [
|
|
356
|
+
"POST"
|
|
357
|
+
],
|
|
358
|
+
"config": {
|
|
359
|
+
"dynamic": "\"force-dynamic\"",
|
|
360
|
+
"runtime": "\"nodejs\""
|
|
361
|
+
}
|
|
362
|
+
},
|
|
173
363
|
{
|
|
174
364
|
"file": "app/api/revalidate/route.ts",
|
|
175
365
|
"hasDefault": false,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"""The editorial-checks plugin's function: routes its GraphQL fields to papyrus_content.editorial_checks."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Any
|
|
6
|
-
|
|
7
|
-
from papyrus_content.editorial_checks import GraphQLEditorialStore, Services, handle
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def handler(event: dict[str, Any], _context: Any = None) -> dict[str, Any]:
|
|
11
|
-
return handle(event["info"]["fieldName"], event.get("arguments") or {}, Services(store=GraphQLEditorialStore()))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
limatus[jev]>=0.31,<0.32
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { secret } from "@aws-amplify/backend";
|
|
2
|
-
import { Stack } from "aws-cdk-lib";
|
|
3
|
-
import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";
|
|
4
|
-
import { editorialChecks } from "./function/resource.js";
|
|
5
|
-
import { editorialChecksSchemaDefinitions } from "./schema.js";
|
|
6
|
-
export const EDITORIAL_CHECKS_QUERIES = ["checkEditorial", "suggestEditorialRewrite", "draftEditorialQuestions", "tryEditorialPolicy"];
|
|
7
|
-
export const EDITORIAL_CHECKS_MUTATIONS = ["importEditorialStarterPack", "recalibrateEditorialPolicies"];
|
|
8
|
-
/** The model operations the function performs with its own role. */
|
|
9
|
-
export const EDITORIAL_CHECKS_FUNCTION_FIELDS = [
|
|
10
|
-
"Query/fields/listEditorialPolicies",
|
|
11
|
-
"Query/fields/getEditorialCheckSettings",
|
|
12
|
-
"Query/fields/listEditorialFeedbacks",
|
|
13
|
-
"Mutation/fields/createEditorialPolicy",
|
|
14
|
-
"Mutation/fields/updateEditorialPolicy",
|
|
15
|
-
];
|
|
16
|
-
export const editorialChecksManifest = {
|
|
17
|
-
name: "editorial-checks",
|
|
18
|
-
contract: 1,
|
|
19
|
-
models: ["EditorialPolicy", "EditorialCheckSettings", "EditorialFeedback"],
|
|
20
|
-
mutations: [...EDITORIAL_CHECKS_QUERIES, ...EDITORIAL_CHECKS_MUTATIONS],
|
|
21
|
-
guest: { mutations: [] },
|
|
22
|
-
newsroomPanels: [{ id: "editorial-checks", label: "Editorial checks" }],
|
|
23
|
-
staticAssets: [],
|
|
24
|
-
};
|
|
25
|
-
export function resolveEditorialChecksConfig(request) {
|
|
26
|
-
const raw = typeof request === "string" ? { name: request } : request;
|
|
27
|
-
const unknown = Object.keys(raw).filter((key) => key !== "name");
|
|
28
|
-
if (unknown.length > 0)
|
|
29
|
-
throw new Error(`Unknown editorial-checks plugin settings: ${unknown.join(", ")} (runtime settings are edited in the newsroom)`);
|
|
30
|
-
return {};
|
|
31
|
-
}
|
|
32
|
-
export const editorialChecksPlugin = {
|
|
33
|
-
manifest: editorialChecksManifest,
|
|
34
|
-
resolveConfig: resolveEditorialChecksConfig,
|
|
35
|
-
functions: () => ({ editorialChecks }),
|
|
36
|
-
schemaDefinitions: editorialChecksSchemaDefinitions,
|
|
37
|
-
publicSettings: () => ({ contract: editorialChecksManifest.contract }),
|
|
38
|
-
wire(backend, _config, context) {
|
|
39
|
-
const lambda = backend.editorialChecks.resources.lambda;
|
|
40
|
-
const stack = Stack.of(lambda);
|
|
41
|
-
lambda.addEnvironment("PAPYRUS_GRAPHQL_ENDPOINT", context.graphqlEndpoint);
|
|
42
|
-
backend.editorialChecks.addEnvironment("TYPESAFE_API_KEY", secret("TYPESAFE_API_KEY"));
|
|
43
|
-
backend.editorialChecks.addEnvironment("OPENAI_API_KEY", secret("OPENAI_API_KEY"));
|
|
44
|
-
lambda.addToRolePolicy(new PolicyStatement({
|
|
45
|
-
effect: Effect.ALLOW,
|
|
46
|
-
actions: ["appsync:GraphQL"],
|
|
47
|
-
resources: EDITORIAL_CHECKS_FUNCTION_FIELDS.map((field) => `arn:aws:appsync:${stack.region}:${stack.account}:apis/${context.graphqlApiId}/types/${field}`),
|
|
48
|
-
}));
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { secret } from "@aws-amplify/backend";
|
|
2
|
-
import { Stack } from "aws-cdk-lib";
|
|
3
|
-
import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";
|
|
4
|
-
import type { Function as LambdaFunction } from "aws-cdk-lib/aws-lambda";
|
|
5
|
-
import type { PapyrusPlugin, PluginManifest, PluginRequest, PluginWiringContext } from "../types";
|
|
6
|
-
import { editorialChecks } from "./function/resource";
|
|
7
|
-
import { editorialChecksSchemaDefinitions } from "./schema";
|
|
8
|
-
|
|
9
|
-
/** Runtime settings (lanes, models, deadline) live in EditorialCheckSettings, edited in the newsroom; enabling the plugin takes no options. */
|
|
10
|
-
export type EditorialChecksPluginConfig = Record<string, never>;
|
|
11
|
-
|
|
12
|
-
export const EDITORIAL_CHECKS_QUERIES = ["checkEditorial", "suggestEditorialRewrite", "draftEditorialQuestions", "tryEditorialPolicy"];
|
|
13
|
-
export const EDITORIAL_CHECKS_MUTATIONS = ["importEditorialStarterPack", "recalibrateEditorialPolicies"];
|
|
14
|
-
|
|
15
|
-
/** The model operations the function performs with its own role. */
|
|
16
|
-
export const EDITORIAL_CHECKS_FUNCTION_FIELDS = [
|
|
17
|
-
"Query/fields/listEditorialPolicies",
|
|
18
|
-
"Query/fields/getEditorialCheckSettings",
|
|
19
|
-
"Query/fields/listEditorialFeedbacks",
|
|
20
|
-
"Mutation/fields/createEditorialPolicy",
|
|
21
|
-
"Mutation/fields/updateEditorialPolicy",
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
export const editorialChecksManifest: PluginManifest = {
|
|
25
|
-
name: "editorial-checks",
|
|
26
|
-
contract: 1,
|
|
27
|
-
models: ["EditorialPolicy", "EditorialCheckSettings", "EditorialFeedback"],
|
|
28
|
-
mutations: [...EDITORIAL_CHECKS_QUERIES, ...EDITORIAL_CHECKS_MUTATIONS],
|
|
29
|
-
guest: { mutations: [] },
|
|
30
|
-
newsroomPanels: [{ id: "editorial-checks", label: "Editorial checks" }],
|
|
31
|
-
staticAssets: [],
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export function resolveEditorialChecksConfig(request: PluginRequest): EditorialChecksPluginConfig {
|
|
35
|
-
const raw = typeof request === "string" ? { name: request } : request;
|
|
36
|
-
const unknown = Object.keys(raw).filter((key) => key !== "name");
|
|
37
|
-
if (unknown.length > 0) throw new Error(`Unknown editorial-checks plugin settings: ${unknown.join(", ")} (runtime settings are edited in the newsroom)`);
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const editorialChecksPlugin: PapyrusPlugin<EditorialChecksPluginConfig, { editorialChecks: typeof editorialChecks }> = {
|
|
42
|
-
manifest: editorialChecksManifest,
|
|
43
|
-
resolveConfig: resolveEditorialChecksConfig,
|
|
44
|
-
functions: () => ({ editorialChecks }),
|
|
45
|
-
schemaDefinitions: editorialChecksSchemaDefinitions,
|
|
46
|
-
publicSettings: () => ({ contract: editorialChecksManifest.contract }),
|
|
47
|
-
wire(backend, _config, context: PluginWiringContext) {
|
|
48
|
-
const lambda = backend.editorialChecks.resources.lambda as LambdaFunction;
|
|
49
|
-
const stack = Stack.of(lambda);
|
|
50
|
-
lambda.addEnvironment("PAPYRUS_GRAPHQL_ENDPOINT", context.graphqlEndpoint);
|
|
51
|
-
backend.editorialChecks.addEnvironment("TYPESAFE_API_KEY", secret("TYPESAFE_API_KEY"));
|
|
52
|
-
backend.editorialChecks.addEnvironment("OPENAI_API_KEY", secret("OPENAI_API_KEY"));
|
|
53
|
-
lambda.addToRolePolicy(
|
|
54
|
-
new PolicyStatement({
|
|
55
|
-
effect: Effect.ALLOW,
|
|
56
|
-
actions: ["appsync:GraphQL"],
|
|
57
|
-
resources: EDITORIAL_CHECKS_FUNCTION_FIELDS.map(
|
|
58
|
-
(field) => `arn:aws:appsync:${stack.region}:${stack.account}:apis/${context.graphqlApiId}/types/${field}`,
|
|
59
|
-
),
|
|
60
|
-
}),
|
|
61
|
-
);
|
|
62
|
-
},
|
|
63
|
-
};
|
|
@@ -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
|
-
}
|