@payloadcms/graphql 3.0.0-alpha.48 → 3.0.0-alpha.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/resolvers/auth/access.d.ts +1 -1
- package/dist/resolvers/auth/access.d.ts.map +1 -1
- package/dist/resolvers/auth/access.js +1 -1
- package/dist/resolvers/auth/access.js.map +1 -1
- package/dist/resolvers/auth/forgotPassword.d.ts.map +1 -1
- package/dist/resolvers/auth/forgotPassword.js.map +1 -1
- package/dist/resolvers/auth/init.d.ts.map +1 -1
- package/dist/resolvers/auth/init.js.map +1 -1
- package/dist/resolvers/auth/login.d.ts.map +1 -1
- package/dist/resolvers/auth/login.js +3 -3
- package/dist/resolvers/auth/login.js.map +1 -1
- package/dist/resolvers/auth/logout.d.ts.map +1 -1
- package/dist/resolvers/auth/logout.js +1 -1
- package/dist/resolvers/auth/logout.js.map +1 -1
- package/dist/resolvers/auth/me.d.ts.map +1 -1
- package/dist/resolvers/auth/me.js.map +1 -1
- package/dist/resolvers/auth/refresh.d.ts.map +1 -1
- package/dist/resolvers/auth/refresh.js +3 -3
- package/dist/resolvers/auth/refresh.js.map +1 -1
- package/dist/resolvers/auth/resetPassword.d.ts.map +1 -1
- package/dist/resolvers/auth/resetPassword.js +3 -3
- package/dist/resolvers/auth/resetPassword.js.map +1 -1
- package/dist/resolvers/auth/unlock.d.ts.map +1 -1
- package/dist/resolvers/auth/unlock.js.map +1 -1
- package/dist/resolvers/auth/verifyEmail.d.ts.map +1 -1
- package/dist/resolvers/auth/verifyEmail.js.map +1 -1
- package/dist/resolvers/collections/create.d.ts +1 -1
- package/dist/resolvers/collections/create.d.ts.map +1 -1
- package/dist/resolvers/collections/create.js.map +1 -1
- package/dist/resolvers/collections/delete.d.ts.map +1 -1
- package/dist/resolvers/collections/delete.js.map +1 -1
- package/dist/resolvers/collections/docAccess.d.ts +1 -1
- package/dist/resolvers/collections/docAccess.d.ts.map +1 -1
- package/dist/resolvers/collections/docAccess.js +2 -2
- package/dist/resolvers/collections/docAccess.js.map +1 -1
- package/dist/resolvers/collections/duplicate.d.ts +13 -0
- package/dist/resolvers/collections/duplicate.d.ts.map +1 -0
- package/dist/resolvers/collections/duplicate.js +22 -0
- package/dist/resolvers/collections/duplicate.js.map +1 -0
- package/dist/resolvers/collections/find.d.ts.map +1 -1
- package/dist/resolvers/collections/find.js.map +1 -1
- package/dist/resolvers/collections/findByID.d.ts.map +1 -1
- package/dist/resolvers/collections/findByID.js.map +1 -1
- package/dist/resolvers/collections/findVersionByID.d.ts +1 -1
- package/dist/resolvers/collections/findVersionByID.d.ts.map +1 -1
- package/dist/resolvers/collections/findVersionByID.js.map +1 -1
- package/dist/resolvers/collections/findVersions.d.ts +1 -1
- package/dist/resolvers/collections/findVersions.d.ts.map +1 -1
- package/dist/resolvers/collections/findVersions.js.map +1 -1
- package/dist/resolvers/collections/restoreVersion.d.ts.map +1 -1
- package/dist/resolvers/collections/restoreVersion.js.map +1 -1
- package/dist/resolvers/collections/update.d.ts.map +1 -1
- package/dist/resolvers/collections/update.js.map +1 -1
- package/dist/resolvers/globals/docAccess.d.ts +1 -1
- package/dist/resolvers/globals/docAccess.d.ts.map +1 -1
- package/dist/resolvers/globals/docAccess.js.map +1 -1
- package/dist/resolvers/globals/findOne.d.ts.map +1 -1
- package/dist/resolvers/globals/findOne.js.map +1 -1
- package/dist/resolvers/globals/findVersionByID.d.ts.map +1 -1
- package/dist/resolvers/globals/findVersionByID.js.map +1 -1
- package/dist/resolvers/globals/findVersions.d.ts.map +1 -1
- package/dist/resolvers/globals/findVersions.js.map +1 -1
- package/dist/resolvers/globals/restoreVersion.d.ts.map +1 -1
- package/dist/resolvers/globals/restoreVersion.js.map +1 -1
- package/dist/resolvers/globals/update.d.ts +1 -1
- package/dist/resolvers/globals/update.d.ts.map +1 -1
- package/dist/resolvers/globals/update.js.map +1 -1
- package/dist/resolvers/types.d.ts +2 -2
- package/dist/resolvers/types.d.ts.map +1 -1
- package/dist/resolvers/types.js.map +1 -1
- package/dist/schema/buildFallbackLocaleInputType.d.ts +1 -1
- package/dist/schema/buildFallbackLocaleInputType.d.ts.map +1 -1
- package/dist/schema/buildFallbackLocaleInputType.js.map +1 -1
- package/dist/schema/buildLocaleInputType.d.ts +1 -1
- package/dist/schema/buildLocaleInputType.d.ts.map +1 -1
- package/dist/schema/buildLocaleInputType.js.map +1 -1
- package/dist/schema/buildMutationInputType.d.ts +6 -6
- package/dist/schema/buildMutationInputType.d.ts.map +1 -1
- package/dist/schema/buildMutationInputType.js +9 -9
- package/dist/schema/buildMutationInputType.js.map +1 -1
- package/dist/schema/buildObjectType.d.ts +5 -5
- package/dist/schema/buildObjectType.d.ts.map +1 -1
- package/dist/schema/buildObjectType.js +15 -15
- package/dist/schema/buildObjectType.js.map +1 -1
- package/dist/schema/buildPoliciesType.d.ts +1 -1
- package/dist/schema/buildPoliciesType.d.ts.map +1 -1
- package/dist/schema/buildPoliciesType.js +4 -4
- package/dist/schema/buildPoliciesType.js.map +1 -1
- package/dist/schema/buildWhereInputType.d.ts +1 -1
- package/dist/schema/buildWhereInputType.d.ts.map +1 -1
- package/dist/schema/buildWhereInputType.js +1 -1
- package/dist/schema/buildWhereInputType.js.map +1 -1
- package/dist/schema/fieldToWhereInputSchemaMap.js.map +1 -1
- package/dist/schema/initCollections.d.ts.map +1 -1
- package/dist/schema/initCollections.js +99 -89
- package/dist/schema/initCollections.js.map +1 -1
- package/dist/schema/initGlobals.d.ts.map +1 -1
- package/dist/schema/initGlobals.js +33 -32
- package/dist/schema/initGlobals.js.map +1 -1
- package/dist/schema/recursivelyBuildNestedPaths.d.ts.map +1 -1
- package/dist/schema/recursivelyBuildNestedPaths.js +2 -2
- package/dist/schema/recursivelyBuildNestedPaths.js.map +1 -1
- package/dist/schema/withNullableType.d.ts.map +1 -1
- package/dist/schema/withNullableType.js.map +1 -1
- package/dist/schema/withOperators.d.ts +1 -1
- package/dist/schema/withOperators.d.ts.map +1 -1
- package/dist/schema/withOperators.js +3 -3
- package/dist/schema/withOperators.js.map +1 -1
- package/dist/utilities/wrapCustomResolver.d.ts.map +1 -1
- package/dist/utilities/wrapCustomResolver.js.map +1 -1
- package/package.json +4 -6
- package/src/index.ts +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/collections/findByID.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/collections/findByID.ts"],"sourcesContent":["import type { GeneratedTypes } from 'payload'\nimport type { PayloadRequest } from 'payload/types'\nimport type { Collection } from 'payload/types'\n\nimport { findByIDOperation } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<T> = (\n _: unknown,\n args: {\n draft: boolean\n fallbackLocale?: string\n id: string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<T>\n\nexport default function findByIDResolver<T extends keyof GeneratedTypes['collections']>(\n collection: Collection,\n): Resolver<GeneratedTypes['collections'][T]> {\n return async function resolver(_, args, context: Context) {\n let { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req = isolateObjectProperty(req, 'locale')\n req = isolateObjectProperty(req, 'fallbackLocale')\n req.locale = args.locale || locale\n req.fallbackLocale = args.fallbackLocale || fallbackLocale\n\n const options = {\n id: args.id,\n collection,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(req, 'transactionID'),\n }\n\n const result = await findByIDOperation(options)\n\n return result\n }\n}\n"],"names":["findByIDOperation","isolateObjectProperty","findByIDResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","options","id","depth","draft","result"],"mappings":"AAIA,SAASA,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,qBAAqB,QAAQ,oBAAmB;AAiBzD,eAAe,SAASC,iBACtBC,UAAsB;IAEtB,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAI,EAAEC,GAAG,EAAE,GAAGD;QACd,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,MAAMP,sBAAsBO,KAAK;QACjCA,MAAMP,sBAAsBO,KAAK;QACjCA,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGJ,KAAKI,cAAc,IAAIA;QAE5C,MAAMC,UAAU;YACdC,IAAIN,KAAKM,EAAE;YACXT;YACAU,OAAO;YACPC,OAAOR,KAAKQ,KAAK;YACjBN,KAAKP,sBAAsBO,KAAK;QAClC;QAEA,MAAMO,SAAS,MAAMf,kBAAkBW;QAEvC,OAAOI;IACT;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PayloadRequest } from 'payload/types';
|
|
2
|
-
import type { TypeWithVersion } from 'payload/versions';
|
|
3
2
|
import type { Collection, TypeWithID } from 'payload/types';
|
|
3
|
+
import type { TypeWithVersion } from 'payload/versions';
|
|
4
4
|
export type Resolver<T extends TypeWithID = any> = (_: unknown, args: {
|
|
5
5
|
draft: boolean;
|
|
6
6
|
fallbackLocale?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/findVersionByID.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAOvD,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,UAAU,GAAG,GAAG,IAAI,CACjD,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,KAAK,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhC,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CAsBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/collections/findVersionByID.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/collections/findVersionByID.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload/types'\nimport type { Collection, TypeWithID } from 'payload/types'\nimport type { TypeWithVersion } from 'payload/versions'\n\nimport { findVersionByIDOperation } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<T extends TypeWithID = any> = (\n _: unknown,\n args: {\n draft: boolean\n fallbackLocale?: string\n id: number | string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<TypeWithVersion<T>>\n\nexport default function findVersionByIDResolver(collection: Collection): Resolver {\n return async function resolver(_, args, context: Context) {\n let { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req = isolateObjectProperty(req, 'locale')\n req = isolateObjectProperty(req, 'fallbackLocale')\n req.locale = args.locale || locale\n req.fallbackLocale = args.fallbackLocale || fallbackLocale\n\n const options = {\n id: args.id,\n collection,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(req, 'transactionID'),\n }\n\n const result = await findVersionByIDOperation(options)\n\n return result\n }\n}\n"],"names":["findVersionByIDOperation","isolateObjectProperty","findVersionByIDResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","options","id","depth","draft","result"],"mappings":"AAIA,SAASA,wBAAwB,QAAQ,qBAAoB;AAC7D,SAASC,qBAAqB,QAAQ,oBAAmB;AAiBzD,eAAe,SAASC,wBAAwBC,UAAsB;IACpE,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAI,EAAEC,GAAG,EAAE,GAAGD;QACd,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,MAAMP,sBAAsBO,KAAK;QACjCA,MAAMP,sBAAsBO,KAAK;QACjCA,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGJ,KAAKI,cAAc,IAAIA;QAE5C,MAAMC,UAAU;YACdC,IAAIN,KAAKM,EAAE;YACXT;YACAU,OAAO;YACPC,OAAOR,KAAKQ,KAAK;YACjBN,KAAKP,sBAAsBO,KAAK;QAClC;QAEA,MAAMO,SAAS,MAAMf,yBAAyBW;QAE9C,OAAOI;IACT;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PayloadRequest, Where } from 'payload/types';
|
|
2
1
|
import type { PaginatedDocs } from 'payload/database';
|
|
2
|
+
import type { PayloadRequest, Where } from 'payload/types';
|
|
3
3
|
import type { Collection } from 'payload/types';
|
|
4
4
|
export type Resolver = (_: unknown, args: {
|
|
5
5
|
fallbackLocale?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/findVersions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAO/C,MAAM,MAAM,QAAQ,GAAG,CACrB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAA;CACb,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AAEhC,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CA0B7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/collections/findVersions.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/collections/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from 'payload/database'\nimport type { PayloadRequest, Where } from 'payload/types'\nimport type { Collection } from 'payload/types'\n\nimport { findVersionsOperation } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n args: {\n fallbackLocale?: string\n limit?: number\n locale?: string\n page?: number\n sort?: string\n where: Where\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<PaginatedDocs<any>>\n\nexport default function findVersionsResolver(collection: Collection): Resolver {\n async function resolver(_, args, context: Context) {\n let { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req = isolateObjectProperty(req, 'locale')\n req = isolateObjectProperty(req, 'fallbackLocale')\n req.locale = args.locale || locale\n req.fallbackLocale = args.fallbackLocale || fallbackLocale\n\n const options = {\n collection,\n depth: 0,\n limit: args.limit,\n page: args.page,\n req: isolateObjectProperty(req, 'transactionID'),\n sort: args.sort,\n where: args.where,\n }\n\n const result = await findVersionsOperation(options)\n\n return result\n }\n\n return resolver\n}\n"],"names":["findVersionsOperation","isolateObjectProperty","findVersionsResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","options","depth","limit","page","sort","where","result"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,qBAAqB,QAAQ,oBAAmB;AAmBzD,eAAe,SAASC,qBAAqBC,UAAsB;IACjE,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QAC/C,IAAI,EAAEC,GAAG,EAAE,GAAGD;QACd,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,MAAMP,sBAAsBO,KAAK;QACjCA,MAAMP,sBAAsBO,KAAK;QACjCA,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGJ,KAAKI,cAAc,IAAIA;QAE5C,MAAMC,UAAU;YACdR;YACAS,OAAO;YACPC,OAAOP,KAAKO,KAAK;YACjBC,MAAMR,KAAKQ,IAAI;YACfN,KAAKP,sBAAsBO,KAAK;YAChCO,MAAMT,KAAKS,IAAI;YACfC,OAAOV,KAAKU,KAAK;QACnB;QAEA,MAAMC,SAAS,MAAMjB,sBAAsBW;QAE3C,OAAOM;IACT;IAEA,OAAOb;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/restoreVersion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/restoreVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAO/C,MAAM,MAAM,QAAQ,GAAG,CACrB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CAc/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/collections/restoreVersion.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/collections/restoreVersion.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload/types'\nimport type { Collection } from 'payload/types'\n\nimport { restoreVersionOperation } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n args: {\n id: number | string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<Document>\n\nexport default function restoreVersionResolver(collection: Collection): Resolver {\n async function resolver(_, args, context: Context) {\n const options = {\n id: args.id,\n collection,\n depth: 0,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await restoreVersionOperation(options)\n return result\n }\n\n return resolver\n}\n"],"names":["restoreVersionOperation","isolateObjectProperty","restoreVersionResolver","collection","resolver","_","args","context","options","id","depth","req","result"],"mappings":"AAGA,SAASA,uBAAuB,QAAQ,qBAAoB;AAC5D,SAASC,qBAAqB,QAAQ,oBAAmB;AAczD,eAAe,SAASC,uBAAuBC,UAAsB;IACnE,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QAC/C,MAAMC,UAAU;YACdC,IAAIH,KAAKG,EAAE;YACXN;YACAO,OAAO;YACPC,KAAKV,sBAAsBM,QAAQI,GAAG,EAAE;QAC1C;QAEA,MAAMC,SAAS,MAAMZ,wBAAwBQ;QAC7C,OAAOI;IACT;IAEA,OAAOR;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAO/C,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI,CACxE,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAA;IAC1C,KAAK,EAAE,OAAO,CAAA;IACd,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;AAElD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EACtF,UAAU,EAAE,UAAU,GACrB,QAAQ,CAAC,KAAK,CAAC,CA0BjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/collections/update.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/collections/update.ts"],"sourcesContent":["import type { GeneratedTypes } from 'payload'\nimport type { PayloadRequest } from 'payload/types'\nimport type { Collection } from 'payload/types'\n\nimport { updateByIDOperation } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver<TSlug extends keyof GeneratedTypes['collections']> = (\n _: unknown,\n args: {\n autosave: boolean\n data: GeneratedTypes['collections'][TSlug]\n draft: boolean\n id: number | string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<GeneratedTypes['collections'][TSlug]>\n\nexport default function updateResolver<TSlug extends keyof GeneratedTypes['collections']>(\n collection: Collection,\n): Resolver<TSlug> {\n async function resolver(_, args, context: Context) {\n let { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req = isolateObjectProperty(req, 'locale')\n req = isolateObjectProperty(req, 'fallbackLocale')\n req.locale = args.locale || locale\n req.fallbackLocale = args.fallbackLocale || fallbackLocale\n\n const options = {\n id: args.id,\n autosave: args.autosave,\n collection,\n data: args.data,\n depth: 0,\n draft: args.draft,\n req: isolateObjectProperty(req, 'transactionID'),\n }\n\n const result = await updateByIDOperation<TSlug>(options)\n\n return result\n }\n\n return resolver\n}\n"],"names":["updateByIDOperation","isolateObjectProperty","updateResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","options","id","autosave","data","depth","draft","result"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,qBAAqB,QAAQ,oBAAmB;AAkBzD,eAAe,SAASC,eACtBC,UAAsB;IAEtB,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QAC/C,IAAI,EAAEC,GAAG,EAAE,GAAGD;QACd,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,MAAMP,sBAAsBO,KAAK;QACjCA,MAAMP,sBAAsBO,KAAK;QACjCA,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGJ,KAAKI,cAAc,IAAIA;QAE5C,MAAMC,UAAU;YACdC,IAAIN,KAAKM,EAAE;YACXC,UAAUP,KAAKO,QAAQ;YACvBV;YACAW,MAAMR,KAAKQ,IAAI;YACfC,OAAO;YACPC,OAAOV,KAAKU,KAAK;YACjBR,KAAKP,sBAAsBO,KAAK;QAClC;QAEA,MAAMS,SAAS,MAAMjB,oBAA2BW;QAEhD,OAAOM;IACT;IAEA,OAAOb;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types';
|
|
2
1
|
import type { CollectionPermission, GlobalPermission } from 'payload/auth';
|
|
2
|
+
import type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types';
|
|
3
3
|
export type Resolver = (_: unknown, context: {
|
|
4
4
|
req: PayloadRequest;
|
|
5
5
|
}) => Promise<CollectionPermission | GlobalPermission>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docAccess.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/docAccess.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docAccess.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/docAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAO1E,MAAM,MAAM,QAAQ,GAAG,CACrB,CAAC,EAAE,OAAO,EACV,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,oBAAoB,GAAG,gBAAgB,CAAC,CAAA;AAErD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,qBAAqB,GAAG,QAAQ,CASzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/globals/docAccess.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/globals/docAccess.ts"],"sourcesContent":["import type { CollectionPermission, GlobalPermission } from 'payload/auth'\nimport type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types'\n\nimport { docAccessOperationGlobal } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n context: {\n req: PayloadRequest\n },\n) => Promise<CollectionPermission | GlobalPermission>\n\nexport function docAccessResolver(global: SanitizedGlobalConfig): Resolver {\n async function resolver(_, context: Context) {\n return docAccessOperationGlobal({\n globalConfig: global,\n req: isolateObjectProperty(context.req, 'transactionID'),\n })\n }\n\n return resolver\n}\n"],"names":["docAccessOperationGlobal","isolateObjectProperty","docAccessResolver","global","resolver","_","context","globalConfig","req"],"mappings":"AAGA,SAASA,wBAAwB,QAAQ,qBAAoB;AAC7D,SAASC,qBAAqB,QAAQ,oBAAmB;AAWzD,OAAO,SAASC,kBAAkBC,MAA6B;IAC7D,eAAeC,SAASC,CAAC,EAAEC,OAAgB;QACzC,OAAON,yBAAyB;YAC9BO,cAAcJ;YACdK,KAAKP,sBAAsBK,QAAQE,GAAG,EAAE;QAC1C;IACF;IAEA,OAAOJ;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/findOne.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAOpE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,YAAY,EAAE,qBAAqB,GAAG,QAAQ,CAkBrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/globals/findOne.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/globals/findOne.ts"],"sourcesContent":["import type { Document, SanitizedGlobalConfig } from 'payload/types'\n\nimport { findOneOperation } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport default function findOneResolver(globalConfig: SanitizedGlobalConfig): Document {\n return async function resolver(_, args, context: Context) {\n if (args.locale) context.req.locale = args.locale\n if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale\n\n const { slug } = globalConfig\n\n const options = {\n slug,\n depth: 0,\n draft: args.draft,\n globalConfig,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await findOneOperation(options)\n return result\n }\n}\n"],"names":["findOneOperation","isolateObjectProperty","findOneResolver","globalConfig","resolver","_","args","context","locale","req","fallbackLocale","slug","options","depth","draft","result"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,qBAAoB;AACrD,SAASC,qBAAqB,QAAQ,oBAAmB;AAIzD,eAAe,SAASC,gBAAgBC,YAAmC;IACzE,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAID,KAAKE,MAAM,EAAED,QAAQE,GAAG,CAACD,MAAM,GAAGF,KAAKE,MAAM;QACjD,IAAIF,KAAKI,cAAc,EAAEH,QAAQE,GAAG,CAACC,cAAc,GAAGJ,KAAKI,cAAc;QAEzE,MAAM,EAAEC,IAAI,EAAE,GAAGR;QAEjB,MAAMS,UAAU;YACdD;YACAE,OAAO;YACPC,OAAOR,KAAKQ,KAAK;YACjBX;YACAM,KAAKR,sBAAsBM,QAAQE,GAAG,EAAE;QAC1C;QAEA,MAAMM,SAAS,MAAMf,iBAAiBY;QACtC,OAAOG;IACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/findVersionByID.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAOpF,MAAM,MAAM,QAAQ,GAAG,CACrB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtB,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,YAAY,EAAE,qBAAqB,GAAG,QAAQ,CAgB7F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/globals/findVersionByID.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/globals/findVersionByID.ts"],"sourcesContent":["import type { Document, PayloadRequest, SanitizedGlobalConfig } from 'payload/types'\n\nimport { findVersionByIDOperationGlobal } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n args: {\n draft?: boolean\n fallbackLocale?: string\n id: number | string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<Document>\n\nexport default function findVersionByIDResolver(globalConfig: SanitizedGlobalConfig): Resolver {\n return async function resolver(_, args, context: Context) {\n if (args.locale) context.req.locale = args.locale\n if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale\n\n const options = {\n id: args.id,\n depth: 0,\n draft: args.draft,\n globalConfig,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await findVersionByIDOperationGlobal(options)\n return result\n }\n}\n"],"names":["findVersionByIDOperationGlobal","isolateObjectProperty","findVersionByIDResolver","globalConfig","resolver","_","args","context","locale","req","fallbackLocale","options","id","depth","draft","result"],"mappings":"AAEA,SAASA,8BAA8B,QAAQ,qBAAoB;AACnE,SAASC,qBAAqB,QAAQ,oBAAmB;AAiBzD,eAAe,SAASC,wBAAwBC,YAAmC;IACjF,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAID,KAAKE,MAAM,EAAED,QAAQE,GAAG,CAACD,MAAM,GAAGF,KAAKE,MAAM;QACjD,IAAIF,KAAKI,cAAc,EAAEH,QAAQE,GAAG,CAACC,cAAc,GAAGJ,KAAKI,cAAc;QAEzE,MAAMC,UAAU;YACdC,IAAIN,KAAKM,EAAE;YACXC,OAAO;YACPC,OAAOR,KAAKQ,KAAK;YACjBX;YACAM,KAAKR,sBAAsBM,QAAQE,GAAG,EAAE;QAC1C;QAEA,MAAMM,SAAS,MAAMf,+BAA+BW;QACpD,OAAOI;IACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/findVersions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAO3F,MAAM,MAAM,QAAQ,GAAG,CACrB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAA;CACb,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtB,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,YAAY,EAAE,qBAAqB,GAAG,QAAQ,CAgB1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/globals/findVersions.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/globals/findVersions.ts"],"sourcesContent":["import type { Document, PayloadRequest, SanitizedGlobalConfig, Where } from 'payload/types'\n\nimport { findVersionsOperationGlobal } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n args: {\n fallbackLocale?: string\n limit?: number\n locale?: string\n page?: number\n sort?: string\n where: Where\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<Document>\n\nexport default function findVersionsResolver(globalConfig: SanitizedGlobalConfig): Resolver {\n return async function resolver(_, args, context: Context) {\n const options = {\n depth: 0,\n globalConfig,\n limit: args.limit,\n page: args.page,\n req: isolateObjectProperty(context.req, 'transactionID'),\n sort: args.sort,\n where: args.where,\n }\n\n const result = await findVersionsOperationGlobal(options)\n\n return result\n }\n}\n"],"names":["findVersionsOperationGlobal","isolateObjectProperty","findVersionsResolver","globalConfig","resolver","_","args","context","options","depth","limit","page","req","sort","where","result"],"mappings":"AAEA,SAASA,2BAA2B,QAAQ,qBAAoB;AAChE,SAASC,qBAAqB,QAAQ,oBAAmB;AAmBzD,eAAe,SAASC,qBAAqBC,YAAmC;IAC9E,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,MAAMC,UAAU;YACdC,OAAO;YACPN;YACAO,OAAOJ,KAAKI,KAAK;YACjBC,MAAML,KAAKK,IAAI;YACfC,KAAKX,sBAAsBM,QAAQK,GAAG,EAAE;YACxCC,MAAMP,KAAKO,IAAI;YACfC,OAAOR,KAAKQ,KAAK;QACnB;QAEA,MAAMC,SAAS,MAAMf,4BAA4BQ;QAEjD,OAAOO;IACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/restoreVersion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/restoreVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAOpF,KAAK,QAAQ,GAAG,CACd,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,QAAQ,CAAC,CAAA;AACtB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,YAAY,EAAE,qBAAqB,GAAG,QAAQ,CAY5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/globals/restoreVersion.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/globals/restoreVersion.ts"],"sourcesContent":["import type { Document, PayloadRequest, SanitizedGlobalConfig } from 'payload/types'\n\nimport { restoreVersionOperationGlobal } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\ntype Resolver = (\n _: unknown,\n args: {\n id: number | string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<Document>\nexport default function restoreVersionResolver(globalConfig: SanitizedGlobalConfig): Resolver {\n return async function resolver(_, args, context: Context) {\n const options = {\n id: args.id,\n depth: 0,\n globalConfig,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await restoreVersionOperationGlobal(options)\n return result\n }\n}\n"],"names":["restoreVersionOperationGlobal","isolateObjectProperty","restoreVersionResolver","globalConfig","resolver","_","args","context","options","id","depth","req","result"],"mappings":"AAEA,SAASA,6BAA6B,QAAQ,qBAAoB;AAClE,SAASC,qBAAqB,QAAQ,oBAAmB;AAazD,eAAe,SAASC,uBAAuBC,YAAmC;IAChF,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,MAAMC,UAAU;YACdC,IAAIH,KAAKG,EAAE;YACXC,OAAO;YACPP;YACAQ,KAAKV,sBAAsBM,QAAQI,GAAG,EAAE;QAC1C;QAEA,MAAMC,SAAS,MAAMZ,8BAA8BQ;QACnD,OAAOI;IACT;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DeepPartial } from 'ts-essentials';
|
|
2
1
|
import type { GeneratedTypes } from 'payload';
|
|
3
2
|
import type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types';
|
|
3
|
+
import type { DeepPartial } from 'ts-essentials';
|
|
4
4
|
type Resolver<TSlug extends keyof GeneratedTypes['globals']> = (_: unknown, args: {
|
|
5
5
|
data?: DeepPartial<Omit<GeneratedTypes['globals'][TSlug], 'id'>>;
|
|
6
6
|
draft?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAOhD,KAAK,QAAQ,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI,CAC7D,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IAChE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE;IACP,GAAG,EAAE,cAAc,CAAA;CACpB,KACE,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;AAE9C,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,EAClF,YAAY,EAAE,qBAAqB,GAClC,QAAQ,CAAC,KAAK,CAAC,CAmBjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resolvers/globals/update.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/resolvers/globals/update.ts"],"sourcesContent":["import type { GeneratedTypes } from 'payload'\nimport type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport { updateOperationGlobal } from 'payload/operations'\nimport { isolateObjectProperty } from 'payload/utilities'\n\nimport type { Context } from '../types.js'\n\ntype Resolver<TSlug extends keyof GeneratedTypes['globals']> = (\n _: unknown,\n args: {\n data?: DeepPartial<Omit<GeneratedTypes['globals'][TSlug], 'id'>>\n draft?: boolean\n fallbackLocale?: string\n locale?: string\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<GeneratedTypes['globals'][TSlug]>\n\nexport default function updateResolver<TSlug extends keyof GeneratedTypes['globals']>(\n globalConfig: SanitizedGlobalConfig,\n): Resolver<TSlug> {\n return async function resolver(_, args, context: Context) {\n if (args.locale) context.req.locale = args.locale\n if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale\n\n const { slug } = globalConfig\n\n const options = {\n slug,\n data: args.data,\n depth: 0,\n draft: args.draft,\n globalConfig,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await updateOperationGlobal<TSlug>(options)\n return result\n }\n}\n"],"names":["updateOperationGlobal","isolateObjectProperty","updateResolver","globalConfig","resolver","_","args","context","locale","req","fallbackLocale","slug","options","data","depth","draft","result"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,qBAAqB,QAAQ,oBAAmB;AAiBzD,eAAe,SAASC,eACtBC,YAAmC;IAEnC,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAID,KAAKE,MAAM,EAAED,QAAQE,GAAG,CAACD,MAAM,GAAGF,KAAKE,MAAM;QACjD,IAAIF,KAAKI,cAAc,EAAEH,QAAQE,GAAG,CAACC,cAAc,GAAGJ,KAAKI,cAAc;QAEzE,MAAM,EAAEC,IAAI,EAAE,GAAGR;QAEjB,MAAMS,UAAU;YACdD;YACAE,MAAMP,KAAKO,IAAI;YACfC,OAAO;YACPC,OAAOT,KAAKS,KAAK;YACjBZ;YACAM,KAAKR,sBAAsBM,QAAQE,GAAG,EAAE;QAC1C;QAEA,MAAMO,SAAS,MAAMhB,sBAA6BY;QAClD,OAAOI;IACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resolvers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resolvers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IACD,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/resolvers/types.ts"],"sourcesContent":["import { PayloadRequest } from 'payload/types'\n\nexport type Context = {\n
|
|
1
|
+
{"version":3,"sources":["../../src/resolvers/types.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload/types'\n\nexport type Context = {\n headers: {\n [key: string]: string\n }\n req: PayloadRequest\n}\n"],"names":[],"mappings":"AAEA,WAKC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GraphQLEnumType } from 'graphql';
|
|
2
1
|
import type { SanitizedLocalizationConfig } from 'payload/config';
|
|
2
|
+
import { GraphQLEnumType } from 'graphql';
|
|
3
3
|
declare const buildFallbackLocaleInputType: (localization: SanitizedLocalizationConfig) => GraphQLEnumType;
|
|
4
4
|
export default buildFallbackLocaleInputType;
|
|
5
5
|
//# sourceMappingURL=buildFallbackLocaleInputType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFallbackLocaleInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildFallbackLocaleInputType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buildFallbackLocaleInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildFallbackLocaleInputType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAIzC,QAAA,MAAM,4BAA4B,iBAClB,2BAA2B,KACxC,eAaF,CAAA;AAED,eAAe,4BAA4B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/buildFallbackLocaleInputType.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/schema/buildFallbackLocaleInputType.ts"],"sourcesContent":["import type { SanitizedLocalizationConfig } from 'payload/config'\n\nimport { GraphQLEnumType } from 'graphql'\n\nimport formatName from '../utilities/formatName.js'\n\nconst buildFallbackLocaleInputType = (\n localization: SanitizedLocalizationConfig,\n): GraphQLEnumType => {\n return new GraphQLEnumType({\n name: 'FallbackLocaleInputType',\n values: [...localization.localeCodes, 'none'].reduce(\n (values, locale) => ({\n ...values,\n [formatName(locale)]: {\n value: locale,\n },\n }),\n {},\n ),\n })\n}\n\nexport default buildFallbackLocaleInputType\n"],"names":["GraphQLEnumType","formatName","buildFallbackLocaleInputType","localization","name","values","localeCodes","reduce","locale","value"],"mappings":"AAEA,SAASA,eAAe,QAAQ,UAAS;AAEzC,OAAOC,gBAAgB,6BAA4B;AAEnD,MAAMC,+BAA+B,CACnCC;IAEA,OAAO,IAAIH,gBAAgB;QACzBI,MAAM;QACNC,QAAQ;eAAIF,aAAaG,WAAW;YAAE;SAAO,CAACC,MAAM,CAClD,CAACF,QAAQG,SAAY,CAAA;gBACnB,GAAGH,MAAM;gBACT,CAACJ,WAAWO,QAAQ,EAAE;oBACpBC,OAAOD;gBACT;YACF,CAAA,GACA,CAAC;IAEL;AACF;AAEA,eAAeN,6BAA4B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GraphQLScalarType } from 'graphql';
|
|
2
|
-
import { GraphQLEnumType } from 'graphql';
|
|
3
2
|
import type { SanitizedLocalizationConfig } from 'payload/config';
|
|
3
|
+
import { GraphQLEnumType } from 'graphql';
|
|
4
4
|
declare const buildLocaleInputType: (localization: SanitizedLocalizationConfig) => GraphQLEnumType | GraphQLScalarType;
|
|
5
5
|
export default buildLocaleInputType;
|
|
6
6
|
//# sourceMappingURL=buildLocaleInputType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildLocaleInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildLocaleInputType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"buildLocaleInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildLocaleInputType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAIzC,QAAA,MAAM,oBAAoB,iBACV,2BAA2B,KACxC,eAAe,GAAG,iBAapB,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/buildLocaleInputType.ts"],"sourcesContent":["import type { GraphQLScalarType } from 'graphql'\
|
|
1
|
+
{"version":3,"sources":["../../src/schema/buildLocaleInputType.ts"],"sourcesContent":["import type { GraphQLScalarType } from 'graphql'\nimport type { SanitizedLocalizationConfig } from 'payload/config'\n\nimport { GraphQLEnumType } from 'graphql'\n\nimport formatName from '../utilities/formatName.js'\n\nconst buildLocaleInputType = (\n localization: SanitizedLocalizationConfig,\n): GraphQLEnumType | GraphQLScalarType => {\n return new GraphQLEnumType({\n name: 'LocaleInputType',\n values: localization.localeCodes.reduce(\n (values, locale) => ({\n ...values,\n [formatName(locale)]: {\n value: locale,\n },\n }),\n {},\n ),\n })\n}\n\nexport default buildLocaleInputType\n"],"names":["GraphQLEnumType","formatName","buildLocaleInputType","localization","name","values","localeCodes","reduce","locale","value"],"mappings":"AAGA,SAASA,eAAe,QAAQ,UAAS;AAEzC,OAAOC,gBAAgB,6BAA4B;AAEnD,MAAMC,uBAAuB,CAC3BC;IAEA,OAAO,IAAIH,gBAAgB;QACzBI,MAAM;QACNC,QAAQF,aAAaG,WAAW,CAACC,MAAM,CACrC,CAACF,QAAQG,SAAY,CAAA;gBACnB,GAAGH,MAAM;gBACT,CAACJ,WAAWO,QAAQ,EAAE;oBACpBC,OAAOD;gBACT;YACF,CAAA,GACA,CAAC;IAEL;AACF;AAEA,eAAeN,qBAAoB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GraphQLInputFieldConfig, GraphQLScalarType } from 'graphql';
|
|
2
|
-
import { GraphQLInputObjectType } from 'graphql';
|
|
3
2
|
import type { GraphQLInfo } from 'payload/config';
|
|
4
|
-
import type { SanitizedCollectionConfig, SanitizedConfig
|
|
3
|
+
import type { Field, SanitizedCollectionConfig, SanitizedConfig } from 'payload/types';
|
|
4
|
+
import { GraphQLInputObjectType } from 'graphql';
|
|
5
5
|
declare const idFieldTypes: {
|
|
6
6
|
number: GraphQLScalarType<number, number>;
|
|
7
7
|
text: GraphQLScalarType<string, string>;
|
|
@@ -11,13 +11,13 @@ export type InputObjectTypeConfig = {
|
|
|
11
11
|
[path: string]: GraphQLInputFieldConfig;
|
|
12
12
|
};
|
|
13
13
|
type BuildMutationInputTypeArgs = {
|
|
14
|
-
|
|
14
|
+
config: SanitizedConfig;
|
|
15
15
|
fields: Field[];
|
|
16
|
-
parentName: string;
|
|
17
16
|
forceNullable?: boolean;
|
|
18
17
|
graphqlResult: GraphQLInfo;
|
|
19
|
-
|
|
18
|
+
name: string;
|
|
19
|
+
parentName: string;
|
|
20
20
|
};
|
|
21
|
-
export declare function buildMutationInputType({ name,
|
|
21
|
+
export declare function buildMutationInputType({ name, config, fields, forceNullable, graphqlResult, parentName, }: BuildMutationInputTypeArgs): GraphQLInputObjectType | null;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=buildMutationInputType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildMutationInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildMutationInputType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAe,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"buildMutationInputType.d.ts","sourceRoot":"","sources":["../../src/schema/buildMutationInputType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAe,MAAM,SAAS,CAAA;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAQV,KAAK,EASL,yBAAyB,EACzB,eAAe,EAMhB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAIL,sBAAsB,EAKvB,MAAM,SAAS,CAAA;AAWhB,QAAA,MAAM,YAAY;;;CAGjB,CAAA;AAED,eAAO,MAAM,mBAAmB,SACxB,MAAM,mBAAmB,cACnB,yBAAyB,KACpC,iBAUF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAAA;CACxC,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,WAAW,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,MAAM,EACN,aAAqB,EACrB,aAAa,EACb,UAAU,GACX,EAAE,0BAA0B,GAAG,sBAAsB,GAAG,IAAI,CAgQ5D"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { GraphQLJSON } from 'graphql-type-json';
|
|
3
3
|
import { fieldAffectsData, optionIsObject, tabHasName } from 'payload/types';
|
|
4
4
|
import { toWords } from 'payload/utilities';
|
|
5
|
-
import {
|
|
5
|
+
import { flattenTopLevelFields } from 'payload/utilities';
|
|
6
6
|
import combineParentName from '../utilities/combineParentName.js';
|
|
7
7
|
import formatName from '../utilities/formatName.js';
|
|
8
|
+
import { groupOrTabHasRequiredSubfield } from '../utilities/groupOrTabHasRequiredSubfield.js';
|
|
8
9
|
import withNullableType from './withNullableType.js';
|
|
9
|
-
import { flattenTopLevelFields } from 'payload/utilities';
|
|
10
10
|
const idFieldTypes = {
|
|
11
11
|
number: GraphQLInt,
|
|
12
12
|
text: GraphQLString
|
|
@@ -18,16 +18,16 @@ export const getCollectionIDType = (type, collection)=>{
|
|
|
18
18
|
}
|
|
19
19
|
return idFieldTypes[idField.type];
|
|
20
20
|
};
|
|
21
|
-
export function buildMutationInputType({ name,
|
|
21
|
+
export function buildMutationInputType({ name, config, fields, forceNullable = false, graphqlResult, parentName }) {
|
|
22
22
|
const fieldToSchemaMap = {
|
|
23
23
|
array: (inputObjectTypeConfig, field)=>{
|
|
24
24
|
const fullName = combineParentName(parentName, toWords(field.name, true));
|
|
25
25
|
let type = buildMutationInputType({
|
|
26
26
|
name: fullName,
|
|
27
|
+
config,
|
|
27
28
|
fields: field.fields,
|
|
28
|
-
parentName: fullName,
|
|
29
29
|
graphqlResult,
|
|
30
|
-
|
|
30
|
+
parentName: fullName
|
|
31
31
|
});
|
|
32
32
|
if (!type) return inputObjectTypeConfig;
|
|
33
33
|
type = new GraphQLList(withNullableType(field, type, forceNullable));
|
|
@@ -78,10 +78,10 @@ export function buildMutationInputType({ name, fields, parentName, forceNullable
|
|
|
78
78
|
const fullName = combineParentName(parentName, toWords(field.name, true));
|
|
79
79
|
let type = buildMutationInputType({
|
|
80
80
|
name: fullName,
|
|
81
|
+
config,
|
|
81
82
|
fields: field.fields,
|
|
82
|
-
parentName: fullName,
|
|
83
83
|
graphqlResult,
|
|
84
|
-
|
|
84
|
+
parentName: fullName
|
|
85
85
|
});
|
|
86
86
|
if (!type) return inputObjectTypeConfig;
|
|
87
87
|
if (requiresAtLeastOneField) type = new GraphQLNonNull(type);
|
|
@@ -201,10 +201,10 @@ export function buildMutationInputType({ name, fields, parentName, forceNullable
|
|
|
201
201
|
const requiresAtLeastOneField = groupOrTabHasRequiredSubfield(field);
|
|
202
202
|
let type = buildMutationInputType({
|
|
203
203
|
name: fullName,
|
|
204
|
+
config,
|
|
204
205
|
fields: tab.fields,
|
|
205
|
-
parentName: fullName,
|
|
206
206
|
graphqlResult,
|
|
207
|
-
|
|
207
|
+
parentName: fullName
|
|
208
208
|
});
|
|
209
209
|
if (!type) return acc;
|
|
210
210
|
if (requiresAtLeastOneField) type = new GraphQLNonNull(type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/buildMutationInputType.ts"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport type { GraphQLInputFieldConfig, GraphQLScalarType, GraphQLType } from 'graphql'\n\nimport {\n GraphQLBoolean,\n GraphQLEnumType,\n GraphQLFloat,\n GraphQLInputObjectType,\n GraphQLInt,\n GraphQLList,\n GraphQLNonNull,\n GraphQLString,\n} from 'graphql'\nimport { GraphQLJSON } from 'graphql-type-json'\n\nimport type { GraphQLInfo } from 'payload/config'\nimport type {\n SanitizedCollectionConfig,\n SanitizedConfig,\n ArrayField,\n BlockField,\n CheckboxField,\n CodeField,\n CollapsibleField,\n DateField,\n EmailField,\n Field,\n GroupField,\n JSONField,\n NumberField,\n PointField,\n RadioField,\n RelationshipField,\n RichTextField,\n RowField,\n SelectField,\n TabsField,\n TextField,\n TextareaField,\n UploadField,\n} from 'payload/types'\nimport { fieldAffectsData, optionIsObject, tabHasName } from 'payload/types'\nimport { toWords } from 'payload/utilities'\n\nimport { groupOrTabHasRequiredSubfield } from '../utilities/groupOrTabHasRequiredSubfield.js'\nimport combineParentName from '../utilities/combineParentName.js'\nimport formatName from '../utilities/formatName.js'\nimport withNullableType from './withNullableType.js'\nimport { flattenTopLevelFields } from 'payload/utilities'\n\nconst idFieldTypes = {\n number: GraphQLInt,\n text: GraphQLString,\n}\n\nexport const getCollectionIDType = (\n type: keyof typeof idFieldTypes,\n collection: SanitizedCollectionConfig,\n): GraphQLScalarType => {\n const idField = flattenTopLevelFields(collection.fields).find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n )\n\n if (!idField) {\n return idFieldTypes[type]\n }\n\n return idFieldTypes[idField.type]\n}\n\nexport type InputObjectTypeConfig = {\n [path: string]: GraphQLInputFieldConfig\n}\n\ntype BuildMutationInputTypeArgs = {\n name: string\n fields: Field[]\n parentName: string\n forceNullable?: boolean\n graphqlResult: GraphQLInfo\n config: SanitizedConfig\n}\n\nexport function buildMutationInputType({\n name,\n fields,\n parentName,\n forceNullable = false,\n graphqlResult,\n config,\n}: BuildMutationInputTypeArgs): GraphQLInputObjectType | null {\n const fieldToSchemaMap = {\n array: (inputObjectTypeConfig: InputObjectTypeConfig, field: ArrayField) => {\n const fullName = combineParentName(parentName, toWords(field.name, true))\n let type: GraphQLList<GraphQLType> | GraphQLType = buildMutationInputType({\n name: fullName,\n fields: field.fields,\n parentName: fullName,\n graphqlResult,\n config,\n })\n\n if (!type) return inputObjectTypeConfig\n\n type = new GraphQLList(withNullableType(field, type, forceNullable))\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type },\n }\n },\n blocks: (inputObjectTypeConfig: InputObjectTypeConfig, field: BlockField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: GraphQLJSON },\n }),\n checkbox: (inputObjectTypeConfig: InputObjectTypeConfig, field: CheckboxField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: GraphQLBoolean },\n }),\n code: (inputObjectTypeConfig: InputObjectTypeConfig, field: CodeField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n collapsible: (inputObjectTypeConfig: InputObjectTypeConfig, field: CollapsibleField) =>\n field.fields.reduce((acc, subField: CollapsibleField) => {\n const addSubField = fieldToSchemaMap[subField.type]\n if (addSubField) return addSubField(acc, subField)\n return acc\n }, inputObjectTypeConfig),\n date: (inputObjectTypeConfig: InputObjectTypeConfig, field: DateField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n email: (inputObjectTypeConfig: InputObjectTypeConfig, field: EmailField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n group: (inputObjectTypeConfig: InputObjectTypeConfig, field: GroupField) => {\n const requiresAtLeastOneField = groupOrTabHasRequiredSubfield(field)\n const fullName = combineParentName(parentName, toWords(field.name, true))\n let type: GraphQLType = buildMutationInputType({\n name: fullName,\n fields: field.fields,\n parentName: fullName,\n graphqlResult,\n config,\n })\n\n if (!type) return inputObjectTypeConfig\n\n if (requiresAtLeastOneField) type = new GraphQLNonNull(type)\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type },\n }\n },\n json: (inputObjectTypeConfig: InputObjectTypeConfig, field: JSONField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLJSON, forceNullable) },\n }),\n number: (inputObjectTypeConfig: InputObjectTypeConfig, field: NumberField) => {\n const type = field.name === 'id' ? GraphQLInt : GraphQLFloat\n return {\n ...inputObjectTypeConfig,\n [field.name]: {\n type: withNullableType(\n field,\n field.hasMany === true ? new GraphQLList(type) : type,\n forceNullable,\n ),\n },\n }\n },\n point: (inputObjectTypeConfig: InputObjectTypeConfig, field: PointField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, new GraphQLList(GraphQLFloat), forceNullable) },\n }),\n radio: (inputObjectTypeConfig: InputObjectTypeConfig, field: RadioField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n relationship: (inputObjectTypeConfig: InputObjectTypeConfig, field: RelationshipField) => {\n const { relationTo } = field\n type PayloadGraphQLRelationshipType =\n | GraphQLInputObjectType\n | GraphQLList<GraphQLScalarType>\n | GraphQLScalarType\n let type: PayloadGraphQLRelationshipType\n\n if (Array.isArray(relationTo)) {\n const fullName = `${combineParentName(\n parentName,\n toWords(field.name, true),\n )}RelationshipInput`\n type = new GraphQLInputObjectType({\n name: fullName,\n fields: {\n relationTo: {\n type: new GraphQLEnumType({\n name: `${fullName}RelationTo`,\n values: relationTo.reduce(\n (values, option) => ({\n ...values,\n [formatName(option)]: {\n value: option,\n },\n }),\n {},\n ),\n }),\n },\n value: { type: GraphQLJSON },\n },\n })\n } else {\n type = getCollectionIDType(\n config.db.defaultIDType,\n graphqlResult.collections[relationTo].config,\n )\n }\n\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type: field.hasMany ? new GraphQLList(type) : type },\n }\n },\n richText: (inputObjectTypeConfig: InputObjectTypeConfig, field: RichTextField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLJSON, forceNullable) },\n }),\n row: (inputObjectTypeConfig: InputObjectTypeConfig, field: RowField) =>\n field.fields.reduce((acc, subField: Field) => {\n const addSubField = fieldToSchemaMap[subField.type]\n if (addSubField) return addSubField(acc, subField)\n return acc\n }, inputObjectTypeConfig),\n select: (inputObjectTypeConfig: InputObjectTypeConfig, field: SelectField) => {\n const formattedName = `${combineParentName(parentName, field.name)}_MutationInput`\n let type: GraphQLType = new GraphQLEnumType({\n name: formattedName,\n values: field.options.reduce((values, option) => {\n if (optionIsObject(option)) {\n return {\n ...values,\n [formatName(option.value)]: {\n value: option.value,\n },\n }\n }\n\n return {\n ...values,\n [formatName(option)]: {\n value: option,\n },\n }\n }, {}),\n })\n\n type = field.hasMany ? new GraphQLList(type) : type\n type = withNullableType(field, type, forceNullable)\n\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type },\n }\n },\n tabs: (inputObjectTypeConfig: InputObjectTypeConfig, field: TabsField) => {\n return field.tabs.reduce((acc, tab) => {\n if (tabHasName(tab)) {\n const fullName = combineParentName(parentName, toWords(tab.name, true))\n const requiresAtLeastOneField = groupOrTabHasRequiredSubfield(field)\n let type: GraphQLType = buildMutationInputType({\n name: fullName,\n fields: tab.fields,\n parentName: fullName,\n graphqlResult,\n config,\n })\n\n if (!type) return acc\n\n if (requiresAtLeastOneField) type = new GraphQLNonNull(type)\n return {\n ...acc,\n [tab.name]: { type },\n }\n }\n\n return {\n ...acc,\n ...tab.fields.reduce((subFieldSchema, subField) => {\n const addSubField = fieldToSchemaMap[subField.type]\n if (addSubField) return addSubField(subFieldSchema, subField)\n return subFieldSchema\n }, acc),\n }\n }, inputObjectTypeConfig)\n },\n text: (inputObjectTypeConfig: InputObjectTypeConfig, field: TextField) => ({\n ...inputObjectTypeConfig,\n [field.name]: {\n type: withNullableType(\n field,\n field.hasMany === true ? new GraphQLList(GraphQLString) : GraphQLString,\n forceNullable,\n ),\n },\n }),\n textarea: (inputObjectTypeConfig: InputObjectTypeConfig, field: TextareaField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n upload: (inputObjectTypeConfig: InputObjectTypeConfig, field: UploadField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n }\n\n const fieldName = formatName(name)\n\n const fieldSchemas = fields.reduce((inputObjectTypeConfig, field) => {\n const fieldSchema = fieldToSchemaMap[field.type]\n\n if (typeof fieldSchema !== 'function') {\n return inputObjectTypeConfig\n }\n\n const schema = fieldSchema(inputObjectTypeConfig, field)\n if (Object.keys(schema).length === 0) {\n return inputObjectTypeConfig\n }\n\n return {\n ...inputObjectTypeConfig,\n ...fieldSchema(inputObjectTypeConfig, field),\n }\n }, {})\n\n if (Object.keys(fieldSchemas).length === 0) {\n return null\n }\n\n return new GraphQLInputObjectType({\n name: `mutation${fieldName}Input`,\n fields: fieldSchemas,\n })\n}\n"],"names":["GraphQLBoolean","GraphQLEnumType","GraphQLFloat","GraphQLInputObjectType","GraphQLInt","GraphQLList","GraphQLNonNull","GraphQLString","GraphQLJSON","fieldAffectsData","optionIsObject","tabHasName","toWords","groupOrTabHasRequiredSubfield","combineParentName","formatName","withNullableType","flattenTopLevelFields","idFieldTypes","number","text","getCollectionIDType","type","collection","idField","fields","find","field","name","buildMutationInputType","parentName","forceNullable","graphqlResult","config","fieldToSchemaMap","array","inputObjectTypeConfig","fullName","blocks","checkbox","code","collapsible","reduce","acc","subField","addSubField","date","email","group","requiresAtLeastOneField","json","hasMany","point","radio","relationship","relationTo","Array","isArray","values","option","value","db","defaultIDType","collections","richText","row","select","formattedName","options","tabs","tab","subFieldSchema","textarea","upload","fieldName","fieldSchemas","fieldSchema","schema","Object","keys","length"],"mappings":"AAAA,uCAAuC,GAGvC,SACEA,cAAc,EACdC,eAAe,EACfC,YAAY,EACZC,sBAAsB,EACtBC,UAAU,EACVC,WAAW,EACXC,cAAc,EACdC,aAAa,QACR,UAAS;AAChB,SAASC,WAAW,QAAQ,oBAAmB;AA4B/C,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,gBAAe;AAC5E,SAASC,OAAO,QAAQ,oBAAmB;AAE3C,SAASC,6BAA6B,QAAQ,gDAA+C;AAC7F,OAAOC,uBAAuB,oCAAmC;AACjE,OAAOC,gBAAgB,6BAA4B;AACnD,OAAOC,sBAAsB,wBAAuB;AACpD,SAASC,qBAAqB,QAAQ,oBAAmB;AAEzD,MAAMC,eAAe;IACnBC,QAAQf;IACRgB,MAAMb;AACR;AAEA,OAAO,MAAMc,sBAAsB,CACjCC,MACAC;IAEA,MAAMC,UAAUP,sBAAsBM,WAAWE,MAAM,EAAEC,IAAI,CAC3D,CAACC,QAAUlB,iBAAiBkB,UAAUA,MAAMC,IAAI,KAAK;IAGvD,IAAI,CAACJ,SAAS;QACZ,OAAON,YAAY,CAACI,KAAK;IAC3B;IAEA,OAAOJ,YAAY,CAACM,QAAQF,IAAI,CAAC;AACnC,EAAC;AAeD,OAAO,SAASO,uBAAuB,EACrCD,IAAI,EACJH,MAAM,EACNK,UAAU,EACVC,gBAAgB,KAAK,EACrBC,aAAa,EACbC,MAAM,EACqB;IAC3B,MAAMC,mBAAmB;QACvBC,OAAO,CAACC,uBAA8CT;YACpD,MAAMU,WAAWvB,kBAAkBgB,YAAYlB,QAAQe,MAAMC,IAAI,EAAE;YACnE,IAAIN,OAA+CO,uBAAuB;gBACxED,MAAMS;gBACNZ,QAAQE,MAAMF,MAAM;gBACpBK,YAAYO;gBACZL;gBACAC;YACF;YAEA,IAAI,CAACX,MAAM,OAAOc;YAElBd,OAAO,IAAIjB,YAAYW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AC,QAAQ,EAAE8C,UAAU,KAAK,CAAC;QACjCjD,QAAQkD;IACV;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/buildMutationInputType.ts"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport type { GraphQLInputFieldConfig, GraphQLScalarType, GraphQLType } from 'graphql'\nimport type { GraphQLInfo } from 'payload/config'\nimport type {\n ArrayField,\n BlockField,\n CheckboxField,\n CodeField,\n CollapsibleField,\n DateField,\n EmailField,\n Field,\n GroupField,\n JSONField,\n NumberField,\n PointField,\n RadioField,\n RelationshipField,\n RichTextField,\n RowField,\n SanitizedCollectionConfig,\n SanitizedConfig,\n SelectField,\n TabsField,\n TextField,\n TextareaField,\n UploadField,\n} from 'payload/types'\n\nimport {\n GraphQLBoolean,\n GraphQLEnumType,\n GraphQLFloat,\n GraphQLInputObjectType,\n GraphQLInt,\n GraphQLList,\n GraphQLNonNull,\n GraphQLString,\n} from 'graphql'\nimport { GraphQLJSON } from 'graphql-type-json'\nimport { fieldAffectsData, optionIsObject, tabHasName } from 'payload/types'\nimport { toWords } from 'payload/utilities'\nimport { flattenTopLevelFields } from 'payload/utilities'\n\nimport combineParentName from '../utilities/combineParentName.js'\nimport formatName from '../utilities/formatName.js'\nimport { groupOrTabHasRequiredSubfield } from '../utilities/groupOrTabHasRequiredSubfield.js'\nimport withNullableType from './withNullableType.js'\n\nconst idFieldTypes = {\n number: GraphQLInt,\n text: GraphQLString,\n}\n\nexport const getCollectionIDType = (\n type: keyof typeof idFieldTypes,\n collection: SanitizedCollectionConfig,\n): GraphQLScalarType => {\n const idField = flattenTopLevelFields(collection.fields).find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n )\n\n if (!idField) {\n return idFieldTypes[type]\n }\n\n return idFieldTypes[idField.type]\n}\n\nexport type InputObjectTypeConfig = {\n [path: string]: GraphQLInputFieldConfig\n}\n\ntype BuildMutationInputTypeArgs = {\n config: SanitizedConfig\n fields: Field[]\n forceNullable?: boolean\n graphqlResult: GraphQLInfo\n name: string\n parentName: string\n}\n\nexport function buildMutationInputType({\n name,\n config,\n fields,\n forceNullable = false,\n graphqlResult,\n parentName,\n}: BuildMutationInputTypeArgs): GraphQLInputObjectType | null {\n const fieldToSchemaMap = {\n array: (inputObjectTypeConfig: InputObjectTypeConfig, field: ArrayField) => {\n const fullName = combineParentName(parentName, toWords(field.name, true))\n let type: GraphQLList<GraphQLType> | GraphQLType = buildMutationInputType({\n name: fullName,\n config,\n fields: field.fields,\n graphqlResult,\n parentName: fullName,\n })\n\n if (!type) return inputObjectTypeConfig\n\n type = new GraphQLList(withNullableType(field, type, forceNullable))\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type },\n }\n },\n blocks: (inputObjectTypeConfig: InputObjectTypeConfig, field: BlockField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: GraphQLJSON },\n }),\n checkbox: (inputObjectTypeConfig: InputObjectTypeConfig, field: CheckboxField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: GraphQLBoolean },\n }),\n code: (inputObjectTypeConfig: InputObjectTypeConfig, field: CodeField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n collapsible: (inputObjectTypeConfig: InputObjectTypeConfig, field: CollapsibleField) =>\n field.fields.reduce((acc, subField: CollapsibleField) => {\n const addSubField = fieldToSchemaMap[subField.type]\n if (addSubField) return addSubField(acc, subField)\n return acc\n }, inputObjectTypeConfig),\n date: (inputObjectTypeConfig: InputObjectTypeConfig, field: DateField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n email: (inputObjectTypeConfig: InputObjectTypeConfig, field: EmailField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n group: (inputObjectTypeConfig: InputObjectTypeConfig, field: GroupField) => {\n const requiresAtLeastOneField = groupOrTabHasRequiredSubfield(field)\n const fullName = combineParentName(parentName, toWords(field.name, true))\n let type: GraphQLType = buildMutationInputType({\n name: fullName,\n config,\n fields: field.fields,\n graphqlResult,\n parentName: fullName,\n })\n\n if (!type) return inputObjectTypeConfig\n\n if (requiresAtLeastOneField) type = new GraphQLNonNull(type)\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type },\n }\n },\n json: (inputObjectTypeConfig: InputObjectTypeConfig, field: JSONField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLJSON, forceNullable) },\n }),\n number: (inputObjectTypeConfig: InputObjectTypeConfig, field: NumberField) => {\n const type = field.name === 'id' ? GraphQLInt : GraphQLFloat\n return {\n ...inputObjectTypeConfig,\n [field.name]: {\n type: withNullableType(\n field,\n field.hasMany === true ? new GraphQLList(type) : type,\n forceNullable,\n ),\n },\n }\n },\n point: (inputObjectTypeConfig: InputObjectTypeConfig, field: PointField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, new GraphQLList(GraphQLFloat), forceNullable) },\n }),\n radio: (inputObjectTypeConfig: InputObjectTypeConfig, field: RadioField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n relationship: (inputObjectTypeConfig: InputObjectTypeConfig, field: RelationshipField) => {\n const { relationTo } = field\n type PayloadGraphQLRelationshipType =\n | GraphQLInputObjectType\n | GraphQLList<GraphQLScalarType>\n | GraphQLScalarType\n let type: PayloadGraphQLRelationshipType\n\n if (Array.isArray(relationTo)) {\n const fullName = `${combineParentName(\n parentName,\n toWords(field.name, true),\n )}RelationshipInput`\n type = new GraphQLInputObjectType({\n name: fullName,\n fields: {\n relationTo: {\n type: new GraphQLEnumType({\n name: `${fullName}RelationTo`,\n values: relationTo.reduce(\n (values, option) => ({\n ...values,\n [formatName(option)]: {\n value: option,\n },\n }),\n {},\n ),\n }),\n },\n value: { type: GraphQLJSON },\n },\n })\n } else {\n type = getCollectionIDType(\n config.db.defaultIDType,\n graphqlResult.collections[relationTo].config,\n )\n }\n\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type: field.hasMany ? new GraphQLList(type) : type },\n }\n },\n richText: (inputObjectTypeConfig: InputObjectTypeConfig, field: RichTextField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLJSON, forceNullable) },\n }),\n row: (inputObjectTypeConfig: InputObjectTypeConfig, field: RowField) =>\n field.fields.reduce((acc, subField: Field) => {\n const addSubField = fieldToSchemaMap[subField.type]\n if (addSubField) return addSubField(acc, subField)\n return acc\n }, inputObjectTypeConfig),\n select: (inputObjectTypeConfig: InputObjectTypeConfig, field: SelectField) => {\n const formattedName = `${combineParentName(parentName, field.name)}_MutationInput`\n let type: GraphQLType = new GraphQLEnumType({\n name: formattedName,\n values: field.options.reduce((values, option) => {\n if (optionIsObject(option)) {\n return {\n ...values,\n [formatName(option.value)]: {\n value: option.value,\n },\n }\n }\n\n return {\n ...values,\n [formatName(option)]: {\n value: option,\n },\n }\n }, {}),\n })\n\n type = field.hasMany ? new GraphQLList(type) : type\n type = withNullableType(field, type, forceNullable)\n\n return {\n ...inputObjectTypeConfig,\n [field.name]: { type },\n }\n },\n tabs: (inputObjectTypeConfig: InputObjectTypeConfig, field: TabsField) => {\n return field.tabs.reduce((acc, tab) => {\n if (tabHasName(tab)) {\n const fullName = combineParentName(parentName, toWords(tab.name, true))\n const requiresAtLeastOneField = groupOrTabHasRequiredSubfield(field)\n let type: GraphQLType = buildMutationInputType({\n name: fullName,\n config,\n fields: tab.fields,\n graphqlResult,\n parentName: fullName,\n })\n\n if (!type) return acc\n\n if (requiresAtLeastOneField) type = new GraphQLNonNull(type)\n return {\n ...acc,\n [tab.name]: { type },\n }\n }\n\n return {\n ...acc,\n ...tab.fields.reduce((subFieldSchema, subField) => {\n const addSubField = fieldToSchemaMap[subField.type]\n if (addSubField) return addSubField(subFieldSchema, subField)\n return subFieldSchema\n }, acc),\n }\n }, inputObjectTypeConfig)\n },\n text: (inputObjectTypeConfig: InputObjectTypeConfig, field: TextField) => ({\n ...inputObjectTypeConfig,\n [field.name]: {\n type: withNullableType(\n field,\n field.hasMany === true ? new GraphQLList(GraphQLString) : GraphQLString,\n forceNullable,\n ),\n },\n }),\n textarea: (inputObjectTypeConfig: InputObjectTypeConfig, field: TextareaField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n upload: (inputObjectTypeConfig: InputObjectTypeConfig, field: UploadField) => ({\n ...inputObjectTypeConfig,\n [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) },\n }),\n }\n\n const fieldName = formatName(name)\n\n const fieldSchemas = fields.reduce((inputObjectTypeConfig, field) => {\n const fieldSchema = fieldToSchemaMap[field.type]\n\n if (typeof fieldSchema !== 'function') {\n return inputObjectTypeConfig\n }\n\n const schema = fieldSchema(inputObjectTypeConfig, field)\n if (Object.keys(schema).length === 0) {\n return inputObjectTypeConfig\n }\n\n return {\n ...inputObjectTypeConfig,\n ...fieldSchema(inputObjectTypeConfig, field),\n }\n }, {})\n\n if (Object.keys(fieldSchemas).length === 0) {\n return null\n }\n\n return new GraphQLInputObjectType({\n name: `mutation${fieldName}Input`,\n fields: fieldSchemas,\n })\n}\n"],"names":["GraphQLBoolean","GraphQLEnumType","GraphQLFloat","GraphQLInputObjectType","GraphQLInt","GraphQLList","GraphQLNonNull","GraphQLString","GraphQLJSON","fieldAffectsData","optionIsObject","tabHasName","toWords","flattenTopLevelFields","combineParentName","formatName","groupOrTabHasRequiredSubfield","withNullableType","idFieldTypes","number","text","getCollectionIDType","type","collection","idField","fields","find","field","name","buildMutationInputType","config","forceNullable","graphqlResult","parentName","fieldToSchemaMap","array","inputObjectTypeConfig","fullName","blocks","checkbox","code","collapsible","reduce","acc","subField","addSubField","date","email","group","requiresAtLeastOneField","json","hasMany","point","radio","relationship","relationTo","Array","isArray","values","option","value","db","defaultIDType","collections","richText","row","select","formattedName","options","tabs","tab","subFieldSchema","textarea","upload","fieldName","fieldS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D;IACV;AACF"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { GraphQLFieldConfig } from 'graphql';
|
|
2
|
-
import { GraphQLObjectType } from 'graphql';
|
|
3
2
|
import type { GraphQLInfo } from 'payload/config';
|
|
4
|
-
import type {
|
|
3
|
+
import type { Field, SanitizedConfig } from 'payload/types';
|
|
4
|
+
import { GraphQLObjectType } from 'graphql';
|
|
5
5
|
export type ObjectTypeConfig = {
|
|
6
6
|
[path: string]: GraphQLFieldConfig<any, any>;
|
|
7
7
|
};
|
|
8
8
|
type Args = {
|
|
9
9
|
baseFields?: ObjectTypeConfig;
|
|
10
|
+
config: SanitizedConfig;
|
|
10
11
|
fields: Field[];
|
|
11
12
|
forceNullable?: boolean;
|
|
13
|
+
graphqlResult: GraphQLInfo;
|
|
12
14
|
name: string;
|
|
13
15
|
parentName: string;
|
|
14
|
-
graphqlResult: GraphQLInfo;
|
|
15
|
-
config: SanitizedConfig;
|
|
16
16
|
};
|
|
17
|
-
declare function buildObjectType({ name, baseFields, fields, forceNullable,
|
|
17
|
+
declare function buildObjectType({ name, baseFields, config, fields, forceNullable, graphqlResult, parentName, }: Args): GraphQLObjectType;
|
|
18
18
|
export default buildObjectType;
|
|
19
19
|
//# sourceMappingURL=buildObjectType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildObjectType.d.ts","sourceRoot":"","sources":["../../src/schema/buildObjectType.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"buildObjectType.d.ts","sourceRoot":"","sources":["../../src/schema/buildObjectType.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,SAAS,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAQV,KAAK,EAUL,eAAe,EAMhB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAOL,iBAAiB,EAGlB,MAAM,SAAS,CAAA;AA4BhB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAC7C,CAAA;AAED,KAAK,IAAI,GAAG;IACV,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,WAAW,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,iBAAS,eAAe,CAAC,EACvB,IAAI,EACJ,UAAe,EACf,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,GACX,EAAE,IAAI,GAAG,iBAAiB,CA+jB1B;AAED,eAAe,eAAe,CAAA"}
|