create-ampless 0.2.0-alpha.27 → 0.2.0-alpha.29
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,7 +1,11 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url'
|
|
2
2
|
import { dirname, resolve } from 'node:path'
|
|
3
3
|
import { a, defineData, type ClientSchema } from '@aws-amplify/backend'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
amplessSchemaModels,
|
|
6
|
+
amplessSchemaAuthorization,
|
|
7
|
+
defaultAuthorizationModes,
|
|
8
|
+
} from '@ampless/backend'
|
|
5
9
|
import { userAdmin } from '../functions/user-admin/resource.js'
|
|
6
10
|
import { mcpHandler } from '../functions/mcp-handler/resource.js'
|
|
7
11
|
import { customSchemaModels } from './resource.custom.js'
|
|
@@ -27,18 +31,22 @@ const resolverPaths = {
|
|
|
27
31
|
listPostsByTag: resolve(__dirname, 'list-posts-by-tag.js'),
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
const schema = a
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const schema = a
|
|
35
|
+
.schema({
|
|
36
|
+
...amplessSchemaModels(a, {
|
|
37
|
+
resolverPaths,
|
|
38
|
+
userAdminFunction: userAdmin,
|
|
39
|
+
}),
|
|
40
|
+
...customSchemaModels(a),
|
|
41
|
+
})
|
|
42
|
+
// Schema-level `.authorization()` is the only place resource auth is
|
|
43
|
+
// honoured in `@aws-amplify/data-schema` — model-level callbacks have
|
|
44
|
+
// `resource` destructured out of `allow`. The helper returns an empty
|
|
45
|
+
// array when no Lambda refs are supplied, so the schema stays
|
|
46
|
+
// unaffected if MCP is later removed.
|
|
47
|
+
.authorization((allow) => amplessSchemaAuthorization(allow, {
|
|
38
48
|
mcpHandlerFunction: mcpHandler,
|
|
39
|
-
})
|
|
40
|
-
...customSchemaModels(a),
|
|
41
|
-
})
|
|
49
|
+
}))
|
|
42
50
|
|
|
43
51
|
export type Schema = ClientSchema<typeof schema>
|
|
44
52
|
export const data = defineData({
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@ampless/plugin-seo": "^0.2.0-alpha.6",
|
|
28
28
|
"@ampless/plugin-webhook": "^0.2.0-alpha.6",
|
|
29
29
|
"@ampless/admin": "^0.2.0-alpha.21",
|
|
30
|
-
"@ampless/backend": "^0.2.0-alpha.
|
|
30
|
+
"@ampless/backend": "^0.2.0-alpha.12",
|
|
31
31
|
"@ampless/runtime": "^0.2.0-alpha.9",
|
|
32
32
|
"@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
|
|
33
33
|
"ampless": "^0.2.0-alpha.6",
|