@anthusai/papyrus 2.0.0-next.75 → 2.0.0-next.77

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.
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { monitoringView } from "./resource";
3
+ import { functionHandler } from "../../data/function-handler";
3
4
 
4
5
  const editors = ["editor", "admin"];
5
6
 
@@ -14,5 +15,5 @@ export const monitoringViewSchemaDefinitions = {
14
15
  .arguments({ scope: a.string() })
15
16
  .returns(a.json())
16
17
  .authorization((allow) => [allow.groups(editors)])
17
- .handler(a.handler.function(monitoringView)),
18
+ .handler(functionHandler("monitoringView", monitoringView)),
18
19
  };
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { newsletterOps } from "./ops/resource.js";
3
+ import { functionHandler } from "../../data/function-handler.js";
3
4
  const staff = ["editor", "admin"];
4
5
  const admins = ["admin"];
5
6
  /** The newsroom's newsletter operations, all JSON in and out. The function checks the groups again from the identity claims. */
@@ -46,7 +47,7 @@ export const NEWSLETTER_OPERATION_GROUPS = {
46
47
  * table, never readable through the content API. It adds fourteen operations for the newsroom's Newsletter panel.
47
48
  */
48
49
  export function newsletterSchemaDefinitions() {
49
- const handler = a.handler.function(newsletterOps);
50
+ const handler = functionHandler("newsletterOps", newsletterOps);
50
51
  const query = (name) => a.query().arguments({ input: a.json() }).returns(a.json()).authorization((allow) => [allow.groups(NEWSLETTER_OPERATION_GROUPS[name])]).handler(handler);
51
52
  const mutation = (name) => a.mutation().arguments({ input: a.json() }).returns(a.json()).authorization((allow) => [allow.groups(NEWSLETTER_OPERATION_GROUPS[name])]).handler(handler);
52
53
  return {
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { newsletterOps } from "./ops/resource";
3
+ import { functionHandler } from "../../data/function-handler";
3
4
 
4
5
  const staff = ["editor", "admin"];
5
6
  const admins = ["admin"];
@@ -49,7 +50,7 @@ export const NEWSLETTER_OPERATION_GROUPS: Record<string, string[]> = {
49
50
  * table, never readable through the content API. It adds fourteen operations for the newsroom's Newsletter panel.
50
51
  */
51
52
  export function newsletterSchemaDefinitions(): Record<string, unknown> {
52
- const handler = a.handler.function(newsletterOps);
53
+ const handler = functionHandler("newsletterOps", newsletterOps);
53
54
  const query = (name: string) =>
54
55
  a.query().arguments({ input: a.json() }).returns(a.json()).authorization((allow) => [allow.groups(NEWSLETTER_OPERATION_GROUPS[name])]).handler(handler);
55
56
  const mutation = (name: string) =>
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { readerActions } from "./function/resource.js";
3
+ import { functionHandler } from "../../data/function-handler.js";
3
4
  /**
4
5
  * Staff and IAM only: no guest, API key or reader rule on any model. The reader-actions function writes the
5
6
  * tables directly with its own role, and editors may list them; admins may delete. `id` is the lookup key:
@@ -170,7 +171,7 @@ export function readerSteeringSchemaDefinitions() {
170
171
  })
171
172
  .returns(a.ref("ProposalReceipt"))
172
173
  .authorization((allow) => [allow.group("editor"), allow.group("admin")])
173
- .handler(a.handler.function(readerActions)),
174
+ .handler(functionHandler("readerActions", readerActions)),
174
175
  transitionProposal: a
175
176
  .mutation()
176
177
  .arguments({
@@ -181,7 +182,7 @@ export function readerSteeringSchemaDefinitions() {
181
182
  })
182
183
  .returns(a.ref("ProposalReceipt"))
183
184
  .authorization((allow) => [allow.group("editor"), allow.group("admin")])
184
- .handler(a.handler.function(readerActions)),
185
+ .handler(functionHandler("readerActions", readerActions)),
185
186
  ModerationReceipt: a.customType({
186
187
  status: a.string().required(),
187
188
  id: a.string(),
@@ -199,6 +200,6 @@ export function readerSteeringSchemaDefinitions() {
199
200
  })
200
201
  .returns(a.ref("ModerationReceipt"))
201
202
  .authorization((allow) => [allow.group("editor"), allow.group("admin")])
202
- .handler(a.handler.function(readerActions)),
203
+ .handler(functionHandler("readerActions", readerActions)),
203
204
  };
204
205
  }
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { readerActions } from "./function/resource";
3
+ import { functionHandler } from "../../data/function-handler";
3
4
 
4
5
  /**
5
6
  * Staff and IAM only: no guest, API key or reader rule on any model. The reader-actions function writes the
@@ -172,7 +173,7 @@ export function readerSteeringSchemaDefinitions() {
172
173
  })
173
174
  .returns(a.ref("ProposalReceipt"))
174
175
  .authorization((allow) => [allow.group("editor"), allow.group("admin")])
175
- .handler(a.handler.function(readerActions)),
176
+ .handler(functionHandler("readerActions", readerActions)),
176
177
  transitionProposal: a
177
178
  .mutation()
178
179
  .arguments({
@@ -183,7 +184,7 @@ export function readerSteeringSchemaDefinitions() {
183
184
  })
184
185
  .returns(a.ref("ProposalReceipt"))
185
186
  .authorization((allow) => [allow.group("editor"), allow.group("admin")])
186
- .handler(a.handler.function(readerActions)),
187
+ .handler(functionHandler("readerActions", readerActions)),
187
188
  ModerationReceipt: a.customType({
188
189
  status: a.string().required(),
189
190
  id: a.string(),
@@ -201,6 +202,6 @@ export function readerSteeringSchemaDefinitions() {
201
202
  })
202
203
  .returns(a.ref("ModerationReceipt"))
203
204
  .authorization((allow) => [allow.group("editor"), allow.group("admin")])
204
- .handler(a.handler.function(readerActions)),
205
+ .handler(functionHandler("readerActions", readerActions)),
205
206
  };
206
207
  }
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { signupSubmit } from "./function/resource.js";
3
+ import { functionHandler } from "../../data/function-handler.js";
3
4
  /**
4
5
  * SignupEntry is never guest-readable and has no create rule for anyone: only the
5
6
  * submitSignup function (IAM) writes it. Editors and admins list it; admins delete.
@@ -35,6 +36,6 @@ export function signupSchemaDefinitions() {
35
36
  })
36
37
  .returns(a.ref("SignupReceipt"))
37
38
  .authorization((allow) => [allow.guest()])
38
- .handler(a.handler.function(signupSubmit)),
39
+ .handler(functionHandler("signupSubmit", signupSubmit)),
39
40
  };
40
41
  }
@@ -1,5 +1,6 @@
1
1
  import { a } from "@aws-amplify/backend";
2
2
  import { signupSubmit } from "./function/resource";
3
+ import { functionHandler } from "../../data/function-handler";
3
4
 
4
5
  /**
5
6
  * SignupEntry is never guest-readable and has no create rule for anyone: only the
@@ -36,6 +37,6 @@ export function signupSchemaDefinitions() {
36
37
  })
37
38
  .returns(a.ref("SignupReceipt"))
38
39
  .authorization((allow) => [allow.guest()])
39
- .handler(a.handler.function(signupSubmit)),
40
+ .handler(functionHandler("signupSubmit", signupSubmit)),
40
41
  };
41
42
  }
package/package.json CHANGED
@@ -444,7 +444,7 @@
444
444
  "optional": true
445
445
  }
446
446
  },
447
- "version": "2.0.0-next.75",
447
+ "version": "2.0.0-next.77",
448
448
  "dependencies": {
449
449
  "@aws-amplify/adapter-nextjs": "^1.7.3",
450
450
  "@aws-crypto/sha256-js": "5.2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0-next.75",
2
+ "version": "2.0.0-next.77",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",