Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["../../src/utilities/addSelectGenericsToGeneratedTypes.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { addSelectGenericsToGeneratedTypes } from './addSelectGenericsToGeneretedTypes.js'\n\nconst INPUT_AND_OUTPUT = [\n {\n input: `\n/* tslint:disable */\n/* eslint-disable */\n/**\n * This file was automatically generated by Payload.\n * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,\n * and re-run \\`payload generate:types\\` to regenerate this file.\n */\n\nexport interface Config {\n auth: {\n users: UserAuthOperations;\n };\n collections: {\n posts: Post;\n users: User;\n 'payload-locked-documents': PayloadLockedDocument;\n 'payload-preferences': PayloadPreference;\n 'payload-migrations': PayloadMigration;\n };\n collectionsSelect: {\n posts: PostsSelect;\n users: UsersSelect;\n 'payload-locked-documents': PayloadLockedDocumentsSelect;\n 'payload-preferences': PayloadPreferencesSelect;\n 'payload-migrations': PayloadMigrationsSelect;\n };\n db: {\n defaultIDType: string;\n };\n globals: {};\n globalsSelect: {};\n locale: null;\n user: User;\n}\nexport interface UserAuthOperations {\n forgotPassword: {\n email: string;\n password: string;\n };\n login: {\n email: string;\n password: string;\n };\n registerFirstUser: {\n email: string;\n password: string;\n };\n unlock: {\n email: string;\n password: string;\n };\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"posts\".\n */\nexport interface Post {\n id: string;\n text?: string | null;\n number?: number | null;\n group?: {\n text?: string | null;\n number?: number | null;\n };\n array?:\n | {\n text?: string | null;\n number?: number | null;\n id?: string | null;\n }[]\n | null;\n blocks?:\n | (\n | {\n text?: string | null;\n introText?: string | null;\n id?: string | null;\n blockName?: string | null;\n blockType: 'intro';\n }\n | {\n text?: string | null;\n ctaText?: string | null;\n id?: string | null;\n blockName?: string | null;\n blockType: 'cta';\n }\n )[]\n | null;\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"users\".\n */\nexport interface User {\n id: string;\n updatedAt: string;\n createdAt: string;\n email: string;\n resetPasswordToken?: string | null;\n resetPasswordExpiration?: string | null;\n salt?: string | null;\n hash?: string | null;\n loginAttempts?: number | null;\n lockUntil?: string | null;\n password?: string | null;\n collection: 'users';\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-locked-documents\".\n */\nexport interface PayloadLockedDocument {\n id: string;\n document?:\n | ({\n relationTo: 'posts';\n value: string | Post;\n } | null)\n | ({\n relationTo: 'users';\n value: string | User;\n } | null);\n globalSlug?: string | null;\n user: {\n relationTo: 'users';\n value: string | User;\n };\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-preferences\".\n */\nexport interface PayloadPreference {\n id: string;\n user: {\n relationTo: 'users';\n value: string | User;\n };\n key?: string | null;\n value?:\n | {\n [k: string]: unknown;\n }\n | unknown[]\n | string\n | number\n | boolean\n | null;\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-migrations\".\n */\nexport interface PayloadMigration {\n id: string;\n name?: string | null;\n batch?: number | null;\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"posts_select\".\n */\nexport interface PostsSelect {\n text?: boolean;\n number?: boolean;\n sharedGroup?: boolean | SharedGroup;\n group?:\n | boolean\n | {\n text?: boolean;\n number?: boolean;\n };\n array?:\n | boolean\n | {\n text?: boolean;\n number?: boolean;\n id?: boolean;\n };\n blocks?:\n | boolean\n | {\n intro?:\n | boolean\n | {\n text?: boolean;\n introText?: boolean;\n id?: boolean;\n blockName?: boolean;\n };\n cta?:\n | boolean\n | {\n text?: boolean;\n ctaText?: boolean;\n id?: boolean;\n blockName?: boolean;\n };\n };\n updatedAt?: boolean;\n createdAt?: boolean;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"users_select\".\n */\nexport interface UsersSelect {\n updatedAt?: boolean;\n createdAt?: boolean;\n email?: boolean;\n resetPasswordToken?: boolean;\n resetPasswordExpiration?: boolean;\n salt?: boolean;\n hash?: boolean;\n loginAttempts?: boolean;\n lockUntil?: boolean;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-locked-documents_select\".\n */\nexport interface PayloadLockedDocumentsSelect {\n document?: boolean;\n globalSlug?: boolean;\n user?: boolean;\n updatedAt?: boolean;\n createdAt?: boolean;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-preferences_select\".\n */\nexport interface PayloadPreferencesSelect {\n user?: boolean;\n key?: boolean;\n value?: boolean;\n updatedAt?: boolean;\n createdAt?: boolean;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-migrations_select\".\n */\nexport interface PayloadMigrationsSelect {\n name?: boolean;\n batch?: boolean;\n updatedAt?: boolean;\n createdAt?: boolean;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"auth\".\n */\nexport interface Auth {\n [k: string]: unknown;\n}\n\n\ndeclare module 'payload' {\n // @ts-ignore\n export interface GeneratedTypes extends Config {}\n}\n`,\n output: `\n/* tslint:disable */\n/* eslint-disable */\n/**\n * This file was automatically generated by Payload.\n * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,\n * and re-run \\`payload generate:types\\` to regenerate this file.\n */\n\nexport interface Config {\n auth: {\n users: UserAuthOperations;\n };\n collections: {\n posts: Post;\n users: User;\n 'payload-locked-documents': PayloadLockedDocument;\n 'payload-preferences': PayloadPreference;\n 'payload-migrations': PayloadMigration;\n };\n collectionsSelect: {\n posts: PostsSelect<false> | PostsSelect<true>;\n users: UsersSelect<false> | UsersSelect<true>;\n 'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;\n 'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;\n 'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;\n };\n db: {\n defaultIDType: string;\n };\n globals: {};\n globalsSelect: {};\n locale: null;\n user: User;\n}\nexport interface UserAuthOperations {\n forgotPassword: {\n email: string;\n password: string;\n };\n login: {\n email: string;\n password: string;\n };\n registerFirstUser: {\n email: string;\n password: string;\n };\n unlock: {\n email: string;\n password: string;\n };\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"posts\".\n */\nexport interface Post {\n id: string;\n text?: string | null;\n number?: number | null;\n group?: {\n text?: string | null;\n number?: number | null;\n };\n array?:\n | {\n text?: string | null;\n number?: number | null;\n id?: string | null;\n }[]\n | null;\n blocks?:\n | (\n | {\n text?: string | null;\n introText?: string | null;\n id?: string | null;\n blockName?: string | null;\n blockType: 'intro';\n }\n | {\n text?: string | null;\n ctaText?: string | null;\n id?: string | null;\n blockName?: string | null;\n blockType: 'cta';\n }\n )[]\n | null;\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"users\".\n */\nexport interface User {\n id: string;\n updatedAt: string;\n createdAt: string;\n email: string;\n resetPasswordToken?: string | null;\n resetPasswordExpiration?: string | null;\n salt?: string | null;\n hash?: string | null;\n loginAttempts?: number | null;\n lockUntil?: string | null;\n password?: string | null;\n collection: 'users';\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-locked-documents\".\n */\nexport interface PayloadLockedDocument {\n id: string;\n document?:\n | ({\n relationTo: 'posts';\n value: string | Post;\n } | null)\n | ({\n relationTo: 'users';\n value: string | User;\n } | null);\n globalSlug?: string | null;\n user: {\n relationTo: 'users';\n value: string | User;\n };\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-preferences\".\n */\nexport interface PayloadPreference {\n id: string;\n user: {\n relationTo: 'users';\n value: string | User;\n };\n key?: string | null;\n value?:\n | {\n [k: string]: unknown;\n }\n | unknown[]\n | string\n | number\n | boolean\n | null;\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-migrations\".\n */\nexport interface PayloadMigration {\n id: string;\n name?: string | null;\n batch?: number | null;\n updatedAt: string;\n createdAt: string;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"posts_select\".\n */\nexport interface PostsSelect<T extends boolean = true> {\n text?: T;\n number?: T;\n sharedGroup?: T | SharedGroup<T>;\n group?:\n | T\n | {\n text?: T;\n number?: T;\n };\n array?:\n | T\n | {\n text?: T;\n number?: T;\n id?: T;\n };\n blocks?:\n | T\n | {\n intro?:\n | T\n | {\n text?: T;\n introText?: T;\n id?: T;\n blockName?: T;\n };\n cta?:\n | T\n | {\n text?: T;\n ctaText?: T;\n id?: T;\n blockName?: T;\n };\n };\n updatedAt?: T;\n createdAt?: T;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"users_select\".\n */\nexport interface UsersSelect<T extends boolean = true> {\n updatedAt?: T;\n createdAt?: T;\n email?: T;\n resetPasswordToken?: T;\n resetPasswordExpiration?: T;\n salt?: T;\n hash?: T;\n loginAttempts?: T;\n lockUntil?: T;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-locked-documents_select\".\n */\nexport interface PayloadLockedDocumentsSelect<T extends boolean = true> {\n document?: T;\n globalSlug?: T;\n user?: T;\n updatedAt?: T;\n createdAt?: T;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-preferences_select\".\n */\nexport interface PayloadPreferencesSelect<T extends boolean = true> {\n user?: T;\n key?: T;\n value?: T;\n updatedAt?: T;\n createdAt?: T;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"payload-migrations_select\".\n */\nexport interface PayloadMigrationsSelect<T extends boolean = true> {\n name?: T;\n batch?: T;\n updatedAt?: T;\n createdAt?: T;\n}\n/**\n * This interface was referenced by \\`Config\\`'s JSON-Schema\n * via the \\`definition\\` \"auth\".\n */\nexport interface Auth {\n [k: string]: unknown;\n}\n\n\ndeclare module 'payload' {\n // @ts-ignore\n export interface GeneratedTypes extends Config {}\n}\n`,\n },\n]\n\ndescribe('addSelectGenericsToGeneratedTypes', () => {\n it('should match return of given input with output', () => {\n for (const { input, output } of INPUT_AND_OUTPUT) {\n expect(\n addSelectGenericsToGeneratedTypes({\n compiledGeneratedTypes: input,\n }),\n ).toStrictEqual(output)\n }\n })\n})\n"],"names":["describe","it","expect","addSelectGenericsToGeneratedTypes","INPUT_AND_OUTPUT","input","output","compiledGeneratedTypes","toStrictEqual"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,SAAQ;AAC7C,SAASC,iCAAiC,QAAQ,yCAAwC;AAE1F,MAAMC,mBAAmB;IACvB;QACEC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgRZ,CAAC;QACGC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgRb,CAAC;IACC;CACD;AAEDN,SAAS,qCAAqC;IAC5CC,GAAG,kDAAkD;QACnD,KAAK,MAAM,EAAEI,KAAK,EAAEC,MAAM,EAAE,IAAIF,iBAAkB;YAChDF,OACEC,kCAAkC;gBAChCI,wBAAwBF;YAC1B,IACAG,aAAa,CAACF;QAClB;IACF;AACF"} |