create-keystone-app 5.0.1 → 6.0.1
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/dist/create-keystone-app.cjs.dev.js +4 -8
- package/dist/create-keystone-app.cjs.prod.js +4 -8
- package/package.json +2 -2
- package/starter/.keystone/admin/.next/build-manifest.json +17 -79
- package/starter/.keystone/admin/.next/cache/webpack/client-development/0.pack +0 -0
- package/starter/.keystone/admin/.next/cache/webpack/client-development/index.pack +0 -0
- package/starter/.keystone/admin/.next/cache/webpack/server-development/0.pack +0 -0
- package/starter/.keystone/admin/.next/cache/webpack/server-development/index.pack +0 -0
- package/starter/.keystone/admin/.next/server/middleware-manifest.json +6 -0
- package/starter/.keystone/admin/.next/server/pages/_app.js +978 -361
- package/starter/.keystone/admin/.next/server/pages/_document.js +73 -1073
- package/starter/.keystone/admin/.next/server/pages/_error.js +24 -104
- package/starter/.keystone/admin/.next/server/pages/api/__keystone_api_build.js +82 -235
- package/starter/.keystone/admin/.next/server/pages-manifest.json +1 -12
- package/starter/.keystone/admin/.next/server/webpack-api-runtime.js +168 -0
- package/starter/.keystone/admin/.next/server/webpack-runtime.js +12 -4
- package/starter/.keystone/admin/.next/static/chunks/amp.js +366 -0
- package/starter/.keystone/admin/.next/static/chunks/main.js +1251 -0
- package/starter/.keystone/admin/.next/static/chunks/pages/_app.js +10481 -0
- package/starter/.keystone/admin/.next/static/chunks/pages/_error.js +28 -0
- package/starter/.keystone/admin/.next/static/chunks/{polyfills-a40ef1678bae11e696dba45124eadd70.js → polyfills.js} +0 -0
- package/starter/.keystone/admin/.next/static/chunks/react-refresh.js +62 -0
- package/starter/.keystone/admin/.next/static/chunks/webpack.js +1202 -0
- package/starter/.keystone/admin/.next/static/development/_buildManifest.js +1 -0
- package/starter/.keystone/admin/.next/static/development/_middlewareManifest.js +1 -0
- package/starter/.keystone/admin/.next/static/development/_ssgManifest.js +1 -0
- package/starter/.keystone/admin/.next/trace +26 -22
- package/starter/.keystone/admin/pages/_app.js +11 -179
- package/starter/.keystone/admin/pages/api/__keystone_api_build.js +3 -4
- package/starter/.keystone/admin/pages/init.js +2 -6
- package/starter/.keystone/admin/pages/no-access.js +1 -1
- package/starter/.keystone/admin/pages/posts/[id].js +1 -1
- package/starter/.keystone/admin/pages/posts/index.js +1 -1
- package/starter/.keystone/admin/pages/signin.js +2 -8
- package/starter/.keystone/admin/pages/tags/[id].js +1 -1
- package/starter/.keystone/admin/pages/tags/index.js +1 -1
- package/starter/.keystone/admin/pages/users/[id].js +1 -1
- package/starter/.keystone/admin/pages/users/index.js +1 -1
- package/starter/.keystone/admin/tsconfig.json +2 -1
- package/starter/CHANGELOG.md +22 -0
- package/starter/auth.ts +2 -2
- package/starter/keystone.db +0 -0
- package/starter/keystone.ts +1 -1
- package/starter/package.json +12 -9
- package/starter/schema.graphql +51 -51
- package/starter/schema.prisma +4 -5
- package/starter/schema.ts +10 -4
- package/CHANGELOG.md +0 -157
- package/starter/.keystone/admin/.next/BUILD_ID +0 -1
- package/starter/.keystone/admin/.next/cache/webpack/client-production/0.pack +0 -0
- package/starter/.keystone/admin/.next/cache/webpack/client-production/index.pack +0 -0
- package/starter/.keystone/admin/.next/cache/webpack/server-production/0.pack +0 -0
- package/starter/.keystone/admin/.next/cache/webpack/server-production/index.pack +0 -0
- package/starter/.keystone/admin/.next/export-marker.json +0 -1
- package/starter/.keystone/admin/.next/images-manifest.json +0 -1
- package/starter/.keystone/admin/.next/prerender-manifest.json +0 -1
- package/starter/.keystone/admin/.next/required-server-files.json +0 -1
- package/starter/.keystone/admin/.next/routes-manifest.json +0 -1
- package/starter/.keystone/admin/.next/server/chunks/240.js +0 -14009
- package/starter/.keystone/admin/.next/server/font-manifest.json +0 -1
- package/starter/.keystone/admin/.next/server/pages/404.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/500.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/index.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/init.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/no-access.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/posts/[id].html +0 -1
- package/starter/.keystone/admin/.next/server/pages/posts.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/signin.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/tags/[id].html +0 -1
- package/starter/.keystone/admin/.next/server/pages/tags.html +0 -1
- package/starter/.keystone/admin/.next/server/pages/users/[id].html +0 -1
- package/starter/.keystone/admin/.next/server/pages/users.html +0 -1
- package/starter/.keystone/admin/.next/static/chunks/845-5539e5cef7ad50cce2e3.js +0 -29
- package/starter/.keystone/admin/.next/static/chunks/882-9860297ca4605e1a1a0a.js +0 -35
- package/starter/.keystone/admin/.next/static/chunks/framework-f9027f68f44ebbf3e174.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/main-76a462729396bcfabf1b.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/_app-d509355e2565bcb71899.js +0 -256
- package/starter/.keystone/admin/.next/static/chunks/pages/_error-e474cef4d019fc6ee7d4.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/index-298e0c9b59ac630228e4.js +0 -17
- package/starter/.keystone/admin/.next/static/chunks/pages/init-94d4b032c41cc3c12e0d.js +0 -9
- package/starter/.keystone/admin/.next/static/chunks/pages/no-access-13f9226067042a423dc6.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/posts/[id]-f45c7c270de5326d8339.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/posts-bd996323004b12ae185b.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/signin-b7a27af2c1cca197a4e5.js +0 -14
- package/starter/.keystone/admin/.next/static/chunks/pages/tags/[id]-ff349a8664f7df16d190.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/tags-e255b296f4cb3c74438b.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/users/[id]-072af9943b94b1a26491.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/pages/users-2c04aa80b5a8479e8638.js +0 -1
- package/starter/.keystone/admin/.next/static/chunks/webpack-613fd858cdb9cf2af3be.js +0 -1
- package/starter/.keystone/admin/.next/static/vMUSAlVTH8qaayrNeoQKH/_buildManifest.js +0 -1
- package/starter/.keystone/admin/.next/static/vMUSAlVTH8qaayrNeoQKH/_ssgManifest.js +0 -1
|
@@ -1,187 +1,19 @@
|
|
|
1
1
|
import { getApp } from '@keystone-next/keystone/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App';
|
|
2
2
|
|
|
3
|
-
import * as view0 from
|
|
4
|
-
import * as view1 from
|
|
5
|
-
import * as view2 from
|
|
6
|
-
import * as view3 from
|
|
7
|
-
import * as view4 from
|
|
8
|
-
import * as view5 from
|
|
9
|
-
import * as view6 from
|
|
3
|
+
import * as view0 from "../../../../../node_modules/@keystone-next/keystone/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view";
|
|
4
|
+
import * as view1 from "../../../../../node_modules/@keystone-next/keystone/fields/types/text/views";
|
|
5
|
+
import * as view2 from "../../../../../node_modules/@keystone-next/keystone/fields/types/password/views";
|
|
6
|
+
import * as view3 from "../../../../../node_modules/@keystone-next/keystone/fields/types/relationship/views";
|
|
7
|
+
import * as view4 from "../../../../../node_modules/@keystone-next/keystone/fields/types/select/views";
|
|
8
|
+
import * as view5 from "../../../../../node_modules/@keystone-next/fields-document/views";
|
|
9
|
+
import * as view6 from "../../../../../node_modules/@keystone-next/keystone/fields/types/timestamp/views";
|
|
10
10
|
|
|
11
11
|
var adminConfig = {};
|
|
12
12
|
|
|
13
13
|
export default getApp({
|
|
14
|
-
lazyMetadataQuery: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
kind: 'OperationDefinition',
|
|
19
|
-
operation: 'query',
|
|
20
|
-
selectionSet: {
|
|
21
|
-
kind: 'SelectionSet',
|
|
22
|
-
selections: [
|
|
23
|
-
{
|
|
24
|
-
kind: 'Field',
|
|
25
|
-
name: {
|
|
26
|
-
kind: 'Name',
|
|
27
|
-
value: 'keystone',
|
|
28
|
-
loc: { start: 22, end: 30 },
|
|
29
|
-
},
|
|
30
|
-
arguments: [],
|
|
31
|
-
directives: [],
|
|
32
|
-
selectionSet: {
|
|
33
|
-
kind: 'SelectionSet',
|
|
34
|
-
selections: [
|
|
35
|
-
{
|
|
36
|
-
kind: 'Field',
|
|
37
|
-
name: {
|
|
38
|
-
kind: 'Name',
|
|
39
|
-
value: 'adminMeta',
|
|
40
|
-
loc: { start: 39, end: 48 },
|
|
41
|
-
},
|
|
42
|
-
arguments: [],
|
|
43
|
-
directives: [],
|
|
44
|
-
selectionSet: {
|
|
45
|
-
kind: 'SelectionSet',
|
|
46
|
-
selections: [
|
|
47
|
-
{
|
|
48
|
-
kind: 'Field',
|
|
49
|
-
name: {
|
|
50
|
-
kind: 'Name',
|
|
51
|
-
value: 'lists',
|
|
52
|
-
loc: { start: 59, end: 64 },
|
|
53
|
-
},
|
|
54
|
-
arguments: [],
|
|
55
|
-
directives: [],
|
|
56
|
-
selectionSet: {
|
|
57
|
-
kind: 'SelectionSet',
|
|
58
|
-
selections: [
|
|
59
|
-
{
|
|
60
|
-
kind: 'Field',
|
|
61
|
-
name: {
|
|
62
|
-
kind: 'Name',
|
|
63
|
-
value: 'key',
|
|
64
|
-
loc: { start: 77, end: 80 },
|
|
65
|
-
},
|
|
66
|
-
arguments: [],
|
|
67
|
-
directives: [],
|
|
68
|
-
loc: { start: 77, end: 80 },
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
kind: 'Field',
|
|
72
|
-
name: {
|
|
73
|
-
kind: 'Name',
|
|
74
|
-
value: 'isHidden',
|
|
75
|
-
loc: { start: 91, end: 99 },
|
|
76
|
-
},
|
|
77
|
-
arguments: [],
|
|
78
|
-
directives: [],
|
|
79
|
-
loc: { start: 91, end: 99 },
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
kind: 'Field',
|
|
83
|
-
name: {
|
|
84
|
-
kind: 'Name',
|
|
85
|
-
value: 'fields',
|
|
86
|
-
loc: { start: 110, end: 116 },
|
|
87
|
-
},
|
|
88
|
-
arguments: [],
|
|
89
|
-
directives: [],
|
|
90
|
-
selectionSet: {
|
|
91
|
-
kind: 'SelectionSet',
|
|
92
|
-
selections: [
|
|
93
|
-
{
|
|
94
|
-
kind: 'Field',
|
|
95
|
-
name: {
|
|
96
|
-
kind: 'Name',
|
|
97
|
-
value: 'path',
|
|
98
|
-
loc: { start: 131, end: 135 },
|
|
99
|
-
},
|
|
100
|
-
arguments: [],
|
|
101
|
-
directives: [],
|
|
102
|
-
loc: { start: 131, end: 135 },
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
kind: 'Field',
|
|
106
|
-
name: {
|
|
107
|
-
kind: 'Name',
|
|
108
|
-
value: 'createView',
|
|
109
|
-
loc: { start: 148, end: 158 },
|
|
110
|
-
},
|
|
111
|
-
arguments: [],
|
|
112
|
-
directives: [],
|
|
113
|
-
selectionSet: {
|
|
114
|
-
kind: 'SelectionSet',
|
|
115
|
-
selections: [
|
|
116
|
-
{
|
|
117
|
-
kind: 'Field',
|
|
118
|
-
name: {
|
|
119
|
-
kind: 'Name',
|
|
120
|
-
value: 'fieldMode',
|
|
121
|
-
loc: { start: 175, end: 184 },
|
|
122
|
-
},
|
|
123
|
-
arguments: [],
|
|
124
|
-
directives: [],
|
|
125
|
-
loc: { start: 175, end: 184 },
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
loc: { start: 159, end: 198 },
|
|
129
|
-
},
|
|
130
|
-
loc: { start: 148, end: 198 },
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
loc: { start: 117, end: 210 },
|
|
134
|
-
},
|
|
135
|
-
loc: { start: 110, end: 210 },
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
loc: { start: 65, end: 220 },
|
|
139
|
-
},
|
|
140
|
-
loc: { start: 59, end: 220 },
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
loc: { start: 49, end: 228 },
|
|
144
|
-
},
|
|
145
|
-
loc: { start: 39, end: 228 },
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
loc: { start: 31, end: 234 },
|
|
149
|
-
},
|
|
150
|
-
loc: { start: 22, end: 234 },
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
kind: 'Field',
|
|
154
|
-
name: { kind: 'Name', value: 'authenticatedItem' },
|
|
155
|
-
selectionSet: {
|
|
156
|
-
kind: 'SelectionSet',
|
|
157
|
-
selections: [
|
|
158
|
-
{
|
|
159
|
-
kind: 'InlineFragment',
|
|
160
|
-
typeCondition: {
|
|
161
|
-
kind: 'NamedType',
|
|
162
|
-
name: { kind: 'Name', value: 'User' },
|
|
163
|
-
},
|
|
164
|
-
selectionSet: {
|
|
165
|
-
kind: 'SelectionSet',
|
|
166
|
-
selections: [
|
|
167
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
168
|
-
{
|
|
169
|
-
kind: 'Field',
|
|
170
|
-
name: { kind: 'Name', value: 'name' },
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
],
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
fieldViews: [view0, view1, view2, view3, view4, view5, view6],
|
|
184
|
-
adminMetaHash: 'n6lent',
|
|
14
|
+
lazyMetadataQuery: {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"keystone","loc":{"start":22,"end":30}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminMeta","loc":{"start":39,"end":48}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lists","loc":{"start":59,"end":64}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key","loc":{"start":77,"end":80}},"arguments":[],"directives":[],"loc":{"start":77,"end":80}},{"kind":"Field","name":{"kind":"Name","value":"isHidden","loc":{"start":91,"end":99}},"arguments":[],"directives":[],"loc":{"start":91,"end":99}},{"kind":"Field","name":{"kind":"Name","value":"fields","loc":{"start":110,"end":116}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path","loc":{"start":131,"end":135}},"arguments":[],"directives":[],"loc":{"start":131,"end":135}},{"kind":"Field","name":{"kind":"Name","value":"createView","loc":{"start":148,"end":158}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMode","loc":{"start":175,"end":184}},"arguments":[],"directives":[],"loc":{"start":175,"end":184}}],"loc":{"start":159,"end":198}},"loc":{"start":148,"end":198}}],"loc":{"start":117,"end":210}},"loc":{"start":110,"end":210}}],"loc":{"start":65,"end":220}},"loc":{"start":59,"end":220}}],"loc":{"start":49,"end":228}},"loc":{"start":39,"end":228}}],"loc":{"start":31,"end":234}},"loc":{"start":22,"end":234}},{"kind":"Field","name":{"kind":"Name","value":"authenticatedItem"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]},
|
|
15
|
+
fieldViews: [view0,view1,view2,view3,view4,view5,view6],
|
|
16
|
+
adminMetaHash: "2qivu7",
|
|
185
17
|
adminConfig: adminConfig,
|
|
186
|
-
apiPath:
|
|
18
|
+
apiPath: "/api/graphql",
|
|
187
19
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
exports.getConfig = () => require("../../../../keystone").default;
|
|
2
|
+
const x = Math.random();
|
|
3
|
+
exports.default = function (req, res) { return res.send(x.toString()) }
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { getInitPage } from '@keystone-next/auth/pages/InitPage';
|
|
2
2
|
|
|
3
|
-
const fieldPaths = [
|
|
3
|
+
const fieldPaths = ["name","email","password"];
|
|
4
4
|
|
|
5
|
-
export default getInitPage({
|
|
6
|
-
listKey: 'User',
|
|
7
|
-
fieldPaths: ['name', 'email', 'password'],
|
|
8
|
-
enableWelcome: true,
|
|
9
|
-
});
|
|
5
|
+
export default getInitPage({"listKey":"User","fieldPaths":["name","email","password"],"enableWelcome":true});
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { getSigninPage } from '@keystone-next/auth/pages/SigninPage'
|
|
1
|
+
import { getSigninPage } from '@keystone-next/auth/pages/SigninPage'
|
|
2
2
|
|
|
3
|
-
export default getSigninPage({
|
|
4
|
-
identityField: 'email',
|
|
5
|
-
secretField: 'password',
|
|
6
|
-
mutationName: 'authenticateUserWithPassword',
|
|
7
|
-
successTypename: 'UserAuthenticationWithPasswordSuccess',
|
|
8
|
-
failureTypename: 'UserAuthenticationWithPasswordFailure',
|
|
9
|
-
});
|
|
3
|
+
export default getSigninPage({"identityField":"email","secretField":"password","mutationName":"authenticateUserWithPassword","successTypename":"UserAuthenticationWithPasswordSuccess","failureTypename":"UserAuthenticationWithPasswordFailure"});
|
package/starter/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# keystone-next-app
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#260](https://github.com/keystonejs/create-keystone-app/pull/260) [`6288ac4`](https://github.com/keystonejs/create-keystone-app/commit/6288ac493d82a4f4f669f70daa2f24cefd8e375e) Thanks [@bladey](https://github.com/bladey)! - Updated to use Keystone 6.
|
|
8
|
+
|
|
9
|
+
## 3.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#241](https://github.com/keystonejs/create-keystone-app/pull/241) [`d6ff06d`](https://github.com/keystonejs/create-keystone-app/commit/d6ff06d3a80830f37d5da07738a69e0af2edc039) Thanks [@bladey](https://github.com/bladey)! - Added engines to package.json to indicate required version of Node.js to run Keystone.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#237](https://github.com/keystonejs/create-keystone-app/pull/237) [`a65ef75`](https://github.com/keystonejs/create-keystone-app/commit/a65ef75c8ca21007aade0c77a6482cbf145ff679) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
|
|
18
|
+
|
|
19
|
+
## 3.0.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#235](https://github.com/keystonejs/create-keystone-app/pull/235) [`9a3c00c`](https://github.com/keystonejs/create-keystone-app/commit/9a3c00cb6a719cef330955f8014f431c0ffa38d0) Thanks [@bladey](https://github.com/bladey)! - Updated Keystone dependencies to latest version.
|
|
24
|
+
|
|
3
25
|
## 3.0.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/starter/auth.ts
CHANGED
|
@@ -7,10 +7,10 @@ Welcome to the auth file! Here we have put a config to do basic auth in Keystone
|
|
|
7
7
|
For more on auth, check out: https://keystonejs.com/docs/apis/auth#authentication-api
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { createAuth } from '@keystone-
|
|
10
|
+
import { createAuth } from '@keystone-6/auth';
|
|
11
11
|
|
|
12
12
|
// See https://keystonejs.com/docs/apis/session#session-api for the session docs
|
|
13
|
-
import { statelessSessions } from '@keystone-
|
|
13
|
+
import { statelessSessions } from '@keystone-6/core/session';
|
|
14
14
|
|
|
15
15
|
let sessionSecret = process.env.SESSION_SECRET;
|
|
16
16
|
|
package/starter/keystone.db
CHANGED
|
Binary file
|
package/starter/keystone.ts
CHANGED
|
@@ -6,7 +6,7 @@ It looks at the default export, and expects a Keystone config object.
|
|
|
6
6
|
You can find all the config options in our docs here: https://keystonejs.com/docs/apis/config
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { config } from '@keystone-
|
|
9
|
+
import { config } from '@keystone-6/core';
|
|
10
10
|
|
|
11
11
|
// Look in the schema file for how we define our lists, and how users interact with them through graphql or the Admin UI
|
|
12
12
|
import { lists } from './schema';
|
package/starter/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keystone-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"dev": "keystone
|
|
7
|
-
"start": "keystone
|
|
8
|
-
"build": "keystone
|
|
9
|
-
"postinstall": "keystone
|
|
6
|
+
"dev": "keystone dev",
|
|
7
|
+
"start": "keystone start",
|
|
8
|
+
"build": "keystone build",
|
|
9
|
+
"postinstall": "keystone postinstall"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@keystone-
|
|
13
|
-
"@keystone-
|
|
14
|
-
"@keystone-
|
|
15
|
-
"typescript": "^4.4
|
|
12
|
+
"@keystone-6/auth": "^1.0.1",
|
|
13
|
+
"@keystone-6/core": "^1.0.1",
|
|
14
|
+
"@keystone-6/fields-document": "^1.0.1",
|
|
15
|
+
"typescript": "^4.5.4"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": "^14.15 || ^16.13"
|
|
16
19
|
}
|
|
17
20
|
}
|
package/starter/schema.graphql
CHANGED
|
@@ -1,56 +1,6 @@
|
|
|
1
1
|
# This file is automatically generated by Keystone, do not modify it manually.
|
|
2
2
|
# Modify your Keystone config when you want to change this.
|
|
3
3
|
|
|
4
|
-
input CreateInitialUserInput {
|
|
5
|
-
name: String
|
|
6
|
-
email: String
|
|
7
|
-
password: String
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
type Mutation {
|
|
11
|
-
createInitialUser(
|
|
12
|
-
data: CreateInitialUserInput!
|
|
13
|
-
): UserAuthenticationWithPasswordSuccess!
|
|
14
|
-
authenticateUserWithPassword(
|
|
15
|
-
email: String!
|
|
16
|
-
password: String!
|
|
17
|
-
): UserAuthenticationWithPasswordResult!
|
|
18
|
-
createUser(data: UserCreateInput!): User
|
|
19
|
-
createUsers(data: [UserCreateInput!]!): [User]
|
|
20
|
-
updateUser(where: UserWhereUniqueInput!, data: UserUpdateInput!): User
|
|
21
|
-
updateUsers(data: [UserUpdateArgs!]!): [User]
|
|
22
|
-
deleteUser(where: UserWhereUniqueInput!): User
|
|
23
|
-
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
|
|
24
|
-
createPost(data: PostCreateInput!): Post
|
|
25
|
-
createPosts(data: [PostCreateInput!]!): [Post]
|
|
26
|
-
updatePost(where: PostWhereUniqueInput!, data: PostUpdateInput!): Post
|
|
27
|
-
updatePosts(data: [PostUpdateArgs!]!): [Post]
|
|
28
|
-
deletePost(where: PostWhereUniqueInput!): Post
|
|
29
|
-
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
|
|
30
|
-
createTag(data: TagCreateInput!): Tag
|
|
31
|
-
createTags(data: [TagCreateInput!]!): [Tag]
|
|
32
|
-
updateTag(where: TagWhereUniqueInput!, data: TagUpdateInput!): Tag
|
|
33
|
-
updateTags(data: [TagUpdateArgs!]!): [Tag]
|
|
34
|
-
deleteTag(where: TagWhereUniqueInput!): Tag
|
|
35
|
-
deleteTags(where: [TagWhereUniqueInput!]!): [Tag]
|
|
36
|
-
endSession: Boolean!
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
union AuthenticatedItem = User
|
|
40
|
-
|
|
41
|
-
union UserAuthenticationWithPasswordResult =
|
|
42
|
-
UserAuthenticationWithPasswordSuccess
|
|
43
|
-
| UserAuthenticationWithPasswordFailure
|
|
44
|
-
|
|
45
|
-
type UserAuthenticationWithPasswordSuccess {
|
|
46
|
-
sessionToken: String!
|
|
47
|
-
item: User!
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
type UserAuthenticationWithPasswordFailure {
|
|
51
|
-
message: String!
|
|
52
|
-
}
|
|
53
|
-
|
|
54
4
|
type User {
|
|
55
5
|
id: ID!
|
|
56
6
|
name: String
|
|
@@ -361,8 +311,55 @@ scalar JSON
|
|
|
361
311
|
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
|
|
362
312
|
)
|
|
363
313
|
|
|
314
|
+
type Mutation {
|
|
315
|
+
createUser(data: UserCreateInput!): User
|
|
316
|
+
createUsers(data: [UserCreateInput!]!): [User]
|
|
317
|
+
updateUser(where: UserWhereUniqueInput!, data: UserUpdateInput!): User
|
|
318
|
+
updateUsers(data: [UserUpdateArgs!]!): [User]
|
|
319
|
+
deleteUser(where: UserWhereUniqueInput!): User
|
|
320
|
+
deleteUsers(where: [UserWhereUniqueInput!]!): [User]
|
|
321
|
+
createPost(data: PostCreateInput!): Post
|
|
322
|
+
createPosts(data: [PostCreateInput!]!): [Post]
|
|
323
|
+
updatePost(where: PostWhereUniqueInput!, data: PostUpdateInput!): Post
|
|
324
|
+
updatePosts(data: [PostUpdateArgs!]!): [Post]
|
|
325
|
+
deletePost(where: PostWhereUniqueInput!): Post
|
|
326
|
+
deletePosts(where: [PostWhereUniqueInput!]!): [Post]
|
|
327
|
+
createTag(data: TagCreateInput!): Tag
|
|
328
|
+
createTags(data: [TagCreateInput!]!): [Tag]
|
|
329
|
+
updateTag(where: TagWhereUniqueInput!, data: TagUpdateInput!): Tag
|
|
330
|
+
updateTags(data: [TagUpdateArgs!]!): [Tag]
|
|
331
|
+
deleteTag(where: TagWhereUniqueInput!): Tag
|
|
332
|
+
deleteTags(where: [TagWhereUniqueInput!]!): [Tag]
|
|
333
|
+
endSession: Boolean!
|
|
334
|
+
authenticateUserWithPassword(
|
|
335
|
+
email: String!
|
|
336
|
+
password: String!
|
|
337
|
+
): UserAuthenticationWithPasswordResult
|
|
338
|
+
createInitialUser(
|
|
339
|
+
data: CreateInitialUserInput!
|
|
340
|
+
): UserAuthenticationWithPasswordSuccess!
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
union UserAuthenticationWithPasswordResult =
|
|
344
|
+
UserAuthenticationWithPasswordSuccess
|
|
345
|
+
| UserAuthenticationWithPasswordFailure
|
|
346
|
+
|
|
347
|
+
type UserAuthenticationWithPasswordSuccess {
|
|
348
|
+
sessionToken: String!
|
|
349
|
+
item: User!
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
type UserAuthenticationWithPasswordFailure {
|
|
353
|
+
message: String!
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
input CreateInitialUserInput {
|
|
357
|
+
name: String
|
|
358
|
+
email: String
|
|
359
|
+
password: String
|
|
360
|
+
}
|
|
361
|
+
|
|
364
362
|
type Query {
|
|
365
|
-
authenticatedItem: AuthenticatedItem
|
|
366
363
|
users(
|
|
367
364
|
where: UserWhereInput! = {}
|
|
368
365
|
orderBy: [UserOrderByInput!]! = []
|
|
@@ -388,8 +385,11 @@ type Query {
|
|
|
388
385
|
tag(where: TagWhereUniqueInput!): Tag
|
|
389
386
|
tagsCount(where: TagWhereInput! = {}): Int
|
|
390
387
|
keystone: KeystoneMeta!
|
|
388
|
+
authenticatedItem: AuthenticatedItem
|
|
391
389
|
}
|
|
392
390
|
|
|
391
|
+
union AuthenticatedItem = User
|
|
392
|
+
|
|
393
393
|
type KeystoneMeta {
|
|
394
394
|
adminMeta: KeystoneAdminMeta!
|
|
395
395
|
}
|
package/starter/schema.prisma
CHANGED
|
@@ -7,9 +7,8 @@ datasource sqlite {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
generator client {
|
|
10
|
-
provider
|
|
11
|
-
output
|
|
12
|
-
engineType = "binary"
|
|
10
|
+
provider = "prisma-client-js"
|
|
11
|
+
output = "node_modules/.prisma/client"
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
model User {
|
|
@@ -28,7 +27,7 @@ model Post {
|
|
|
28
27
|
publishDate DateTime?
|
|
29
28
|
author User? @relation("Post_author", fields: [authorId], references: [id])
|
|
30
29
|
authorId String? @map("author")
|
|
31
|
-
tags Tag[] @relation("
|
|
30
|
+
tags Tag[] @relation("Post_tags")
|
|
32
31
|
|
|
33
32
|
@@index([authorId])
|
|
34
33
|
}
|
|
@@ -36,5 +35,5 @@ model Post {
|
|
|
36
35
|
model Tag {
|
|
37
36
|
id String @id @default(cuid())
|
|
38
37
|
name String @default("")
|
|
39
|
-
posts Post[] @relation("
|
|
38
|
+
posts Post[] @relation("Post_tags")
|
|
40
39
|
}
|
package/starter/schema.ts
CHANGED
|
@@ -15,7 +15,7 @@ A field: The individual bits of data on your list, each with its own type.
|
|
|
15
15
|
// Like the `config` function we use in keystone.ts, we use functions
|
|
16
16
|
// for putting in our config so we get useful errors. With typescript,
|
|
17
17
|
// we get these even before code runs.
|
|
18
|
-
import { list } from '@keystone-
|
|
18
|
+
import { list } from '@keystone-6/core';
|
|
19
19
|
|
|
20
20
|
// We're using some common fields in the starter. Check out https://keystonejs.com/docs/apis/fields#fields-api
|
|
21
21
|
// for the full list of fields.
|
|
@@ -25,16 +25,22 @@ import {
|
|
|
25
25
|
password,
|
|
26
26
|
timestamp,
|
|
27
27
|
select,
|
|
28
|
-
} from '@keystone-
|
|
28
|
+
} from '@keystone-6/core/fields';
|
|
29
29
|
// The document field is a more complicated field, so it's in its own package
|
|
30
30
|
// Keystone aims to have all the base field types, but you can make your own
|
|
31
31
|
// custom ones.
|
|
32
|
-
import { document } from '@keystone-
|
|
32
|
+
import { document } from '@keystone-6/fields-document';
|
|
33
|
+
|
|
34
|
+
// We are using Typescript, and we want our types experience to be as strict as it can be.
|
|
35
|
+
// By providing the Keystone generated `Lists` type to our lists object, we refine
|
|
36
|
+
// our types to a stricter subset that is type-aware of other lists in our schema
|
|
37
|
+
// that Typescript cannot easily infer.
|
|
38
|
+
import { Lists } from '.keystone/types';
|
|
33
39
|
|
|
34
40
|
// We have a users list, a blogs list, and tags for blog posts, so they can be filtered.
|
|
35
41
|
// Each property on the exported object will become the name of a list (a.k.a. the `listKey`),
|
|
36
42
|
// with the value being the definition of the list, including the fields.
|
|
37
|
-
export const lists = {
|
|
43
|
+
export const lists: Lists = {
|
|
38
44
|
// Here we define the user list.
|
|
39
45
|
User: list({
|
|
40
46
|
// Here are the fields that `User` will have. We want an email and password so they can log in
|