@payloadcms/drizzle 4.0.0-internal.17c142b → 4.0.0-internal.1a2a79e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/count.d.ts.map +1 -1
- package/dist/count.js +25 -3
- package/dist/count.js.map +1 -1
- package/dist/countVersions.d.ts.map +1 -1
- package/dist/countVersions.js +28 -4
- package/dist/countVersions.js.map +1 -1
- package/dist/createGlobalVersion.d.ts.map +1 -1
- package/dist/createGlobalVersion.js +15 -2
- package/dist/createGlobalVersion.js.map +1 -1
- package/dist/createTableName.d.ts.map +1 -1
- package/dist/createTableName.js +2 -7
- package/dist/createTableName.js.map +1 -1
- package/dist/createVersion.d.ts.map +1 -1
- package/dist/createVersion.js +12 -1
- package/dist/createVersion.js.map +1 -1
- package/dist/deleteBranchGlobal.d.ts +10 -0
- package/dist/deleteBranchGlobal.d.ts.map +1 -0
- package/dist/deleteBranchGlobal.js +27 -0
- package/dist/deleteBranchGlobal.js.map +1 -0
- package/dist/deleteOne.d.ts.map +1 -1
- package/dist/deleteOne.js +18 -1
- package/dist/deleteOne.js.map +1 -1
- package/dist/exports/postgres.d.ts +4 -1
- package/dist/exports/postgres.d.ts.map +1 -1
- package/dist/exports/postgres.js +4 -1
- package/dist/exports/postgres.js.map +1 -1
- package/dist/exports/sqlite.d.ts +2 -1
- package/dist/exports/sqlite.d.ts.map +1 -1
- package/dist/exports/sqlite.js +2 -1
- package/dist/exports/sqlite.js.map +1 -1
- package/dist/find/buildFindManyArgs.d.ts +3 -2
- package/dist/find/buildFindManyArgs.d.ts.map +1 -1
- package/dist/find/buildFindManyArgs.js +2 -1
- package/dist/find/buildFindManyArgs.js.map +1 -1
- package/dist/find/buildPolymorphicJoinQuery.d.ts +40 -0
- package/dist/find/buildPolymorphicJoinQuery.d.ts.map +1 -0
- package/dist/find/buildPolymorphicJoinQuery.js +163 -0
- package/dist/find/buildPolymorphicJoinQuery.js.map +1 -0
- package/dist/find/buildPolymorphicJoinWhere.d.ts +20 -0
- package/dist/find/buildPolymorphicJoinWhere.d.ts.map +1 -0
- package/dist/find/buildPolymorphicJoinWhere.js +301 -0
- package/dist/find/buildPolymorphicJoinWhere.js.map +1 -0
- package/dist/find/createPolymorphicJoinWherePlan.d.ts +38 -0
- package/dist/find/createPolymorphicJoinWherePlan.d.ts.map +1 -0
- package/dist/find/createPolymorphicJoinWherePlan.js +200 -0
- package/dist/find/createPolymorphicJoinWherePlan.js.map +1 -0
- package/dist/find/findMany.d.ts +6 -1
- package/dist/find/findMany.d.ts.map +1 -1
- package/dist/find/findMany.js +16 -3
- package/dist/find/findMany.js.map +1 -1
- package/dist/find/traverseFields.d.ts +3 -2
- package/dist/find/traverseFields.d.ts.map +1 -1
- package/dist/find/traverseFields.js +73 -197
- package/dist/find/traverseFields.js.map +1 -1
- package/dist/find.d.ts.map +1 -1
- package/dist/find.js +32 -4
- package/dist/find.js.map +1 -1
- package/dist/findDistinct.d.ts.map +1 -1
- package/dist/findDistinct.js +107 -8
- package/dist/findDistinct.js.map +1 -1
- package/dist/findGlobal.d.ts.map +1 -1
- package/dist/findGlobal.js +22 -5
- package/dist/findGlobal.js.map +1 -1
- package/dist/findGlobalVersions.js +8 -3
- package/dist/findGlobalVersions.js.map +1 -1
- package/dist/findOne.d.ts +1 -1
- package/dist/findOne.d.ts.map +1 -1
- package/dist/findOne.js +30 -3
- package/dist/findOne.js.map +1 -1
- package/dist/findVersions.d.ts.map +1 -1
- package/dist/findVersions.js +32 -5
- package/dist/findVersions.js.map +1 -1
- package/dist/index.d.ts +6 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -9
- package/dist/index.js.map +1 -1
- package/dist/migrate.d.ts.map +1 -1
- package/dist/migrate.js +41 -15
- package/dist/migrate.js.map +1 -1
- package/dist/migrateDown.d.ts +2 -1
- package/dist/migrateDown.d.ts.map +1 -1
- package/dist/migrateDown.js +17 -4
- package/dist/migrateDown.js.map +1 -1
- package/dist/migrateFresh.d.ts +4 -2
- package/dist/migrateFresh.d.ts.map +1 -1
- package/dist/migrateFresh.js +26 -9
- package/dist/migrateFresh.js.map +1 -1
- package/dist/migrateRefresh.d.ts +2 -1
- package/dist/migrateRefresh.d.ts.map +1 -1
- package/dist/migrateRefresh.js +20 -5
- package/dist/migrateRefresh.js.map +1 -1
- package/dist/migrateReset.d.ts +2 -1
- package/dist/migrateReset.d.ts.map +1 -1
- package/dist/migrateReset.js +18 -4
- package/dist/migrateReset.js.map +1 -1
- package/dist/migrateStatus.d.ts +2 -1
- package/dist/migrateStatus.d.ts.map +1 -1
- package/dist/migrateStatus.js +11 -6
- package/dist/migrateStatus.js.map +1 -1
- package/dist/postgres/createDatabase.d.ts.map +1 -1
- package/dist/postgres/createExtensions.d.ts.map +1 -1
- package/dist/postgres/createJSONQuery/index.d.ts.map +1 -1
- package/dist/postgres/createJSONQuery/index.js +3 -3
- package/dist/postgres/createJSONQuery/index.js.map +1 -1
- package/dist/postgres/init.d.ts.map +1 -1
- package/dist/postgres/init.js +6 -0
- package/dist/postgres/init.js.map +1 -1
- package/dist/postgres/insert.d.ts.map +1 -1
- package/dist/postgres/insert.js +4 -2
- package/dist/postgres/insert.js.map +1 -1
- package/dist/postgres/predefinedMigrations/sizes-to-variants/index.d.ts +35 -0
- package/dist/postgres/predefinedMigrations/sizes-to-variants/index.d.ts.map +1 -0
- package/dist/postgres/predefinedMigrations/sizes-to-variants/index.js +185 -0
- package/dist/postgres/predefinedMigrations/sizes-to-variants/index.js.map +1 -0
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.js +8 -4
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/index.js +2 -2
- package/dist/postgres/predefinedMigrations/v2-v3/index.js.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -1
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.d.ts +15 -0
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.d.ts.map +1 -0
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.js +25 -0
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.js.map +1 -0
- package/dist/postgres/query/postgresUnaccent.d.ts +13 -0
- package/dist/postgres/query/postgresUnaccent.d.ts.map +1 -0
- package/dist/postgres/query/postgresUnaccent.js +40 -0
- package/dist/postgres/query/postgresUnaccent.js.map +1 -0
- package/dist/postgres/requireDrizzleKit.d.ts +4 -0
- package/dist/postgres/requireDrizzleKit.d.ts.map +1 -1
- package/dist/postgres/requireDrizzleKit.js +16 -10
- package/dist/postgres/requireDrizzleKit.js.map +1 -1
- package/dist/postgres/schema/buildDrizzleTable.d.ts.map +1 -1
- package/dist/postgres/schema/geometryColumn.d.ts +2 -2
- package/dist/postgres/schema/geometryColumn.d.ts.map +1 -1
- package/dist/postgres/types.d.ts +17 -2
- package/dist/postgres/types.d.ts.map +1 -1
- package/dist/postgres/types.js.map +1 -1
- package/dist/queries/addJoinTable.d.ts +1 -1
- package/dist/queries/addJoinTable.d.ts.map +1 -1
- package/dist/queries/buildAndOrConditions.d.ts +3 -2
- package/dist/queries/buildAndOrConditions.d.ts.map +1 -1
- package/dist/queries/buildAndOrConditions.js +2 -1
- package/dist/queries/buildAndOrConditions.js.map +1 -1
- package/dist/queries/buildBranchVisibility.d.ts +11 -0
- package/dist/queries/buildBranchVisibility.d.ts.map +1 -0
- package/dist/queries/buildBranchVisibility.js +48 -0
- package/dist/queries/buildBranchVisibility.js.map +1 -0
- package/dist/queries/buildOperatorConstraint.d.ts +22 -0
- package/dist/queries/buildOperatorConstraint.d.ts.map +1 -0
- package/dist/queries/buildOperatorConstraint.js +63 -0
- package/dist/queries/buildOperatorConstraint.js.map +1 -0
- package/dist/queries/buildOrderBy.d.ts +3 -2
- package/dist/queries/buildOrderBy.d.ts.map +1 -1
- package/dist/queries/buildOrderBy.js +2 -1
- package/dist/queries/buildOrderBy.js.map +1 -1
- package/dist/queries/buildQuery.d.ts +3 -2
- package/dist/queries/buildQuery.d.ts.map +1 -1
- package/dist/queries/buildQuery.js +4 -2
- package/dist/queries/buildQuery.js.map +1 -1
- package/dist/queries/getTableAlias.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.d.ts +15 -5
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.js +225 -54
- package/dist/queries/getTableColumnFromPath.js.map +1 -1
- package/dist/queries/operatorMap.d.ts +7 -3
- package/dist/queries/operatorMap.d.ts.map +1 -1
- package/dist/queries/operatorMap.js.map +1 -1
- package/dist/queries/parseParams.d.ts +3 -2
- package/dist/queries/parseParams.d.ts.map +1 -1
- package/dist/queries/parseParams.js +266 -11
- package/dist/queries/parseParams.js.map +1 -1
- package/dist/queries/resolveRelationshipPath.d.ts +36 -0
- package/dist/queries/resolveRelationshipPath.d.ts.map +1 -0
- package/dist/queries/resolveRelationshipPath.js +66 -0
- package/dist/queries/resolveRelationshipPath.js.map +1 -0
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/selectDistinct.d.ts.map +1 -1
- package/dist/queries/validateOperatorHandlers.d.ts +8 -0
- package/dist/queries/validateOperatorHandlers.d.ts.map +1 -0
- package/dist/queries/validateOperatorHandlers.js +30 -0
- package/dist/queries/validateOperatorHandlers.js.map +1 -0
- package/dist/queryDrafts.d.ts.map +1 -1
- package/dist/queryDrafts.js +23 -4
- package/dist/queryDrafts.js.map +1 -1
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/build.js +23 -20
- package/dist/schema/build.js.map +1 -1
- package/dist/schema/buildDrizzleRelations.d.ts.map +1 -1
- package/dist/schema/buildRawSchema.d.ts.map +1 -1
- package/dist/schema/idToUUID.d.ts.map +1 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +6 -5
- package/dist/schema/traverseFields.js.map +1 -1
- package/dist/schema/withDefault.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.js +3 -2
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.js.map +1 -1
- package/dist/sqlite/createJSONQuery/index.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/index.js +6 -5
- package/dist/sqlite/createJSONQuery/index.js.map +1 -1
- package/dist/sqlite/createRequireDrizzleKit.d.ts +6 -0
- package/dist/sqlite/createRequireDrizzleKit.d.ts.map +1 -0
- package/dist/sqlite/createRequireDrizzleKit.js +15 -0
- package/dist/sqlite/createRequireDrizzleKit.js.map +1 -0
- package/dist/sqlite/execute.js.map +1 -1
- package/dist/sqlite/insert.d.ts.map +1 -1
- package/dist/sqlite/insert.js +9 -4
- package/dist/sqlite/insert.js.map +1 -1
- package/dist/sqlite/predefinedMigrations/sizes-to-variants/index.d.ts +15 -0
- package/dist/sqlite/predefinedMigrations/sizes-to-variants/index.d.ts.map +1 -0
- package/dist/sqlite/predefinedMigrations/sizes-to-variants/index.js +114 -0
- package/dist/sqlite/predefinedMigrations/sizes-to-variants/index.js.map +1 -0
- package/dist/sqlite/types.d.ts +4 -0
- package/dist/sqlite/types.d.ts.map +1 -1
- package/dist/sqlite/types.js.map +1 -1
- package/dist/transactions/beginTransaction.d.ts.map +1 -1
- package/dist/transactions/beginTransaction.js +13 -5
- package/dist/transactions/beginTransaction.js.map +1 -1
- package/dist/transactions/commitTransaction.d.ts.map +1 -1
- package/dist/transactions/commitTransaction.js +1 -5
- package/dist/transactions/commitTransaction.js.map +1 -1
- package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
- package/dist/transform/read/hasManyText.d.ts.map +1 -1
- package/dist/transform/read/index.d.ts.map +1 -1
- package/dist/transform/read/relationship.d.ts.map +1 -1
- package/dist/transform/read/traverseFields.d.ts.map +1 -1
- package/dist/transform/read/traverseFields.js.map +1 -1
- package/dist/transform/write/array.d.ts +3 -2
- package/dist/transform/write/array.d.ts.map +1 -1
- package/dist/transform/write/array.js +2 -1
- package/dist/transform/write/array.js.map +1 -1
- package/dist/transform/write/blocks.d.ts +3 -2
- package/dist/transform/write/blocks.d.ts.map +1 -1
- package/dist/transform/write/blocks.js +2 -1
- package/dist/transform/write/blocks.js.map +1 -1
- package/dist/transform/write/index.d.ts.map +1 -1
- package/dist/transform/write/index.js +2 -0
- package/dist/transform/write/index.js.map +1 -1
- package/dist/transform/write/numbers.d.ts.map +1 -1
- package/dist/transform/write/relationships.d.ts.map +1 -1
- package/dist/transform/write/selects.d.ts.map +1 -1
- package/dist/transform/write/texts.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.d.ts +2 -1
- package/dist/transform/write/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.js +40 -20
- package/dist/transform/write/traverseFields.js.map +1 -1
- package/dist/transform/write/types.d.ts +7 -0
- package/dist/transform/write/types.d.ts.map +1 -1
- package/dist/transform/write/types.js.map +1 -1
- package/dist/types.d.ts +53 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/types.js.map +1 -1
- package/dist/updateGlobal.d.ts +5 -1
- package/dist/updateGlobal.d.ts.map +1 -1
- package/dist/updateGlobal.js +96 -4
- package/dist/updateGlobal.js.map +1 -1
- package/dist/updateJobs.d.ts.map +1 -1
- package/dist/updateJobs.js +37 -0
- package/dist/updateJobs.js.map +1 -1
- package/dist/updateOne.d.ts.map +1 -1
- package/dist/updateOne.js +86 -4
- package/dist/updateOne.js.map +1 -1
- package/dist/upsertBranchGlobalChange.d.ts +3 -0
- package/dist/upsertBranchGlobalChange.d.ts.map +1 -0
- package/dist/upsertBranchGlobalChange.js +35 -0
- package/dist/upsertBranchGlobalChange.js.map +1 -0
- package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -1
- package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -1
- package/dist/upsertRow/deleteExistingRowsByPath.js +17 -12
- package/dist/upsertRow/deleteExistingRowsByPath.js.map +1 -1
- package/dist/upsertRow/handleUpsertError.d.ts.map +1 -1
- package/dist/upsertRow/index.d.ts +1 -1
- package/dist/upsertRow/index.d.ts.map +1 -1
- package/dist/upsertRow/index.js +156 -46
- package/dist/upsertRow/index.js.map +1 -1
- package/dist/upsertRow/insertArrays.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.js +2 -1
- package/dist/upsertRow/insertArrays.js.map +1 -1
- package/dist/upsertRow/shouldUseOptimizedUpsertRow.d.ts.map +1 -1
- package/dist/upsertRow/types.d.ts +3 -0
- package/dist/upsertRow/types.d.ts.map +1 -1
- package/dist/upsertRow/types.js.map +1 -1
- package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -1
- package/dist/utilities/blocksToJsonMigrator.d.ts.map +1 -1
- package/dist/utilities/blocksToJsonMigrator.js +7 -18
- package/dist/utilities/blocksToJsonMigrator.js.map +1 -1
- package/dist/utilities/buildCreateMigration.d.ts.map +1 -1
- package/dist/utilities/buildCreateMigration.js +13 -9
- package/dist/utilities/buildCreateMigration.js.map +1 -1
- package/dist/utilities/buildDynamicPredefinedSizesToVariantsMigration.d.ts +15 -0
- package/dist/utilities/buildDynamicPredefinedSizesToVariantsMigration.d.ts.map +1 -0
- package/dist/utilities/buildDynamicPredefinedSizesToVariantsMigration.js +110 -0
- package/dist/utilities/buildDynamicPredefinedSizesToVariantsMigration.js.map +1 -0
- package/dist/utilities/buildForeignKeyName.d.ts.map +1 -1
- package/dist/utilities/buildForeignKeyName.js +3 -2
- package/dist/utilities/buildForeignKeyName.js.map +1 -1
- package/dist/utilities/buildIndexName.d.ts.map +1 -1
- package/dist/utilities/buildIndexName.js +3 -2
- package/dist/utilities/buildIndexName.js.map +1 -1
- package/dist/utilities/checkTruncatedIdentifiers.d.ts +13 -0
- package/dist/utilities/checkTruncatedIdentifiers.d.ts.map +1 -0
- package/dist/utilities/checkTruncatedIdentifiers.js +56 -0
- package/dist/utilities/checkTruncatedIdentifiers.js.map +1 -0
- package/dist/utilities/createBlocksMap.d.ts.map +1 -1
- package/dist/utilities/createRelationshipMap.d.ts.map +1 -1
- package/dist/utilities/createSchemaGenerator.d.ts.map +1 -1
- package/dist/utilities/createSchemaGenerator.js +10 -12
- package/dist/utilities/createSchemaGenerator.js.map +1 -1
- package/dist/utilities/escapeSQLValue.d.ts.map +1 -1
- package/dist/utilities/executeSchemaHooks.d.ts.map +1 -1
- package/dist/utilities/executeSchemaHooks.js +1 -1
- package/dist/utilities/executeSchemaHooks.js.map +1 -1
- package/dist/utilities/extendDrizzleTable.d.ts.map +1 -1
- package/dist/utilities/formatGeneratedFile.d.ts +10 -0
- package/dist/utilities/formatGeneratedFile.d.ts.map +1 -0
- package/dist/utilities/formatGeneratedFile.js +58 -0
- package/dist/utilities/formatGeneratedFile.js.map +1 -0
- package/dist/utilities/getArrayRelationName.d.ts.map +1 -1
- package/dist/utilities/getCollectionIdType.d.ts.map +1 -1
- package/dist/utilities/getMigrationTemplate.d.ts.map +1 -1
- package/dist/utilities/getNameFromDrizzleTable.d.ts.map +1 -1
- package/dist/utilities/getPrimaryDb.d.ts +1 -1
- package/dist/utilities/getPrimaryDb.d.ts.map +1 -1
- package/dist/utilities/getSizesToVariantsRenames.d.ts +54 -0
- package/dist/utilities/getSizesToVariantsRenames.d.ts.map +1 -0
- package/dist/utilities/getSizesToVariantsRenames.js +251 -0
- package/dist/utilities/getSizesToVariantsRenames.js.map +1 -0
- package/dist/utilities/getTransaction.d.ts +1 -1
- package/dist/utilities/getTransaction.d.ts.map +1 -1
- package/dist/utilities/getTransaction.js.map +1 -1
- package/dist/utilities/hasLocalesTable.d.ts.map +1 -1
- package/dist/utilities/isPolymorphicRelationship.d.ts.map +1 -1
- package/dist/utilities/isUUIDType.d.ts.map +1 -1
- package/dist/utilities/json.d.ts.map +1 -1
- package/dist/utilities/migrationTableExists.d.ts.map +1 -1
- package/dist/utilities/parseError.d.ts.map +1 -1
- package/dist/utilities/parseJSONPathSegment.d.ts +9 -0
- package/dist/utilities/parseJSONPathSegment.d.ts.map +1 -0
- package/dist/utilities/parseJSONPathSegment.js +17 -0
- package/dist/utilities/parseJSONPathSegment.js.map +1 -0
- package/dist/utilities/pushDevSchema.d.ts.map +1 -1
- package/dist/utilities/pushDevSchema.js +1 -1
- package/dist/utilities/pushDevSchema.js.map +1 -1
- package/dist/utilities/rawConstraint.d.ts.map +1 -1
- package/dist/utilities/sanitizePathSegment.d.ts.map +1 -1
- package/dist/utilities/validateExistingBlockIsIdentical.d.ts +1 -5
- package/dist/utilities/validateExistingBlockIsIdentical.d.ts.map +1 -1
- package/dist/utilities/validateExistingBlockIsIdentical.js.map +1 -1
- package/dist/utilities/validateIdentifierLength.d.ts +12 -0
- package/dist/utilities/validateIdentifierLength.d.ts.map +1 -0
- package/dist/utilities/validateIdentifierLength.js +18 -0
- package/dist/utilities/validateIdentifierLength.js.map +1 -0
- package/package.json +17 -19
- package/dist/find/chainMethods.d.ts +0 -20
- package/dist/find/chainMethods.d.ts.map +0 -1
- package/dist/find/chainMethods.js +0 -16
- package/dist/find/chainMethods.js.map +0 -1
- package/dist/sqlite/requireDrizzleKit.d.ts +0 -3
- package/dist/sqlite/requireDrizzleKit.d.ts.map +0 -1
- package/dist/sqlite/requireDrizzleKit.js +0 -12
- package/dist/sqlite/requireDrizzleKit.js.map +0 -1
- package/dist/upsertRow/handleUpsertError.spec.js +0 -42
- package/dist/upsertRow/handleUpsertError.spec.js.map +0 -1
- package/dist/utilities/isValidStringID.spec.js +0 -15
- package/dist/utilities/isValidStringID.spec.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/transform/write/array.ts"],"sourcesContent":["import type { FlattenedArrayField } from 'payload'\n\nimport { fieldShouldBeLocalized } from 'payload/shared'\n\nimport type { DrizzleAdapter } from '../../types.js'\nimport type {\n ArrayRowToInsert,\n BlockRowToInsert,\n NumberToDelete,\n RelationshipToDelete,\n TextToDelete,\n} from './types.js'\n\nimport { isArrayOfRows } from '../../utilities/isArrayOfRows.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n arrayTableName: string\n baseTableName: string\n blocks: {\n [blockType: string]: BlockRowToInsert[]\n }\n blocksToDelete: Set<string>\n data: unknown\n field: FlattenedArrayField\n locale?: string\n numbers: Record<string, unknown>[]\n numbersToDelete: NumberToDelete[]\n parentIsLocalized: boolean\n path: string\n relationships: Record<string, unknown>[]\n relationshipsToDelete: RelationshipToDelete[]\n selects: {\n [tableName: string]: Record<string, unknown>[]\n }\n texts: Record<string, unknown>[]\n textsToDelete: TextToDelete[]\n /**\n * Set to a locale code if this set of fields is traversed within a\n * localized array or block field\n */\n withinArrayOrBlockLocale?: string\n}\n\nexport const transformArray = ({\n adapter,\n arrayTableName,\n baseTableName,\n blocks,\n blocksToDelete,\n data,\n field,\n locale,\n numbers,\n numbersToDelete,\n parentIsLocalized,\n path,\n relationships,\n relationshipsToDelete,\n selects,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n}: Args) => {\n const newRows: ArrayRowToInsert[] = []\n\n const hasUUID = adapter.tables[arrayTableName]._uuid\n\n if (isArrayOfRows(data)) {\n data.forEach((arrayRow, i) => {\n const newRow: ArrayRowToInsert = {\n arrays: {},\n arraysToPush: {},\n locales: {},\n row: {\n _order: i + 1,\n },\n }\n\n // If we have declared a _uuid field on arrays,\n // that means the ID has to be unique,\n // and our ids within arrays are not unique.\n // So move the ID to a uuid field for storage\n // and allow the database to generate a serial id automatically\n if (hasUUID) {\n newRow.row._uuid = arrayRow.id\n delete arrayRow.id\n }\n\n if (locale) {\n newRow.locales[locale] = {\n _locale: locale,\n }\n }\n\n if (fieldShouldBeLocalized({ field, parentIsLocalized }) && locale) {\n newRow.row._locale = locale\n }\n\n if (withinArrayOrBlockLocale) {\n newRow.row._locale = withinArrayOrBlockLocale\n }\n\n traverseFields({\n adapter,\n arrays: newRow.arrays,\n arraysToPush: newRow.arraysToPush,\n baseTableName,\n blocks,\n blocksToDelete,\n columnPrefix: '',\n data: arrayRow,\n fieldPrefix: '',\n fields: field.flattenedFields,\n insideArrayOrBlock: true,\n locales: newRow.locales,\n numbers,\n numbersToDelete,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentTableName: arrayTableName,\n path: `${path || ''}${field.name}.${i}.`,\n relationships,\n relationshipsToAppend: [],\n relationshipsToDelete,\n row: newRow.row,\n selects,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n })\n\n newRows.push(newRow)\n })\n }\n\n return newRows\n}\n"],"names":["fieldShouldBeLocalized","isArrayOfRows","traverseFields","transformArray","adapter","arrayTableName","baseTableName","blocks","blocksToDelete","data","field","locale","numbers","numbersToDelete","parentIsLocalized","path","relationships","relationshipsToDelete","selects","texts","textsToDelete","withinArrayOrBlockLocale","newRows","hasUUID","tables","_uuid","forEach","arrayRow","i","newRow","arrays","arraysToPush","locales","row","_order","id","_locale","columnPrefix","fieldPrefix","fields","flattenedFields","insideArrayOrBlock","localized","parentTableName","name","relationshipsToAppend","push"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,iBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../../src/transform/write/array.ts"],"sourcesContent":["import type { FlattenedArrayField } from 'payload'\n\nimport { fieldShouldBeLocalized } from 'payload/shared'\n\nimport type { DrizzleAdapter } from '../../types.js'\nimport type {\n ArrayRowToInsert,\n BlockRowToInsert,\n NumberToDelete,\n RelationshipToDelete,\n RowToInsert,\n TextToDelete,\n} from './types.js'\n\nimport { isArrayOfRows } from '../../utilities/isArrayOfRows.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n arrayTableName: string\n baseTableName: string\n blocks: {\n [blockType: string]: BlockRowToInsert[]\n }\n blocksToDelete: Set<string>\n data: unknown\n field: FlattenedArrayField\n locale?: string\n numbers: Record<string, unknown>[]\n numbersToDelete: NumberToDelete[]\n parentIsLocalized: boolean\n path: string\n relationships: Record<string, unknown>[]\n relationshipsToDelete: RelationshipToDelete[]\n selects: {\n [tableName: string]: Record<string, unknown>[]\n }\n selectsToDelete: RowToInsert['selectsToDelete']\n texts: Record<string, unknown>[]\n textsToDelete: TextToDelete[]\n /**\n * Set to a locale code if this set of fields is traversed within a\n * localized array or block field\n */\n withinArrayOrBlockLocale?: string\n}\n\nexport const transformArray = ({\n adapter,\n arrayTableName,\n baseTableName,\n blocks,\n blocksToDelete,\n data,\n field,\n locale,\n numbers,\n numbersToDelete,\n parentIsLocalized,\n path,\n relationships,\n relationshipsToDelete,\n selects,\n selectsToDelete,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n}: Args) => {\n const newRows: ArrayRowToInsert[] = []\n\n const hasUUID = adapter.tables[arrayTableName]._uuid\n\n if (isArrayOfRows(data)) {\n data.forEach((arrayRow, i) => {\n const newRow: ArrayRowToInsert = {\n arrays: {},\n arraysToPush: {},\n locales: {},\n row: {\n _order: i + 1,\n },\n }\n\n // If we have declared a _uuid field on arrays,\n // that means the ID has to be unique,\n // and our ids within arrays are not unique.\n // So move the ID to a uuid field for storage\n // and allow the database to generate a serial id automatically\n if (hasUUID) {\n newRow.row._uuid = arrayRow.id\n delete arrayRow.id\n }\n\n if (locale) {\n newRow.locales[locale] = {\n _locale: locale,\n }\n }\n\n if (fieldShouldBeLocalized({ field, parentIsLocalized }) && locale) {\n newRow.row._locale = locale\n }\n\n if (withinArrayOrBlockLocale) {\n newRow.row._locale = withinArrayOrBlockLocale\n }\n\n traverseFields({\n adapter,\n arrays: newRow.arrays,\n arraysToPush: newRow.arraysToPush,\n baseTableName,\n blocks,\n blocksToDelete,\n columnPrefix: '',\n data: arrayRow,\n fieldPrefix: '',\n fields: field.flattenedFields,\n insideArrayOrBlock: true,\n locales: newRow.locales,\n numbers,\n numbersToDelete,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentTableName: arrayTableName,\n path: `${path || ''}${field.name}.${i}.`,\n relationships,\n relationshipsToAppend: [],\n relationshipsToDelete,\n row: newRow.row,\n selects,\n selectsToDelete,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n })\n\n newRows.push(newRow)\n })\n }\n\n return newRows\n}\n"],"names":["fieldShouldBeLocalized","isArrayOfRows","traverseFields","transformArray","adapter","arrayTableName","baseTableName","blocks","blocksToDelete","data","field","locale","numbers","numbersToDelete","parentIsLocalized","path","relationships","relationshipsToDelete","selects","selectsToDelete","texts","textsToDelete","withinArrayOrBlockLocale","newRows","hasUUID","tables","_uuid","forEach","arrayRow","i","newRow","arrays","arraysToPush","locales","row","_order","id","_locale","columnPrefix","fieldPrefix","fields","flattenedFields","insideArrayOrBlock","localized","parentTableName","name","relationshipsToAppend","push"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,iBAAgB;AAYvD,SAASC,aAAa,QAAQ,mCAAkC;AAChE,SAASC,cAAc,QAAQ,sBAAqB;AAgCpD,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,MAAM,EACNC,cAAc,EACdC,IAAI,EACJC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,eAAe,EACfC,iBAAiB,EACjBC,IAAI,EACJC,aAAa,EACbC,qBAAqB,EACrBC,OAAO,EACPC,eAAe,EACfC,KAAK,EACLC,aAAa,EACbC,wBAAwB,EACnB;IACL,MAAMC,UAA8B,EAAE;IAEtC,MAAMC,UAAUpB,QAAQqB,MAAM,CAACpB,eAAe,CAACqB,KAAK;IAEpD,IAAIzB,cAAcQ,O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
|
import type { FlattenedBlocksField } from 'payload';
|
|
2
2
|
import type { DrizzleAdapter } from '../../types.js';
|
|
3
|
-
import type { BlockRowToInsert, NumberToDelete, RelationshipToDelete, TextToDelete } from './types.js';
|
|
3
|
+
import type { BlockRowToInsert, NumberToDelete, RelationshipToDelete, RowToInsert, TextToDelete } from './types.js';
|
|
4
4
|
type Args = {
|
|
5
5
|
adapter: DrizzleAdapter;
|
|
6
6
|
baseTableName: string;
|
|
@@ -20,6 +20,7 @@ type Args = {
|
|
|
20
20
|
selects: {
|
|
21
21
|
[tableName: string]: Record<string, unknown>[];
|
|
22
22
|
};
|
|
23
|
+
selectsToDelete: RowToInsert['selectsToDelete'];
|
|
23
24
|
texts: Record<string, unknown>[];
|
|
24
25
|
textsToDelete: TextToDelete[];
|
|
25
26
|
/**
|
|
@@ -28,6 +29,6 @@ type Args = {
|
|
|
28
29
|
*/
|
|
29
30
|
withinArrayOrBlockLocale?: string;
|
|
30
31
|
};
|
|
31
|
-
export declare const transformBlocks: ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, numbersToDelete, parentIsLocalized, path, relationships, relationshipsToDelete, selects, texts, textsToDelete, withinArrayOrBlockLocale, }: Args) => void;
|
|
32
|
+
export declare const transformBlocks: ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, numbersToDelete, parentIsLocalized, path, relationships, relationshipsToDelete, selects, selectsToDelete, texts, textsToDelete, withinArrayOrBlockLocale, }: Args) => void;
|
|
32
33
|
export {};
|
|
33
34
|
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/transform/write/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc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BAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,YAAY,CAAA;AAKnB,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,KAAK,EAAE,oBAAoB,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,iBAAiB,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;IACD,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAChC,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AACD,eAAO,MAAM,eAAe,gPAmBzB,IAAI,SAsFN,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { fieldShouldBeLocalized } from 'payload/shared';
|
|
|
2
2
|
import toSnakeCase from 'to-snake-case';
|
|
3
3
|
import { resolveBlockTableName } from '../../utilities/validateExistingBlockIsIdentical.js';
|
|
4
4
|
import { traverseFields } from './traverseFields.js';
|
|
5
|
-
export const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, numbersToDelete, parentIsLocalized, path, relationships, relationshipsToDelete, selects, texts, textsToDelete, withinArrayOrBlockLocale })=>{
|
|
5
|
+
export const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, numbersToDelete, parentIsLocalized, path, relationships, relationshipsToDelete, selects, selectsToDelete, texts, textsToDelete, withinArrayOrBlockLocale })=>{
|
|
6
6
|
data.forEach((blockRow, i)=>{
|
|
7
7
|
if (typeof blockRow.blockType !== 'string') {
|
|
8
8
|
return;
|
|
@@ -67,6 +67,7 @@ export const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete
|
|
|
67
67
|
relationshipsToDelete,
|
|
68
68
|
row: newRow.row,
|
|
69
69
|
selects,
|
|
70
|
+
selectsToDelete,
|
|
70
71
|
texts,
|
|
71
72
|
textsToDelete,
|
|
72
73
|
withinArrayOrBlockLocale
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/transform/write/blocks.ts"],"sourcesContent":["import type { FlattenedBlock, FlattenedBlocksField } from 'payload'\n\nimport { fieldShouldBeLocalized } from 'payload/shared'\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from '../../types.js'\nimport type {\n BlockRowToInsert,\n NumberToDelete,\n RelationshipToDelete,\n TextToDelete,\n} from './types.js'\n\nimport { resolveBlockTableName } from '../../utilities/validateExistingBlockIsIdentical.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n baseTableName: string\n blocks: {\n [blockType: string]: BlockRowToInsert[]\n }\n blocksToDelete: Set<string>\n data: Record<string, unknown>[]\n field: FlattenedBlocksField\n locale?: string\n numbers: Record<string, unknown>[]\n numbersToDelete: NumberToDelete[]\n parentIsLocalized: boolean\n path: string\n relationships: Record<string, unknown>[]\n relationshipsToDelete: RelationshipToDelete[]\n selects: {\n [tableName: string]: Record<string, unknown>[]\n }\n texts: Record<string, unknown>[]\n textsToDelete: TextToDelete[]\n /**\n * Set to a locale code if this set of fields is traversed within a\n * localized array or block field\n */\n withinArrayOrBlockLocale?: string\n}\nexport const transformBlocks = ({\n adapter,\n baseTableName,\n blocks,\n blocksToDelete,\n data,\n field,\n locale,\n numbers,\n numbersToDelete,\n parentIsLocalized,\n path,\n relationships,\n relationshipsToDelete,\n selects,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n}: Args) => {\n data.forEach((blockRow, i) => {\n if (typeof blockRow.blockType !== 'string') {\n return\n }\n\n const matchedBlock =\n adapter.payload.blocks[blockRow.blockType] ??\n (field.blocks.find(\n (block) => typeof block !== 'string' && block.slug === blockRow.blockType,\n ) as FlattenedBlock | undefined)\n\n if (!matchedBlock) {\n return\n }\n const blockType = toSnakeCase(blockRow.blockType)\n\n const newRow: BlockRowToInsert = {\n arrays: {},\n arraysToPush: {},\n locales: {},\n row: {\n _order: i + 1,\n _path: `${path}${field.name}`,\n },\n }\n\n if (fieldShouldBeLocalized({ field, parentIsLocalized }) && locale) {\n newRow.row._locale = locale\n }\n if (withinArrayOrBlockLocale) {\n newRow.row._locale = withinArrayOrBlockLocale\n }\n\n const blockTableName = resolveBlockTableName(\n matchedBlock,\n adapter.tableNameMap.get(`${baseTableName}_blocks_${blockType}`),\n )\n\n if (!blocks[blockTableName]) {\n blocks[blockTableName] = []\n }\n\n const hasUUID = adapter.tables[blockTableName]._uuid\n\n // If we have declared a _uuid field on arrays,\n // that means the ID has to be unique,\n // and our ids within arrays are not unique.\n // So move the ID to a uuid field for storage\n // and allow the database to generate a serial id automatically\n if (hasUUID) {\n newRow.row._uuid = blockRow.id\n delete blockRow.id\n }\n\n traverseFields({\n adapter,\n arrays: newRow.arrays,\n arraysToPush: newRow.arraysToPush,\n baseTableName,\n blocks,\n blocksToDelete,\n columnPrefix: '',\n data: blockRow,\n fieldPrefix: '',\n fields: matchedBlock.flattenedFields,\n insideArrayOrBlock: true,\n locales: newRow.locales,\n numbers,\n numbersToDelete,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentTableName: blockTableName,\n path: `${path || ''}${field.name}.${i}.`,\n relationships,\n relationshipsToAppend: [],\n relationshipsToDelete,\n row: newRow.row,\n selects,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n })\n\n blocks[blockTableName].push(newRow)\n })\n}\n"],"names":["fieldShouldBeLocalized","toSnakeCase","resolveBlockTableName","traverseFields","transformBlocks","adapter","baseTableName","blocks","blocksToDelete","data","field","locale","numbers","numbersToDelete","parentIsLocalized","path","relationships","relationshipsToDelete","selects","texts","textsToDelete","withinArrayOrBlockLocale","forEach","blockRow","i","blockType","matchedBlock","payload","find","block","slug","newRow","arrays","arraysToPush","locales","row","_order","_path","name","_locale","blockTableName","tableNameMap","get","hasUUID","tables","_uuid","id","columnPrefix","fieldPrefix","fields","flattenedFields","insideArrayOrBlock","localized","parentTableName","relationshipsToAppend","push"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,iBAAgB;AACvD,OAAOC,iBAAiB,gBAAe;
|
|
1
|
+
{"version":3,"sources":["../../../src/transform/write/blocks.ts"],"sourcesContent":["import type { FlattenedBlock, FlattenedBlocksField } from 'payload'\n\nimport { fieldShouldBeLocalized } from 'payload/shared'\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from '../../types.js'\nimport type {\n BlockRowToInsert,\n NumberToDelete,\n RelationshipToDelete,\n RowToInsert,\n TextToDelete,\n} from './types.js'\n\nimport { resolveBlockTableName } from '../../utilities/validateExistingBlockIsIdentical.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n baseTableName: string\n blocks: {\n [blockType: string]: BlockRowToInsert[]\n }\n blocksToDelete: Set<string>\n data: Record<string, unknown>[]\n field: FlattenedBlocksField\n locale?: string\n numbers: Record<string, unknown>[]\n numbersToDelete: NumberToDelete[]\n parentIsLocalized: boolean\n path: string\n relationships: Record<string, unknown>[]\n relationshipsToDelete: RelationshipToDelete[]\n selects: {\n [tableName: string]: Record<string, unknown>[]\n }\n selectsToDelete: RowToInsert['selectsToDelete']\n texts: Record<string, unknown>[]\n textsToDelete: TextToDelete[]\n /**\n * Set to a locale code if this set of fields is traversed within a\n * localized array or block field\n */\n withinArrayOrBlockLocale?: string\n}\nexport const transformBlocks = ({\n adapter,\n baseTableName,\n blocks,\n blocksToDelete,\n data,\n field,\n locale,\n numbers,\n numbersToDelete,\n parentIsLocalized,\n path,\n relationships,\n relationshipsToDelete,\n selects,\n selectsToDelete,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n}: Args) => {\n data.forEach((blockRow, i) => {\n if (typeof blockRow.blockType !== 'string') {\n return\n }\n\n const matchedBlock =\n adapter.payload.blocks[blockRow.blockType] ??\n (field.blocks.find(\n (block) => typeof block !== 'string' && block.slug === blockRow.blockType,\n ) as FlattenedBlock | undefined)\n\n if (!matchedBlock) {\n return\n }\n const blockType = toSnakeCase(blockRow.blockType)\n\n const newRow: BlockRowToInsert = {\n arrays: {},\n arraysToPush: {},\n locales: {},\n row: {\n _order: i + 1,\n _path: `${path}${field.name}`,\n },\n }\n\n if (fieldShouldBeLocalized({ field, parentIsLocalized }) && locale) {\n newRow.row._locale = locale\n }\n if (withinArrayOrBlockLocale) {\n newRow.row._locale = withinArrayOrBlockLocale\n }\n\n const blockTableName = resolveBlockTableName(\n matchedBlock,\n adapter.tableNameMap.get(`${baseTableName}_blocks_${blockType}`),\n )\n\n if (!blocks[blockTableName]) {\n blocks[blockTableName] = []\n }\n\n const hasUUID = adapter.tables[blockTableName]._uuid\n\n // If we have declared a _uuid field on arrays,\n // that means the ID has to be unique,\n // and our ids within arrays are not unique.\n // So move the ID to a uuid field for storage\n // and allow the database to generate a serial id automatically\n if (hasUUID) {\n newRow.row._uuid = blockRow.id\n delete blockRow.id\n }\n\n traverseFields({\n adapter,\n arrays: newRow.arrays,\n arraysToPush: newRow.arraysToPush,\n baseTableName,\n blocks,\n blocksToDelete,\n columnPrefix: '',\n data: blockRow,\n fieldPrefix: '',\n fields: matchedBlock.flattenedFields,\n insideArrayOrBlock: true,\n locales: newRow.locales,\n numbers,\n numbersToDelete,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentTableName: blockTableName,\n path: `${path || ''}${field.name}.${i}.`,\n relationships,\n relationshipsToAppend: [],\n relationshipsToDelete,\n row: newRow.row,\n selects,\n selectsToDelete,\n texts,\n textsToDelete,\n withinArrayOrBlockLocale,\n })\n\n blocks[blockTableName].push(newRow)\n })\n}\n"],"names":["fieldShouldBeLocalized","toSnakeCase","resolveBlockTableName","traverseFields","transformBlocks","adapter","baseTableName","blocks","blocksToDelete","data","field","locale","numbers","numbersToDelete","parentIsLocalized","path","relationships","relationshipsToDelete","selects","selectsToDelete","texts","textsToDelete","withinArrayOrBlockLocale","forEach","blockRow","i","blockType","matchedBlock","payload","find","block","slug","newRow","arrays","arraysToPush","locales","row","_order","_path","name","_locale","blockTableName","tableNameMap","get","hasUUID","tables","_uuid","id","columnPrefix","fieldPrefix","fields","flattenedFields","insideArrayOrBlock","localized","parentTableName","relationshipsToAppend","push"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,iBAAgB;AACvD,OAAOC,iBAAiB,gBAAe;AAWvC,SAASC,qBAAqB,QAAQ,sDAAqD;AAC3F,SAASC,cAAc,QAAQ,sBAAqB;AA8BpD,OAAO,MAAMC,kBAAkB,CAAC,EAC9BC,OAAO,EACPC,aAAa,EACbC,MAAM,EACNC,cAAc,EACdC,IAAI,EACJC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,eAAe,EACfC,iBAAiB,EACjBC,IAAI,EACJC,aAAa,EACbC,qBAAqB,EACrBC,OAAO,EACPC,eAAe,EACfC,KAAK,EACLC,aAAa,EACbC,wBAAwB,EACnB;IACLb,KAAKc,OAAO,CAAC,CAACC,UAAUC;QACtB,IAAI,OAAOD,SAASE,SAAS,KAAK,UAAU;YAC1C;QACF;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AoB;YACpBjB,SAASH,OAAOG,OAAO;YACvBvB;YACAC;YACAC,mBAAmBA,qBAAqBJ,MAAM2C,SAAS;YACvDC,iBAAiBb;YACjB1B,MAAM,GAAGA,QAAQ,KAAKL,MAAM6B,IAAI,CAAC,CAAC,EAAEd,EAAE,CAAC,CAAC;YACxCT;YACAuC,uBAAuB,EAAE;YACzBtC;YACAmB,KAAKJ,OAAOI,GAAG;YACflB;YACAC;YACAC;YACAC;YACAC;QACF;QAEAf,MAAM,CAACkC,eAAe,CAACe,IAAI,CAACxB;IAC9B;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/write/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI7C,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/write/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI7C,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,uFAQ3B,IAAI,KAAG,WAmDT,CAAA"}
|
|
@@ -14,6 +14,7 @@ export const transformForWrite = ({ adapter, data, enableAtomicWrites, fields, p
|
|
|
14
14
|
relationshipsToDelete: [],
|
|
15
15
|
row: {},
|
|
16
16
|
selects: {},
|
|
17
|
+
selectsToDelete: {},
|
|
17
18
|
texts: [],
|
|
18
19
|
textsToDelete: []
|
|
19
20
|
};
|
|
@@ -42,6 +43,7 @@ export const transformForWrite = ({ adapter, data, enableAtomicWrites, fields, p
|
|
|
42
43
|
relationshipsToDelete: rowToInsert.relationshipsToDelete,
|
|
43
44
|
row: rowToInsert.row,
|
|
44
45
|
selects: rowToInsert.selects,
|
|
46
|
+
selectsToDelete: rowToInsert.selectsToDelete,
|
|
45
47
|
texts: rowToInsert.texts,
|
|
46
48
|
textsToDelete: rowToInsert.textsToDelete
|
|
47
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/transform/write/index.ts"],"sourcesContent":["import type { FlattenedField } from 'payload'\n\nimport type { DrizzleAdapter } from '../../types.js'\nimport type { RowToInsert } from './types.js'\n\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n data: Record<string, unknown>\n enableAtomicWrites?: boolean\n fields: FlattenedField[]\n parentIsLocalized?: boolean\n path?: string\n tableName: string\n}\n\nexport const transformForWrite = ({\n adapter,\n data,\n enableAtomicWrites,\n fields,\n parentIsLocalized,\n path = '',\n tableName,\n}: Args): RowToInsert => {\n // Split out the incoming data into rows to insert / delete\n const rowToInsert: RowToInsert = {\n arrays: {},\n arraysToPush: {},\n blocks: {},\n blocksToDelete: new Set(),\n locales: {},\n numbers: [],\n numbersToDelete: [],\n relationships: [],\n relationshipsToAppend: [],\n relationshipsToDelete: [],\n row: {},\n selects: {},\n texts: [],\n textsToDelete: [],\n }\n\n // This function is responsible for building up the\n // above rowToInsert\n traverseFields({\n adapter,\n arrays: rowToInsert.arrays,\n arraysToPush: rowToInsert.arraysToPush,\n baseTableName: tableName,\n blocks: rowToInsert.blocks,\n blocksToDelete: rowToInsert.blocksToDelete,\n columnPrefix: '',\n data,\n enableAtomicWrites,\n fieldPrefix: '',\n fields,\n locales: rowToInsert.locales,\n numbers: rowToInsert.numbers,\n numbersToDelete: rowToInsert.numbersToDelete,\n parentIsLocalized,\n parentTableName: tableName,\n path,\n relationships: rowToInsert.relationships,\n relationshipsToAppend: rowToInsert.relationshipsToAppend,\n relationshipsToDelete: rowToInsert.relationshipsToDelete,\n row: rowToInsert.row,\n selects: rowToInsert.selects,\n texts: rowToInsert.texts,\n textsToDelete: rowToInsert.textsToDelete,\n })\n\n return rowToInsert\n}\n"],"names":["traverseFields","transformForWrite","adapter","data","enableAtomicWrites","fields","parentIsLocalized","path","tableName","rowToInsert","arrays","arraysToPush","blocks","blocksToDelete","Set","locales","numbers","numbersToDelete","relationships","relationshipsToAppend","relationshipsToDelete","row","selects","texts","textsToDelete","baseTableName","columnPrefix","fieldPrefix","parentTableName"],"mappings":"AAKA,SAASA,cAAc,QAAQ,sBAAqB;AAYpD,OAAO,MAAMC,oBAAoB,CAAC,EAChCC,OAAO,EACPC,IAAI,EACJC,kBAAkB,EAClBC,MAAM,EACNC,iBAAiB,EACjBC,OAAO,EAAE,EACTC,SAAS,EACJ;IACL,2DAA2D;IAC3D,MAAMC,cAA2B;QAC/BC,QAAQ,CAAC;QACTC,cAAc,CAAC;QACfC,QAAQ,CAAC;QACTC,gBAAgB,IAAIC;QACpBC,SAAS,CAAC;QACVC,SAAS,EAAE;QACXC,iBAAiB,EAAE;QACnBC,eAAe,EAAE;QACjBC,uBAAuB,EAAE;QACzBC,uBAAuB,EAAE;QACzBC,KAAK,CAAC;QACNC,SAAS,CAAC;QACVC,OAAO,EAAE;QACTC,eAAe,EAAE;IACnB;IAEA,mDAAmD;IACnD,oBAAoB;
|
|
1
|
+
{"version":3,"sources":["../../../src/transform/write/index.ts"],"sourcesContent":["import type { FlattenedField } from 'payload'\n\nimport type { DrizzleAdapter } from '../../types.js'\nimport type { RowToInsert } from './types.js'\n\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: DrizzleAdapter\n data: Record<string, unknown>\n enableAtomicWrites?: boolean\n fields: FlattenedField[]\n parentIsLocalized?: boolean\n path?: string\n tableName: string\n}\n\nexport const transformForWrite = ({\n adapter,\n data,\n enableAtomicWrites,\n fields,\n parentIsLocalized,\n path = '',\n tableName,\n}: Args): RowToInsert => {\n // Split out the incoming data into rows to insert / delete\n const rowToInsert: RowToInsert = {\n arrays: {},\n arraysToPush: {},\n blocks: {},\n blocksToDelete: new Set(),\n locales: {},\n numbers: [],\n numbersToDelete: [],\n relationships: [],\n relationshipsToAppend: [],\n relationshipsToDelete: [],\n row: {},\n selects: {},\n selectsToDelete: {},\n texts: [],\n textsToDelete: [],\n }\n\n // This function is responsible for building up the\n // above rowToInsert\n traverseFields({\n adapter,\n arrays: rowToInsert.arrays,\n arraysToPush: rowToInsert.arraysToPush,\n baseTableName: tableName,\n blocks: rowToInsert.blocks,\n blocksToDelete: rowToInsert.blocksToDelete,\n columnPrefix: '',\n data,\n enableAtomicWrites,\n fieldPrefix: '',\n fields,\n locales: rowToInsert.locales,\n numbers: rowToInsert.numbers,\n numbersToDelete: rowToInsert.numbersToDelete,\n parentIsLocalized,\n parentTableName: tableName,\n path,\n relationships: rowToInsert.relationships,\n relationshipsToAppend: rowToInsert.relationshipsToAppend,\n relationshipsToDelete: rowToInsert.relationshipsToDelete,\n row: rowToInsert.row,\n selects: rowToInsert.selects,\n selectsToDelete: rowToInsert.selectsToDelete,\n texts: rowToInsert.texts,\n textsToDelete: rowToInsert.textsToDelete,\n })\n\n return rowToInsert\n}\n"],"names":["traverseFields","transformForWrite","adapter","data","enableAtomicWrites","fields","parentIsLocalized","path","tableName","rowToInsert","arrays","arraysToPush","blocks","blocksToDelete","Set","locales","numbers","numbersToDelete","relationships","relationshipsToAppend","relationshipsToDelete","row","selects","selectsToDelete","texts","textsToDelete","baseTableName","columnPrefix","fieldPrefix","parentTableName"],"mappings":"AAKA,SAASA,cAAc,QAAQ,sBAAqB;AAYpD,OAAO,MAAMC,oBAAoB,CAAC,EAChCC,OAAO,EACPC,IAAI,EACJC,kBAAkB,EAClBC,MAAM,EACNC,iBAAiB,EACjBC,OAAO,EAAE,EACTC,SAAS,EACJ;IACL,2DAA2D;IAC3D,MAAMC,cAA2B;QAC/BC,QAAQ,CAAC;QACTC,cAAc,CAAC;QACfC,QAAQ,CAAC;QACTC,gBAAgB,IAAIC;QACpBC,SAAS,CAAC;QACVC,SAAS,EAAE;QACXC,iBAAiB,EAAE;QACnBC,eAAe,EAAE;QACjBC,uBAAuB,EAAE;QACzBC,uBAAuB,EAAE;QACzBC,KAAK,CAAC;QACNC,SAAS,CAAC;QACVC,iBAAiB,CAAC;QAClBC,OAAO,EAAE;QACTC,eAAe,EAAE;IACnB;IAEA,mDAAmD;IACnD,oBAAoB;IACpBzB,eAAe;QACbE;QACAQ,QAAQD,YAAYC,MAAM;QAC1BC,cAAcF,YAAYE,YAAY;QACtCe,eAAelB;QACfI,QAAQH,YAAYG,MAAM;QAC1BC,gBAAgBJ,YAAYI,cAAc;QAC1Cc,cAAc;QACdxB;QACAC;QACAwB,aAAa;QACbvB;QACAU,SAASN,YAAYM,OAAO;QAC5BC,SAASP,YAAYO,OAAO;QAC5BC,iBAAiBR,YAAYQ,eAAe;QAC5CX;QACAuB,iBAAiBrB;QACjBD;QACAW,eAAeT,YAAYS,aAAa;QACxCC,uBAAuBV,YAAYU,qBAAqB;QACxDC,uBAAuBX,YAAYW,qBAAqB;QACxDC,KAAKZ,YAAYY,GAAG;QACpBC,SAASb,YAAYa,OAAO;QAC5BC,iBAAiBd,YAAYc,eAAe;QAC5CC,OAAOf,YAAYe,KAAK;QACxBC,eAAehB,YAAYgB,aAAa;IAC1C;IAEA,OAAOhB;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../../src/transform/write/numbers.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../../src/transform/write/numbers.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,gBAAgB,+BAAgC,IAAI,SAQhE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/transform/write/relationships.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI7D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAAA;IACtC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/transform/write/relationships.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI7D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAAA;IACtC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,qBAAqB,4CAA6C,IAAI,SAqBlF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selects.d.ts","sourceRoot":"","sources":["../../../src/transform/write/selects.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"selects.d.ts","sourceRoot":"","sources":["../../../src/transform/write/selects.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,gBAAgB,yBAA0B,IAAI,8BAoB1D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../../../src/transform/write/texts.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../../../src/transform/write/texts.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,cAAc,6BAA8B,IAAI,SAQ5D,CAAA"}
|
|
@@ -55,6 +55,7 @@ type Args = {
|
|
|
55
55
|
selects: {
|
|
56
56
|
[tableName: string]: Record<string, unknown>[];
|
|
57
57
|
};
|
|
58
|
+
selectsToDelete: RowToInsert['selectsToDelete'];
|
|
58
59
|
texts: Record<string, unknown>[];
|
|
59
60
|
textsToDelete: TextToDelete[];
|
|
60
61
|
/**
|
|
@@ -63,6 +64,6 @@ type Args = {
|
|
|
63
64
|
*/
|
|
64
65
|
withinArrayOrBlockLocale?: string;
|
|
65
66
|
};
|
|
66
|
-
export declare const traverseFields: ({ adapter, arrays, arraysToPush, baseTableName, blocks, blocksToDelete, columnPrefix, data, enableAtomicWrites, existingLocales, fieldPrefix, fields, forcedLocale, insideArrayOrBlock, locales, numbers, numbersToDelete, parentIsLocalized, parentTableName, path, relationships, relationshipsToAppend, relationshipsToDelete, row, selects, texts, textsToDelete, withinArrayOrBlockLocale, }: Args) => void;
|
|
67
|
+
export declare const traverseFields: ({ adapter, arrays, arraysToPush, baseTableName, blocks, blocksToDelete, columnPrefix, data, enableAtomicWrites, existingLocales, fieldPrefix, fields, forcedLocale, insideArrayOrBlock, locales, numbers, numbersToDelete, parentIsLocalized, parentTableName, path, relationships, relationshipsToAppend, relationshipsToDelete, row, selects, selectsToDelete, texts, textsToDelete, withinArrayOrBlockLocale, }: Args) => void;
|
|
67
68
|
export {};
|
|
68
69
|
//# sourceMappingURL=traverseFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/write/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAIvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,YAAY,CAAA;AAWnB,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7B;;;OAGG;IACH,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;IACzC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC3C;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,OAAO,EAAE;QACP,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AAe,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAChC,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,cAAc,uZA8BxB,IAAI,SAqwBN,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sql } from 'drizzle-orm';
|
|
2
2
|
import { APIError } from 'payload';
|
|
3
|
-
import { fieldIsVirtual, fieldShouldBeLocalized } from 'payload/shared';
|
|
3
|
+
import { expandOwnDottedKey, fieldIsVirtual, fieldShouldBeLocalized } from 'payload/shared';
|
|
4
4
|
import toSnakeCase from 'to-snake-case';
|
|
5
5
|
import { isArrayOfRows } from '../../utilities/isArrayOfRows.js';
|
|
6
6
|
import { resolveBlockTableName } from '../../utilities/validateExistingBlockIsIdentical.js';
|
|
@@ -10,7 +10,7 @@ import { transformNumbers } from './numbers.js';
|
|
|
10
10
|
import { transformRelationship } from './relationships.js';
|
|
11
11
|
import { transformSelects } from './selects.js';
|
|
12
12
|
import { transformTexts } from './texts.js';
|
|
13
|
-
export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, blocks, blocksToDelete, columnPrefix, data, enableAtomicWrites, existingLocales, fieldPrefix, fields, forcedLocale, insideArrayOrBlock = false, locales, numbers, numbersToDelete, parentIsLocalized, parentTableName, path, relationships, relationshipsToAppend, relationshipsToDelete, row, selects, texts, textsToDelete, withinArrayOrBlockLocale })=>{
|
|
13
|
+
export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, blocks, blocksToDelete, columnPrefix, data, enableAtomicWrites, existingLocales, fieldPrefix, fields, forcedLocale, insideArrayOrBlock = false, locales, numbers, numbersToDelete, parentIsLocalized, parentTableName, path, relationships, relationshipsToAppend, relationshipsToDelete, row, selects, selectsToDelete, texts, textsToDelete, withinArrayOrBlockLocale })=>{
|
|
14
14
|
let fieldsMatched = false;
|
|
15
15
|
if (row._uuid) {
|
|
16
16
|
data._uuid = row._uuid;
|
|
@@ -34,6 +34,9 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
34
34
|
parentIsLocalized
|
|
35
35
|
});
|
|
36
36
|
if (field.type === 'array') {
|
|
37
|
+
if (fieldData === undefined) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
37
40
|
const arrayTableName = adapter.tableNameMap.get(`${parentTableName}_${columnName}`);
|
|
38
41
|
if (isLocalized) {
|
|
39
42
|
const value = data[field.name];
|
|
@@ -67,6 +70,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
67
70
|
relationships,
|
|
68
71
|
relationshipsToDelete,
|
|
69
72
|
selects,
|
|
73
|
+
selectsToDelete,
|
|
70
74
|
texts,
|
|
71
75
|
textsToDelete,
|
|
72
76
|
withinArrayOrBlockLocale: localeKey
|
|
@@ -109,6 +113,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
109
113
|
relationships,
|
|
110
114
|
relationshipsToDelete,
|
|
111
115
|
selects,
|
|
116
|
+
selectsToDelete,
|
|
112
117
|
texts,
|
|
113
118
|
textsToDelete,
|
|
114
119
|
withinArrayOrBlockLocale
|
|
@@ -128,6 +133,9 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
128
133
|
return;
|
|
129
134
|
}
|
|
130
135
|
if (field.type === 'blocks' && !adapter.blocksAsJSON) {
|
|
136
|
+
if (fieldData === undefined) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
131
139
|
field.blocks.forEach((block)=>{
|
|
132
140
|
const matchedBlock = typeof block === 'string' ? adapter.payload.config.blocks.find((each)=>each.slug === block) : block;
|
|
133
141
|
blocksToDelete.add(resolveBlockTableName(matchedBlock, adapter.tableNameMap.get(`${baseTableName}_blocks_${toSnakeCase(matchedBlock.slug)}`)));
|
|
@@ -151,6 +159,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
151
159
|
relationships,
|
|
152
160
|
relationshipsToDelete,
|
|
153
161
|
selects,
|
|
162
|
+
selectsToDelete,
|
|
154
163
|
texts,
|
|
155
164
|
textsToDelete,
|
|
156
165
|
withinArrayOrBlockLocale: localeKey
|
|
@@ -173,6 +182,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
173
182
|
relationships,
|
|
174
183
|
relationshipsToDelete,
|
|
175
184
|
selects,
|
|
185
|
+
selectsToDelete,
|
|
176
186
|
texts,
|
|
177
187
|
textsToDelete,
|
|
178
188
|
withinArrayOrBlockLocale
|
|
@@ -212,6 +222,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
212
222
|
relationshipsToDelete,
|
|
213
223
|
row,
|
|
214
224
|
selects,
|
|
225
|
+
selectsToDelete,
|
|
215
226
|
texts,
|
|
216
227
|
textsToDelete,
|
|
217
228
|
withinArrayOrBlockLocale: localeKey
|
|
@@ -247,6 +258,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
247
258
|
relationshipsToDelete,
|
|
248
259
|
row,
|
|
249
260
|
selects,
|
|
261
|
+
selectsToDelete,
|
|
250
262
|
texts,
|
|
251
263
|
textsToDelete,
|
|
252
264
|
withinArrayOrBlockLocale
|
|
@@ -298,7 +310,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
298
310
|
];
|
|
299
311
|
itemsToAppend.forEach((item)=>{
|
|
300
312
|
const relationshipToAppend = {
|
|
301
|
-
locale:
|
|
313
|
+
locale: withinArrayOrBlockLocale,
|
|
302
314
|
path: relationshipPath,
|
|
303
315
|
value: item
|
|
304
316
|
};
|
|
@@ -353,7 +365,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
353
365
|
itemsToRemove.forEach((item)=>{
|
|
354
366
|
const relationshipToDelete = {
|
|
355
367
|
itemToRemove: item,
|
|
356
|
-
locale:
|
|
368
|
+
locale: withinArrayOrBlockLocale,
|
|
357
369
|
path: relationshipPath
|
|
358
370
|
};
|
|
359
371
|
// Store relationTo for simple relationships
|
|
@@ -368,7 +380,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
368
380
|
if (isLocalized && (Array.isArray(field.relationTo) || 'hasMany' in field && field.hasMany)) {
|
|
369
381
|
if (typeof fieldData === 'object') {
|
|
370
382
|
Object.entries(fieldData).forEach(([localeKey, localeData])=>{
|
|
371
|
-
if (localeData === null) {
|
|
383
|
+
if (localeData === null || Array.isArray(localeData) && localeData.length === 0) {
|
|
372
384
|
relationshipsToDelete.push({
|
|
373
385
|
locale: localeKey,
|
|
374
386
|
path: relationshipPath
|
|
@@ -390,6 +402,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
390
402
|
} else if (Array.isArray(field.relationTo) || 'hasMany' in field && field.hasMany) {
|
|
391
403
|
if (fieldData === null || Array.isArray(fieldData) && fieldData.length === 0) {
|
|
392
404
|
relationshipsToDelete.push({
|
|
405
|
+
locale: withinArrayOrBlockLocale,
|
|
393
406
|
path: relationshipPath
|
|
394
407
|
});
|
|
395
408
|
return;
|
|
@@ -509,16 +522,27 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
509
522
|
return;
|
|
510
523
|
}
|
|
511
524
|
if (field.type === 'select' && field.hasMany) {
|
|
525
|
+
if (fieldData === undefined) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
512
528
|
const selectTableName = adapter.tableNameMap.get(`${parentTableName}_${columnName}`);
|
|
513
529
|
if (!selects[selectTableName]) {
|
|
514
530
|
selects[selectTableName] = [];
|
|
515
531
|
}
|
|
532
|
+
if (!selectsToDelete[selectTableName]) {
|
|
533
|
+
selectsToDelete[selectTableName] = [];
|
|
534
|
+
}
|
|
535
|
+
const selectParent = insideArrayOrBlock ? data._uuid ?? data.id : undefined;
|
|
516
536
|
if (isLocalized) {
|
|
517
537
|
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
|
518
538
|
Object.entries(data[field.name]).forEach(([localeKey, localeData])=>{
|
|
519
539
|
if (Array.isArray(localeData)) {
|
|
540
|
+
selectsToDelete[selectTableName].push({
|
|
541
|
+
locale: localeKey,
|
|
542
|
+
parent: selectParent
|
|
543
|
+
});
|
|
520
544
|
const newRows = transformSelects({
|
|
521
|
-
id:
|
|
545
|
+
id: selectParent,
|
|
522
546
|
data: localeData,
|
|
523
547
|
locale: localeKey
|
|
524
548
|
});
|
|
@@ -527,8 +551,12 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
527
551
|
});
|
|
528
552
|
}
|
|
529
553
|
} else if (Array.isArray(data[field.name])) {
|
|
554
|
+
selectsToDelete[selectTableName].push({
|
|
555
|
+
locale: withinArrayOrBlockLocale,
|
|
556
|
+
parent: selectParent
|
|
557
|
+
});
|
|
530
558
|
const newRows = transformSelects({
|
|
531
|
-
id:
|
|
559
|
+
id: selectParent,
|
|
532
560
|
data: data[field.name],
|
|
533
561
|
locale: withinArrayOrBlockLocale
|
|
534
562
|
});
|
|
@@ -607,19 +635,10 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
607
635
|
// Handle dot-notation paths when no fields matched
|
|
608
636
|
if (!fieldsMatched) {
|
|
609
637
|
Object.keys(data).forEach((key)=>{
|
|
610
|
-
if (
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
const remainingPath = key.substring(firstDotIndex + 1);
|
|
615
|
-
// Create nested structure for this field
|
|
616
|
-
if (!data[fieldName]) {
|
|
617
|
-
data[fieldName] = {};
|
|
618
|
-
}
|
|
619
|
-
const nestedData = data[fieldName];
|
|
620
|
-
// Move the value to the nested structure
|
|
621
|
-
nestedData[remainingPath] = data[key];
|
|
622
|
-
delete data[key];
|
|
638
|
+
if (expandOwnDottedKey({
|
|
639
|
+
key,
|
|
640
|
+
target: data
|
|
641
|
+
})) {
|
|
623
642
|
// Recursively process the newly created nested structure
|
|
624
643
|
// The field traversal will naturally handle it if the field exists in the schema
|
|
625
644
|
traverseFields({
|
|
@@ -648,6 +667,7 @@ export const traverseFields = ({ adapter, arrays, arraysToPush, baseTableName, b
|
|
|
648
667
|
relationshipsToDelete,
|
|
649
668
|
row,
|
|
650
669
|
selects,
|
|
670
|
+
selectsToDelete,
|
|
651
671
|
texts,
|
|
652
672
|
textsToDelete,
|
|
653
673
|
withinArrayOrBlockLocale
|