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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/adapter/test/schema.test.ts"],"sourcesContent":["import { describe, expect, it, test } from 'vitest'\nimport { format } from 'prettier'\nimport { getPayloadPath } from '../generate-schema/utils'\nimport { generateSchema } from '../generate-schema'\n\nconst PAYLOAD_TEST_DIR_PATH = getPayloadPath('./test/test_payload1')\nconst PAYLOAD_TEST_DIR_PATH2 = getPayloadPath('./test/test_payload2')\nconst PAYLOAD_TEST_DIR_PATH3 = getPayloadPath('./test/test_payload3')\n\ndescribe(`Handle schema generation`, async () => {\n it('should generate the correct schema with existing schema', async () => {\n const generate_schema = await generateSchema(\n {\n plugins: [\n {\n schema: {\n testTable: {\n fields: {\n hello: {\n type: 'boolean',\n required: false,\n },\n hello2: {\n type: 'string',\n required: true,\n },\n },\n },\n },\n id: 'test',\n },\n ],\n },\n {\n outputDir: PAYLOAD_TEST_DIR_PATH,\n },\n )\n\n // console.log(generate_schema);\n\n const hard_coded_schema = await format(\n `/**\n * EXAMPLE COLLECTIONS FOR BETTER AUTH\n *\n * Below is what your Payload collections should look like.\n * Please copy these to your actual collection configs.\n * Make sure to add an authStrategy for the users collection if there is one.\n *\n * Example auth strategy:\n * auth: {\n * disableLocalStrategy: true,\n * strategies: [\n * betterAuthStrategy(),\n * // Add other strategies as needed\n * ],\n * },\n */\nimport type { CollectionConfig } from \"payload\";\n\nconst User: CollectionConfig = {\n slug: \"user\",\n admin: {\n useAsTitle: \"name\",\n },\n fields: [\n {\n name: \"name\",\n type: \"text\",\n required: true,\n },\n {\n name: \"email\",\n type: \"email\",\n required: true,\n unique: true,\n },\n {\n name: \"emailVerified\",\n type: \"checkbox\",\n required: true,\n },\n {\n name: \"image\",\n type: \"upload\",\n relationTo: \"media\",\n },\n ],\n timestamps: true,\n} as const;\n\nconst Session: CollectionConfig = {\n slug: \"session\",\n admin: {\n useAsTitle: \"expiresAt\",\n },\n fields: [\n {\n name: \"expiresAt\",\n type: \"date\",\n required: true,\n },\n {\n name: \"token\",\n type: \"text\",\n required: true,\n unique: true,\n },\n {\n name: \"ipAddress\",\n type: \"text\",\n },\n {\n name: \"userAgent\",\n type: \"text\",\n },\n {\n name: \"userId\",\n type: \"relationship\",\n required: true,\n relationTo: \"user\",\n },\n ],\n timestamps: true,\n} as const;\n\nconst Account: CollectionConfig = {\n slug: \"account\",\n admin: {\n useAsTitle: \"accountId\",\n },\n fields: [\n {\n name: \"accountId\",\n type: \"text\",\n required: true,\n },\n {\n name: \"providerId\",\n type: \"text\",\n required: true,\n },\n {\n name: \"userId\",\n type: \"relationship\",\n required: true,\n relationTo: \"user\",\n },\n {\n name: \"accessToken\",\n type: \"text\",\n },\n {\n name: \"refreshToken\",\n type: \"text\",\n },\n {\n name: \"idToken\",\n type: \"text\",\n },\n {\n name: \"accessTokenExpiresAt\",\n type: \"date\",\n },\n {\n name: \"refreshTokenExpiresAt\",\n type: \"date\",\n },\n {\n name: \"scope\",\n type: \"text\",\n },\n {\n name: \"password\",\n type: \"text\",\n },\n ],\n timestamps: true,\n} as const;\n\nconst Verification: CollectionConfig = {\n slug: \"verification\",\n admin: {\n useAsTitle: \"identifier\",\n },\n fields: [\n {\n name: \"identifier\",\n type: \"text\",\n required: true,\n },\n {\n name: \"value\",\n type: \"text\",\n required: true,\n },\n {\n name: \"expiresAt\",\n type: \"date\",\n required: true,\n },\n ],\n timestamps: true,\n} as const;\n\nconst TestTable: CollectionConfig = {\n slug: \"testTable\",\n admin: {\n useAsTitle: \"hello\",\n },\n fields: [\n {\n name: \"hello\",\n type: \"checkbox\",\n },\n {\n name: \"hello2\",\n type: \"text\",\n required: true,\n },\n ],\n timestamps: true,\n} as const;\n\nexport { User, Session, Account, Verification, TestTable };\n\n`,\n { filepath: 'schema.ts' },\n )\n\n // if (generate_schema !== hard_coded_schema) {\n // console.log(`\\n\\n\\n--------------------------------- Generated:`);\n // console.log(generate_schema);\n // console.log(`--------------------------------- Hard-coded:`);\n // console.log(hard_coded_schema);\n // console.log(`---------------------------------\\n\\n\\n`);\n // }\n expect(generate_schema).toEqual(hard_coded_schema)\n })\n\n // it(\"should generate the correct schema based on multiple plugins\", async () => {\n // const generate_schema = await generateSchema(\n // {\n // plugins: [\n // {\n // schema: {\n // user: {\n // fields: {},\n // },\n // admins: {\n // fields: {},\n // },\n // },\n // id: \"test\",\n // },\n // ],\n // },\n // {\n // payload_dir_path: PAYLOAD_TEST_DIR_PATH2,\n // }\n // );\n\n // const hard_coded_schema = await format(\n // `/**\n // * EXAMPLE COLLECTIONS FOR BETTER AUTH\n // *\n // * Below is what your Payload collections should look like.\n // * Please copy these to your actual collection configs.\n // * Make sure to add an authStrategy for the users collection if there is one.\n // *\n // * Example auth strategy:\n // * auth: {\n // * disableLocalStrategy: true,\n // * strategies: [\n // * betterAuthStrategy(),\n // * // Add other strategies as needed\n // * ],\n // * },\n // */\n // import type { CollectionConfig } from \"payload\";\n\n // const User: CollectionConfig = {\n // slug: \"user\",\n // admin: {\n // useAsTitle: \"name\",\n // },\n // fields: [\n // {\n // name: \"name\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"email\",\n // type: \"email\",\n // required: true,\n // unique: true,\n // },\n // {\n // name: \"emailVerified\",\n // type: \"checkbox\",\n // required: true,\n // defaultValue: false,\n // },\n // {\n // name: \"image\",\n // type: \"upload\",\n // relationTo: \"media\",\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Session: CollectionConfig = {\n // slug: \"session\",\n // admin: {\n // useAsTitle: \"expiresAt\",\n // },\n // fields: [\n // {\n // name: \"expiresAt\",\n // type: \"date\",\n // required: true,\n // },\n // {\n // name: \"token\",\n // type: \"text\",\n // required: true,\n // unique: true,\n // },\n // {\n // name: \"ipAddress\",\n // type: \"text\",\n // },\n // {\n // name: \"userAgent\",\n // type: \"text\",\n // },\n // {\n // name: \"userId\",\n // type: \"relationship\",\n // relationTo: \"user\",\n // required: true,\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Account: CollectionConfig = {\n // slug: \"account\",\n // admin: {\n // useAsTitle: \"accountId\",\n // },\n // fields: [\n // {\n // name: \"accountId\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"providerId\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"userId\",\n // type: \"relationship\",\n // relationTo: \"user\",\n // required: true,\n // },\n // {\n // name: \"accessToken\",\n // type: \"text\",\n // },\n // {\n // name: \"refreshToken\",\n // type: \"text\",\n // },\n // {\n // name: \"idToken\",\n // type: \"text\",\n // },\n // {\n // name: \"accessTokenExpiresAt\",\n // type: \"date\",\n // },\n // {\n // name: \"refreshTokenExpiresAt\",\n // type: \"date\",\n // },\n // {\n // name: \"scope\",\n // type: \"text\",\n // },\n // {\n // name: \"password\",\n // type: \"text\",\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Verification: CollectionConfig = {\n // slug: \"verification\",\n // admin: {\n // useAsTitle: \"identifier\",\n // },\n // fields: [\n // {\n // name: \"identifier\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"value\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"expiresAt\",\n // type: \"date\",\n // required: true,\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Admins: CollectionConfig = {\n // slug: \"admins\",\n // admin: {\n // useAsTitle: \"id\",\n // },\n // fields: [],\n // timestamps: true,\n // } as const;\n\n // export { User, Session, Account, Verification, Admins };\n // `,\n // { filepath: \"schema.ts\" }\n // );\n\n // if (generate_schema !== hard_coded_schema) {\n // console.log(`\\n\\n\\n--------------------------------- Generated:`);\n // console.log(generate_schema);\n // console.log(`--------------------------------- Hard-coded:`);\n // console.log(hard_coded_schema);\n // console.log(`---------------------------------\\n\\n\\n`);\n // }\n\n // expect(generate_schema).toBe(hard_coded_schema);\n // });\n\n // it(`should generate the correct schema based on multiple different field types`, async () => {\n // const generate_schema = await generateSchema(\n // {\n // plugins: [\n // {\n // id: \"admin\",\n // schema: {\n // admin: {\n // fields: {\n // name: {\n // type: \"string\",\n // required: true,\n // },\n // id: {\n // type: \"string\",\n // required: true,\n // },\n // isAdmin: {\n // type: \"boolean\",\n // required: true,\n // },\n // status: {\n // type: \"string\",\n // required: false,\n // },\n // date: {\n // type: \"date\",\n // },\n // number: {\n // type: \"number\",\n // },\n // str_array: {\n // type: \"string[]\",\n // },\n // num_array: {\n // type: \"number[]\",\n // },\n // },\n // },\n // },\n // },\n // ],\n // },\n // {\n // payload_dir_path: PAYLOAD_TEST_DIR_PATH3,\n // }\n // );\n\n // const hard_coded_schema = await format(\n // `/**\n // * EXAMPLE COLLECTIONS FOR BETTER AUTH\n // *\n // * Below is what your Payload collections should look like.\n // * Please copy these to your actual collection configs.\n // * Make sure to add an authStrategy for the users collection if there is one.\n // *\n // * Example auth strategy:\n // * auth: {\n // * disableLocalStrategy: true,\n // * strategies: [\n // * betterAuthStrategy(),\n // * // Add other strategies as needed\n // * ],\n // * },\n // */\n // import type { CollectionConfig } from \"payload\";\n\n // const User: CollectionConfig = {\n // slug: \"user\",\n // admin: {\n // useAsTitle: \"name\",\n // },\n // fields: [\n // {\n // name: \"name\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"email\",\n // type: \"email\",\n // required: true,\n // unique: true,\n // },\n // {\n // name: \"emailVerified\",\n // type: \"checkbox\",\n // required: true,\n // defaultValue: false,\n // },\n // {\n // name: \"image\",\n // type: \"upload\",\n // relationTo: \"media\",\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Session: CollectionConfig = {\n // slug: \"session\",\n // admin: {\n // useAsTitle: \"expiresAt\",\n // },\n // fields: [\n // {\n // name: \"expiresAt\",\n // type: \"date\",\n // required: true,\n // },\n // {\n // name: \"token\",\n // type: \"text\",\n // required: true,\n // unique: true,\n // },\n // {\n // name: \"ipAddress\",\n // type: \"text\",\n // },\n // {\n // name: \"userAgent\",\n // type: \"text\",\n // },\n // {\n // name: \"userId\",\n // type: \"relationship\",\n // relationTo: \"user\",\n // required: true,\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Account: CollectionConfig = {\n // slug: \"account\",\n // admin: {\n // useAsTitle: \"accountId\",\n // },\n // fields: [\n // {\n // name: \"accountId\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"providerId\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"userId\",\n // type: \"relationship\",\n // relationTo: \"user\",\n // required: true,\n // },\n // {\n // name: \"accessToken\",\n // type: \"text\",\n // },\n // {\n // name: \"refreshToken\",\n // type: \"text\",\n // },\n // {\n // name: \"idToken\",\n // type: \"text\",\n // },\n // {\n // name: \"accessTokenExpiresAt\",\n // type: \"date\",\n // },\n // {\n // name: \"refreshTokenExpiresAt\",\n // type: \"date\",\n // },\n // {\n // name: \"scope\",\n // type: \"text\",\n // },\n // {\n // name: \"password\",\n // type: \"text\",\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Verification: CollectionConfig = {\n // slug: \"verification\",\n // admin: {\n // useAsTitle: \"identifier\",\n // },\n // fields: [\n // {\n // name: \"identifier\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"value\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"expiresAt\",\n // type: \"date\",\n // required: true,\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // const Admin: CollectionConfig = {\n // slug: \"admin\",\n // admin: {\n // useAsTitle: \"name\",\n // },\n // fields: [\n // {\n // name: \"name\",\n // type: \"text\",\n // required: true,\n // },\n // {\n // name: \"isAdmin\",\n // type: \"checkbox\",\n // required: true,\n // },\n // {\n // name: \"status\",\n // type: \"text\",\n // },\n // {\n // name: \"date\",\n // type: \"date\",\n // },\n // {\n // name: \"number\",\n // type: \"number\",\n // },\n // {\n // name: \"str_array\",\n // type: \"text\",\n // },\n // {\n // name: \"num_array\",\n // type: \"text\",\n // },\n // ],\n // timestamps: true,\n // } as const;\n\n // export { User, Session, Account, Verification, Admin };\n // `,\n // { filepath: \"schema.ts\" }\n // );\n\n // if (generate_schema !== hard_coded_schema) {\n // console.log(`\\n\\n\\n--------------------------------- Generated:`);\n // console.log(generate_schema);\n // console.log(`--------------------------------- Hard-coded:`);\n // console.log(hard_coded_schema);\n // console.log(`---------------------------------\\n\\n\\n`);\n // }\n\n // expect(generate_schema).toBe(hard_coded_schema);\n // });\n\n // test.skip(\"should support .index method after `defineTable`\", async () => {\n // const generate_schema = await generateSchema(\n // {\n // plugins: [\n // {\n // schema: {\n // testTable: {\n // fields: {},\n // },\n // },\n // id: \"test\",\n // },\n // ],\n // },\n // {\n // payload_dir_path: PAYLOAD_TEST_DIR_PATH3,\n // }\n // );\n\n // const hard_coded_schema = await format(\n // [\n // `import {defineSchema,defineTable} from \"convex/server\";`,\n // `import {v} from \"convex/values\";`,\n // ``,\n // `export default defineSchema({`,\n // default_tables,\n // `testTable: defineTable({`,\n // `}).index(\"by_something\", [\"email\"]),`,\n // `});`,\n // ].join(\"\\n\"),\n // { filepath: \"schema.ts\" }\n // );\n\n // if (generate_schema !== hard_coded_schema) {\n // console.log(`\\n\\n\\n--------------------------------- Generated:`);\n // console.log(generate_schema);\n // console.log(`--------------------------------- Hard-coded:`);\n // console.log(hard_coded_schema);\n // console.log(`---------------------------------\\n\\n\\n`);\n // }\n\n // expect(generate_schema).toBe(hard_coded_schema);\n // });\n\n // it(`should generate references correctly`, async () => {\n // const generate_schema = await generateSchema(\n // {\n // plugins: [\n // {\n // id: \"admin\",\n // schema: {\n // admin: {\n // fields: {\n // id: {\n // type: \"string\",\n // required: true,\n // },\n\n // reference_optional: {\n // type: \"string\",\n // references: {\n // field: \"something\",\n // model: \"something_else\",\n // },\n // },\n // reference_required: {\n // type: \"string\",\n // required: true,\n // references: {\n // field: \"something2\",\n // model: \"something2_else\",\n // },\n // },\n // },\n // },\n // },\n // },\n // ],\n // },\n // {\n // payload_dir_path: PAYLOAD_TEST_DIR_PATH3,\n // }\n // );\n\n // const hard_coded_schema = await format(\n // [\n // `import {defineSchema,defineTable} from \"convex/server\";`,\n // `import {v} from \"convex/values\";`,\n // ``,\n // `export default defineSchema({`,\n // default_tables,\n // `admin: defineTable({`,\n // `id: v.id(\"admin\"),`,\n // `reference_optional: v.id(\"something_else\"),`,\n // `reference_required: v.id(\"something2_else\"),`,\n // `}),`,\n // `});`,\n // ].join(\"\\n\"),\n // { filepath: \"schema.ts\" }\n // );\n\n // if (generate_schema !== hard_coded_schema) {\n // console.log(`\\n\\n\\n--------------------------------- Generated:`);\n // console.log(generate_schema);\n // console.log(`--------------------------------- Hard-coded:`);\n // console.log(hard_coded_schema);\n // console.log(`---------------------------------\\n\\n\\n`);\n // }\n // expect(generate_schema).toBe(hard_coded_schema);\n // });\n})\n"],"names":["describe","expect","it","format","getPayloadPath","generateSchema","PAYLOAD_TEST_DIR_PATH","PAYLOAD_TEST_DIR_PATH2","PAYLOAD_TEST_DIR_PATH3","generate_schema","plugins","schema","testTable","fields","hello","type","required","hello2","id","outputDir","hard_coded_schema","filepath","toEqual"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAc,SAAQ;AACnD,SAAS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LLECTIONS FOR BETTER AUTH
|
|
3
|
+
*
|
|
4
|
+
* Below is what your Payload collections should look like.
|
|
5
|
+
* Please copy these to your actual collection configs.
|
|
6
|
+
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
+
*
|
|
8
|
+
* Example auth strategy:
|
|
9
|
+
* auth: {
|
|
10
|
+
* disableLocalStrategy: true,
|
|
11
|
+
* strategies: [
|
|
12
|
+
* betterAuthStrategy(),
|
|
13
|
+
* // Add other strategies as needed
|
|
14
|
+
* ],
|
|
15
|
+
* },
|
|
16
|
+
*/
|
|
17
|
+
import type { CollectionConfig } from 'payload';
|
|
18
|
+
declare const User: CollectionConfig;
|
|
19
|
+
declare const Session: CollectionConfig;
|
|
20
|
+
declare const Account: CollectionConfig;
|
|
21
|
+
declare const Verification: CollectionConfig;
|
|
22
|
+
declare const TestTable: CollectionConfig;
|
|
23
|
+
export { User, Session, Account, Verification, TestTable };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
3
|
+
*
|
|
4
|
+
* Below is what your Payload collections should look like.
|
|
5
|
+
* Please copy these to your actual collection configs.
|
|
6
|
+
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
+
*
|
|
8
|
+
* Example auth strategy:
|
|
9
|
+
* auth: {
|
|
10
|
+
* disableLocalStrategy: true,
|
|
11
|
+
* strategies: [
|
|
12
|
+
* betterAuthStrategy(),
|
|
13
|
+
* // Add other strategies as needed
|
|
14
|
+
* ],
|
|
15
|
+
* },
|
|
16
|
+
*/ const User = {
|
|
17
|
+
slug: 'user',
|
|
18
|
+
admin: {
|
|
19
|
+
useAsTitle: 'name'
|
|
20
|
+
},
|
|
21
|
+
fields: [
|
|
22
|
+
{
|
|
23
|
+
name: 'name',
|
|
24
|
+
type: 'text',
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'email',
|
|
29
|
+
type: 'email',
|
|
30
|
+
required: true,
|
|
31
|
+
unique: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'emailVerified',
|
|
35
|
+
type: 'checkbox',
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'image',
|
|
40
|
+
type: 'upload',
|
|
41
|
+
relationTo: 'media'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
timestamps: true
|
|
45
|
+
};
|
|
46
|
+
const Session = {
|
|
47
|
+
slug: 'session',
|
|
48
|
+
admin: {
|
|
49
|
+
useAsTitle: 'expiresAt'
|
|
50
|
+
},
|
|
51
|
+
fields: [
|
|
52
|
+
{
|
|
53
|
+
name: 'expiresAt',
|
|
54
|
+
type: 'date',
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'token',
|
|
59
|
+
type: 'text',
|
|
60
|
+
required: true,
|
|
61
|
+
unique: true
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'ipAddress',
|
|
65
|
+
type: 'text'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'userAgent',
|
|
69
|
+
type: 'text'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'userId',
|
|
73
|
+
type: 'relationship',
|
|
74
|
+
required: true,
|
|
75
|
+
relationTo: 'user'
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
timestamps: true
|
|
79
|
+
};
|
|
80
|
+
const Account = {
|
|
81
|
+
slug: 'account',
|
|
82
|
+
admin: {
|
|
83
|
+
useAsTitle: 'accountId'
|
|
84
|
+
},
|
|
85
|
+
fields: [
|
|
86
|
+
{
|
|
87
|
+
name: 'accountId',
|
|
88
|
+
type: 'text',
|
|
89
|
+
required: true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'providerId',
|
|
93
|
+
type: 'text',
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'userId',
|
|
98
|
+
type: 'relationship',
|
|
99
|
+
required: true,
|
|
100
|
+
relationTo: 'user'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'accessToken',
|
|
104
|
+
type: 'text'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'refreshToken',
|
|
108
|
+
type: 'text'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'idToken',
|
|
112
|
+
type: 'text'
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'accessTokenExpiresAt',
|
|
116
|
+
type: 'date'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'refreshTokenExpiresAt',
|
|
120
|
+
type: 'date'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'scope',
|
|
124
|
+
type: 'text'
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'password',
|
|
128
|
+
type: 'text'
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
timestamps: true
|
|
132
|
+
};
|
|
133
|
+
const Verification = {
|
|
134
|
+
slug: 'verification',
|
|
135
|
+
admin: {
|
|
136
|
+
useAsTitle: 'identifier'
|
|
137
|
+
},
|
|
138
|
+
fields: [
|
|
139
|
+
{
|
|
140
|
+
name: 'identifier',
|
|
141
|
+
type: 'text',
|
|
142
|
+
required: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'value',
|
|
146
|
+
type: 'text',
|
|
147
|
+
required: true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'expiresAt',
|
|
151
|
+
type: 'date',
|
|
152
|
+
required: true
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
timestamps: true
|
|
156
|
+
};
|
|
157
|
+
const TestTable = {
|
|
158
|
+
slug: 'testTable',
|
|
159
|
+
admin: {
|
|
160
|
+
useAsTitle: 'hello'
|
|
161
|
+
},
|
|
162
|
+
fields: [
|
|
163
|
+
{
|
|
164
|
+
name: 'hello',
|
|
165
|
+
type: 'checkbox'
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'hello2',
|
|
169
|
+
type: 'text',
|
|
170
|
+
required: true
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
timestamps: true
|
|
174
|
+
};
|
|
175
|
+
export { User, Session, Account, Verification, TestTable };
|
|
176
|
+
|
|
177
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapter/test/test_payload1/schema.ts"],"sourcesContent":["/**\n * EXAMPLE COLLECTIONS FOR BETTER AUTH\n *\n * Below is what your Payload collections should look like.\n * Please copy these to your actual collection configs.\n * Make sure to add an authStrategy for the users collection if there is one.\n *\n * Example auth strategy:\n * auth: {\n * disableLocalStrategy: true,\n * strategies: [\n * betterAuthStrategy(),\n * // Add other strategies as needed\n * ],\n * },\n */\nimport type { CollectionConfig } from 'payload'\n\nconst User: CollectionConfig = {\n slug: 'user',\n admin: {\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n },\n {\n name: 'email',\n type: 'email',\n required: true,\n unique: true,\n },\n {\n name: 'emailVerified',\n type: 'checkbox',\n required: true,\n },\n {\n name: 'image',\n type: 'upload',\n relationTo: 'media',\n },\n ],\n timestamps: true,\n} as const\n\nconst Session: CollectionConfig = {\n slug: 'session',\n admin: {\n useAsTitle: 'expiresAt',\n },\n fields: [\n {\n name: 'expiresAt',\n type: 'date',\n required: true,\n },\n {\n name: 'token',\n type: 'text',\n required: true,\n unique: true,\n },\n {\n name: 'ipAddress',\n type: 'text',\n },\n {\n name: 'userAgent',\n type: 'text',\n },\n {\n name: 'userId',\n type: 'relationship',\n required: true,\n relationTo: 'user',\n },\n ],\n timestamps: true,\n} as const\n\nconst Account: CollectionConfig = {\n slug: 'account',\n admin: {\n useAsTitle: 'accountId',\n },\n fields: [\n {\n name: 'accountId',\n type: 'text',\n required: true,\n },\n {\n name: 'providerId',\n type: 'text',\n required: true,\n },\n {\n name: 'userId',\n type: 'relationship',\n required: true,\n relationTo: 'user',\n },\n {\n name: 'accessToken',\n type: 'text',\n },\n {\n name: 'refreshToken',\n type: 'text',\n },\n {\n name: 'idToken',\n type: 'text',\n },\n {\n name: 'accessTokenExpiresAt',\n type: 'date',\n },\n {\n name: 'refreshTokenExpiresAt',\n type: 'date',\n },\n {\n name: 'scope',\n type: 'text',\n },\n {\n name: 'password',\n type: 'text',\n },\n ],\n timestamps: true,\n} as const\n\nconst Verification: CollectionConfig = {\n slug: 'verification',\n admin: {\n useAsTitle: 'identifier',\n },\n fields: [\n {\n name: 'identifier',\n type: 'text',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n required: true,\n },\n {\n name: 'expiresAt',\n type: 'date',\n required: true,\n },\n ],\n timestamps: true,\n} as const\n\nconst TestTable: CollectionConfig = {\n slug: 'testTable',\n admin: {\n useAsTitle: 'hello',\n },\n fields: [\n {\n name: 'hello',\n type: 'checkbox',\n },\n {\n name: 'hello2',\n type: 'text',\n required: true,\n },\n ],\n timestamps: true,\n} as const\n\nexport { User, Session, Account, Verification, TestTable }\n"],"names":["User","slug","admin","useAsTitle","fields","name","type","required","unique","relationTo","timestamps","Session","Account","Verification","TestTable"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,MAAMA,OAAyB;IAC7BC,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;QACV;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNG,YAAY;QACd;KACD;IACDC,YAAY;AACd;AAEA,MAAMC,UAA4B;IAChCV,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;QACV;QACA;YACEH,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNC,UAAU;YACVE,YAAY;QACd;KACD;IACDC,YAAY;AACd;AAEA,MAAME,UAA4B;IAChCX,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVE,YAAY;QACd;QACA;YACEJ,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;KACD;IACDI,YAAY;AACd;AAEA,MAAMG,eAAiC;IACrCZ,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;KACD;IACDG,YAAY;AACd;AAEA,MAAMI,YAA8B;IAClCb,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;KACD;IACDG,YAAY;AACd;AAEA,SAASV,IAAI,EAAEW,OAAO,EAAEC,OAAO,EAAEC,YAAY,EAAEC,SAAS,GAAE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
3
|
+
*
|
|
4
|
+
* Below is what your Payload collections should look like.
|
|
5
|
+
* Please copy these to your actual collection configs.
|
|
6
|
+
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
+
*
|
|
8
|
+
* Example auth strategy:
|
|
9
|
+
* auth: {
|
|
10
|
+
* disableLocalStrategy: true,
|
|
11
|
+
* strategies: [
|
|
12
|
+
* betterAuthStrategy(),
|
|
13
|
+
* // Add other strategies as needed
|
|
14
|
+
* ],
|
|
15
|
+
* },
|
|
16
|
+
*/
|
|
17
|
+
import type { CollectionConfig } from 'payload';
|
|
18
|
+
declare const User: CollectionConfig;
|
|
19
|
+
declare const Session: CollectionConfig;
|
|
20
|
+
declare const Account: CollectionConfig;
|
|
21
|
+
declare const Verification: CollectionConfig;
|
|
22
|
+
declare const Admins: CollectionConfig;
|
|
23
|
+
export { User, Session, Account, Verification, Admins };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
3
|
+
*
|
|
4
|
+
* Below is what your Payload collections should look like.
|
|
5
|
+
* Please copy these to your actual collection configs.
|
|
6
|
+
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
+
*
|
|
8
|
+
* Example auth strategy:
|
|
9
|
+
* auth: {
|
|
10
|
+
* disableLocalStrategy: true,
|
|
11
|
+
* strategies: [
|
|
12
|
+
* betterAuthStrategy(),
|
|
13
|
+
* // Add other strategies as needed
|
|
14
|
+
* ],
|
|
15
|
+
* },
|
|
16
|
+
*/ const User = {
|
|
17
|
+
slug: 'user',
|
|
18
|
+
admin: {
|
|
19
|
+
useAsTitle: 'name'
|
|
20
|
+
},
|
|
21
|
+
fields: [
|
|
22
|
+
{
|
|
23
|
+
name: 'name',
|
|
24
|
+
type: 'text',
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'email',
|
|
29
|
+
type: 'email',
|
|
30
|
+
required: true,
|
|
31
|
+
unique: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'emailVerified',
|
|
35
|
+
type: 'checkbox',
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'image',
|
|
40
|
+
type: 'upload',
|
|
41
|
+
relationTo: 'media'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
timestamps: true
|
|
45
|
+
};
|
|
46
|
+
const Session = {
|
|
47
|
+
slug: 'session',
|
|
48
|
+
admin: {
|
|
49
|
+
useAsTitle: 'expiresAt'
|
|
50
|
+
},
|
|
51
|
+
fields: [
|
|
52
|
+
{
|
|
53
|
+
name: 'expiresAt',
|
|
54
|
+
type: 'date',
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'token',
|
|
59
|
+
type: 'text',
|
|
60
|
+
required: true,
|
|
61
|
+
unique: true
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'ipAddress',
|
|
65
|
+
type: 'text'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'userAgent',
|
|
69
|
+
type: 'text'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'userId',
|
|
73
|
+
type: 'relationship',
|
|
74
|
+
required: true,
|
|
75
|
+
relationTo: 'user'
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
timestamps: true
|
|
79
|
+
};
|
|
80
|
+
const Account = {
|
|
81
|
+
slug: 'account',
|
|
82
|
+
admin: {
|
|
83
|
+
useAsTitle: 'accountId'
|
|
84
|
+
},
|
|
85
|
+
fields: [
|
|
86
|
+
{
|
|
87
|
+
name: 'accountId',
|
|
88
|
+
type: 'text',
|
|
89
|
+
required: true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'providerId',
|
|
93
|
+
type: 'text',
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'userId',
|
|
98
|
+
type: 'relationship',
|
|
99
|
+
required: true,
|
|
100
|
+
relationTo: 'user'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'accessToken',
|
|
104
|
+
type: 'text'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'refreshToken',
|
|
108
|
+
type: 'text'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'idToken',
|
|
112
|
+
type: 'text'
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'accessTokenExpiresAt',
|
|
116
|
+
type: 'date'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'refreshTokenExpiresAt',
|
|
120
|
+
type: 'date'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'scope',
|
|
124
|
+
type: 'text'
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'password',
|
|
128
|
+
type: 'text'
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
timestamps: true
|
|
132
|
+
};
|
|
133
|
+
const Verification = {
|
|
134
|
+
slug: 'verification',
|
|
135
|
+
admin: {
|
|
136
|
+
useAsTitle: 'identifier'
|
|
137
|
+
},
|
|
138
|
+
fields: [
|
|
139
|
+
{
|
|
140
|
+
name: 'identifier',
|
|
141
|
+
type: 'text',
|
|
142
|
+
required: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'value',
|
|
146
|
+
type: 'text',
|
|
147
|
+
required: true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'expiresAt',
|
|
151
|
+
type: 'date',
|
|
152
|
+
required: true
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
timestamps: true
|
|
156
|
+
};
|
|
157
|
+
const Admins = {
|
|
158
|
+
slug: 'admins',
|
|
159
|
+
admin: {
|
|
160
|
+
useAsTitle: 'id'
|
|
161
|
+
},
|
|
162
|
+
fields: [],
|
|
163
|
+
timestamps: true
|
|
164
|
+
};
|
|
165
|
+
export { User, Session, Account, Verification, Admins };
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapter/test/test_payload2/schema.ts"],"sourcesContent":["/**\n * EXAMPLE COLLECTIONS FOR BETTER AUTH\n *\n * Below is what your Payload collections should look like.\n * Please copy these to your actual collection configs.\n * Make sure to add an authStrategy for the users collection if there is one.\n *\n * Example auth strategy:\n * auth: {\n * disableLocalStrategy: true,\n * strategies: [\n * betterAuthStrategy(),\n * // Add other strategies as needed\n * ],\n * },\n */\nimport type { CollectionConfig } from 'payload'\n\nconst User: CollectionConfig = {\n slug: 'user',\n admin: {\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n },\n {\n name: 'email',\n type: 'email',\n required: true,\n unique: true,\n },\n {\n name: 'emailVerified',\n type: 'checkbox',\n required: true,\n },\n {\n name: 'image',\n type: 'upload',\n relationTo: 'media',\n },\n ],\n timestamps: true,\n} as const\n\nconst Session: CollectionConfig = {\n slug: 'session',\n admin: {\n useAsTitle: 'expiresAt',\n },\n fields: [\n {\n name: 'expiresAt',\n type: 'date',\n required: true,\n },\n {\n name: 'token',\n type: 'text',\n required: true,\n unique: true,\n },\n {\n name: 'ipAddress',\n type: 'text',\n },\n {\n name: 'userAgent',\n type: 'text',\n },\n {\n name: 'userId',\n type: 'relationship',\n required: true,\n relationTo: 'user',\n },\n ],\n timestamps: true,\n} as const\n\nconst Account: CollectionConfig = {\n slug: 'account',\n admin: {\n useAsTitle: 'accountId',\n },\n fields: [\n {\n name: 'accountId',\n type: 'text',\n required: true,\n },\n {\n name: 'providerId',\n type: 'text',\n required: true,\n },\n {\n name: 'userId',\n type: 'relationship',\n required: true,\n relationTo: 'user',\n },\n {\n name: 'accessToken',\n type: 'text',\n },\n {\n name: 'refreshToken',\n type: 'text',\n },\n {\n name: 'idToken',\n type: 'text',\n },\n {\n name: 'accessTokenExpiresAt',\n type: 'date',\n },\n {\n name: 'refreshTokenExpiresAt',\n type: 'date',\n },\n {\n name: 'scope',\n type: 'text',\n },\n {\n name: 'password',\n type: 'text',\n },\n ],\n timestamps: true,\n} as const\n\nconst Verification: CollectionConfig = {\n slug: 'verification',\n admin: {\n useAsTitle: 'identifier',\n },\n fields: [\n {\n name: 'identifier',\n type: 'text',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n required: true,\n },\n {\n name: 'expiresAt',\n type: 'date',\n required: true,\n },\n ],\n timestamps: true,\n} as const\n\nconst Admins: CollectionConfig = {\n slug: 'admins',\n admin: {\n useAsTitle: 'id',\n },\n fields: [],\n timestamps: true,\n} as const\n\nexport { User, Session, Account, Verification, Admins }\n"],"names":["User","slug","admin","useAsTitle","fields","name","type","required","unique","relationTo","timestamps","Session","Account","Verification","Admins"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,MAAMA,OAAyB;IAC7BC,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;QACV;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNG,YAAY;QACd;KACD;IACDC,YAAY;AACd;AAEA,MAAMC,UAA4B;IAChCV,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;QACV;QACA;YACEH,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNC,UAAU;YACVE,YAAY;QACd;KACD;IACDC,YAAY;AACd;AAEA,MAAME,UAA4B;IAChCX,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVE,YAAY;QACd;QACA;YACEJ,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;KACD;IACDI,YAAY;AACd;AAEA,MAAMG,eAAiC;IACrCZ,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;KACD;IACDG,YAAY;AACd;AAEA,MAAMI,SAA2B;IAC/Bb,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ,EAAE;IACVM,YAAY;AACd;AAEA,SAASV,IAAI,EAAEW,OAAO,EAAEC,OAAO,EAAEC,YAAY,EAAEC,MAAM,GAAE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
3
|
+
*
|
|
4
|
+
* Below is what your Payload collections should look like.
|
|
5
|
+
* Please copy these to your actual collection configs.
|
|
6
|
+
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
+
*
|
|
8
|
+
* Example auth strategy:
|
|
9
|
+
* auth: {
|
|
10
|
+
* disableLocalStrategy: true,
|
|
11
|
+
* strategies: [
|
|
12
|
+
* betterAuthStrategy(),
|
|
13
|
+
* // Add other strategies as needed
|
|
14
|
+
* ],
|
|
15
|
+
* },
|
|
16
|
+
*/
|
|
17
|
+
import type { CollectionConfig } from 'payload';
|
|
18
|
+
declare const User: CollectionConfig;
|
|
19
|
+
declare const Session: CollectionConfig;
|
|
20
|
+
declare const Account: CollectionConfig;
|
|
21
|
+
declare const Verification: CollectionConfig;
|
|
22
|
+
declare const Admin: CollectionConfig;
|
|
23
|
+
export { User, Session, Account, Verification, Admin };
|