payload-auth 1.0.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/LICENSE.md +17 -0
- package/dist/authjs/index.d.ts +1 -0
- package/dist/authjs/index.js +3 -0
- package/dist/authjs/index.js.map +1 -0
- package/dist/better-auth/adapter/dev/bin/run.d.ts +1 -0
- package/dist/better-auth/adapter/dev/bin/run.js +64 -0
- package/dist/better-auth/adapter/dev/bin/run.js.map +1 -0
- package/dist/better-auth/adapter/dev/bin/schema.d.ts +22 -0
- package/dist/better-auth/adapter/dev/bin/schema.js +160 -0
- package/dist/better-auth/adapter/dev/bin/schema.js.map +1 -0
- package/dist/better-auth/adapter/dev/collections.d.ts +3 -0
- package/dist/better-auth/adapter/dev/collections.js +212 -0
- package/dist/better-auth/adapter/dev/collections.js.map +1 -0
- package/dist/better-auth/adapter/dev/index.d.ts +3 -0
- package/dist/better-auth/adapter/dev/index.js +168 -0
- package/dist/better-auth/adapter/dev/index.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +23 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +326 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts +1 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +23 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/index.d.ts +4 -0
- package/dist/better-auth/adapter/generate-schema/index.js +19 -0
- package/dist/better-auth/adapter/generate-schema/index.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/utils.d.ts +2 -0
- package/dist/better-auth/adapter/generate-schema/utils.js +20 -0
- package/dist/better-auth/adapter/generate-schema/utils.js.map +1 -0
- package/dist/better-auth/adapter/index.d.ts +5 -0
- package/dist/better-auth/adapter/index.js +578 -0
- package/dist/better-auth/adapter/index.js.map +1 -0
- package/dist/better-auth/adapter/test/adapter.test.d.ts +1 -0
- package/dist/better-auth/adapter/test/adapter.test.js +181 -0
- package/dist/better-auth/adapter/test/adapter.test.js.map +1 -0
- package/dist/better-auth/adapter/test/better-auth-adapter-test.d.ts +7 -0
- package/dist/better-auth/adapter/test/better-auth-adapter-test.js +425 -0
- package/dist/better-auth/adapter/test/better-auth-adapter-test.js.map +1 -0
- package/dist/better-auth/adapter/test/schema.test.d.ts +1 -0
- package/dist/better-auth/adapter/test/schema.test.js +796 -0
- package/dist/better-auth/adapter/test/schema.test.js.map +1 -0
- package/dist/better-auth/adapter/test/test_payload1/schema.d.ts +23 -0
- package/dist/better-auth/adapter/test/test_payload1/schema.js +177 -0
- package/dist/better-auth/adapter/test/test_payload1/schema.js.map +1 -0
- package/dist/better-auth/adapter/test/test_payload2/schema.d.ts +23 -0
- package/dist/better-auth/adapter/test/test_payload2/schema.js +167 -0
- package/dist/better-auth/adapter/test/test_payload2/schema.js.map +1 -0
- package/dist/better-auth/adapter/test/test_payload3/schema.d.ts +23 -0
- package/dist/better-auth/adapter/test/test_payload3/schema.js +198 -0
- package/dist/better-auth/adapter/test/test_payload3/schema.js.map +1 -0
- package/dist/better-auth/adapter/transform/index.d.ts +16 -0
- package/dist/better-auth/adapter/transform/index.js +252 -0
- package/dist/better-auth/adapter/transform/index.js.map +1 -0
- package/dist/better-auth/adapter/types.d.ts +6 -0
- package/dist/better-auth/adapter/types.js +3 -0
- package/dist/better-auth/adapter/types.js.map +1 -0
- package/dist/better-auth/index.d.ts +6 -0
- package/dist/better-auth/index.js +8 -0
- package/dist/better-auth/index.js.map +1 -0
- package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.d.ts +7 -0
- package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.js +47 -0
- package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.d.ts +6 -0
- package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.js +106 -0
- package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/hooks/after-login.d.ts +11 -0
- package/dist/better-auth/plugin/collections/users/hooks/after-login.js +71 -0
- package/dist/better-auth/plugin/collections/users/hooks/after-login.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/hooks/after-logout.d.ts +6 -0
- package/dist/better-auth/plugin/collections/users/hooks/after-logout.js +49 -0
- package/dist/better-auth/plugin/collections/users/hooks/after-logout.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/hooks/before-login.d.ts +5 -0
- package/dist/better-auth/plugin/collections/users/hooks/before-login.js +18 -0
- package/dist/better-auth/plugin/collections/users/hooks/before-login.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.d.ts +5 -0
- package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.js +33 -0
- package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.d.ts +2 -0
- package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.js +14 -0
- package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.js.map +1 -0
- package/dist/better-auth/plugin/collections/users/hooks/sync-account.d.ts +7 -0
- package/dist/better-auth/plugin/collections/users/hooks/sync-account.js +82 -0
- package/dist/better-auth/plugin/collections/users/hooks/sync-account.js.map +1 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +29 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +46 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-ip.d.ts +2 -0
- package/dist/better-auth/plugin/helpers/get-ip.js +31 -0
- package/dist/better-auth/plugin/helpers/get-ip.js.map +1 -0
- package/dist/better-auth/plugin/helpers/index.d.ts +1 -0
- package/dist/better-auth/plugin/helpers/index.js +3 -0
- package/dist/better-auth/plugin/helpers/index.js.map +1 -0
- package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts +104 -0
- package/dist/better-auth/plugin/helpers/serialize-cookie.js +186 -0
- package/dist/better-auth/plugin/helpers/serialize-cookie.js.map +1 -0
- package/dist/better-auth/plugin/index.d.ts +7 -0
- package/dist/better-auth/plugin/index.js +64 -0
- package/dist/better-auth/plugin/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/auth-strategy.d.ts +8 -0
- package/dist/better-auth/plugin/lib/auth-strategy.js +48 -0
- package/dist/better-auth/plugin/lib/auth-strategy.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collection-configs.d.ts +11 -0
- package/dist/better-auth/plugin/lib/build-collection-configs.js +1558 -0
- package/dist/better-auth/plugin/lib/build-collection-configs.js.map +1 -0
- package/dist/better-auth/plugin/lib/config.d.ts +41 -0
- package/dist/better-auth/plugin/lib/config.js +43 -0
- package/dist/better-auth/plugin/lib/config.js.map +1 -0
- package/dist/better-auth/plugin/lib/ensure-password-set-before-create.d.ts +7 -0
- package/dist/better-auth/plugin/lib/ensure-password-set-before-create.js +24 -0
- package/dist/better-auth/plugin/lib/ensure-password-set-before-create.js.map +1 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +5 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.js +9 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.js.map +1 -0
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts +9 -0
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.js +52 -0
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.js.map +1 -0
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +6 -0
- package/dist/better-auth/plugin/lib/init-better-auth.js +13 -0
- package/dist/better-auth/plugin/lib/init-better-auth.js.map +1 -0
- package/dist/better-auth/plugin/lib/password.d.ts +25 -0
- package/dist/better-auth/plugin/lib/password.js +63 -0
- package/dist/better-auth/plugin/lib/password.js.map +1 -0
- package/dist/better-auth/plugin/lib/payload-access.d.ts +14 -0
- package/dist/better-auth/plugin/lib/payload-access.js +64 -0
- package/dist/better-auth/plugin/lib/payload-access.js.map +1 -0
- package/dist/better-auth/plugin/lib/prepare-session-data.d.ts +21 -0
- package/dist/better-auth/plugin/lib/prepare-session-data.js +42 -0
- package/dist/better-auth/plugin/lib/prepare-session-data.js.map +1 -0
- package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.d.ts +15 -0
- package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.js +30 -0
- package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-auth-options.d.ts +5 -0
- package/dist/better-auth/plugin/lib/sanitize-auth-options.js +298 -0
- package/dist/better-auth/plugin/lib/sanitize-auth-options.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons.d.ts +5 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons.js +222 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/login-redirect.d.ts +1 -0
- package/dist/better-auth/plugin/payload/components/login-redirect.js +6 -0
- package/dist/better-auth/plugin/payload/components/login-redirect.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/logo.d.ts +1 -0
- package/dist/better-auth/plugin/payload/components/logo.js +36 -0
- package/dist/better-auth/plugin/payload/components/logo.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/logout.d.ts +1 -0
- package/dist/better-auth/plugin/payload/components/logout.js +61 -0
- package/dist/better-auth/plugin/payload/components/logout.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/sign-in.d.ts +3 -0
- package/dist/better-auth/plugin/payload/components/sign-in.js +384 -0
- package/dist/better-auth/plugin/payload/components/sign-in.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/sign-up.d.ts +6 -0
- package/dist/better-auth/plugin/payload/components/sign-up.js +502 -0
- package/dist/better-auth/plugin/payload/components/sign-up.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/styles.css +73 -0
- package/dist/better-auth/plugin/payload/components/ui/button.d.ts +10 -0
- package/dist/better-auth/plugin/payload/components/ui/button.js +42 -0
- package/dist/better-auth/plugin/payload/components/ui/button.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/ui/card.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/ui/card.js +55 -0
- package/dist/better-auth/plugin/payload/components/ui/card.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/ui/checkbox.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/ui/checkbox.js +23 -0
- package/dist/better-auth/plugin/payload/components/ui/checkbox.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/ui/cn.d.ts +2 -0
- package/dist/better-auth/plugin/payload/components/ui/cn.js +7 -0
- package/dist/better-auth/plugin/payload/components/ui/cn.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/ui/input.d.ts +3 -0
- package/dist/better-auth/plugin/payload/components/ui/input.js +14 -0
- package/dist/better-auth/plugin/payload/components/ui/input.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/ui/label.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/ui/label.js +15 -0
- package/dist/better-auth/plugin/payload/components/ui/label.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/ui/password-input.d.ts +2 -0
- package/dist/better-auth/plugin/payload/components/ui/password-input.js +55 -0
- package/dist/better-auth/plugin/payload/components/ui/password-input.js.map +1 -0
- package/dist/better-auth/plugin/payload/exports/client.d.ts +3 -0
- package/dist/better-auth/plugin/payload/exports/client.js +5 -0
- package/dist/better-auth/plugin/payload/exports/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts +5 -0
- package/dist/better-auth/plugin/payload/exports/rsc.js +7 -0
- package/dist/better-auth/plugin/payload/exports/rsc.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts +4 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.js +112 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/login/index.d.ts +4 -0
- package/dist/better-auth/plugin/payload/views/login/index.js +78 -0
- package/dist/better-auth/plugin/payload/views/login/index.js.map +1 -0
- package/dist/better-auth/plugin/types.d.ts +224 -0
- package/dist/better-auth/plugin/types.js +3 -0
- package/dist/better-auth/plugin/types.js.map +1 -0
- package/dist/better-auth/types.d.ts +2 -0
- package/dist/better-auth/types.js +4 -0
- package/dist/better-auth/types.js.map +1 -0
- package/dist/clerk/index.d.ts +1 -0
- package/dist/clerk/index.js +3 -0
- package/dist/clerk/index.js.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/kinde/index.d.ts +1 -0
- package/dist/kinde/index.js +3 -0
- package/dist/kinde/index.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { format } from 'prettier';
|
|
3
|
+
import { getPayloadPath } from '../generate-schema/utils';
|
|
4
|
+
import { generateSchema } from '../generate-schema';
|
|
5
|
+
const PAYLOAD_TEST_DIR_PATH = getPayloadPath('./test/test_payload1');
|
|
6
|
+
const PAYLOAD_TEST_DIR_PATH2 = getPayloadPath('./test/test_payload2');
|
|
7
|
+
const PAYLOAD_TEST_DIR_PATH3 = getPayloadPath('./test/test_payload3');
|
|
8
|
+
describe(`Handle schema generation`, async ()=>{
|
|
9
|
+
it('should generate the correct schema with existing schema', async ()=>{
|
|
10
|
+
const generate_schema = await generateSchema({
|
|
11
|
+
plugins: [
|
|
12
|
+
{
|
|
13
|
+
schema: {
|
|
14
|
+
testTable: {
|
|
15
|
+
fields: {
|
|
16
|
+
hello: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
hello2: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
id: 'test'
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}, {
|
|
31
|
+
outputDir: PAYLOAD_TEST_DIR_PATH
|
|
32
|
+
});
|
|
33
|
+
// console.log(generate_schema);
|
|
34
|
+
const hard_coded_schema = await format(`/**
|
|
35
|
+
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
36
|
+
*
|
|
37
|
+
* Below is what your Payload collections should look like.
|
|
38
|
+
* Please copy these to your actual collection configs.
|
|
39
|
+
* Make sure to add an authStrategy for the users collection if there is one.
|
|
40
|
+
*
|
|
41
|
+
* Example auth strategy:
|
|
42
|
+
* auth: {
|
|
43
|
+
* disableLocalStrategy: true,
|
|
44
|
+
* strategies: [
|
|
45
|
+
* betterAuthStrategy(),
|
|
46
|
+
* // Add other strategies as needed
|
|
47
|
+
* ],
|
|
48
|
+
* },
|
|
49
|
+
*/
|
|
50
|
+
import type { CollectionConfig } from "payload";
|
|
51
|
+
|
|
52
|
+
const User: CollectionConfig = {
|
|
53
|
+
slug: "user",
|
|
54
|
+
admin: {
|
|
55
|
+
useAsTitle: "name",
|
|
56
|
+
},
|
|
57
|
+
fields: [
|
|
58
|
+
{
|
|
59
|
+
name: "name",
|
|
60
|
+
type: "text",
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "email",
|
|
65
|
+
type: "email",
|
|
66
|
+
required: true,
|
|
67
|
+
unique: true,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "emailVerified",
|
|
71
|
+
type: "checkbox",
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "image",
|
|
76
|
+
type: "upload",
|
|
77
|
+
relationTo: "media",
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
timestamps: true,
|
|
81
|
+
} as const;
|
|
82
|
+
|
|
83
|
+
const Session: CollectionConfig = {
|
|
84
|
+
slug: "session",
|
|
85
|
+
admin: {
|
|
86
|
+
useAsTitle: "expiresAt",
|
|
87
|
+
},
|
|
88
|
+
fields: [
|
|
89
|
+
{
|
|
90
|
+
name: "expiresAt",
|
|
91
|
+
type: "date",
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "token",
|
|
96
|
+
type: "text",
|
|
97
|
+
required: true,
|
|
98
|
+
unique: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "ipAddress",
|
|
102
|
+
type: "text",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "userAgent",
|
|
106
|
+
type: "text",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "userId",
|
|
110
|
+
type: "relationship",
|
|
111
|
+
required: true,
|
|
112
|
+
relationTo: "user",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
timestamps: true,
|
|
116
|
+
} as const;
|
|
117
|
+
|
|
118
|
+
const Account: CollectionConfig = {
|
|
119
|
+
slug: "account",
|
|
120
|
+
admin: {
|
|
121
|
+
useAsTitle: "accountId",
|
|
122
|
+
},
|
|
123
|
+
fields: [
|
|
124
|
+
{
|
|
125
|
+
name: "accountId",
|
|
126
|
+
type: "text",
|
|
127
|
+
required: true,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "providerId",
|
|
131
|
+
type: "text",
|
|
132
|
+
required: true,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "userId",
|
|
136
|
+
type: "relationship",
|
|
137
|
+
required: true,
|
|
138
|
+
relationTo: "user",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "accessToken",
|
|
142
|
+
type: "text",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "refreshToken",
|
|
146
|
+
type: "text",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "idToken",
|
|
150
|
+
type: "text",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "accessTokenExpiresAt",
|
|
154
|
+
type: "date",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "refreshTokenExpiresAt",
|
|
158
|
+
type: "date",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "scope",
|
|
162
|
+
type: "text",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "password",
|
|
166
|
+
type: "text",
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
timestamps: true,
|
|
170
|
+
} as const;
|
|
171
|
+
|
|
172
|
+
const Verification: CollectionConfig = {
|
|
173
|
+
slug: "verification",
|
|
174
|
+
admin: {
|
|
175
|
+
useAsTitle: "identifier",
|
|
176
|
+
},
|
|
177
|
+
fields: [
|
|
178
|
+
{
|
|
179
|
+
name: "identifier",
|
|
180
|
+
type: "text",
|
|
181
|
+
required: true,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "value",
|
|
185
|
+
type: "text",
|
|
186
|
+
required: true,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "expiresAt",
|
|
190
|
+
type: "date",
|
|
191
|
+
required: true,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
timestamps: true,
|
|
195
|
+
} as const;
|
|
196
|
+
|
|
197
|
+
const TestTable: CollectionConfig = {
|
|
198
|
+
slug: "testTable",
|
|
199
|
+
admin: {
|
|
200
|
+
useAsTitle: "hello",
|
|
201
|
+
},
|
|
202
|
+
fields: [
|
|
203
|
+
{
|
|
204
|
+
name: "hello",
|
|
205
|
+
type: "checkbox",
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: "hello2",
|
|
209
|
+
type: "text",
|
|
210
|
+
required: true,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
timestamps: true,
|
|
214
|
+
} as const;
|
|
215
|
+
|
|
216
|
+
export { User, Session, Account, Verification, TestTable };
|
|
217
|
+
|
|
218
|
+
`, {
|
|
219
|
+
filepath: 'schema.ts'
|
|
220
|
+
});
|
|
221
|
+
// if (generate_schema !== hard_coded_schema) {
|
|
222
|
+
// console.log(`\n\n\n--------------------------------- Generated:`);
|
|
223
|
+
// console.log(generate_schema);
|
|
224
|
+
// console.log(`--------------------------------- Hard-coded:`);
|
|
225
|
+
// console.log(hard_coded_schema);
|
|
226
|
+
// console.log(`---------------------------------\n\n\n`);
|
|
227
|
+
// }
|
|
228
|
+
expect(generate_schema).toEqual(hard_coded_schema);
|
|
229
|
+
});
|
|
230
|
+
// it("should generate the correct schema based on multiple plugins", async () => {
|
|
231
|
+
// const generate_schema = await generateSchema(
|
|
232
|
+
// {
|
|
233
|
+
// plugins: [
|
|
234
|
+
// {
|
|
235
|
+
// schema: {
|
|
236
|
+
// user: {
|
|
237
|
+
// fields: {},
|
|
238
|
+
// },
|
|
239
|
+
// admins: {
|
|
240
|
+
// fields: {},
|
|
241
|
+
// },
|
|
242
|
+
// },
|
|
243
|
+
// id: "test",
|
|
244
|
+
// },
|
|
245
|
+
// ],
|
|
246
|
+
// },
|
|
247
|
+
// {
|
|
248
|
+
// payload_dir_path: PAYLOAD_TEST_DIR_PATH2,
|
|
249
|
+
// }
|
|
250
|
+
// );
|
|
251
|
+
// const hard_coded_schema = await format(
|
|
252
|
+
// `/**
|
|
253
|
+
// * EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
254
|
+
// *
|
|
255
|
+
// * Below is what your Payload collections should look like.
|
|
256
|
+
// * Please copy these to your actual collection configs.
|
|
257
|
+
// * Make sure to add an authStrategy for the users collection if there is one.
|
|
258
|
+
// *
|
|
259
|
+
// * Example auth strategy:
|
|
260
|
+
// * auth: {
|
|
261
|
+
// * disableLocalStrategy: true,
|
|
262
|
+
// * strategies: [
|
|
263
|
+
// * betterAuthStrategy(),
|
|
264
|
+
// * // Add other strategies as needed
|
|
265
|
+
// * ],
|
|
266
|
+
// * },
|
|
267
|
+
// */
|
|
268
|
+
// import type { CollectionConfig } from "payload";
|
|
269
|
+
// const User: CollectionConfig = {
|
|
270
|
+
// slug: "user",
|
|
271
|
+
// admin: {
|
|
272
|
+
// useAsTitle: "name",
|
|
273
|
+
// },
|
|
274
|
+
// fields: [
|
|
275
|
+
// {
|
|
276
|
+
// name: "name",
|
|
277
|
+
// type: "text",
|
|
278
|
+
// required: true,
|
|
279
|
+
// },
|
|
280
|
+
// {
|
|
281
|
+
// name: "email",
|
|
282
|
+
// type: "email",
|
|
283
|
+
// required: true,
|
|
284
|
+
// unique: true,
|
|
285
|
+
// },
|
|
286
|
+
// {
|
|
287
|
+
// name: "emailVerified",
|
|
288
|
+
// type: "checkbox",
|
|
289
|
+
// required: true,
|
|
290
|
+
// defaultValue: false,
|
|
291
|
+
// },
|
|
292
|
+
// {
|
|
293
|
+
// name: "image",
|
|
294
|
+
// type: "upload",
|
|
295
|
+
// relationTo: "media",
|
|
296
|
+
// },
|
|
297
|
+
// ],
|
|
298
|
+
// timestamps: true,
|
|
299
|
+
// } as const;
|
|
300
|
+
// const Session: CollectionConfig = {
|
|
301
|
+
// slug: "session",
|
|
302
|
+
// admin: {
|
|
303
|
+
// useAsTitle: "expiresAt",
|
|
304
|
+
// },
|
|
305
|
+
// fields: [
|
|
306
|
+
// {
|
|
307
|
+
// name: "expiresAt",
|
|
308
|
+
// type: "date",
|
|
309
|
+
// required: true,
|
|
310
|
+
// },
|
|
311
|
+
// {
|
|
312
|
+
// name: "token",
|
|
313
|
+
// type: "text",
|
|
314
|
+
// required: true,
|
|
315
|
+
// unique: true,
|
|
316
|
+
// },
|
|
317
|
+
// {
|
|
318
|
+
// name: "ipAddress",
|
|
319
|
+
// type: "text",
|
|
320
|
+
// },
|
|
321
|
+
// {
|
|
322
|
+
// name: "userAgent",
|
|
323
|
+
// type: "text",
|
|
324
|
+
// },
|
|
325
|
+
// {
|
|
326
|
+
// name: "userId",
|
|
327
|
+
// type: "relationship",
|
|
328
|
+
// relationTo: "user",
|
|
329
|
+
// required: true,
|
|
330
|
+
// },
|
|
331
|
+
// ],
|
|
332
|
+
// timestamps: true,
|
|
333
|
+
// } as const;
|
|
334
|
+
// const Account: CollectionConfig = {
|
|
335
|
+
// slug: "account",
|
|
336
|
+
// admin: {
|
|
337
|
+
// useAsTitle: "accountId",
|
|
338
|
+
// },
|
|
339
|
+
// fields: [
|
|
340
|
+
// {
|
|
341
|
+
// name: "accountId",
|
|
342
|
+
// type: "text",
|
|
343
|
+
// required: true,
|
|
344
|
+
// },
|
|
345
|
+
// {
|
|
346
|
+
// name: "providerId",
|
|
347
|
+
// type: "text",
|
|
348
|
+
// required: true,
|
|
349
|
+
// },
|
|
350
|
+
// {
|
|
351
|
+
// name: "userId",
|
|
352
|
+
// type: "relationship",
|
|
353
|
+
// relationTo: "user",
|
|
354
|
+
// required: true,
|
|
355
|
+
// },
|
|
356
|
+
// {
|
|
357
|
+
// name: "accessToken",
|
|
358
|
+
// type: "text",
|
|
359
|
+
// },
|
|
360
|
+
// {
|
|
361
|
+
// name: "refreshToken",
|
|
362
|
+
// type: "text",
|
|
363
|
+
// },
|
|
364
|
+
// {
|
|
365
|
+
// name: "idToken",
|
|
366
|
+
// type: "text",
|
|
367
|
+
// },
|
|
368
|
+
// {
|
|
369
|
+
// name: "accessTokenExpiresAt",
|
|
370
|
+
// type: "date",
|
|
371
|
+
// },
|
|
372
|
+
// {
|
|
373
|
+
// name: "refreshTokenExpiresAt",
|
|
374
|
+
// type: "date",
|
|
375
|
+
// },
|
|
376
|
+
// {
|
|
377
|
+
// name: "scope",
|
|
378
|
+
// type: "text",
|
|
379
|
+
// },
|
|
380
|
+
// {
|
|
381
|
+
// name: "password",
|
|
382
|
+
// type: "text",
|
|
383
|
+
// },
|
|
384
|
+
// ],
|
|
385
|
+
// timestamps: true,
|
|
386
|
+
// } as const;
|
|
387
|
+
// const Verification: CollectionConfig = {
|
|
388
|
+
// slug: "verification",
|
|
389
|
+
// admin: {
|
|
390
|
+
// useAsTitle: "identifier",
|
|
391
|
+
// },
|
|
392
|
+
// fields: [
|
|
393
|
+
// {
|
|
394
|
+
// name: "identifier",
|
|
395
|
+
// type: "text",
|
|
396
|
+
// required: true,
|
|
397
|
+
// },
|
|
398
|
+
// {
|
|
399
|
+
// name: "value",
|
|
400
|
+
// type: "text",
|
|
401
|
+
// required: true,
|
|
402
|
+
// },
|
|
403
|
+
// {
|
|
404
|
+
// name: "expiresAt",
|
|
405
|
+
// type: "date",
|
|
406
|
+
// required: true,
|
|
407
|
+
// },
|
|
408
|
+
// ],
|
|
409
|
+
// timestamps: true,
|
|
410
|
+
// } as const;
|
|
411
|
+
// const Admins: CollectionConfig = {
|
|
412
|
+
// slug: "admins",
|
|
413
|
+
// admin: {
|
|
414
|
+
// useAsTitle: "id",
|
|
415
|
+
// },
|
|
416
|
+
// fields: [],
|
|
417
|
+
// timestamps: true,
|
|
418
|
+
// } as const;
|
|
419
|
+
// export { User, Session, Account, Verification, Admins };
|
|
420
|
+
// `,
|
|
421
|
+
// { filepath: "schema.ts" }
|
|
422
|
+
// );
|
|
423
|
+
// if (generate_schema !== hard_coded_schema) {
|
|
424
|
+
// console.log(`\n\n\n--------------------------------- Generated:`);
|
|
425
|
+
// console.log(generate_schema);
|
|
426
|
+
// console.log(`--------------------------------- Hard-coded:`);
|
|
427
|
+
// console.log(hard_coded_schema);
|
|
428
|
+
// console.log(`---------------------------------\n\n\n`);
|
|
429
|
+
// }
|
|
430
|
+
// expect(generate_schema).toBe(hard_coded_schema);
|
|
431
|
+
// });
|
|
432
|
+
// it(`should generate the correct schema based on multiple different field types`, async () => {
|
|
433
|
+
// const generate_schema = await generateSchema(
|
|
434
|
+
// {
|
|
435
|
+
// plugins: [
|
|
436
|
+
// {
|
|
437
|
+
// id: "admin",
|
|
438
|
+
// schema: {
|
|
439
|
+
// admin: {
|
|
440
|
+
// fields: {
|
|
441
|
+
// name: {
|
|
442
|
+
// type: "string",
|
|
443
|
+
// required: true,
|
|
444
|
+
// },
|
|
445
|
+
// id: {
|
|
446
|
+
// type: "string",
|
|
447
|
+
// required: true,
|
|
448
|
+
// },
|
|
449
|
+
// isAdmin: {
|
|
450
|
+
// type: "boolean",
|
|
451
|
+
// required: true,
|
|
452
|
+
// },
|
|
453
|
+
// status: {
|
|
454
|
+
// type: "string",
|
|
455
|
+
// required: false,
|
|
456
|
+
// },
|
|
457
|
+
// date: {
|
|
458
|
+
// type: "date",
|
|
459
|
+
// },
|
|
460
|
+
// number: {
|
|
461
|
+
// type: "number",
|
|
462
|
+
// },
|
|
463
|
+
// str_array: {
|
|
464
|
+
// type: "string[]",
|
|
465
|
+
// },
|
|
466
|
+
// num_array: {
|
|
467
|
+
// type: "number[]",
|
|
468
|
+
// },
|
|
469
|
+
// },
|
|
470
|
+
// },
|
|
471
|
+
// },
|
|
472
|
+
// },
|
|
473
|
+
// ],
|
|
474
|
+
// },
|
|
475
|
+
// {
|
|
476
|
+
// payload_dir_path: PAYLOAD_TEST_DIR_PATH3,
|
|
477
|
+
// }
|
|
478
|
+
// );
|
|
479
|
+
// const hard_coded_schema = await format(
|
|
480
|
+
// `/**
|
|
481
|
+
// * EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
482
|
+
// *
|
|
483
|
+
// * Below is what your Payload collections should look like.
|
|
484
|
+
// * Please copy these to your actual collection configs.
|
|
485
|
+
// * Make sure to add an authStrategy for the users collection if there is one.
|
|
486
|
+
// *
|
|
487
|
+
// * Example auth strategy:
|
|
488
|
+
// * auth: {
|
|
489
|
+
// * disableLocalStrategy: true,
|
|
490
|
+
// * strategies: [
|
|
491
|
+
// * betterAuthStrategy(),
|
|
492
|
+
// * // Add other strategies as needed
|
|
493
|
+
// * ],
|
|
494
|
+
// * },
|
|
495
|
+
// */
|
|
496
|
+
// import type { CollectionConfig } from "payload";
|
|
497
|
+
// const User: CollectionConfig = {
|
|
498
|
+
// slug: "user",
|
|
499
|
+
// admin: {
|
|
500
|
+
// useAsTitle: "name",
|
|
501
|
+
// },
|
|
502
|
+
// fields: [
|
|
503
|
+
// {
|
|
504
|
+
// name: "name",
|
|
505
|
+
// type: "text",
|
|
506
|
+
// required: true,
|
|
507
|
+
// },
|
|
508
|
+
// {
|
|
509
|
+
// name: "email",
|
|
510
|
+
// type: "email",
|
|
511
|
+
// required: true,
|
|
512
|
+
// unique: true,
|
|
513
|
+
// },
|
|
514
|
+
// {
|
|
515
|
+
// name: "emailVerified",
|
|
516
|
+
// type: "checkbox",
|
|
517
|
+
// required: true,
|
|
518
|
+
// defaultValue: false,
|
|
519
|
+
// },
|
|
520
|
+
// {
|
|
521
|
+
// name: "image",
|
|
522
|
+
// type: "upload",
|
|
523
|
+
// relationTo: "media",
|
|
524
|
+
// },
|
|
525
|
+
// ],
|
|
526
|
+
// timestamps: true,
|
|
527
|
+
// } as const;
|
|
528
|
+
// const Session: CollectionConfig = {
|
|
529
|
+
// slug: "session",
|
|
530
|
+
// admin: {
|
|
531
|
+
// useAsTitle: "expiresAt",
|
|
532
|
+
// },
|
|
533
|
+
// fields: [
|
|
534
|
+
// {
|
|
535
|
+
// name: "expiresAt",
|
|
536
|
+
// type: "date",
|
|
537
|
+
// required: true,
|
|
538
|
+
// },
|
|
539
|
+
// {
|
|
540
|
+
// name: "token",
|
|
541
|
+
// type: "text",
|
|
542
|
+
// required: true,
|
|
543
|
+
// unique: true,
|
|
544
|
+
// },
|
|
545
|
+
// {
|
|
546
|
+
// name: "ipAddress",
|
|
547
|
+
// type: "text",
|
|
548
|
+
// },
|
|
549
|
+
// {
|
|
550
|
+
// name: "userAgent",
|
|
551
|
+
// type: "text",
|
|
552
|
+
// },
|
|
553
|
+
// {
|
|
554
|
+
// name: "userId",
|
|
555
|
+
// type: "relationship",
|
|
556
|
+
// relationTo: "user",
|
|
557
|
+
// required: true,
|
|
558
|
+
// },
|
|
559
|
+
// ],
|
|
560
|
+
// timestamps: true,
|
|
561
|
+
// } as const;
|
|
562
|
+
// const Account: CollectionConfig = {
|
|
563
|
+
// slug: "account",
|
|
564
|
+
// admin: {
|
|
565
|
+
// useAsTitle: "accountId",
|
|
566
|
+
// },
|
|
567
|
+
// fields: [
|
|
568
|
+
// {
|
|
569
|
+
// name: "accountId",
|
|
570
|
+
// type: "text",
|
|
571
|
+
// required: true,
|
|
572
|
+
// },
|
|
573
|
+
// {
|
|
574
|
+
// name: "providerId",
|
|
575
|
+
// type: "text",
|
|
576
|
+
// required: true,
|
|
577
|
+
// },
|
|
578
|
+
// {
|
|
579
|
+
// name: "userId",
|
|
580
|
+
// type: "relationship",
|
|
581
|
+
// relationTo: "user",
|
|
582
|
+
// required: true,
|
|
583
|
+
// },
|
|
584
|
+
// {
|
|
585
|
+
// name: "accessToken",
|
|
586
|
+
// type: "text",
|
|
587
|
+
// },
|
|
588
|
+
// {
|
|
589
|
+
// name: "refreshToken",
|
|
590
|
+
// type: "text",
|
|
591
|
+
// },
|
|
592
|
+
// {
|
|
593
|
+
// name: "idToken",
|
|
594
|
+
// type: "text",
|
|
595
|
+
// },
|
|
596
|
+
// {
|
|
597
|
+
// name: "accessTokenExpiresAt",
|
|
598
|
+
// type: "date",
|
|
599
|
+
// },
|
|
600
|
+
// {
|
|
601
|
+
// name: "refreshTokenExpiresAt",
|
|
602
|
+
// type: "date",
|
|
603
|
+
// },
|
|
604
|
+
// {
|
|
605
|
+
// name: "scope",
|
|
606
|
+
// type: "text",
|
|
607
|
+
// },
|
|
608
|
+
// {
|
|
609
|
+
// name: "password",
|
|
610
|
+
// type: "text",
|
|
611
|
+
// },
|
|
612
|
+
// ],
|
|
613
|
+
// timestamps: true,
|
|
614
|
+
// } as const;
|
|
615
|
+
// const Verification: CollectionConfig = {
|
|
616
|
+
// slug: "verification",
|
|
617
|
+
// admin: {
|
|
618
|
+
// useAsTitle: "identifier",
|
|
619
|
+
// },
|
|
620
|
+
// fields: [
|
|
621
|
+
// {
|
|
622
|
+
// name: "identifier",
|
|
623
|
+
// type: "text",
|
|
624
|
+
// required: true,
|
|
625
|
+
// },
|
|
626
|
+
// {
|
|
627
|
+
// name: "value",
|
|
628
|
+
// type: "text",
|
|
629
|
+
// required: true,
|
|
630
|
+
// },
|
|
631
|
+
// {
|
|
632
|
+
// name: "expiresAt",
|
|
633
|
+
// type: "date",
|
|
634
|
+
// required: true,
|
|
635
|
+
// },
|
|
636
|
+
// ],
|
|
637
|
+
// timestamps: true,
|
|
638
|
+
// } as const;
|
|
639
|
+
// const Admin: CollectionConfig = {
|
|
640
|
+
// slug: "admin",
|
|
641
|
+
// admin: {
|
|
642
|
+
// useAsTitle: "name",
|
|
643
|
+
// },
|
|
644
|
+
// fields: [
|
|
645
|
+
// {
|
|
646
|
+
// name: "name",
|
|
647
|
+
// type: "text",
|
|
648
|
+
// required: true,
|
|
649
|
+
// },
|
|
650
|
+
// {
|
|
651
|
+
// name: "isAdmin",
|
|
652
|
+
// type: "checkbox",
|
|
653
|
+
// required: true,
|
|
654
|
+
// },
|
|
655
|
+
// {
|
|
656
|
+
// name: "status",
|
|
657
|
+
// type: "text",
|
|
658
|
+
// },
|
|
659
|
+
// {
|
|
660
|
+
// name: "date",
|
|
661
|
+
// type: "date",
|
|
662
|
+
// },
|
|
663
|
+
// {
|
|
664
|
+
// name: "number",
|
|
665
|
+
// type: "number",
|
|
666
|
+
// },
|
|
667
|
+
// {
|
|
668
|
+
// name: "str_array",
|
|
669
|
+
// type: "text",
|
|
670
|
+
// },
|
|
671
|
+
// {
|
|
672
|
+
// name: "num_array",
|
|
673
|
+
// type: "text",
|
|
674
|
+
// },
|
|
675
|
+
// ],
|
|
676
|
+
// timestamps: true,
|
|
677
|
+
// } as const;
|
|
678
|
+
// export { User, Session, Account, Verification, Admin };
|
|
679
|
+
// `,
|
|
680
|
+
// { filepath: "schema.ts" }
|
|
681
|
+
// );
|
|
682
|
+
// if (generate_schema !== hard_coded_schema) {
|
|
683
|
+
// console.log(`\n\n\n--------------------------------- Generated:`);
|
|
684
|
+
// console.log(generate_schema);
|
|
685
|
+
// console.log(`--------------------------------- Hard-coded:`);
|
|
686
|
+
// console.log(hard_coded_schema);
|
|
687
|
+
// console.log(`---------------------------------\n\n\n`);
|
|
688
|
+
// }
|
|
689
|
+
// expect(generate_schema).toBe(hard_coded_schema);
|
|
690
|
+
// });
|
|
691
|
+
// test.skip("should support .index method after `defineTable`", async () => {
|
|
692
|
+
// const generate_schema = await generateSchema(
|
|
693
|
+
// {
|
|
694
|
+
// plugins: [
|
|
695
|
+
// {
|
|
696
|
+
// schema: {
|
|
697
|
+
// testTable: {
|
|
698
|
+
// fields: {},
|
|
699
|
+
// },
|
|
700
|
+
// },
|
|
701
|
+
// id: "test",
|
|
702
|
+
// },
|
|
703
|
+
// ],
|
|
704
|
+
// },
|
|
705
|
+
// {
|
|
706
|
+
// payload_dir_path: PAYLOAD_TEST_DIR_PATH3,
|
|
707
|
+
// }
|
|
708
|
+
// );
|
|
709
|
+
// const hard_coded_schema = await format(
|
|
710
|
+
// [
|
|
711
|
+
// `import {defineSchema,defineTable} from "convex/server";`,
|
|
712
|
+
// `import {v} from "convex/values";`,
|
|
713
|
+
// ``,
|
|
714
|
+
// `export default defineSchema({`,
|
|
715
|
+
// default_tables,
|
|
716
|
+
// `testTable: defineTable({`,
|
|
717
|
+
// `}).index("by_something", ["email"]),`,
|
|
718
|
+
// `});`,
|
|
719
|
+
// ].join("\n"),
|
|
720
|
+
// { filepath: "schema.ts" }
|
|
721
|
+
// );
|
|
722
|
+
// if (generate_schema !== hard_coded_schema) {
|
|
723
|
+
// console.log(`\n\n\n--------------------------------- Generated:`);
|
|
724
|
+
// console.log(generate_schema);
|
|
725
|
+
// console.log(`--------------------------------- Hard-coded:`);
|
|
726
|
+
// console.log(hard_coded_schema);
|
|
727
|
+
// console.log(`---------------------------------\n\n\n`);
|
|
728
|
+
// }
|
|
729
|
+
// expect(generate_schema).toBe(hard_coded_schema);
|
|
730
|
+
// });
|
|
731
|
+
// it(`should generate references correctly`, async () => {
|
|
732
|
+
// const generate_schema = await generateSchema(
|
|
733
|
+
// {
|
|
734
|
+
// plugins: [
|
|
735
|
+
// {
|
|
736
|
+
// id: "admin",
|
|
737
|
+
// schema: {
|
|
738
|
+
// admin: {
|
|
739
|
+
// fields: {
|
|
740
|
+
// id: {
|
|
741
|
+
// type: "string",
|
|
742
|
+
// required: true,
|
|
743
|
+
// },
|
|
744
|
+
// reference_optional: {
|
|
745
|
+
// type: "string",
|
|
746
|
+
// references: {
|
|
747
|
+
// field: "something",
|
|
748
|
+
// model: "something_else",
|
|
749
|
+
// },
|
|
750
|
+
// },
|
|
751
|
+
// reference_required: {
|
|
752
|
+
// type: "string",
|
|
753
|
+
// required: true,
|
|
754
|
+
// references: {
|
|
755
|
+
// field: "something2",
|
|
756
|
+
// model: "something2_else",
|
|
757
|
+
// },
|
|
758
|
+
// },
|
|
759
|
+
// },
|
|
760
|
+
// },
|
|
761
|
+
// },
|
|
762
|
+
// },
|
|
763
|
+
// ],
|
|
764
|
+
// },
|
|
765
|
+
// {
|
|
766
|
+
// payload_dir_path: PAYLOAD_TEST_DIR_PATH3,
|
|
767
|
+
// }
|
|
768
|
+
// );
|
|
769
|
+
// const hard_coded_schema = await format(
|
|
770
|
+
// [
|
|
771
|
+
// `import {defineSchema,defineTable} from "convex/server";`,
|
|
772
|
+
// `import {v} from "convex/values";`,
|
|
773
|
+
// ``,
|
|
774
|
+
// `export default defineSchema({`,
|
|
775
|
+
// default_tables,
|
|
776
|
+
// `admin: defineTable({`,
|
|
777
|
+
// `id: v.id("admin"),`,
|
|
778
|
+
// `reference_optional: v.id("something_else"),`,
|
|
779
|
+
// `reference_required: v.id("something2_else"),`,
|
|
780
|
+
// `}),`,
|
|
781
|
+
// `});`,
|
|
782
|
+
// ].join("\n"),
|
|
783
|
+
// { filepath: "schema.ts" }
|
|
784
|
+
// );
|
|
785
|
+
// if (generate_schema !== hard_coded_schema) {
|
|
786
|
+
// console.log(`\n\n\n--------------------------------- Generated:`);
|
|
787
|
+
// console.log(generate_schema);
|
|
788
|
+
// console.log(`--------------------------------- Hard-coded:`);
|
|
789
|
+
// console.log(hard_coded_schema);
|
|
790
|
+
// console.log(`---------------------------------\n\n\n`);
|
|
791
|
+
// }
|
|
792
|
+
// expect(generate_schema).toBe(hard_coded_schema);
|
|
793
|
+
// });
|
|
794
|
+
});
|
|
795
|
+
|
|
796
|
+
//# sourceMappingURL=schema.test.js.map
|