payload 4.0.0-internal.532221d → 4.0.0-internal.567a487
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/bin.js +10 -14
- package/dist/admin/adapters/devReload.d.ts +13 -0
- package/dist/admin/adapters/devReload.d.ts.map +1 -1
- package/dist/admin/adapters/devReload.js +14 -1
- package/dist/admin/adapters/devReload.js.map +1 -1
- package/dist/admin/functions/index.d.ts +1 -1
- package/dist/admin/functions/index.js.map +1 -1
- package/dist/admin/types.d.ts +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/index.d.ts +2 -2
- package/dist/admin/views/index.d.ts.map +1 -1
- package/dist/admin/views/index.js.map +1 -1
- package/dist/auth/endpoints/refresh.d.ts.map +1 -1
- package/dist/auth/endpoints/refresh.js +4 -6
- package/dist/auth/endpoints/refresh.js.map +1 -1
- package/dist/auth/operations/me.d.ts +0 -7
- package/dist/auth/operations/me.d.ts.map +1 -1
- package/dist/auth/operations/me.js +0 -6
- package/dist/auth/operations/me.js.map +1 -1
- package/dist/auth/operations/refresh.d.ts +0 -7
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js +0 -6
- package/dist/auth/operations/refresh.js.map +1 -1
- package/dist/{cli/commands/build → bin}/build.d.ts +9 -4
- package/dist/bin/build.d.ts.map +1 -0
- package/dist/{cli/commands/build → bin}/build.js +16 -5
- package/dist/bin/build.js.map +1 -0
- package/dist/{cli/commands/build → bin}/build.spec.js +51 -14
- package/dist/bin/build.spec.js.map +1 -0
- package/dist/{cli → bin}/frameworkConventions.d.ts.map +1 -1
- package/dist/{cli → bin}/frameworkConventions.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/generateImportMap.spec.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/index.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/index.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateCollections.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateCollections.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateConfig.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateConfig.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateFields.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateFields.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateGlobals.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/iterateGlobals.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/addPayloadComponentToImportMap.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/getFromImportMap.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/getFromImportMap.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/getImportMapToBaseDirPath.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/parsePayloadComponent.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/parsePayloadComponent.js.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -1
- package/dist/{cli → bin}/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -1
- package/dist/{cli → bin}/generateTypes.d.ts.map +1 -1
- package/dist/{cli → bin}/generateTypes.js.map +1 -1
- package/dist/bin/index.d.ts +2 -0
- package/dist/bin/index.d.ts.map +1 -0
- package/dist/bin/index.js +200 -0
- package/dist/bin/index.js.map +1 -0
- package/dist/bin/info.d.ts +2 -0
- package/dist/bin/info.d.ts.map +1 -0
- package/dist/bin/info.js +56 -0
- package/dist/bin/info.js.map +1 -0
- package/dist/bin/loadEnv.d.ts.map +1 -0
- package/dist/{cli → bin}/loadEnv.js.map +1 -1
- package/dist/bin/migrate.d.ts +15 -0
- package/dist/bin/migrate.d.ts.map +1 -0
- package/dist/bin/migrate.js +102 -0
- package/dist/bin/migrate.js.map +1 -0
- package/dist/branching/appendBranchFilter.d.ts +28 -0
- package/dist/branching/appendBranchFilter.d.ts.map +1 -0
- package/dist/branching/appendBranchFilter.js +84 -0
- package/dist/branching/appendBranchFilter.js.map +1 -0
- package/dist/branching/appendBranchFilter.spec.js +166 -0
- package/dist/branching/appendBranchFilter.spec.js.map +1 -0
- package/dist/branching/assertBranchReadable.d.ts +34 -0
- package/dist/branching/assertBranchReadable.d.ts.map +1 -0
- package/dist/branching/assertBranchReadable.js +72 -0
- package/dist/branching/assertBranchReadable.js.map +1 -0
- package/dist/branching/assertBranchWritable.d.ts +18 -0
- package/dist/branching/assertBranchWritable.d.ts.map +1 -0
- package/dist/branching/assertBranchWritable.js +45 -0
- package/dist/branching/assertBranchWritable.js.map +1 -0
- package/dist/branching/branchIDs.d.ts +38 -0
- package/dist/branching/branchIDs.d.ts.map +1 -0
- package/dist/branching/branchIDs.js +110 -0
- package/dist/branching/branchIDs.js.map +1 -0
- package/dist/branching/branchIDs.spec.js +167 -0
- package/dist/branching/branchIDs.spec.js.map +1 -0
- package/dist/branching/branchSelect.d.ts +35 -0
- package/dist/branching/branchSelect.d.ts.map +1 -0
- package/dist/branching/branchSelect.js +74 -0
- package/dist/branching/branchSelect.js.map +1 -0
- package/dist/branching/collections.d.ts +14 -0
- package/dist/branching/collections.d.ts.map +1 -0
- package/dist/branching/collections.js +378 -0
- package/dist/branching/collections.js.map +1 -0
- package/dist/branching/discard.d.ts +45 -0
- package/dist/branching/discard.d.ts.map +1 -0
- package/dist/branching/discard.js +186 -0
- package/dist/branching/discard.js.map +1 -0
- package/dist/branching/effectiveOperations.d.ts +52 -0
- package/dist/branching/effectiveOperations.d.ts.map +1 -0
- package/dist/branching/effectiveOperations.js +273 -0
- package/dist/branching/effectiveOperations.js.map +1 -0
- package/dist/branching/endpoints/discard.d.ts +13 -0
- package/dist/branching/endpoints/discard.d.ts.map +1 -0
- package/dist/branching/endpoints/discard.js +46 -0
- package/dist/branching/endpoints/discard.js.map +1 -0
- package/dist/branching/endpoints/merge.d.ts +34 -0
- package/dist/branching/endpoints/merge.d.ts.map +1 -0
- package/dist/branching/endpoints/merge.js +120 -0
- package/dist/branching/endpoints/merge.js.map +1 -0
- package/dist/branching/forkDocument.d.ts +18 -0
- package/dist/branching/forkDocument.d.ts.map +1 -0
- package/dist/branching/forkDocument.js +169 -0
- package/dist/branching/forkDocument.js.map +1 -0
- package/dist/branching/globals.d.ts +49 -0
- package/dist/branching/globals.d.ts.map +1 -0
- package/dist/branching/globals.js +160 -0
- package/dist/branching/globals.js.map +1 -0
- package/dist/branching/hooks.d.ts +29 -0
- package/dist/branching/hooks.d.ts.map +1 -0
- package/dist/branching/hooks.js +91 -0
- package/dist/branching/hooks.js.map +1 -0
- package/dist/branching/injectBranchFields.d.ts +44 -0
- package/dist/branching/injectBranchFields.d.ts.map +1 -0
- package/dist/branching/injectBranchFields.js +171 -0
- package/dist/branching/injectBranchFields.js.map +1 -0
- package/dist/branching/merge.d.ts +105 -0
- package/dist/branching/merge.d.ts.map +1 -0
- package/dist/branching/merge.js +563 -0
- package/dist/branching/merge.js.map +1 -0
- package/dist/branching/preflight.d.ts +50 -0
- package/dist/branching/preflight.d.ts.map +1 -0
- package/dist/branching/preflight.js +155 -0
- package/dist/branching/preflight.js.map +1 -0
- package/dist/branching/resolveBranch.d.ts +130 -0
- package/dist/branching/resolveBranch.d.ts.map +1 -0
- package/dist/branching/resolveBranch.js +297 -0
- package/dist/branching/resolveBranch.js.map +1 -0
- package/dist/branching/resolveBranchQuery.d.ts +43 -0
- package/dist/branching/resolveBranchQuery.d.ts.map +1 -0
- package/dist/branching/resolveBranchQuery.js +87 -0
- package/dist/branching/resolveBranchQuery.js.map +1 -0
- package/dist/branching/resolveBranchRowID.d.ts +22 -0
- package/dist/branching/resolveBranchRowID.d.ts.map +1 -0
- package/dist/branching/resolveBranchRowID.js +70 -0
- package/dist/branching/resolveBranchRowID.js.map +1 -0
- package/dist/branching/sanitizeBranchingConfig.d.ts +31 -0
- package/dist/branching/sanitizeBranchingConfig.d.ts.map +1 -0
- package/dist/branching/sanitizeBranchingConfig.js +105 -0
- package/dist/branching/sanitizeBranchingConfig.js.map +1 -0
- package/dist/branching/schedule/job.d.ts +47 -0
- package/dist/branching/schedule/job.d.ts.map +1 -0
- package/dist/branching/schedule/job.js +128 -0
- package/dist/branching/schedule/job.js.map +1 -0
- package/dist/branching/tombstone.d.ts +46 -0
- package/dist/branching/tombstone.d.ts.map +1 -0
- package/dist/branching/tombstone.js +186 -0
- package/dist/branching/tombstone.js.map +1 -0
- package/dist/branching/types.d.ts +87 -0
- package/dist/branching/types.d.ts.map +1 -0
- package/dist/branching/types.js +24 -0
- package/dist/branching/types.js.map +1 -0
- package/dist/branching/versions.d.ts +108 -0
- package/dist/branching/versions.d.ts.map +1 -0
- package/dist/branching/versions.js +343 -0
- package/dist/branching/versions.js.map +1 -0
- package/dist/collections/config/client.d.ts +1 -1
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/types.d.ts +13 -0
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/dataloader.d.ts +10 -1
- package/dist/collections/dataloader.d.ts.map +1 -1
- package/dist/collections/dataloader.js +12 -5
- package/dist/collections/dataloader.js.map +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +15 -5
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js +17 -5
- package/dist/collections/operations/deleteByID.js.map +1 -1
- package/dist/collections/operations/findByID.d.ts.map +1 -1
- package/dist/collections/operations/findByID.js +6 -0
- package/dist/collections/operations/findByID.js.map +1 -1
- package/dist/collections/operations/local/count.d.ts +9 -4
- package/dist/collections/operations/local/count.d.ts.map +1 -1
- package/dist/collections/operations/local/count.js.map +1 -1
- package/dist/collections/operations/local/countVersions.d.ts +4 -0
- package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/countVersions.js.map +1 -1
- package/dist/collections/operations/local/create.d.ts +9 -4
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js.map +1 -1
- package/dist/collections/operations/local/delete.d.ts +9 -4
- package/dist/collections/operations/local/delete.d.ts.map +1 -1
- package/dist/collections/operations/local/delete.js.map +1 -1
- package/dist/collections/operations/local/find.d.ts +9 -4
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js.map +1 -1
- package/dist/collections/operations/local/findByID.d.ts +9 -4
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js.map +1 -1
- package/dist/collections/operations/local/findVersions.d.ts +5 -0
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js.map +1 -1
- package/dist/collections/operations/local/update.d.ts +9 -4
- package/dist/collections/operations/local/update.d.ts.map +1 -1
- package/dist/collections/operations/local/update.js.map +1 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +51 -25
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts +7 -0
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +1 -0
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/collections/operations/utilities/update.d.ts +9 -1
- package/dist/collections/operations/utilities/update.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.js +9 -7
- package/dist/collections/operations/utilities/update.js.map +1 -1
- package/dist/config/client.d.ts +5 -3
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js +10 -1
- package/dist/config/client.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +44 -43
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +39 -1
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/sanitize.spec.js +101 -0
- package/dist/config/sanitize.spec.js.map +1 -0
- package/dist/config/types.d.ts +423 -419
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/database/types.d.ts +63 -0
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js.map +1 -1
- package/dist/exports/internal.d.ts +0 -1
- package/dist/exports/internal.d.ts.map +1 -1
- package/dist/exports/internal.js +1 -2
- package/dist/exports/internal.js.map +1 -1
- package/dist/exports/node.d.ts +2 -2
- package/dist/exports/node.js +2 -2
- package/dist/exports/node.js.map +1 -1
- package/dist/exports/shared.d.ts +3 -2
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +3 -2
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/config/client.d.ts +1 -1
- package/dist/fields/config/client.js +1 -1
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js +2 -0
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js.map +1 -1
- package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js +3 -0
- package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js.map +1 -1
- package/dist/globals/config/client.d.ts +1 -1
- package/dist/globals/config/client.js.map +1 -1
- package/dist/globals/config/types.d.ts +5 -0
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/globals/operations/local/findOne.d.ts +5 -0
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js.map +1 -1
- package/dist/globals/operations/local/findVersions.d.ts +5 -0
- package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersions.js.map +1 -1
- package/dist/globals/operations/local/update.d.ts +5 -0
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js.map +1 -1
- package/dist/index.bundled.d.ts +4251 -3265
- package/dist/index.d.ts +66 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -63
- package/dist/index.js.map +1 -1
- package/dist/preferences/keys.d.ts +11 -4
- package/dist/preferences/keys.d.ts.map +1 -1
- package/dist/preferences/keys.js +10 -3
- package/dist/preferences/keys.js.map +1 -1
- package/dist/preferences/types.d.ts +19 -0
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js.map +1 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/cropImage.d.ts +1 -1
- package/dist/uploads/cropImage.d.ts.map +1 -1
- package/dist/uploads/cropImage.js.map +1 -1
- package/dist/utilities/createLocalReq.d.ts +5 -0
- package/dist/utilities/createLocalReq.d.ts.map +1 -1
- package/dist/utilities/createLocalReq.js +37 -1
- package/dist/utilities/createLocalReq.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +9 -0
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextVersion.d.ts +7 -0
- package/dist/utilities/getNextVersion.d.ts.map +1 -0
- package/dist/utilities/getNextVersion.js +20 -0
- package/dist/utilities/getNextVersion.js.map +1 -0
- package/dist/utilities/getNextVersion.spec.js +16 -0
- package/dist/utilities/getNextVersion.spec.js.map +1 -0
- package/dist/utilities/getRequestOrigin.d.ts.map +1 -1
- package/dist/utilities/getRequestOrigin.js.map +1 -1
- package/dist/utilities/handleEndpoints.d.ts.map +1 -1
- package/dist/utilities/handleEndpoints.js +7 -0
- package/dist/utilities/handleEndpoints.js.map +1 -1
- package/dist/utilities/headersWithCors.js +1 -1
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/logError.d.ts.map +1 -1
- package/dist/utilities/logError.js +5 -2
- package/dist/utilities/logError.js.map +1 -1
- package/dist/utilities/nextJsDevReloadStrategy.d.ts +7 -0
- package/dist/utilities/nextJsDevReloadStrategy.d.ts.map +1 -0
- package/dist/utilities/nextJsDevReloadStrategy.js +59 -0
- package/dist/utilities/nextJsDevReloadStrategy.js.map +1 -0
- package/dist/utilities/nextJsDevReloadStrategy.spec.js +123 -0
- package/dist/utilities/nextJsDevReloadStrategy.spec.js.map +1 -0
- package/dist/versions/buildCollectionFields.d.ts.map +1 -1
- package/dist/versions/buildCollectionFields.js +23 -0
- package/dist/versions/buildCollectionFields.js.map +1 -1
- package/dist/versions/buildGlobalFields.d.ts.map +1 -1
- package/dist/versions/buildGlobalFields.js +14 -0
- package/dist/versions/buildGlobalFields.js.map +1 -1
- package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
- package/dist/versions/deleteCollectionVersions.js +9 -5
- package/dist/versions/deleteCollectionVersions.js.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js +8 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js.map +1 -1
- package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
- package/dist/versions/enforceMaxVersions.js +17 -6
- package/dist/versions/enforceMaxVersions.js.map +1 -1
- package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
- package/dist/versions/getLatestCollectionVersion.js +10 -2
- package/dist/versions/getLatestCollectionVersion.js.map +1 -1
- package/dist/versions/updateLatestVersion.d.ts.map +1 -1
- package/dist/versions/updateLatestVersion.js +23 -7
- package/dist/versions/updateLatestVersion.js.map +1 -1
- package/package.json +7 -11
- package/skills/payload/SKILL.md +517 -0
- package/skills/payload/reference/ACCESS-CONTROL-ADVANCED.md +704 -0
- package/skills/payload/reference/ACCESS-CONTROL.md +696 -0
- package/skills/payload/reference/ADAPTERS.md +305 -0
- package/skills/payload/reference/ADVANCED.md +386 -0
- package/skills/payload/reference/COLLECTIONS.md +301 -0
- package/skills/payload/reference/ENDPOINTS.md +634 -0
- package/skills/payload/reference/FIELD-TYPE-GUARDS.md +553 -0
- package/skills/payload/reference/FIELDS.md +739 -0
- package/skills/payload/reference/HOOKS.md +186 -0
- package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +1436 -0
- package/skills/payload/reference/QUERIES.md +274 -0
- package/dist/cli/args.d.ts +0 -15
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -72
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/commands/build/build.d.ts.map +0 -1
- package/dist/cli/commands/build/build.js.map +0 -1
- package/dist/cli/commands/build/build.spec.js.map +0 -1
- package/dist/cli/commands/build/index.d.ts +0 -3
- package/dist/cli/commands/build/index.d.ts.map +0 -1
- package/dist/cli/commands/build/index.js +0 -14
- package/dist/cli/commands/build/index.js.map +0 -1
- package/dist/cli/commands/collections/countDocuments.d.ts +0 -3
- package/dist/cli/commands/collections/countDocuments.d.ts.map +0 -1
- package/dist/cli/commands/collections/countDocuments.js +0 -30
- package/dist/cli/commands/collections/countDocuments.js.map +0 -1
- package/dist/cli/commands/collections/countVersions.d.ts +0 -3
- package/dist/cli/commands/collections/countVersions.d.ts.map +0 -1
- package/dist/cli/commands/collections/countVersions.js +0 -28
- package/dist/cli/commands/collections/countVersions.js.map +0 -1
- package/dist/cli/commands/collections/createDocuments.d.ts +0 -3
- package/dist/cli/commands/collections/createDocuments.d.ts.map +0 -1
- package/dist/cli/commands/collections/createDocuments.js +0 -82
- package/dist/cli/commands/collections/createDocuments.js.map +0 -1
- package/dist/cli/commands/collections/deleteDocuments.d.ts +0 -3
- package/dist/cli/commands/collections/deleteDocuments.d.ts.map +0 -1
- package/dist/cli/commands/collections/deleteDocuments.js +0 -35
- package/dist/cli/commands/collections/deleteDocuments.js.map +0 -1
- package/dist/cli/commands/collections/duplicateDocument.d.ts +0 -3
- package/dist/cli/commands/collections/duplicateDocument.d.ts.map +0 -1
- package/dist/cli/commands/collections/duplicateDocument.js +0 -49
- package/dist/cli/commands/collections/duplicateDocument.js.map +0 -1
- package/dist/cli/commands/collections/findDistinct.d.ts +0 -3
- package/dist/cli/commands/collections/findDistinct.d.ts.map +0 -1
- package/dist/cli/commands/collections/findDistinct.js +0 -44
- package/dist/cli/commands/collections/findDistinct.js.map +0 -1
- package/dist/cli/commands/collections/findDocuments.d.ts +0 -3
- package/dist/cli/commands/collections/findDocuments.d.ts.map +0 -1
- package/dist/cli/commands/collections/findDocuments.js +0 -51
- package/dist/cli/commands/collections/findDocuments.js.map +0 -1
- package/dist/cli/commands/collections/findVersionByID.d.ts +0 -3
- package/dist/cli/commands/collections/findVersionByID.d.ts.map +0 -1
- package/dist/cli/commands/collections/findVersionByID.js +0 -31
- package/dist/cli/commands/collections/findVersionByID.js.map +0 -1
- package/dist/cli/commands/collections/findVersions.d.ts +0 -3
- package/dist/cli/commands/collections/findVersions.d.ts.map +0 -1
- package/dist/cli/commands/collections/findVersions.js +0 -39
- package/dist/cli/commands/collections/findVersions.js.map +0 -1
- package/dist/cli/commands/collections/getCollectionSchema.d.ts +0 -3
- package/dist/cli/commands/collections/getCollectionSchema.d.ts.map +0 -1
- package/dist/cli/commands/collections/getCollectionSchema.js +0 -49
- package/dist/cli/commands/collections/getCollectionSchema.js.map +0 -1
- package/dist/cli/commands/collections/restoreVersion.d.ts +0 -3
- package/dist/cli/commands/collections/restoreVersion.d.ts.map +0 -1
- package/dist/cli/commands/collections/restoreVersion.js +0 -29
- package/dist/cli/commands/collections/restoreVersion.js.map +0 -1
- package/dist/cli/commands/collections/updateDocument.d.ts +0 -3
- package/dist/cli/commands/collections/updateDocument.d.ts.map +0 -1
- package/dist/cli/commands/collections/updateDocument.js +0 -66
- package/dist/cli/commands/collections/updateDocument.js.map +0 -1
- package/dist/cli/commands/data/createDataCommand.d.ts +0 -18
- package/dist/cli/commands/data/createDataCommand.d.ts.map +0 -1
- package/dist/cli/commands/data/createDataCommand.js +0 -19
- package/dist/cli/commands/data/createDataCommand.js.map +0 -1
- package/dist/cli/commands/data/options.d.ts +0 -50
- package/dist/cli/commands/data/options.d.ts.map +0 -1
- package/dist/cli/commands/data/options.js +0 -204
- package/dist/cli/commands/data/options.js.map +0 -1
- package/dist/cli/commands/data/utilities.d.ts +0 -34
- package/dist/cli/commands/data/utilities.d.ts.map +0 -1
- package/dist/cli/commands/data/utilities.js +0 -29
- package/dist/cli/commands/data/utilities.js.map +0 -1
- package/dist/cli/commands/generateDBSchema.d.ts +0 -3
- package/dist/cli/commands/generateDBSchema.d.ts.map +0 -1
- package/dist/cli/commands/generateDBSchema.js +0 -19
- package/dist/cli/commands/generateDBSchema.js.map +0 -1
- package/dist/cli/commands/generateImportMap.d.ts +0 -3
- package/dist/cli/commands/generateImportMap.d.ts.map +0 -1
- package/dist/cli/commands/generateImportMap.js +0 -10
- package/dist/cli/commands/generateImportMap.js.map +0 -1
- package/dist/cli/commands/generateTypes.d.ts +0 -3
- package/dist/cli/commands/generateTypes.d.ts.map +0 -1
- package/dist/cli/commands/generateTypes.js +0 -10
- package/dist/cli/commands/generateTypes.js.map +0 -1
- package/dist/cli/commands/getConfigInfo.d.ts +0 -3
- package/dist/cli/commands/getConfigInfo.d.ts.map +0 -1
- package/dist/cli/commands/getConfigInfo.js +0 -20
- package/dist/cli/commands/getConfigInfo.js.map +0 -1
- package/dist/cli/commands/globals/countGlobalVersions.d.ts +0 -3
- package/dist/cli/commands/globals/countGlobalVersions.d.ts.map +0 -1
- package/dist/cli/commands/globals/countGlobalVersions.js +0 -28
- package/dist/cli/commands/globals/countGlobalVersions.js.map +0 -1
- package/dist/cli/commands/globals/findGlobal.d.ts +0 -3
- package/dist/cli/commands/globals/findGlobal.d.ts.map +0 -1
- package/dist/cli/commands/globals/findGlobal.js +0 -25
- package/dist/cli/commands/globals/findGlobal.js.map +0 -1
- package/dist/cli/commands/globals/findGlobalVersionByID.d.ts +0 -3
- package/dist/cli/commands/globals/findGlobalVersionByID.d.ts.map +0 -1
- package/dist/cli/commands/globals/findGlobalVersionByID.js +0 -27
- package/dist/cli/commands/globals/findGlobalVersionByID.js.map +0 -1
- package/dist/cli/commands/globals/findGlobalVersions.d.ts +0 -3
- package/dist/cli/commands/globals/findGlobalVersions.d.ts.map +0 -1
- package/dist/cli/commands/globals/findGlobalVersions.js +0 -35
- package/dist/cli/commands/globals/findGlobalVersions.js.map +0 -1
- package/dist/cli/commands/globals/getGlobalSchema.d.ts +0 -3
- package/dist/cli/commands/globals/getGlobalSchema.d.ts.map +0 -1
- package/dist/cli/commands/globals/getGlobalSchema.js +0 -34
- package/dist/cli/commands/globals/getGlobalSchema.js.map +0 -1
- package/dist/cli/commands/globals/restoreGlobalVersion.d.ts +0 -3
- package/dist/cli/commands/globals/restoreGlobalVersion.d.ts.map +0 -1
- package/dist/cli/commands/globals/restoreGlobalVersion.js +0 -27
- package/dist/cli/commands/globals/restoreGlobalVersion.js.map +0 -1
- package/dist/cli/commands/globals/updateGlobal.d.ts +0 -3
- package/dist/cli/commands/globals/updateGlobal.d.ts.map +0 -1
- package/dist/cli/commands/globals/updateGlobal.js +0 -51
- package/dist/cli/commands/globals/updateGlobal.js.map +0 -1
- package/dist/cli/commands/help.d.ts +0 -3
- package/dist/cli/commands/help.d.ts.map +0 -1
- package/dist/cli/commands/help.js +0 -4
- package/dist/cli/commands/help.js.map +0 -1
- package/dist/cli/commands/info.d.ts +0 -3
- package/dist/cli/commands/info.d.ts.map +0 -1
- package/dist/cli/commands/info.js +0 -58
- package/dist/cli/commands/info.js.map +0 -1
- package/dist/cli/commands/jobs/handleSchedules.d.ts +0 -3
- package/dist/cli/commands/jobs/handleSchedules.d.ts.map +0 -1
- package/dist/cli/commands/jobs/handleSchedules.js +0 -13
- package/dist/cli/commands/jobs/handleSchedules.js.map +0 -1
- package/dist/cli/commands/jobs/run.d.ts +0 -3
- package/dist/cli/commands/jobs/run.d.ts.map +0 -1
- package/dist/cli/commands/jobs/run.js +0 -27
- package/dist/cli/commands/jobs/run.js.map +0 -1
- package/dist/cli/commands/migrate/create.d.ts +0 -3
- package/dist/cli/commands/migrate/create.d.ts.map +0 -1
- package/dist/cli/commands/migrate/create.js +0 -26
- package/dist/cli/commands/migrate/create.js.map +0 -1
- package/dist/cli/commands/migrate/down.d.ts +0 -3
- package/dist/cli/commands/migrate/down.d.ts.map +0 -1
- package/dist/cli/commands/migrate/down.js +0 -14
- package/dist/cli/commands/migrate/down.js.map +0 -1
- package/dist/cli/commands/migrate/fresh.d.ts +0 -3
- package/dist/cli/commands/migrate/fresh.d.ts.map +0 -1
- package/dist/cli/commands/migrate/fresh.js +0 -16
- package/dist/cli/commands/migrate/fresh.js.map +0 -1
- package/dist/cli/commands/migrate/index.d.ts +0 -3
- package/dist/cli/commands/migrate/index.d.ts.map +0 -1
- package/dist/cli/commands/migrate/index.js +0 -14
- package/dist/cli/commands/migrate/index.js.map +0 -1
- package/dist/cli/commands/migrate/initialize.d.ts +0 -11
- package/dist/cli/commands/migrate/initialize.d.ts.map +0 -1
- package/dist/cli/commands/migrate/initialize.js +0 -23
- package/dist/cli/commands/migrate/initialize.js.map +0 -1
- package/dist/cli/commands/migrate/refresh.d.ts +0 -3
- package/dist/cli/commands/migrate/refresh.d.ts.map +0 -1
- package/dist/cli/commands/migrate/refresh.js +0 -14
- package/dist/cli/commands/migrate/refresh.js.map +0 -1
- package/dist/cli/commands/migrate/reset.d.ts +0 -3
- package/dist/cli/commands/migrate/reset.d.ts.map +0 -1
- package/dist/cli/commands/migrate/reset.js +0 -14
- package/dist/cli/commands/migrate/reset.js.map +0 -1
- package/dist/cli/commands/migrate/status.d.ts +0 -3
- package/dist/cli/commands/migrate/status.d.ts.map +0 -1
- package/dist/cli/commands/migrate/status.js +0 -14
- package/dist/cli/commands/migrate/status.js.map +0 -1
- package/dist/cli/commands/run.d.ts +0 -3
- package/dist/cli/commands/run.d.ts.map +0 -1
- package/dist/cli/commands/run.js +0 -29
- package/dist/cli/commands/run.js.map +0 -1
- package/dist/cli/data.spec.js +0 -326
- package/dist/cli/data.spec.js.map +0 -1
- package/dist/cli/index.d.ts +0 -5
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -117
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/loadEnv.d.ts.map +0 -1
- package/dist/cli/zodCommand.d.ts +0 -40
- package/dist/cli/zodCommand.d.ts.map +0 -1
- package/dist/cli/zodCommand.js +0 -96
- package/dist/cli/zodCommand.js.map +0 -1
- package/dist/exports/cli.d.ts +0 -3
- package/dist/exports/cli.d.ts.map +0 -1
- package/dist/exports/cli.js +0 -3
- package/dist/exports/cli.js.map +0 -1
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.d.ts +0 -30
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.d.ts.map +0 -1
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.js +0 -71
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.js.map +0 -1
- package/dist/utilities/entityInputSchema/getEntityInputSchema.d.ts +0 -13
- package/dist/utilities/entityInputSchema/getEntityInputSchema.d.ts.map +0 -1
- package/dist/utilities/entityInputSchema/getEntityInputSchema.js +0 -66
- package/dist/utilities/entityInputSchema/getEntityInputSchema.js.map +0 -1
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.d.ts +0 -10
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.d.ts.map +0 -1
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.js +0 -384
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.js.map +0 -1
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.spec.js +0 -133
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.spec.js.map +0 -1
- package/dist/utilities/entityInputSchema/types.d.ts +0 -16
- package/dist/utilities/entityInputSchema/types.d.ts.map +0 -1
- package/dist/utilities/entityInputSchema/types.js +0 -3
- package/dist/utilities/entityInputSchema/types.js.map +0 -1
- package/dist/utilities/getVirtualFieldNames.d.ts +0 -14
- package/dist/utilities/getVirtualFieldNames.d.ts.map +0 -1
- package/dist/utilities/getVirtualFieldNames.js +0 -35
- package/dist/utilities/getVirtualFieldNames.js.map +0 -1
- package/dist/utilities/transformPointDataToPayload.d.ts +0 -7
- package/dist/utilities/transformPointDataToPayload.d.ts.map +0 -1
- package/dist/utilities/transformPointDataToPayload.js +0 -28
- package/dist/utilities/transformPointDataToPayload.js.map +0 -1
- /package/dist/{cli → bin}/frameworkConventions.d.ts +0 -0
- /package/dist/{cli → bin}/frameworkConventions.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/generateImportMap.spec.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/index.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/index.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateCollections.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateCollections.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateConfig.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateConfig.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateFields.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateFields.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateGlobals.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/iterateGlobals.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/addPayloadComponentToImportMap.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/getFromImportMap.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/getFromImportMap.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/getImportMapToBaseDirPath.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/parsePayloadComponent.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/parsePayloadComponent.js +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/resolveImportMapFilePath.d.ts +0 -0
- /package/dist/{cli → bin}/generateImportMap/utilities/resolveImportMapFilePath.js +0 -0
- /package/dist/{cli → bin}/generateTypes.d.ts +0 -0
- /package/dist/{cli → bin}/generateTypes.js +0 -0
- /package/dist/{cli → bin}/loadEnv.d.ts +0 -0
- /package/dist/{cli → bin}/loadEnv.js +0 -0
package/bin.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { Command } from 'commander'
|
|
4
3
|
import path from 'node:path'
|
|
5
4
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
.allowUnknownOption()
|
|
10
|
-
.argument('[args...]')
|
|
11
|
-
.option('--disable-transpile')
|
|
12
|
-
.option('--use-swc')
|
|
13
|
-
.parse(process.argv)
|
|
14
|
-
const { disableTranspile, useSwc } = bootstrap.opts()
|
|
15
|
-
|
|
16
|
-
process.argv = [...process.argv.slice(0, 2), ...bootstrap.args]
|
|
6
|
+
const useSwc = process.argv.includes('--use-swc')
|
|
7
|
+
const disableTranspile = process.argv.includes('--disable-transpile')
|
|
17
8
|
|
|
18
9
|
if (disableTranspile) {
|
|
10
|
+
// Remove --disable-transpile from arguments
|
|
11
|
+
process.argv = process.argv.filter((arg) => arg !== '--disable-transpile')
|
|
12
|
+
|
|
19
13
|
const start = async () => {
|
|
20
|
-
const { bin } = await import('./dist/
|
|
14
|
+
const { bin } = await import('./dist/bin/index.js')
|
|
21
15
|
await bin()
|
|
22
16
|
}
|
|
23
17
|
|
|
@@ -43,13 +37,15 @@ if (disableTranspile) {
|
|
|
43
37
|
// Use tsx
|
|
44
38
|
let tsImport = (await import('tsx/esm/api')).tsImport
|
|
45
39
|
|
|
46
|
-
const { bin } = await tsImport('./dist/
|
|
40
|
+
const { bin } = await tsImport('./dist/bin/index.js', url)
|
|
47
41
|
await bin()
|
|
48
42
|
}
|
|
49
43
|
|
|
50
44
|
void start()
|
|
51
45
|
} else if (useSwc) {
|
|
52
46
|
const { register } = await import('node:module')
|
|
47
|
+
// Remove --use-swc from arguments
|
|
48
|
+
process.argv = process.argv.filter((arg) => arg !== '--use-swc')
|
|
53
49
|
|
|
54
50
|
try {
|
|
55
51
|
register('@swc-node/register/esm', url)
|
|
@@ -60,7 +56,7 @@ if (disableTranspile) {
|
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
const start = async () => {
|
|
63
|
-
const { bin } = await import('./dist/
|
|
59
|
+
const { bin } = await import('./dist/bin/index.js')
|
|
64
60
|
await bin()
|
|
65
61
|
}
|
|
66
62
|
|
|
@@ -6,4 +6,17 @@ export type DevReloadStrategy = {
|
|
|
6
6
|
connect: (onReload: () => void) => DevReloadCleanup;
|
|
7
7
|
};
|
|
8
8
|
export type DevReloadCleanup = () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Registers the strategy `getPayload` uses to learn the config changed on disk.
|
|
11
|
+
* Covers callers that never see `InitOptions`, such as `handleEndpoints`.
|
|
12
|
+
* Pass `null` to unregister.
|
|
13
|
+
*
|
|
14
|
+
* Scoped to this module instance rather than `globalThis`, so the registrar has
|
|
15
|
+
* to run in the same module graph as the `getPayload` calls it should affect.
|
|
16
|
+
* Framework adapters register from their server runtime, which resolves the
|
|
17
|
+
* same copy of `payload` as the app.
|
|
18
|
+
*/
|
|
19
|
+
export declare const registerDevReloadStrategy: (strategy: DevReloadStrategy | null) => void;
|
|
20
|
+
/** The strategy set by {@link registerDevReloadStrategy}, or `null` if none is registered. */
|
|
21
|
+
export declare const getRegisteredDevReloadStrategy: () => DevReloadStrategy | null;
|
|
9
22
|
//# sourceMappingURL=devReload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devReload.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/devReload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,gBAAgB,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAA"}
|
|
1
|
+
{"version":3,"file":"devReload.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/devReload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,gBAAgB,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAA;AAIzC;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,aAAc,iBAAiB,GAAG,IAAI,KAAG,IAE9E,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,8BAA8B,QAAO,iBAAiB,GAAG,IAA0B,CAAA"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Strategy for dev-mode HMR/reload detection.
|
|
3
3
|
* Each framework adapter provides its own implementation.
|
|
4
|
-
*/
|
|
4
|
+
*/ let registeredStrategy = null;
|
|
5
|
+
/**
|
|
6
|
+
* Registers the strategy `getPayload` uses to learn the config changed on disk.
|
|
7
|
+
* Covers callers that never see `InitOptions`, such as `handleEndpoints`.
|
|
8
|
+
* Pass `null` to unregister.
|
|
9
|
+
*
|
|
10
|
+
* Scoped to this module instance rather than `globalThis`, so the registrar has
|
|
11
|
+
* to run in the same module graph as the `getPayload` calls it should affect.
|
|
12
|
+
* Framework adapters register from their server runtime, which resolves the
|
|
13
|
+
* same copy of `payload` as the app.
|
|
14
|
+
*/ export const registerDevReloadStrategy = (strategy)=>{
|
|
15
|
+
registeredStrategy = strategy;
|
|
16
|
+
};
|
|
17
|
+
/** The strategy set by {@link registerDevReloadStrategy}, or `null` if none is registered. */ export const getRegisteredDevReloadStrategy = ()=>registeredStrategy;
|
|
5
18
|
|
|
6
19
|
//# sourceMappingURL=devReload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/adapters/devReload.ts"],"sourcesContent":["/**\n * Strategy for dev-mode HMR/reload detection.\n * Each framework adapter provides its own implementation.\n */\nexport type DevReloadStrategy = {\n connect: (onReload: () => void) => DevReloadCleanup\n}\n\nexport type DevReloadCleanup = () => void\n"],"names":[],"mappings":"AAAA;;;CAGC,
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/devReload.ts"],"sourcesContent":["/**\n * Strategy for dev-mode HMR/reload detection.\n * Each framework adapter provides its own implementation.\n */\nexport type DevReloadStrategy = {\n connect: (onReload: () => void) => DevReloadCleanup\n}\n\nexport type DevReloadCleanup = () => void\n\nlet registeredStrategy: DevReloadStrategy | null = null\n\n/**\n * Registers the strategy `getPayload` uses to learn the config changed on disk.\n * Covers callers that never see `InitOptions`, such as `handleEndpoints`.\n * Pass `null` to unregister.\n *\n * Scoped to this module instance rather than `globalThis`, so the registrar has\n * to run in the same module graph as the `getPayload` calls it should affect.\n * Framework adapters register from their server runtime, which resolves the\n * same copy of `payload` as the app.\n */\nexport const registerDevReloadStrategy = (strategy: DevReloadStrategy | null): void => {\n registeredStrategy = strategy\n}\n\n/** The strategy set by {@link registerDevReloadStrategy}, or `null` if none is registered. */\nexport const getRegisteredDevReloadStrategy = (): DevReloadStrategy | null => registeredStrategy\n"],"names":["registeredStrategy","registerDevReloadStrategy","strategy","getRegisteredDevReloadStrategy"],"mappings":"AAAA;;;CAGC,GAOD,IAAIA,qBAA+C;AAEnD;;;;;;;;;CASC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCF,qBAAqBE;AACvB,EAAC;AAED,4FAA4F,GAC5F,OAAO,MAAMC,iCAAiC,IAAgCH,mBAAkB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptedLanguages } from '@payloadcms/translations';
|
|
2
|
-
import type { ImportMap } from '../../
|
|
2
|
+
import type { ImportMap } from '../../bin/generateImportMap/index.js';
|
|
3
3
|
import type { Locale, SanitizedConfig } from '../../config/types.js';
|
|
4
4
|
import type { PaginatedDocs } from '../../database/types.js';
|
|
5
5
|
import type { Slugify } from '../../fields/baseFields/slug/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/functions/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport type { ImportMap } from '../../
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/functions/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { Locale, SanitizedConfig } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { Slugify } from '../../fields/baseFields/slug/types.js'\nimport type {\n CollectionSlug,\n ColumnPreference,\n DefaultDocumentIDType,\n FieldPaths,\n GlobalSlug,\n SanitizedPermissions,\n} from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\nimport type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js'\nimport type { ComponentRenderer } from '../adapters/render.js'\n\nexport type InitReqResult = {\n cookies: Map<string, string>\n // TODO: Remove in 4.0. Duplicative, already available in req.headers\n headers: Headers\n // TODO: Remove in 4.0. Duplicative, already available in req.i18n.language\n languageCode: AcceptedLanguages\n locale?: Locale\n permissions: SanitizedPermissions\n req: PayloadRequest\n}\n\nexport type DefaultServerFunctionArgs = {\n importMap: ImportMap\n renderComponent?: ComponentRenderer\n} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>\n\nexport type ServerFunctionArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClientArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClient = (args: ServerFunctionClientArgs) => Promise<unknown> | unknown\n\nexport type ServerFunction<\n TArgs extends object = Record<string, unknown>,\n TReturnType = Promise<unknown> | unknown,\n> = (args: DefaultServerFunctionArgs & TArgs) => TReturnType\n\nexport type ServerFunctionConfig = {\n fn: ServerFunction\n name: string\n}\n\nexport type ServerFunctionHandler = (\n args: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n /**\n * A map of server function names to their implementations. These are\n * registered alongside the base server functions and can be called\n * using the useServerFunctions() hook.\n *\n * @example\n * const { serverFunction } = useServerFunctions()\n *\n * const callServerFunction = useCallback(() => {\n *\n * async function call() {\n * const result = (await serverFunction({\n * name: 'record-key',\n * args: {\n * // Your args\n * },\n * }))\n *\n * // Do someting with the result\n * }\n *\n * void call()\n * }, [serverFunction])\n */\n serverFunctions?: Record<string, ServerFunction<any, any>>\n } & ServerFunctionClientArgs,\n) => Promise<unknown>\n\nexport type ListQuery = {\n /*\n * This is an of strings, i.e. `['title', '-slug']`\n * Use `transformColumnsToPreferences` and `transformColumnsToSearchParams` to convert it back and forth\n */\n columns?: ColumnsFromURL\n /*\n * A string representing the field to group by, e.g. `category`\n * A leading hyphen represents descending order, e.g. `-category`\n */\n groupBy?: string\n limit?: number\n page?: number\n preset?: number | string\n queryByGroup?: Record<string, ListQuery>\n /*\n When provided, is automatically injected into the `where` object\n */\n search?: string\n sort?: Sort\n where?: Where\n} & Record<string, unknown>\n\nexport type BuildTableStateArgs = {\n /**\n * If an array is provided, the table will be built to support polymorphic collections.\n */\n collectionSlug: string | string[]\n columns?: ColumnPreference[]\n data?: PaginatedDocs\n /**\n * @deprecated Use `data` instead\n */\n docs?: PaginatedDocs['docs']\n enableRowSelections?: boolean\n orderableFieldName: string\n parent?: {\n collectionSlug: CollectionSlug\n id: number | string\n joinPath: string\n }\n query?: ListQuery\n renderRowTypes?: boolean\n tableAppearance?: 'condensed' | 'default'\n}\n\nexport type SlugifyServerFunctionArgs = {\n collectionSlug?: CollectionSlug\n globalSlug?: GlobalSlug\n /**\n * Current doc ID, needed to exclude this doc from uniqueness checks.\n * This ensures that this doc can reuse its own slug rather than bumping past itself when regenerating.\n */\n id?: DefaultDocumentIDType\n /**\n * Active admin locale, so a localized slug's fallback is deduped within the right locale.\n */\n locale?: Locale['code']\n path?: FieldPaths['path']\n} & Omit<Parameters<Slugify>[0], 'req'>\n"],"names":[],"mappings":"AAsIA,WAauC"}
|
package/dist/admin/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
import type { ImportMap } from '../
|
|
3
|
+
import type { ImportMap } from '../bin/generateImportMap/index.js';
|
|
4
4
|
import type { TypeWithID } from '../collections/config/types.js';
|
|
5
5
|
import type { SanitizedConfig } from '../config/types.js';
|
|
6
6
|
import type { Block, ClientBlock, ClientField, Field, FieldTypes, Tab } from '../fields/config/types.js';
|
package/dist/admin/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { ImportMap } from '../cli/generateImportMap/index.js'\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type {\n Block,\n ClientBlock,\n ClientField,\n Field,\n FieldTypes,\n Tab,\n} from '../fields/config/types.js'\nimport type { JsonObject } from '../types/index.js'\nimport type { ClientTab } from './fields/Tabs.js'\nimport type {\n BuildFormStateArgs,\n Data,\n FieldState,\n FieldStateWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n} from './forms/Form.js'\n\nexport type {\n /**\n * @deprecated\n * The `CustomPreviewButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPreviewButton,\n /**\n * @deprecated\n * The `CustomPublishButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPublishButton,\n /**\n * @deprecated\n * The `CustomSaveButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveButton,\n /**\n * @deprecated\n * The `CustomSaveDraftButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveDraftButton,\n} from '../config/types.js'\nexport type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type {\n EditMenuItemsClientProps,\n EditMenuItemsServerProps,\n EditMenuItemsServerPropsOnly,\n} from './elements/EditMenuItems.js'\nexport type {\n NavGroupPreferences,\n NavPreferences,\n SidebarTabClientProps,\n SidebarTabServerProps,\n SidebarTabServerPropsOnly,\n} from './elements/Nav.js'\nexport type {\n PreviewButtonClientProps,\n PreviewButtonServerProps,\n PreviewButtonServerPropsOnly,\n} from './elements/PreviewButton.js'\nexport type {\n PublishButtonClientProps,\n PublishButtonServerProps,\n PublishButtonServerPropsOnly,\n} from './elements/PublishButton.js'\nexport type {\n SaveButtonClientProps,\n SaveButtonServerProps,\n SaveButtonServerPropsOnly,\n} from './elements/SaveButton.js'\nexport type {\n SaveDraftButtonClientProps,\n SaveDraftButtonServerProps,\n SaveDraftButtonServerPropsOnly,\n} from './elements/SaveDraftButton.js'\nexport type { CustomStatus } from './elements/Status.js'\n\nexport type { Column } from './elements/Table.js'\n\nexport type {\n UnpublishButtonClientProps,\n UnpublishButtonServerProps,\n UnpublishButtonServerPropsOnly,\n} from './elements/UnpublishButton.js'\n\nexport type { CustomUpload } from './elements/Upload.js'\n\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\n\nexport type {\n ArrayFieldClientComponent,\n ArrayFieldClientProps,\n ArrayFieldDescriptionClientComponent,\n ArrayFieldDescriptionServerComponent,\n ArrayFieldDiffClientComponent,\n ArrayFieldDiffServerComponent,\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldServerComponent,\n ArrayFieldServerProps,\n} from './fields/Array.js'\n\nexport type {\n BlockRowLabelClientComponent,\n BlockRowLabelServerComponent,\n BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldDescriptionClientComponent,\n BlocksFieldDescriptionServerComponent,\n BlocksFieldDiffClientComponent,\n BlocksFieldDiffServerComponent,\n BlocksFieldErrorClientComponent,\n BlocksFieldErrorServerComponent,\n BlocksFieldLabelClientComponent,\n BlocksFieldLabelServerComponent,\n BlocksFieldServerComponent,\n BlocksFieldServerProps,\n} from './fields/Blocks.js'\n\nexport type {\n CheckboxFieldClientComponent,\n CheckboxFieldClientProps,\n CheckboxFieldDescriptionClientComponent,\n CheckboxFieldDescriptionServerComponent,\n CheckboxFieldDiffClientComponent,\n CheckboxFieldDiffServerComponent,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldServerComponent,\n CheckboxFieldServerProps,\n} from './fields/Checkbox.js'\n\nexport type {\n CodeFieldClientComponent,\n CodeFieldClientProps,\n CodeFieldDescriptionClientComponent,\n CodeFieldDescriptionServerComponent,\n CodeFieldDiffClientComponent,\n CodeFieldDiffServerComponent,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldServerComponent,\n CodeFieldServerProps,\n} from './fields/Code.js'\n\nexport type {\n CollapsibleFieldClientComponent,\n CollapsibleFieldClientProps,\n CollapsibleFieldDescriptionClientComponent,\n CollapsibleFieldDescriptionServerComponent,\n CollapsibleFieldDiffClientComponent,\n CollapsibleFieldDiffServerComponent,\n CollapsibleFieldErrorClientComponent,\n CollapsibleFieldErrorServerComponent,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldServerComponent,\n CollapsibleFieldServerProps,\n} from './fields/Collapsible.js'\n\nexport type {\n DateFieldClientComponent,\n DateFieldClientProps,\n DateFieldDescriptionClientComponent,\n DateFieldDescriptionServerComponent,\n DateFieldDiffClientComponent,\n DateFieldDiffServerComponent,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldServerComponent,\n DateFieldServerProps,\n} from './fields/Date.js'\n\nexport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldDescriptionClientComponent,\n EmailFieldDescriptionServerComponent,\n EmailFieldDiffClientComponent,\n EmailFieldDiffServerComponent,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldServerComponent,\n EmailFieldServerProps,\n} from './fields/Email.js'\n\nexport type {\n GroupFieldClientComponent,\n GroupFieldClientProps,\n GroupFieldDescriptionClientComponent,\n GroupFieldDescriptionServerComponent,\n GroupFieldDiffClientComponent,\n GroupFieldDiffServerComponent,\n GroupFieldErrorClientComponent,\n GroupFieldErrorServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldServerComponent,\n GroupFieldServerProps,\n} from './fields/Group.js'\n\nexport type { HiddenFieldProps } from './fields/Hidden.js'\n\nexport type {\n JoinFieldClientComponent,\n JoinFieldClientProps,\n JoinFieldDescriptionClientComponent,\n JoinFieldDescriptionServerComponent,\n JoinFieldDiffClientComponent,\n JoinFieldDiffServerComponent,\n JoinFieldErrorClientComponent,\n JoinFieldErrorServerComponent,\n JoinFieldLabelClientComponent,\n JoinFieldLabelServerComponent,\n JoinFieldServerComponent,\n JoinFieldServerProps,\n} from './fields/Join.js'\n\nexport type {\n JSONFieldClientComponent,\n JSONFieldClientProps,\n JSONFieldDescriptionClientComponent,\n JSONFieldDescriptionServerComponent,\n JSONFieldDiffClientComponent,\n JSONFieldDiffServerComponent,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldServerComponent,\n JSONFieldServerProps,\n} from './fields/JSON.js'\n\nexport type {\n NumberFieldClientComponent,\n NumberFieldClientProps,\n NumberFieldDescriptionClientComponent,\n NumberFieldDescriptionServerComponent,\n NumberFieldDiffClientComponent,\n NumberFieldDiffServerComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldServerComponent,\n NumberFieldServerProps,\n} from './fields/Number.js'\n\nexport type {\n PointFieldClientComponent,\n PointFieldClientProps,\n PointFieldDescriptionClientComponent,\n PointFieldDescriptionServerComponent,\n PointFieldDiffClientComponent,\n PointFieldDiffServerComponent,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldServerComponent,\n PointFieldServerProps,\n} from './fields/Point.js'\n\nexport type {\n RadioFieldClientComponent,\n RadioFieldClientProps,\n RadioFieldDescriptionClientComponent,\n RadioFieldDescriptionServerComponent,\n RadioFieldDiffClientComponent,\n RadioFieldDiffServerComponent,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldServerComponent,\n RadioFieldServerProps,\n} from './fields/Radio.js'\n\nexport type {\n RelationshipFieldClientComponent,\n RelationshipFieldClientProps,\n RelationshipFieldDescriptionClientComponent,\n RelationshipFieldDescriptionServerComponent,\n RelationshipFieldDiffClientComponent,\n RelationshipFieldDiffServerComponent,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldServerComponent,\n RelationshipFieldServerProps,\n} from './fields/Relationship.js'\n\nexport type {\n RichTextFieldClientComponent,\n RichTextFieldClientProps,\n RichTextFieldDescriptionClientComponent,\n RichTextFieldDescriptionServerComponent,\n RichTextFieldDiffClientComponent,\n RichTextFieldDiffServerComponent,\n RichTextFieldErrorClientComponent,\n RichTextFieldErrorServerComponent,\n RichTextFieldLabelClientComponent,\n RichTextFieldLabelServerComponent,\n RichTextFieldServerComponent,\n RichTextFieldServerProps,\n} from './fields/RichText.js'\n\nexport type {\n RowFieldClientComponent,\n RowFieldClientProps,\n RowFieldDescriptionClientComponent,\n RowFieldDescriptionServerComponent,\n RowFieldDiffClientComponent,\n RowFieldDiffServerComponent,\n RowFieldErrorClientComponent,\n RowFieldErrorServerComponent,\n RowFieldLabelClientComponent,\n RowFieldLabelServerComponent,\n RowFieldServerComponent,\n RowFieldServerProps,\n} from './fields/Row.js'\n\nexport type {\n SelectFieldClientComponent,\n SelectFieldClientProps,\n SelectFieldDescriptionClientComponent,\n SelectFieldDescriptionServerComponent,\n SelectFieldDiffClientComponent,\n SelectFieldDiffServerComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldServerComponent,\n SelectFieldServerProps,\n} from './fields/Select.js'\n\nexport type {\n ClientTab,\n TabsFieldClientComponent,\n TabsFieldClientProps,\n TabsFieldDescriptionClientComponent,\n TabsFieldDescriptionServerComponent,\n TabsFieldDiffClientComponent,\n TabsFieldDiffServerComponent,\n TabsFieldErrorClientComponent,\n TabsFieldErrorServerComponent,\n TabsFieldLabelClientComponent,\n TabsFieldLabelServerComponent,\n TabsFieldServerComponent,\n TabsFieldServerProps,\n} from './fields/Tabs.js'\n\nexport type {\n TextFieldClientComponent,\n TextFieldClientProps,\n TextFieldDescriptionClientComponent,\n TextFieldDescriptionServerComponent,\n TextFieldDiffClientComponent,\n TextFieldDiffServerComponent,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n TextFieldServerComponent,\n TextFieldServerProps,\n} from './fields/Text.js'\n\nexport type {\n TextareaFieldClientComponent,\n TextareaFieldClientProps,\n TextareaFieldDescriptionClientComponent,\n TextareaFieldDescriptionServerComponent,\n TextareaFieldDiffClientComponent,\n TextareaFieldDiffServerComponent,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldServerComponent,\n TextareaFieldServerProps,\n} from './fields/Textarea.js'\n\nexport type {\n UIFieldClientComponent,\n UIFieldClientProps,\n UIFieldDiffClientComponent,\n UIFieldDiffServerComponent,\n UIFieldServerComponent,\n UIFieldServerProps,\n} from './fields/UI.js'\n\nexport type {\n UploadFieldClientComponent,\n UploadFieldClientProps,\n UploadFieldDescriptionClientComponent,\n UploadFieldDescriptionServerComponent,\n UploadFieldDiffClientComponent,\n UploadFieldDiffServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldServerComponent,\n UploadFieldServerProps,\n} from './fields/Upload.js'\n\nexport type {\n Description,\n DescriptionFunction,\n FieldDescriptionClientComponent,\n FieldDescriptionClientProps,\n FieldDescriptionServerComponent,\n FieldDescriptionServerProps,\n GenericDescriptionProps,\n StaticDescription,\n} from './forms/Description.js'\n\nexport type {\n BaseVersionField,\n DiffMethod,\n FieldDiffClientComponent,\n FieldDiffClientProps,\n FieldDiffServerComponent,\n FieldDiffServerProps,\n VersionField,\n VersionTab,\n} from './forms/Diff.js'\n\nexport type {\n BuildFormStateArgs,\n Data,\n FieldState as FormField,\n FieldStateWithoutComponents as FormFieldWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n}\n\nexport type {\n FieldErrorClientComponent,\n FieldErrorClientProps,\n FieldErrorServerComponent,\n FieldErrorServerProps,\n GenericErrorProps,\n} from './forms/Error.js'\n\nexport type {\n ClientComponentProps,\n ClientFieldBase,\n ClientFieldWithOptionalType,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerComponentProps,\n ServerFieldBase,\n} from './forms/Field.js'\n\nexport type {\n FieldLabelClientComponent,\n FieldLabelClientProps,\n FieldLabelServerComponent,\n FieldLabelServerProps,\n GenericLabelProps,\n SanitizedLabelProps,\n} from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<any>\n RenderedComponent: React.ReactNode\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n type: 'client'\n}\n\nexport type MappedEmptyComponent = {\n type: 'empty'\n}\n\nexport enum Action {\n RenderConfig = 'render-config',\n}\n\nexport type RenderEntityConfigArgs = {\n collectionSlug?: string\n data?: Data\n globalSlug?: string\n}\n\nexport type RenderRootConfigArgs = {}\n\nexport type RenderFieldConfigArgs = {\n collectionSlug?: string\n formState?: FormState\n globalSlug?: string\n schemaPath: string\n}\n\nexport type RenderConfigArgs = {\n action: Action.RenderConfig\n config: Promise<SanitizedConfig> | SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n languageCode: AcceptedLanguages\n serverProps?: any\n} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs)\n\nexport type PayloadServerAction = (\n args:\n | {\n [key: string]: any\n action: Action\n i18n: I18nClient\n }\n | RenderConfigArgs,\n) => Promise<string>\n\nexport type RenderedField = {\n Field: React.ReactNode\n indexPath?: string\n initialSchemaPath?: string\n /**\n * @deprecated\n * This is a legacy property that will be removed in v4.\n * Please use `fieldIsSidebar(field)` from `payload` instead.\n * Or check `field.admin.position === 'sidebar'` directly.\n */\n isSidebar: boolean\n path: string\n schemaPath: string\n type: FieldTypes\n}\n\nexport type FieldRow = {\n RowLabel?: React.ReactNode\n}\n\nexport type DocumentSlots = {\n BeforeDocumentControls?: React.ReactNode\n BeforeDocumentMeta?: React.ReactNode\n Description?: React.ReactNode\n EditMenuItems?: React.ReactNode\n LivePreview?: React.ReactNode\n PreviewButton?: React.ReactNode\n PublishButton?: React.ReactNode\n SaveButton?: React.ReactNode\n SaveDraftButton?: React.ReactNode\n Status?: React.ReactNode\n UnpublishButton?: React.ReactNode\n Upload?: React.ReactNode\n UploadControls?: React.ReactNode\n UploadFilePreview?: React.ReactNode\n}\n\nexport type {\n BuildTableStateArgs,\n DefaultServerFunctionArgs,\n InitReqResult,\n ListQuery,\n ServerFunction,\n ServerFunctionArgs,\n ServerFunctionClient,\n ServerFunctionClientArgs,\n ServerFunctionConfig,\n ServerFunctionHandler,\n SlugifyServerFunctionArgs,\n} from './functions/index.js'\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js'\n\nexport { type WidgetServerProps } from './views/dashboard.js'\n\nexport type {\n BeforeDocumentControlsClientProps,\n BeforeDocumentControlsServerProps,\n BeforeDocumentControlsServerPropsOnly,\n DocumentSubViewTypes,\n DocumentTabClientProps,\n /**\n * @deprecated\n * The `DocumentTabComponent` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps`or `DocumentTabClientProps` instead.\n */\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n /**\n * @deprecated\n * The `DocumentTabProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps` instead.\n */\n DocumentTabServerProps as DocumentTabProps,\n DocumentTabServerProps,\n DocumentTabServerPropsOnly,\n /**\n * @deprecated\n * The `ClientSideEditViewProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentViewClientProps` instead.\n */\n DocumentViewClientProps as ClientSideEditViewProps,\n DocumentViewClientProps,\n /**\n * @deprecated\n * The `ServerSideEditViewProps` is deprecated and will be removed in the next major version.\n * Use `DocumentViewServerProps` instead.\n */\n DocumentViewServerProps as ServerSideEditViewProps,\n DocumentViewServerProps,\n DocumentViewServerPropsOnly,\n EditViewProps,\n RenderDocumentVersionsProperties,\n} from './views/document.js'\n\nexport type { RelatedDocumentsGrouped } from './views/hierarchyList.js'\n\nexport type {\n AdminViewClientProps,\n /**\n * @deprecated\n * The `AdminViewComponent` type is deprecated and will be removed in the next major version.\n * Type your component props directly instead.\n */\n AdminViewComponent,\n AdminViewConfig,\n /**\n * @deprecated\n * The `AdminViewProps` type is deprecated and will be removed in the next major version.\n * Use `AdminViewServerProps` instead.\n */\n AdminViewServerProps as AdminViewProps,\n AdminViewServerProps,\n AdminViewServerPropsOnly,\n InitPageResult,\n ServerPropsFromView,\n ViewDescriptionClientProps,\n ViewDescriptionServerProps,\n ViewDescriptionServerPropsOnly,\n ViewTypes,\n VisibleEntities,\n} from './views/index.js'\n\nexport type {\n AfterListClientProps,\n AfterListServerProps,\n AfterListServerPropsOnly,\n AfterListTableClientProps,\n AfterListTableServerProps,\n AfterListTableServerPropsOnly,\n BeforeListClientProps,\n BeforeListServerProps,\n BeforeListServerPropsOnly,\n BeforeListTableClientProps,\n BeforeListTableServerProps,\n BeforeListTableServerPropsOnly,\n HierarchyViewData,\n ListViewClientProps,\n ListViewServerProps,\n ListViewServerPropsOnly,\n ListViewSlots,\n ListViewSlotSharedClientProps,\n NoResultsClientProps,\n NoResultsServerProps,\n NoResultsServerPropsOnly,\n} from './views/list.js'\n\ntype SchemaPath = {} & string\nexport type FieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: Field[]\n }\n | Block\n | Field\n | Tab\n>\n\nexport type ClientFieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: ClientField[]\n }\n | ClientBlock\n | ClientField\n | ClientTab\n>\n\nexport type DocumentEvent = {\n doc?: TypeWithID\n drawerSlug?: string\n entitySlug: string\n id?: number | string\n operation: 'create' | 'delete' | 'update'\n updatedAt: string\n}\n"],"names":["Action"],"mappings":"AAmgBA,OAAO,IAAA,AAAKA,gCAAAA;;WAAAA;MAEX"}
|
|
1
|
+
{"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type {\n Block,\n ClientBlock,\n ClientField,\n Field,\n FieldTypes,\n Tab,\n} from '../fields/config/types.js'\nimport type { JsonObject } from '../types/index.js'\nimport type { ClientTab } from './fields/Tabs.js'\nimport type {\n BuildFormStateArgs,\n Data,\n FieldState,\n FieldStateWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n} from './forms/Form.js'\n\nexport type {\n /**\n * @deprecated\n * The `CustomPreviewButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPreviewButton,\n /**\n * @deprecated\n * The `CustomPublishButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPublishButton,\n /**\n * @deprecated\n * The `CustomSaveButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveButton,\n /**\n * @deprecated\n * The `CustomSaveDraftButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveDraftButton,\n} from '../config/types.js'\nexport type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type {\n EditMenuItemsClientProps,\n EditMenuItemsServerProps,\n EditMenuItemsServerPropsOnly,\n} from './elements/EditMenuItems.js'\nexport type {\n NavGroupPreferences,\n NavPreferences,\n SidebarTabClientProps,\n SidebarTabServerProps,\n SidebarTabServerPropsOnly,\n} from './elements/Nav.js'\nexport type {\n PreviewButtonClientProps,\n PreviewButtonServerProps,\n PreviewButtonServerPropsOnly,\n} from './elements/PreviewButton.js'\nexport type {\n PublishButtonClientProps,\n PublishButtonServerProps,\n PublishButtonServerPropsOnly,\n} from './elements/PublishButton.js'\nexport type {\n SaveButtonClientProps,\n SaveButtonServerProps,\n SaveButtonServerPropsOnly,\n} from './elements/SaveButton.js'\nexport type {\n SaveDraftButtonClientProps,\n SaveDraftButtonServerProps,\n SaveDraftButtonServerPropsOnly,\n} from './elements/SaveDraftButton.js'\nexport type { CustomStatus } from './elements/Status.js'\n\nexport type { Column } from './elements/Table.js'\n\nexport type {\n UnpublishButtonClientProps,\n UnpublishButtonServerProps,\n UnpublishButtonServerPropsOnly,\n} from './elements/UnpublishButton.js'\n\nexport type { CustomUpload } from './elements/Upload.js'\n\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\n\nexport type {\n ArrayFieldClientComponent,\n ArrayFieldClientProps,\n ArrayFieldDescriptionClientComponent,\n ArrayFieldDescriptionServerComponent,\n ArrayFieldDiffClientComponent,\n ArrayFieldDiffServerComponent,\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldServerComponent,\n ArrayFieldServerProps,\n} from './fields/Array.js'\n\nexport type {\n BlockRowLabelClientComponent,\n BlockRowLabelServerComponent,\n BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldDescriptionClientComponent,\n BlocksFieldDescriptionServerComponent,\n BlocksFieldDiffClientComponent,\n BlocksFieldDiffServerComponent,\n BlocksFieldErrorClientComponent,\n BlocksFieldErrorServerComponent,\n BlocksFieldLabelClientComponent,\n BlocksFieldLabelServerComponent,\n BlocksFieldServerComponent,\n BlocksFieldServerProps,\n} from './fields/Blocks.js'\n\nexport type {\n CheckboxFieldClientComponent,\n CheckboxFieldClientProps,\n CheckboxFieldDescriptionClientComponent,\n CheckboxFieldDescriptionServerComponent,\n CheckboxFieldDiffClientComponent,\n CheckboxFieldDiffServerComponent,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldServerComponent,\n CheckboxFieldServerProps,\n} from './fields/Checkbox.js'\n\nexport type {\n CodeFieldClientComponent,\n CodeFieldClientProps,\n CodeFieldDescriptionClientComponent,\n CodeFieldDescriptionServerComponent,\n CodeFieldDiffClientComponent,\n CodeFieldDiffServerComponent,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldServerComponent,\n CodeFieldServerProps,\n} from './fields/Code.js'\n\nexport type {\n CollapsibleFieldClientComponent,\n CollapsibleFieldClientProps,\n CollapsibleFieldDescriptionClientComponent,\n CollapsibleFieldDescriptionServerComponent,\n CollapsibleFieldDiffClientComponent,\n CollapsibleFieldDiffServerComponent,\n CollapsibleFieldErrorClientComponent,\n CollapsibleFieldErrorServerComponent,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldServerComponent,\n CollapsibleFieldServerProps,\n} from './fields/Collapsible.js'\n\nexport type {\n DateFieldClientComponent,\n DateFieldClientProps,\n DateFieldDescriptionClientComponent,\n DateFieldDescriptionServerComponent,\n DateFieldDiffClientComponent,\n DateFieldDiffServerComponent,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldServerComponent,\n DateFieldServerProps,\n} from './fields/Date.js'\n\nexport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldDescriptionClientComponent,\n EmailFieldDescriptionServerComponent,\n EmailFieldDiffClientComponent,\n EmailFieldDiffServerComponent,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldServerComponent,\n EmailFieldServerProps,\n} from './fields/Email.js'\n\nexport type {\n GroupFieldClientComponent,\n GroupFieldClientProps,\n GroupFieldDescriptionClientComponent,\n GroupFieldDescriptionServerComponent,\n GroupFieldDiffClientComponent,\n GroupFieldDiffServerComponent,\n GroupFieldErrorClientComponent,\n GroupFieldErrorServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldServerComponent,\n GroupFieldServerProps,\n} from './fields/Group.js'\n\nexport type { HiddenFieldProps } from './fields/Hidden.js'\n\nexport type {\n JoinFieldClientComponent,\n JoinFieldClientProps,\n JoinFieldDescriptionClientComponent,\n JoinFieldDescriptionServerComponent,\n JoinFieldDiffClientComponent,\n JoinFieldDiffServerComponent,\n JoinFieldErrorClientComponent,\n JoinFieldErrorServerComponent,\n JoinFieldLabelClientComponent,\n JoinFieldLabelServerComponent,\n JoinFieldServerComponent,\n JoinFieldServerProps,\n} from './fields/Join.js'\n\nexport type {\n JSONFieldClientComponent,\n JSONFieldClientProps,\n JSONFieldDescriptionClientComponent,\n JSONFieldDescriptionServerComponent,\n JSONFieldDiffClientComponent,\n JSONFieldDiffServerComponent,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldServerComponent,\n JSONFieldServerProps,\n} from './fields/JSON.js'\n\nexport type {\n NumberFieldClientComponent,\n NumberFieldClientProps,\n NumberFieldDescriptionClientComponent,\n NumberFieldDescriptionServerComponent,\n NumberFieldDiffClientComponent,\n NumberFieldDiffServerComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldServerComponent,\n NumberFieldServerProps,\n} from './fields/Number.js'\n\nexport type {\n PointFieldClientComponent,\n PointFieldClientProps,\n PointFieldDescriptionClientComponent,\n PointFieldDescriptionServerComponent,\n PointFieldDiffClientComponent,\n PointFieldDiffServerComponent,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldServerComponent,\n PointFieldServerProps,\n} from './fields/Point.js'\n\nexport type {\n RadioFieldClientComponent,\n RadioFieldClientProps,\n RadioFieldDescriptionClientComponent,\n RadioFieldDescriptionServerComponent,\n RadioFieldDiffClientComponent,\n RadioFieldDiffServerComponent,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldServerComponent,\n RadioFieldServerProps,\n} from './fields/Radio.js'\n\nexport type {\n RelationshipFieldClientComponent,\n RelationshipFieldClientProps,\n RelationshipFieldDescriptionClientComponent,\n RelationshipFieldDescriptionServerComponent,\n RelationshipFieldDiffClientComponent,\n RelationshipFieldDiffServerComponent,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldServerComponent,\n RelationshipFieldServerProps,\n} from './fields/Relationship.js'\n\nexport type {\n RichTextFieldClientComponent,\n RichTextFieldClientProps,\n RichTextFieldDescriptionClientComponent,\n RichTextFieldDescriptionServerComponent,\n RichTextFieldDiffClientComponent,\n RichTextFieldDiffServerComponent,\n RichTextFieldErrorClientComponent,\n RichTextFieldErrorServerComponent,\n RichTextFieldLabelClientComponent,\n RichTextFieldLabelServerComponent,\n RichTextFieldServerComponent,\n RichTextFieldServerProps,\n} from './fields/RichText.js'\n\nexport type {\n RowFieldClientComponent,\n RowFieldClientProps,\n RowFieldDescriptionClientComponent,\n RowFieldDescriptionServerComponent,\n RowFieldDiffClientComponent,\n RowFieldDiffServerComponent,\n RowFieldErrorClientComponent,\n RowFieldErrorServerComponent,\n RowFieldLabelClientComponent,\n RowFieldLabelServerComponent,\n RowFieldServerComponent,\n RowFieldServerProps,\n} from './fields/Row.js'\n\nexport type {\n SelectFieldClientComponent,\n SelectFieldClientProps,\n SelectFieldDescriptionClientComponent,\n SelectFieldDescriptionServerComponent,\n SelectFieldDiffClientComponent,\n SelectFieldDiffServerComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldServerComponent,\n SelectFieldServerProps,\n} from './fields/Select.js'\n\nexport type {\n ClientTab,\n TabsFieldClientComponent,\n TabsFieldClientProps,\n TabsFieldDescriptionClientComponent,\n TabsFieldDescriptionServerComponent,\n TabsFieldDiffClientComponent,\n TabsFieldDiffServerComponent,\n TabsFieldErrorClientComponent,\n TabsFieldErrorServerComponent,\n TabsFieldLabelClientComponent,\n TabsFieldLabelServerComponent,\n TabsFieldServerComponent,\n TabsFieldServerProps,\n} from './fields/Tabs.js'\n\nexport type {\n TextFieldClientComponent,\n TextFieldClientProps,\n TextFieldDescriptionClientComponent,\n TextFieldDescriptionServerComponent,\n TextFieldDiffClientComponent,\n TextFieldDiffServerComponent,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n TextFieldServerComponent,\n TextFieldServerProps,\n} from './fields/Text.js'\n\nexport type {\n TextareaFieldClientComponent,\n TextareaFieldClientProps,\n TextareaFieldDescriptionClientComponent,\n TextareaFieldDescriptionServerComponent,\n TextareaFieldDiffClientComponent,\n TextareaFieldDiffServerComponent,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldServerComponent,\n TextareaFieldServerProps,\n} from './fields/Textarea.js'\n\nexport type {\n UIFieldClientComponent,\n UIFieldClientProps,\n UIFieldDiffClientComponent,\n UIFieldDiffServerComponent,\n UIFieldServerComponent,\n UIFieldServerProps,\n} from './fields/UI.js'\n\nexport type {\n UploadFieldClientComponent,\n UploadFieldClientProps,\n UploadFieldDescriptionClientComponent,\n UploadFieldDescriptionServerComponent,\n UploadFieldDiffClientComponent,\n UploadFieldDiffServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldServerComponent,\n UploadFieldServerProps,\n} from './fields/Upload.js'\n\nexport type {\n Description,\n DescriptionFunction,\n FieldDescriptionClientComponent,\n FieldDescriptionClientProps,\n FieldDescriptionServerComponent,\n FieldDescriptionServerProps,\n GenericDescriptionProps,\n StaticDescription,\n} from './forms/Description.js'\n\nexport type {\n BaseVersionField,\n DiffMethod,\n FieldDiffClientComponent,\n FieldDiffClientProps,\n FieldDiffServerComponent,\n FieldDiffServerProps,\n VersionField,\n VersionTab,\n} from './forms/Diff.js'\n\nexport type {\n BuildFormStateArgs,\n Data,\n FieldState as FormField,\n FieldStateWithoutComponents as FormFieldWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n}\n\nexport type {\n FieldErrorClientComponent,\n FieldErrorClientProps,\n FieldErrorServerComponent,\n FieldErrorServerProps,\n GenericErrorProps,\n} from './forms/Error.js'\n\nexport type {\n ClientComponentProps,\n ClientFieldBase,\n ClientFieldWithOptionalType,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerComponentProps,\n ServerFieldBase,\n} from './forms/Field.js'\n\nexport type {\n FieldLabelClientComponent,\n FieldLabelClientProps,\n FieldLabelServerComponent,\n FieldLabelServerProps,\n GenericLabelProps,\n SanitizedLabelProps,\n} from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<any>\n RenderedComponent: React.ReactNode\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n type: 'client'\n}\n\nexport type MappedEmptyComponent = {\n type: 'empty'\n}\n\nexport enum Action {\n RenderConfig = 'render-config',\n}\n\nexport type RenderEntityConfigArgs = {\n collectionSlug?: string\n data?: Data\n globalSlug?: string\n}\n\nexport type RenderRootConfigArgs = {}\n\nexport type RenderFieldConfigArgs = {\n collectionSlug?: string\n formState?: FormState\n globalSlug?: string\n schemaPath: string\n}\n\nexport type RenderConfigArgs = {\n action: Action.RenderConfig\n config: Promise<SanitizedConfig> | SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n languageCode: AcceptedLanguages\n serverProps?: any\n} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs)\n\nexport type PayloadServerAction = (\n args:\n | {\n [key: string]: any\n action: Action\n i18n: I18nClient\n }\n | RenderConfigArgs,\n) => Promise<string>\n\nexport type RenderedField = {\n Field: React.ReactNode\n indexPath?: string\n initialSchemaPath?: string\n /**\n * @deprecated\n * This is a legacy property that will be removed in v4.\n * Please use `fieldIsSidebar(field)` from `payload` instead.\n * Or check `field.admin.position === 'sidebar'` directly.\n */\n isSidebar: boolean\n path: string\n schemaPath: string\n type: FieldTypes\n}\n\nexport type FieldRow = {\n RowLabel?: React.ReactNode\n}\n\nexport type DocumentSlots = {\n BeforeDocumentControls?: React.ReactNode\n BeforeDocumentMeta?: React.ReactNode\n Description?: React.ReactNode\n EditMenuItems?: React.ReactNode\n LivePreview?: React.ReactNode\n PreviewButton?: React.ReactNode\n PublishButton?: React.ReactNode\n SaveButton?: React.ReactNode\n SaveDraftButton?: React.ReactNode\n Status?: React.ReactNode\n UnpublishButton?: React.ReactNode\n Upload?: React.ReactNode\n UploadControls?: React.ReactNode\n UploadFilePreview?: React.ReactNode\n}\n\nexport type {\n BuildTableStateArgs,\n DefaultServerFunctionArgs,\n InitReqResult,\n ListQuery,\n ServerFunction,\n ServerFunctionArgs,\n ServerFunctionClient,\n ServerFunctionClientArgs,\n ServerFunctionConfig,\n ServerFunctionHandler,\n SlugifyServerFunctionArgs,\n} from './functions/index.js'\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js'\n\nexport { type WidgetServerProps } from './views/dashboard.js'\n\nexport type {\n BeforeDocumentControlsClientProps,\n BeforeDocumentControlsServerProps,\n BeforeDocumentControlsServerPropsOnly,\n DocumentSubViewTypes,\n DocumentTabClientProps,\n /**\n * @deprecated\n * The `DocumentTabComponent` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps`or `DocumentTabClientProps` instead.\n */\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n /**\n * @deprecated\n * The `DocumentTabProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps` instead.\n */\n DocumentTabServerProps as DocumentTabProps,\n DocumentTabServerProps,\n DocumentTabServerPropsOnly,\n /**\n * @deprecated\n * The `ClientSideEditViewProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentViewClientProps` instead.\n */\n DocumentViewClientProps as ClientSideEditViewProps,\n DocumentViewClientProps,\n /**\n * @deprecated\n * The `ServerSideEditViewProps` is deprecated and will be removed in the next major version.\n * Use `DocumentViewServerProps` instead.\n */\n DocumentViewServerProps as ServerSideEditViewProps,\n DocumentViewServerProps,\n DocumentViewServerPropsOnly,\n EditViewProps,\n RenderDocumentVersionsProperties,\n} from './views/document.js'\n\nexport type { RelatedDocumentsGrouped } from './views/hierarchyList.js'\n\nexport type {\n AdminViewClientProps,\n /**\n * @deprecated\n * The `AdminViewComponent` type is deprecated and will be removed in the next major version.\n * Type your component props directly instead.\n */\n AdminViewComponent,\n AdminViewConfig,\n /**\n * @deprecated\n * The `AdminViewProps` type is deprecated and will be removed in the next major version.\n * Use `AdminViewServerProps` instead.\n */\n AdminViewServerProps as AdminViewProps,\n AdminViewServerProps,\n AdminViewServerPropsOnly,\n InitPageResult,\n ServerPropsFromView,\n ViewDescriptionClientProps,\n ViewDescriptionServerProps,\n ViewDescriptionServerPropsOnly,\n ViewTypes,\n VisibleEntities,\n} from './views/index.js'\n\nexport type {\n AfterListClientProps,\n AfterListServerProps,\n AfterListServerPropsOnly,\n AfterListTableClientProps,\n AfterListTableServerProps,\n AfterListTableServerPropsOnly,\n BeforeListClientProps,\n BeforeListServerProps,\n BeforeListServerPropsOnly,\n BeforeListTableClientProps,\n BeforeListTableServerProps,\n BeforeListTableServerPropsOnly,\n HierarchyViewData,\n ListViewClientProps,\n ListViewServerProps,\n ListViewServerPropsOnly,\n ListViewSlots,\n ListViewSlotSharedClientProps,\n NoResultsClientProps,\n NoResultsServerProps,\n NoResultsServerPropsOnly,\n} from './views/list.js'\n\ntype SchemaPath = {} & string\nexport type FieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: Field[]\n }\n | Block\n | Field\n | Tab\n>\n\nexport type ClientFieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: ClientField[]\n }\n | ClientBlock\n | ClientField\n | ClientTab\n>\n\nexport type DocumentEvent = {\n doc?: TypeWithID\n drawerSlug?: string\n entitySlug: string\n id?: number | string\n operation: 'create' | 'delete' | 'update'\n updatedAt: string\n}\n"],"names":["Action"],"mappings":"AAmgBA,OAAO,IAAA,AAAKA,gCAAAA;;WAAAA;MAEX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClientTranslationsObject } from '@payloadcms/translations';
|
|
2
2
|
import type { SanitizedPermissions } from '../../auth/index.js';
|
|
3
|
-
import type { ImportMap } from '../../
|
|
3
|
+
import type { ImportMap } from '../../bin/generateImportMap/index.js';
|
|
4
4
|
import type { SanitizedCollectionConfig } from '../../collections/config/types.js';
|
|
5
5
|
import type { ClientConfig } from '../../config/client.js';
|
|
6
6
|
import type { CustomComponent, Locale, MetaConfig, PayloadComponent, SanitizedConfig, ServerProps } from '../../config/types.js';
|
|
@@ -10,7 +10,7 @@ import type { LanguageOptions } from '../LanguageOptions.js';
|
|
|
10
10
|
import type { Data, StaticDescription } from '../types.js';
|
|
11
11
|
import type { DocumentSubViewTypes } from './document.js';
|
|
12
12
|
export type AdminViewConfig = {
|
|
13
|
-
Component: PayloadComponent
|
|
13
|
+
Component: PayloadComponent<AdminViewServerProps>;
|
|
14
14
|
/** Whether the path should be matched exactly or as a prefix */
|
|
15
15
|
exact?: boolean;
|
|
16
16
|
meta?: MetaConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EACV,eAAe,EACf,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE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AAG;IACvC,cAAc,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAClD,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG,EAAE,GAAG,WAAW,CAAA;AAE7D,MAAM,MAAM,0BAA0B,GAAG,0BAA0B,GAAG,8BAA8B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/views/index.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { SanitizedPermissions } from '../../auth/index.js'\nimport type { ImportMap } from '../../
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/views/index.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { SanitizedPermissions } from '../../auth/index.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { ClientConfig } from '../../config/client.js'\nimport type {\n CustomComponent,\n Locale,\n MetaConfig,\n PayloadComponent,\n SanitizedConfig,\n ServerProps,\n} from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { LanguageOptions } from '../LanguageOptions.js'\nimport type { Data, StaticDescription } from '../types.js'\nimport type { DocumentSubViewTypes } from './document.js'\n\nexport type AdminViewConfig = {\n Component: PayloadComponent<AdminViewServerProps>\n /** Whether the path should be matched exactly or as a prefix */\n exact?: boolean\n meta?: MetaConfig\n /**\n * Any valid URL path or array of paths that [`path-to-regexp`](https://www.npmjs.com/package/path-to-regex) understands. Must begin with a forward slash (`/`).\n */\n path?: `/${string}`\n sensitive?: boolean\n strict?: boolean\n}\n\nexport type AdminViewClientProps = {\n clientConfig: ClientConfig\n collectionSlug?: SanitizedCollectionConfig['slug']\n docID?: number | string\n documentSubViewType?: DocumentSubViewTypes\n folderID?: number | string\n globalSlug?: SanitizedGlobalConfig['slug']\n viewType: ViewTypes\n}\n\nexport type AdminViewServerPropsOnly = {\n readonly clientConfig: ClientConfig\n readonly collectionConfig?: SanitizedCollectionConfig\n readonly disableActions?: boolean\n /**\n * @todo remove `docID` here as it is already contained in `initPageResult`\n */\n readonly docID?: number | string\n readonly globalConfig?: SanitizedGlobalConfig\n readonly importMap: ImportMap\n readonly initialData?: Data\n readonly initPageResult: InitPageResult\n readonly params?: { [key: string]: string | string[] | undefined }\n readonly redirectAfterCreate?: boolean\n readonly redirectAfterDelete?: boolean\n readonly redirectAfterDuplicate?: boolean\n readonly redirectAfterRestore?: boolean\n readonly viewActions?: CustomComponent[]\n} & ServerProps\n\nexport type AdminViewServerProps = AdminViewClientProps & AdminViewServerPropsOnly\n\n/**\n * @deprecated This should be removed in favor of direct props\n */\nexport type AdminViewComponent = PayloadComponent<AdminViewServerProps>\n\nexport type VisibleEntities = {\n collections: SanitizedCollectionConfig['slug'][]\n globals: SanitizedGlobalConfig['slug'][]\n}\n\nexport type InitPageResult = {\n collectionConfig?: SanitizedCollectionConfig\n cookies: Map<string, string>\n docID?: number | string\n globalConfig?: SanitizedGlobalConfig\n languageOptions: LanguageOptions\n locale?: Locale\n permissions: SanitizedPermissions\n redirectTo?: string\n req: PayloadRequest\n translations: ClientTranslationsObject\n visibleEntities: VisibleEntities\n}\n\n/**\n * @todo This should be renamed to `ViewType` (singular)\n */\nexport type ViewTypes =\n | 'account'\n | 'createFirstUser'\n | 'dashboard'\n | 'document'\n | 'hierarchy'\n | 'list'\n | 'reset'\n | 'trash'\n | 'verify'\n | 'version'\n | ({} & string)\n\nexport type ServerPropsFromView = {\n collectionConfig?: SanitizedConfig['collections'][number]\n globalConfig?: SanitizedConfig['globals'][number]\n viewActions: CustomComponent[]\n}\n\n// Description\nexport type ViewDescriptionClientProps = {\n collectionSlug?: SanitizedCollectionConfig['slug']\n description: StaticDescription\n}\n\nexport type ViewDescriptionServerPropsOnly = {} & ServerProps\n\nexport type ViewDescriptionServerProps = ViewDescriptionClientProps & ViewDescriptionServerPropsOnly\n"],"names":[],"mappings":"AAuHA,WAAoG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/endpoints/refresh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/endpoints/refresh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,cAAc,EAAE,cAwC5B,CAAA"}
|
|
@@ -14,21 +14,19 @@ export const refreshHandler = async (req)=>{
|
|
|
14
14
|
collection,
|
|
15
15
|
req
|
|
16
16
|
});
|
|
17
|
+
const { refreshedToken, ...resultWithoutToken } = result;
|
|
17
18
|
if (result.setCookie) {
|
|
18
19
|
const cookie = generatePayloadCookie({
|
|
19
20
|
collectionAuthConfig: collection.config.auth,
|
|
20
21
|
cookiePrefix: req.payload.config.cookiePrefix,
|
|
21
|
-
token:
|
|
22
|
+
token: refreshedToken
|
|
22
23
|
});
|
|
23
|
-
if (collection.config.auth.removeTokenFromResponses) {
|
|
24
|
-
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
|
|
25
|
-
delete result.refreshedToken;
|
|
26
|
-
}
|
|
27
24
|
headers.set('Set-Cookie', cookie);
|
|
28
25
|
}
|
|
26
|
+
const responseResult = collection.config.auth.removeTokenFromResponses ? resultWithoutToken : result;
|
|
29
27
|
return Response.json({
|
|
30
28
|
message: t('authentication:tokenRefreshSuccessful'),
|
|
31
|
-
...
|
|
29
|
+
...responseResult
|
|
32
30
|
}, {
|
|
33
31
|
headers,
|
|
34
32
|
status: httpStatus.OK
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/endpoints/refresh.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollection } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { generatePayloadCookie } from '../cookies.js'\nimport { refreshOperation } from '../operations/refresh.js'\n\nexport const refreshHandler: PayloadHandler = async (req) => {\n const collection = getRequestCollection(req)\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token:
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/endpoints/refresh.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollection } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { generatePayloadCookie } from '../cookies.js'\nimport { refreshOperation } from '../operations/refresh.js'\n\nexport const refreshHandler: PayloadHandler = async (req) => {\n const collection = getRequestCollection(req)\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n const { refreshedToken, ...resultWithoutToken } = result\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: refreshedToken,\n })\n\n headers.set('Set-Cookie', cookie)\n }\n\n const responseResult = collection.config.auth.removeTokenFromResponses\n ? resultWithoutToken\n : result\n\n return Response.json(\n {\n message: t('authentication:tokenRefreshSuccessful'),\n ...responseResult,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["status","httpStatus","getRequestCollection","headersWithCors","generatePayloadCookie","refreshOperation","refreshHandler","req","collection","t","headers","Headers","result","refreshedToken","resultWithoutToken","setCookie","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","token","set","responseResult","removeTokenFromResponses","Response","json","message","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,gBAAe;AACrD,SAASC,gBAAgB,QAAQ,2BAA0B;AAE3D,OAAO,MAAMC,iBAAiC,OAAOC;IACnD,MAAMC,aAAaN,qBAAqBK;IACxC,MAAM,EAAEE,CAAC,EAAE,GAAGF;IAEd,MAAMG,UAAUP,gBAAgB;QAC9BO,SAAS,IAAIC;QACbJ;IACF;IAEA,MAAMK,SAAS,MAAMP,iBAAiB;QACpCG;QACAD;IACF;IAEA,MAAM,EAAEM,cAAc,EAAE,GAAGC,oBAAoB,GAAGF;IAElD,IAAIA,OAAOG,SAAS,EAAE;QACpB,MAAMC,SAASZ,sBAAsB;YACnCa,sBAAsBT,WAAWU,MAAM,CAACC,IAAI;YAC5CC,cAAcb,IAAIc,OAAO,CAACH,MAAM,CAACE,YAAY;YAC7CE,OAAOT;QACT;QAEAH,QAAQa,GAAG,CAAC,cAAcP;IAC5B;IAEA,MAAMQ,iBAAiBhB,WAAWU,MAAM,CAACC,IAAI,CAACM,wBAAwB,GAClEX,qBACAF;IAEJ,OAAOc,SAASC,IAAI,CAClB;QACEC,SAASnB,EAAE;QACX,GAAGe,cAAc;IACnB,GACA;QACEd;QACAV,QAAQC,WAAW4B,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -4,13 +4,6 @@ import type { JoinQuery, PayloadRequest, PopulateType, SelectType } from '../../
|
|
|
4
4
|
export type MeOperationResult = {
|
|
5
5
|
collection?: string;
|
|
6
6
|
exp?: number;
|
|
7
|
-
/** @deprecated
|
|
8
|
-
* use:
|
|
9
|
-
* ```ts
|
|
10
|
-
* user._strategy
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
strategy?: string;
|
|
14
7
|
token?: string;
|
|
15
8
|
user?: AuthenticatedUser | null;
|
|
16
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/me.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ
|
|
1
|
+
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/me.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,WAAW,SAAgB,SAAS,KAAG,OAAO,CAAC,iBAAiB,CAoF5E,CAAA"}
|
|
@@ -43,12 +43,6 @@ export const meOperation = async (args)=>{
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
result.collection = req.user.collection;
|
|
46
|
-
/** @deprecated
|
|
47
|
-
* use:
|
|
48
|
-
* ```ts
|
|
49
|
-
* user._strategy
|
|
50
|
-
* ```
|
|
51
|
-
*/ result.strategy = req.user._strategy;
|
|
52
46
|
if (!result.user) {
|
|
53
47
|
result.user = user;
|
|
54
48
|
if (currentToken) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/me.ts"],"sourcesContent":["import { decodeJwt } from 'jose'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { AuthenticatedUser } from '../../index.js'\nimport type { JoinQuery, PayloadRequest, PopulateType, SelectType } from '../../types/index.js'\n\nexport type MeOperationResult = {\n collection?: string\n exp?: number\n
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/me.ts"],"sourcesContent":["import { decodeJwt } from 'jose'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { AuthenticatedUser } from '../../index.js'\nimport type { JoinQuery, PayloadRequest, PopulateType, SelectType } from '../../types/index.js'\n\nexport type MeOperationResult = {\n collection?: string\n exp?: number\n token?: string\n user?: AuthenticatedUser | null\n}\n\nexport type Arguments = {\n collection: Collection\n currentToken?: string\n depth?: number\n draft?: boolean\n joins?: JoinQuery\n populate?: PopulateType\n req: PayloadRequest\n select?: SelectType\n}\n\nexport const meOperation = async (args: Arguments): Promise<MeOperationResult> => {\n const { collection, currentToken, depth, draft, joins, populate, req, select } = args\n\n let result: MeOperationResult = {\n user: null!,\n }\n\n if (req.user) {\n if (req.user.collection !== collection.config.slug) {\n return {\n user: null!,\n }\n }\n\n const { pathname } = req\n const isGraphQL = pathname === `/api${req.payload.config.routes.graphQL}`\n\n const user = (await req.payload.findByID({\n id: req.user.id,\n collection: collection.config.slug,\n depth: isGraphQL ? 0 : (depth ?? collection.config.auth.depth),\n draft,\n joins,\n overrideAccess: false,\n populate,\n req,\n select,\n showHiddenFields: false,\n })) as AuthenticatedUser\n\n if (user) {\n user.collection = collection.config.slug\n user._strategy = req.user._strategy\n }\n\n // /////////////////////////////////////\n // me hook - Collection\n // /////////////////////////////////////\n\n for (const meHook of collection.config.hooks.me) {\n const hookResult = await meHook({ args, user })\n\n if (hookResult) {\n result.user = hookResult.user\n result.exp = hookResult.exp\n\n break\n }\n }\n\n result.collection = req.user.collection\n\n if (!result.user) {\n result.user = user\n\n if (currentToken) {\n const decoded = decodeJwt(currentToken)\n if (decoded) {\n result.exp = decoded.exp\n }\n if (!collection.config.auth.removeTokenFromResponses) {\n result.token = currentToken\n }\n }\n }\n }\n\n // /////////////////////////////////////\n // After Me - Collection\n // /////////////////////////////////////\n\n if (collection.config.hooks?.afterMe?.length) {\n for (const hook of collection.config.hooks.afterMe) {\n result =\n (await hook({\n collection: collection?.config,\n context: req.context,\n req,\n response: result,\n })) || result\n }\n }\n\n return result\n}\n"],"names":["decodeJwt","meOperation","args","collection","currentToken","depth","draft","joins","populate","req","select","result","user","config","slug","pathname","isGraphQL","payload","routes","graphQL","findByID","id","auth","overrideAccess","showHiddenFields","_strategy","meHook","hooks","me","hookResult","exp","decoded","removeTokenFromResponses","token","afterMe","length","hook","context","response"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAM;AAwBhC,OAAO,MAAMC,cAAc,OAAOC;IAChC,MAAM,EAAEC,UAAU,EAAEC,YAAY,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,MAAM,EAAE,GAAGR;IAEjF,IAAIS,SAA4B;QAC9BC,MAAM;IACR;IAEA,IAAIH,IAAIG,IAAI,EAAE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AAC3B,WAAWU,MAAM,CAACS,IAAI,CAACU,wBAAwB,EAAE;oBACpDrB,OAAOsB,KAAK,GAAG7B;gBACjB;YACF;QACF;IACF;IAEA,wCAAwC;IACxC,wBAAwB;IACxB,wCAAwC;IAExC,IAAID,WAAWU,MAAM,CAACc,KAAK,EAAEO,SAASC,QAAQ;QAC5C,KAAK,MAAMC,QAAQjC,WAAWU,MAAM,CAACc,KAAK,CAACO,OAAO,CAAE;YAClDvB,SACE,AAAC,MAAMyB,KAAK;gBACVjC,YAAYA,YAAYU;gBACxBwB,SAAS5B,IAAI4B,OAAO;gBACpB5B;gBACA6B,UAAU3B;YACZ,MAAOA;QACX;IACF;IAEA,OAAOA;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAYpE,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAYpE,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,gBAAgB,iBAAwB,SAAS,KAAG,OAAO,CAAC,MAAM,CAyK9E,CAAA"}
|
|
@@ -106,12 +106,6 @@ export const refreshOperation = async (incomingArgs)=>{
|
|
|
106
106
|
exp,
|
|
107
107
|
refreshedToken,
|
|
108
108
|
setCookie: true,
|
|
109
|
-
/** @deprecated
|
|
110
|
-
* use:
|
|
111
|
-
* ```ts
|
|
112
|
-
* user._strategy
|
|
113
|
-
* ```
|
|
114
|
-
*/ strategy: args.req.user._strategy,
|
|
115
109
|
user
|
|
116
110
|
};
|
|
117
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/refresh.ts"],"sourcesContent":["import type { Collection } from '../../collections/config/types.js'\nimport type { AuthenticatedUser } from '../../index.js'\nimport type { Document, PayloadRequest } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from '../../collections/operations/utilities/buildBeforeOperation.js'\nimport { Forbidden } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { jwtSign } from '../jwt.js'\nimport { removeExpiredSessions } from '../sessions.js'\n\nexport type Result = {\n exp: number\n refreshedToken: string\n setCookie?: boolean\n /** @deprecated\n * use:\n * ```ts\n * user._strategy\n * ```\n */\n strategy?: string\n user: Document\n}\n\nexport type Arguments = {\n collection: Collection\n req: PayloadRequest\n}\n\nexport const refreshOperation = async (incomingArgs: Arguments): Promise<Result> => {\n let args = incomingArgs\n\n try {\n const shouldCommit = await initTransaction(args.req)\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'refresh',\n overrideAccess: false,\n })\n\n // /////////////////////////////////////\n // Refresh\n // /////////////////////////////////////\n\n const {\n collection: { config: collectionConfig },\n req,\n req: {\n payload: { config, secret },\n },\n } = args\n\n if (!args.req.user) {\n throw new Forbidden(args.req.t)\n }\n\n const pathname = new URL(args.req.url!).pathname\n\n const isGraphQL = pathname === config.routes.graphQL\n\n let user = await req.payload.db.findOne<AuthenticatedUser>({\n collection: collectionConfig.slug,\n req,\n where: { id: { equals: args.req.user.id } },\n })\n\n if (!user) {\n throw new Forbidden(args.req.t)\n }\n\n const sid = args.req.user._sid\n\n if (collectionConfig.auth.useSessions && !collectionConfig.auth.disableLocalStrategy) {\n if (!Array.isArray(user.sessions) || !sid) {\n throw new Forbidden(args.req.t)\n }\n\n const existingSession = user.sessions.find(({ id }) => id === sid)\n\n if (!existingSession) {\n throw new Forbidden(args.req.t)\n }\n\n const now = new Date()\n const tokenExpInMs = collectionConfig.auth.tokenExpiration * 1000\n existingSession.expiresAt = new Date(now.getTime() + tokenExpInMs)\n\n await req.payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: {\n ...user,\n // Prevent updatedAt from being updated when only refreshing a session\n sessions: removeExpiredSessions(user.sessions),\n updatedAt: null,\n },\n req,\n returning: false,\n })\n }\n\n user = (await req.payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth: isGraphQL ? 0 : args.collection.config.auth.depth,\n req: args.req,\n })) as AuthenticatedUser\n\n if (user) {\n user.collection = args.req.user.collection\n user._strategy = args.req.user._strategy\n }\n\n let result!: Result\n\n // /////////////////////////////////////\n // refresh hook - Collection\n // /////////////////////////////////////\n\n for (const refreshHook of args.collection.config.hooks.refresh) {\n const hookResult = await refreshHook({ args, user })\n\n if (hookResult) {\n result = hookResult\n break\n }\n }\n\n if (!result) {\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user?.email as string,\n sid,\n user: args?.req?.user,\n })\n\n const { exp, token: refreshedToken } = await jwtSign({\n fieldsToSign,\n secret,\n tokenExpiration: collectionConfig.auth.tokenExpiration,\n })\n\n result = {\n exp,\n refreshedToken,\n setCookie: true,\n /** @deprecated\n * use:\n * ```ts\n * user._strategy\n * ```\n */\n strategy: args.req.user._strategy,\n user,\n }\n }\n\n // /////////////////////////////////////\n // After Refresh - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterRefresh?.length) {\n for (const hook of collectionConfig.hooks.afterRefresh) {\n result =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n exp: result.exp,\n req: args.req,\n token: result.refreshedToken,\n })) || result\n }\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'refresh',\n overrideAccess: false,\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["buildAfterOperation","buildBeforeOperation","Forbidden","commitTransaction","initTransaction","killTransaction","getFieldsToSign","jwtSign","removeExpiredSessions","refreshOperation","incomingArgs","args","shouldCommit","req","collection","config","operation","overrideAccess","collectionConfig","payload","secret","user","t","pathname","URL","url","isGraphQL","routes","graphQL","db","findOne","slug","where","id","equals","sid","_sid","auth","useSessions","disableLocalStrategy","Array","isArray","sessions","existingSession","find","now","Date","tokenExpInMs","tokenExpiration","expiresAt","getTime","updateOne","data","updatedAt","returning","findByID","depth","_strategy","result","refreshHook","hooks","refresh","hookResult","fieldsToSign","email","exp","token","refreshedToken","setCookie","strategy","afterRefresh","length","hook","context","error"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,gEAA+D;AACnG,SAASC,oBAAoB,QAAQ,iEAAgE;AACrG,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;A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AAkBU;QAC1B;QAEA,OAAO6C;IACT,EAAE,OAAOgB,OAAgB;QACvB,MAAMrE,gBAAgBM,KAAKE,GAAG;QAC9B,MAAM6D;IACR;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/refresh.ts"],"sourcesContent":["import type { Collection } from '../../collections/config/types.js'\nimport type { AuthenticatedUser } from '../../index.js'\nimport type { Document, PayloadRequest } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from '../../collections/operations/utilities/buildBeforeOperation.js'\nimport { Forbidden } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { jwtSign } from '../jwt.js'\nimport { removeExpiredSessions } from '../sessions.js'\n\nexport type Result = {\n exp: number\n refreshedToken: string\n setCookie?: boolean\n user: Document\n}\n\nexport type Arguments = {\n collection: Collection\n req: PayloadRequest\n}\n\nexport const refreshOperation = async (incomingArgs: Arguments): Promise<Result> => {\n let args = incomingArgs\n\n try {\n const shouldCommit = await initTransaction(args.req)\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'refresh',\n overrideAccess: false,\n })\n\n // /////////////////////////////////////\n // Refresh\n // /////////////////////////////////////\n\n const {\n collection: { config: collectionConfig },\n req,\n req: {\n payload: { config, secret },\n },\n } = args\n\n if (!args.req.user) {\n throw new Forbidden(args.req.t)\n }\n\n const pathname = new URL(args.req.url!).pathname\n\n const isGraphQL = pathname === config.routes.graphQL\n\n let user = await req.payload.db.findOne<AuthenticatedUser>({\n collection: collectionConfig.slug,\n req,\n where: { id: { equals: args.req.user.id } },\n })\n\n if (!user) {\n throw new Forbidden(args.req.t)\n }\n\n const sid = args.req.user._sid\n\n if (collectionConfig.auth.useSessions && !collectionConfig.auth.disableLocalStrategy) {\n if (!Array.isArray(user.sessions) || !sid) {\n throw new Forbidden(args.req.t)\n }\n\n const existingSession = user.sessions.find(({ id }) => id === sid)\n\n if (!existingSession) {\n throw new Forbidden(args.req.t)\n }\n\n const now = new Date()\n const tokenExpInMs = collectionConfig.auth.tokenExpiration * 1000\n existingSession.expiresAt = new Date(now.getTime() + tokenExpInMs)\n\n await req.payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: {\n ...user,\n // Prevent updatedAt from being updated when only refreshing a session\n sessions: removeExpiredSessions(user.sessions),\n updatedAt: null,\n },\n req,\n returning: false,\n })\n }\n\n user = (await req.payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth: isGraphQL ? 0 : args.collection.config.auth.depth,\n req: args.req,\n })) as AuthenticatedUser\n\n if (user) {\n user.collection = args.req.user.collection\n user._strategy = args.req.user._strategy\n }\n\n let result!: Result\n\n // /////////////////////////////////////\n // refresh hook - Collection\n // /////////////////////////////////////\n\n for (const refreshHook of args.collection.config.hooks.refresh) {\n const hookResult = await refreshHook({ args, user })\n\n if (hookResult) {\n result = hookResult\n break\n }\n }\n\n if (!result) {\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user?.email as string,\n sid,\n user: args?.req?.user,\n })\n\n const { exp, token: refreshedToken } = await jwtSign({\n fieldsToSign,\n secret,\n tokenExpiration: collectionConfig.auth.tokenExpiration,\n })\n\n result = {\n exp,\n refreshedToken,\n setCookie: true,\n user,\n }\n }\n\n // /////////////////////////////////////\n // After Refresh - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterRefresh?.length) {\n for (const hook of collectionConfig.hooks.afterRefresh) {\n result =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n exp: result.exp,\n req: args.req,\n token: result.refreshedToken,\n })) || result\n }\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'refresh',\n overrideAccess: false,\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["buildAfterOperation","buildBeforeOperation","Forbidden","commitTransaction","initTransaction","killTransaction","getFieldsToSign","jwtSign","removeExpiredSessions","refreshOperation","incomingArgs","args","shouldCommit","req","collection","config","operation","overrideAccess","collectionConfig","payload","secret","user","t","pathname","URL","url","isGraphQL","routes","graphQL","db","findOne","slug","where","id","equals","sid","_sid","auth","useSessions","disableLocalStrategy","Array","isArray","sessions","existingSession","find","now","Date","tokenExpInMs","tokenExpiration","expiresAt","getTime","updateOne","data","updatedAt","returning","findByID","depth","_strategy","result","refreshHook","hooks","refresh","hookResult","fieldsToSign","email","exp","token","refreshedToken","setCookie","afterRefresh","length","hook","context","error"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,gEAA+D;AACnG,SAASC,oBAAoB,QAAQ,iEAAgE;AACrG,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,OAAO,QAAQ,YAAW;AACnC,SAASC,qBAAqB,QAAQ,iBAAgB;AActD,OAAO,MAAMC,mBAAmB,OAAOC;IACrC,IAAIC,OAAOD;IAEX,IAAI;QACF,MAAME,eAAe,MAAMR,gBAAgBO,KAAKE,GAAG;QAEnD,wCAAwC;QACxC,+BAA+B;QAC/B,wCAAwC;QAExCF,OAAO,MAAMV,qBAAqB;YAChCU;YACAG,YAAYH,KAAKG,UAAU,CAACC,MAAM;YAClCC,WAAW;YACXC,gBAAgB;QAClB;QAEA,wCAAwC;QACxC,UAAU;QACV,wCAAwC;QAExC,MA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,IAAI,CAACW,eAAe;YACxD;YAEAU,SAAS;gBACPO;gBACAE;gBACAC,WAAW;gBACX/C;YACF;QACF;QAEA,wCAAwC;QACxC,6BAA6B;QAC7B,wCAAwC;QAExC,IAAIH,iBAAiB0C,KAAK,EAAES,cAAcC,QAAQ;YAChD,KAAK,MAAMC,QAAQrD,iBAAiB0C,KAAK,CAACS,YAAY,CAAE;gBACtDX,SACE,AAAC,MAAMa,KAAK;oBACVzD,YAAYH,KAAKG,UAAU,EAAEC;oBAC7ByD,SAAS7D,KAAKE,GAAG,CAAC2D,OAAO;oBACzBP,KAAKP,OAAOO,GAAG;oBACfpD,KAAKF,KAAKE,GAAG;oBACbqD,OAAOR,OAAOS,cAAc;gBAC9B,MAAOT;YACX;QACF;QAEA,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCA,SAAS,MAAM1D,oBAAoB;YACjCW;YACAG,YAAYH,KAAKG,UAAU,EAAEC;YAC7BC,WAAW;YACXC,gBAAgB;YAChByC;QACF;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,IAAI9C,cAAc;YAChB,MAAMT,kBAAkBU;QAC1B;QAEA,OAAO6C;IACT,EAAE,OAAOe,OAAgB;QACvB,MAAMpE,gBAAgBM,KAAKE,GAAG;QAC9B,MAAM4D;IACR;AACF,EAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SanitizedConfig } from '
|
|
1
|
+
import type { SanitizedConfig } from '../config/types.js';
|
|
2
2
|
type Framework = 'next' | 'tanstack-start';
|
|
3
3
|
/**
|
|
4
4
|
* `payload build` — generate the import map (and types) so they are on disk
|
|
@@ -10,10 +10,8 @@ type Framework = 'next' | 'tanstack-start';
|
|
|
10
10
|
* or exits 1 if pre-build generation or framework detection fails (never builds
|
|
11
11
|
* against a stale map or the wrong bundler).
|
|
12
12
|
*/
|
|
13
|
-
export declare function build({ config
|
|
13
|
+
export declare function build({ config }: {
|
|
14
14
|
config: SanitizedConfig;
|
|
15
|
-
forwardedArgs?: string[];
|
|
16
|
-
skipTypes?: boolean;
|
|
17
15
|
}): Promise<void>;
|
|
18
16
|
/**
|
|
19
17
|
* Determine whether the project builds with Next.js or TanStack Start. An explicit
|
|
@@ -40,5 +38,12 @@ export declare function resolveBuildCommand({ cwd, forwardedArgs, framework, }:
|
|
|
40
38
|
args: string[];
|
|
41
39
|
bin: string;
|
|
42
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Forward the raw args that follow the `build` subcommand to the framework build
|
|
43
|
+
* (`next build` / `vite build`), dropping payload-only flags. Uses raw argv (not
|
|
44
|
+
* minimist) so flags like `--turbopack` (Next) or `--mode staging` (Vite) pass
|
|
45
|
+
* through verbatim.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getForwardedArgs(argv?: string[]): string[];
|
|
43
48
|
export {};
|
|
44
49
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/bin/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMzD,KAAK,SAAS,GAAG,MAAM,GAAG,gBAAgB,CAAA;AAY1C;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuClF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,SAAS,CAuDtE;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAElE;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAElE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAmB,EACnB,aAAa,EACb,SAAS,GACV,EAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;CACrB,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAGlC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,MAAM,EAAE,CAIjF"}
|