@anthusai/papyrus 5.10.0 → 5.11.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 +7 -3
- package/amplify/data/resource.ts +7 -3
- package/amplify/data/schema.js +2023 -1981
- package/amplify/data/schema.ts +50 -2
- package/amplify/site-backend-config.ts +7 -0
- package/amplify/site-backend.js +1 -1
- package/amplify/site-backend.ts +1 -1
- package/package.json +1 -1
- package/routes.manifest.json +1 -1
package/amplify/data/resource.js
CHANGED
|
@@ -13,7 +13,7 @@ import { emailSubmissionProcessor } from "../functions/email-submission-processo
|
|
|
13
13
|
import { sesInboundReceive } from "../functions/ses-inbound-receive/resource.js";
|
|
14
14
|
import { slackDelivery } from "../functions/slack-delivery/resource.js";
|
|
15
15
|
import { slackEvents } from "../functions/slack-events/resource.js";
|
|
16
|
-
import { schema as leanSchema, schemaWithPlugins } from "./schema.js";
|
|
16
|
+
import { assertKnownModelGroups, schema as leanSchema, schemaExcludingGroups, schemaWithPlugins } from "./schema.js";
|
|
17
17
|
const authoringOperations = [
|
|
18
18
|
"read",
|
|
19
19
|
"create",
|
|
@@ -2176,10 +2176,14 @@ const schema = a.schema({
|
|
|
2176
2176
|
* The site's data API. Amplify allows one `defineData` per backend and registers it when called, so this is
|
|
2177
2177
|
* a function: a site without plugins passes none and gets exactly the base schema.
|
|
2178
2178
|
*/
|
|
2179
|
-
export function defineSiteData(pluginDefinitions = {}) {
|
|
2179
|
+
export function defineSiteData(pluginDefinitions = {}, excludeModelGroups = []) {
|
|
2180
|
+
assertKnownModelGroups(excludeModelGroups);
|
|
2181
|
+
const hasPlugins = Object.keys(pluginDefinitions).length > 0;
|
|
2180
2182
|
return defineData({
|
|
2181
2183
|
name: "PapyrusCmsApi",
|
|
2182
|
-
schema:
|
|
2184
|
+
schema: excludeModelGroups.length > 0
|
|
2185
|
+
? schemaExcludingGroups(excludeModelGroups, pluginDefinitions)
|
|
2186
|
+
: hasPlugins ? schemaWithPlugins(pluginDefinitions) : leanSchema,
|
|
2183
2187
|
authorizationModes: {
|
|
2184
2188
|
defaultAuthorizationMode: "userPool",
|
|
2185
2189
|
apiKeyAuthorizationMode: {
|
package/amplify/data/resource.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { emailSubmissionProcessor } from "../functions/email-submission-processo
|
|
|
13
13
|
import { sesInboundReceive } from "../functions/ses-inbound-receive/resource";
|
|
14
14
|
import { slackDelivery } from "../functions/slack-delivery/resource";
|
|
15
15
|
import { slackEvents } from "../functions/slack-events/resource";
|
|
16
|
-
import { schema as leanSchema, schemaWithPlugins } from "./schema";
|
|
16
|
+
import { assertKnownModelGroups, schema as leanSchema, schemaExcludingGroups, schemaWithPlugins } from "./schema";
|
|
17
17
|
const authoringOperations: ("read" | "create" | "update" | "delete")[] = [
|
|
18
18
|
"read",
|
|
19
19
|
"create",
|
|
@@ -2306,10 +2306,14 @@ export type Schema = ClientSchema<typeof schema>;
|
|
|
2306
2306
|
* The site's data API. Amplify allows one `defineData` per backend and registers it when called, so this is
|
|
2307
2307
|
* a function: a site without plugins passes none and gets exactly the base schema.
|
|
2308
2308
|
*/
|
|
2309
|
-
export function defineSiteData(pluginDefinitions: Record<string, unknown> = {}) {
|
|
2309
|
+
export function defineSiteData(pluginDefinitions: Record<string, unknown> = {}, excludeModelGroups: readonly string[] = []) {
|
|
2310
|
+
assertKnownModelGroups(excludeModelGroups);
|
|
2311
|
+
const hasPlugins = Object.keys(pluginDefinitions).length > 0;
|
|
2310
2312
|
return defineData({
|
|
2311
2313
|
name: "PapyrusCmsApi",
|
|
2312
|
-
schema:
|
|
2314
|
+
schema: excludeModelGroups.length > 0
|
|
2315
|
+
? schemaExcludingGroups(excludeModelGroups, pluginDefinitions)
|
|
2316
|
+
: hasPlugins ? schemaWithPlugins(pluginDefinitions) : leanSchema,
|
|
2313
2317
|
authorizationModes: {
|
|
2314
2318
|
defaultAuthorizationMode: "userPool",
|
|
2315
2319
|
apiKeyAuthorizationMode: {
|