joist-core 2.5.0-next.2 → 2.5.0-next.21
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/build/BaseEntity.cjs +33 -3
- package/build/BaseEntity.cjs.map +1 -1
- package/build/BaseEntity.d.cts +6 -4
- package/build/BaseEntity.d.cts.map +1 -1
- package/build/BaseEntity.d.mts +6 -4
- package/build/BaseEntity.d.mts.map +1 -1
- package/build/BaseEntity.js +33 -4
- package/build/BaseEntity.js.map +1 -1
- package/build/Entity.cjs +2 -3
- package/build/Entity.d.cts +0 -2
- package/build/Entity.d.cts.map +1 -1
- package/build/Entity.d.mts +0 -2
- package/build/Entity.d.mts.map +1 -1
- package/build/Entity.js +2 -3
- package/build/EntityFields.d.cts +0 -2
- package/build/EntityFields.d.cts.map +1 -1
- package/build/EntityFields.d.mts +0 -2
- package/build/EntityFields.d.mts.map +1 -1
- package/build/EntityManager.cjs +185 -103
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +50 -37
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +50 -37
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +185 -104
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +3 -4
- package/build/EntityMetadata.cjs.map +1 -1
- package/build/EntityMetadata.d.cts +8 -6
- package/build/EntityMetadata.d.cts.map +1 -1
- package/build/EntityMetadata.d.mts +8 -6
- package/build/EntityMetadata.d.mts.map +1 -1
- package/build/EntityMetadata.js +3 -4
- package/build/EntityMetadata.js.map +1 -1
- package/build/EnumMetadata.d.cts +0 -2
- package/build/EnumMetadata.d.cts.map +1 -1
- package/build/EnumMetadata.d.mts +0 -2
- package/build/EnumMetadata.d.mts.map +1 -1
- package/build/IndexManager.cjs +4 -5
- package/build/IndexManager.d.cts +1 -3
- package/build/IndexManager.d.cts.map +1 -1
- package/build/IndexManager.d.mts +1 -3
- package/build/IndexManager.d.mts.map +1 -1
- package/build/IndexManager.js +4 -5
- package/build/InstanceData.cjs +12 -6
- package/build/InstanceData.cjs.map +1 -1
- package/build/InstanceData.d.cts +9 -5
- package/build/InstanceData.d.cts.map +1 -1
- package/build/InstanceData.d.mts +9 -5
- package/build/InstanceData.d.mts.map +1 -1
- package/build/InstanceData.js +12 -6
- package/build/InstanceData.js.map +1 -1
- package/build/PluginManager.cjs +21 -8
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +19 -7
- package/build/PluginManager.d.cts.map +1 -1
- package/build/PluginManager.d.mts +19 -7
- package/build/PluginManager.d.mts.map +1 -1
- package/build/PluginManager.js +21 -8
- package/build/PluginManager.js.map +1 -1
- package/build/RowData.cjs +1 -2
- package/build/RowData.d.cts +0 -2
- package/build/RowData.d.cts.map +1 -1
- package/build/RowData.d.mts +0 -2
- package/build/RowData.d.mts.map +1 -1
- package/build/RowData.js +1 -2
- package/build/_virtual/_rolldown/runtime.cjs +1 -2
- package/build/batchloaders/BatchLoader.cjs +1 -2
- package/build/batchloaders/BatchLoader.d.cts +0 -2
- package/build/batchloaders/BatchLoader.d.cts.map +1 -1
- package/build/batchloaders/BatchLoader.d.mts +0 -2
- package/build/batchloaders/BatchLoader.d.mts.map +1 -1
- package/build/batchloaders/BatchLoader.js +1 -2
- package/build/batchloaders/enumCollectionBatchLoader.cjs +4 -5
- package/build/batchloaders/enumCollectionBatchLoader.cjs.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.cts +1 -3
- package/build/batchloaders/enumCollectionBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.mts +1 -3
- package/build/batchloaders/enumCollectionBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.js +4 -5
- package/build/batchloaders/enumCollectionBatchLoader.js.map +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +9 -9
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.cts +3 -5
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.mts +3 -5
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/loadBatchLoader.js +9 -9
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +5 -6
- package/build/batchloaders/manyToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.cts +1 -3
- package/build/batchloaders/manyToManyBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.mts +1 -3
- package/build/batchloaders/manyToManyBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.js +5 -6
- package/build/batchloaders/manyToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +5 -6
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.d.cts +2 -4
- package/build/batchloaders/oneToManyBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.d.mts +2 -4
- package/build/batchloaders/oneToManyBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.js +6 -7
- package/build/batchloaders/oneToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.cjs +7 -8
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.d.cts +2 -4
- package/build/batchloaders/oneToOneBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.d.mts +2 -4
- package/build/batchloaders/oneToOneBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.js +7 -8
- package/build/batchloaders/oneToOneBatchLoader.js.map +1 -1
- package/build/batchloaders/populateBatchLoader.cjs +14 -18
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.cts +2 -4
- package/build/batchloaders/populateBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.mts +2 -4
- package/build/batchloaders/populateBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/populateBatchLoader.js +14 -18
- package/build/batchloaders/populateBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +11 -11
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts +2 -4
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts +2 -4
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.js +11 -11
- package/build/batchloaders/recursiveChildrenBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +7 -8
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts +2 -4
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts +2 -4
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.js +7 -8
- package/build/batchloaders/recursiveM2mBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +7 -8
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts +2 -4
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts +2 -4
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.js +7 -8
- package/build/batchloaders/recursiveParentsBatchLoader.js.map +1 -1
- package/build/changes.cjs +7 -8
- package/build/changes.d.cts +3 -5
- package/build/changes.d.cts.map +1 -1
- package/build/changes.d.mts +3 -5
- package/build/changes.d.mts.map +1 -1
- package/build/changes.js +7 -8
- package/build/config.cjs +9 -10
- package/build/config.d.cts +6 -8
- package/build/config.d.cts.map +1 -1
- package/build/config.d.mts +6 -8
- package/build/config.d.mts.map +1 -1
- package/build/config.js +9 -10
- package/build/configure.cjs +11 -12
- package/build/configure.d.cts +3 -5
- package/build/configure.d.cts.map +1 -1
- package/build/configure.d.mts +3 -5
- package/build/configure.d.mts.map +1 -1
- package/build/configure.js +11 -12
- package/build/dataloaders/buildCandidateBatchQuery.cjs +499 -0
- package/build/dataloaders/buildCandidateBatchQuery.cjs.map +1 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.cts +57 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.cts.map +1 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.mts +57 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.mts.map +1 -0
- package/build/dataloaders/buildCandidateBatchQuery.js +498 -0
- package/build/dataloaders/buildCandidateBatchQuery.js.map +1 -0
- package/build/dataloaders/collectFindArguments.cjs +48 -0
- package/build/dataloaders/collectFindArguments.cjs.map +1 -0
- package/build/dataloaders/collectFindArguments.d.cts +31 -0
- package/build/dataloaders/collectFindArguments.d.cts.map +1 -0
- package/build/dataloaders/collectFindArguments.d.mts +31 -0
- package/build/dataloaders/collectFindArguments.d.mts.map +1 -0
- package/build/dataloaders/collectFindArguments.js +47 -0
- package/build/dataloaders/collectFindArguments.js.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.cjs +3 -4
- package/build/dataloaders/fastWhereFilterHash.d.cts +0 -2
- package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.d.mts +0 -2
- package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.js +3 -4
- package/build/dataloaders/findByUniqueDataLoader.cjs +2 -3
- package/build/dataloaders/findByUniqueDataLoader.d.cts +2 -4
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.mts +2 -4
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.js +2 -3
- package/build/dataloaders/findCountDataLoader.cjs +8 -9
- package/build/dataloaders/findCountDataLoader.d.cts +3 -5
- package/build/dataloaders/findCountDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.mts +3 -5
- package/build/dataloaders/findCountDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findCountDataLoader.js +8 -9
- package/build/dataloaders/findDataLoader.cjs +48 -77
- package/build/dataloaders/findDataLoader.cjs.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts +5 -7
- package/build/dataloaders/findDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findDataLoader.d.mts +5 -7
- package/build/dataloaders/findDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findDataLoader.js +48 -77
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +6 -7
- package/build/dataloaders/findIdsDataLoader.d.cts +2 -4
- package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.mts +2 -4
- package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.js +6 -7
- package/build/dataloaders/findOrCreateDataLoader.cjs +7 -8
- package/build/dataloaders/findOrCreateDataLoader.d.cts +2 -4
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.mts +2 -4
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js +7 -8
- package/build/dataloaders/findPaginatedDataLoader.cjs +6 -7
- package/build/dataloaders/findPaginatedDataLoader.d.cts +3 -5
- package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts +3 -5
- package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +6 -7
- package/build/dataloaders/lensDataLoader.cjs +5 -6
- package/build/dataloaders/lensDataLoader.d.cts +1 -3
- package/build/dataloaders/lensDataLoader.d.cts.map +1 -1
- package/build/dataloaders/lensDataLoader.d.mts +1 -3
- package/build/dataloaders/lensDataLoader.d.mts.map +1 -1
- package/build/dataloaders/lensDataLoader.js +5 -6
- package/build/dataloaders/manyToManyFindDataLoader.cjs +1 -2
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +2 -4
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +2 -4
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.js +1 -2
- package/build/dataloaders/oneToManyFindDataLoader.cjs +7 -5
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +2 -4
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +2 -4
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.js +8 -6
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +7 -8
- package/build/defaults.d.cts +2 -4
- package/build/defaults.d.cts.map +1 -1
- package/build/defaults.d.mts +2 -4
- package/build/defaults.d.mts.map +1 -1
- package/build/defaults.js +7 -8
- package/build/drivers/Driver.cjs +1 -1
- package/build/drivers/Driver.d.cts +2 -4
- package/build/drivers/Driver.d.cts.map +1 -1
- package/build/drivers/Driver.d.mts +2 -4
- package/build/drivers/Driver.d.mts.map +1 -1
- package/build/drivers/Driver.js +1 -1
- package/build/drivers/EntityWriter.cjs +6 -7
- package/build/drivers/EntityWriter.d.cts +1 -3
- package/build/drivers/EntityWriter.d.cts.map +1 -1
- package/build/drivers/EntityWriter.d.mts +1 -3
- package/build/drivers/EntityWriter.d.mts.map +1 -1
- package/build/drivers/EntityWriter.js +6 -7
- package/build/drivers/IdAssigner.cjs +7 -4
- package/build/drivers/IdAssigner.cjs.map +1 -1
- package/build/drivers/IdAssigner.d.cts +1 -2
- package/build/drivers/IdAssigner.d.cts.map +1 -1
- package/build/drivers/IdAssigner.d.mts +1 -2
- package/build/drivers/IdAssigner.d.mts.map +1 -1
- package/build/drivers/IdAssigner.js +7 -4
- package/build/drivers/IdAssigner.js.map +1 -1
- package/build/drivers/driverApi.cjs +4 -5
- package/build/drivers/driverApi.d.cts +2 -4
- package/build/drivers/driverApi.d.cts.map +1 -1
- package/build/drivers/driverApi.d.mts +2 -4
- package/build/drivers/driverApi.d.mts.map +1 -1
- package/build/drivers/driverApi.js +4 -5
- package/build/drivers/index.d.cts +1 -1
- package/build/drivers/index.d.mts +1 -1
- package/build/fields.cjs +87 -17
- package/build/fields.cjs.map +1 -1
- package/build/fields.d.cts +8 -2
- package/build/fields.d.cts.map +1 -1
- package/build/fields.d.mts +8 -2
- package/build/fields.d.mts.map +1 -1
- package/build/fields.js +87 -19
- package/build/fields.js.map +1 -1
- package/build/flush/FlushLock.cjs +1 -2
- package/build/flush/FlushLock.cjs.map +1 -1
- package/build/flush/FlushLock.d.cts +0 -2
- package/build/flush/FlushLock.d.cts.map +1 -1
- package/build/flush/FlushLock.d.mts +0 -2
- package/build/flush/FlushLock.d.mts.map +1 -1
- package/build/flush/FlushLock.js +1 -2
- package/build/flush/JoinRows.cjs +10 -10
- package/build/flush/JoinRows.cjs.map +1 -1
- package/build/flush/JoinRows.d.cts +2 -4
- package/build/flush/JoinRows.d.cts.map +1 -1
- package/build/flush/JoinRows.d.mts +2 -4
- package/build/flush/JoinRows.d.mts.map +1 -1
- package/build/flush/JoinRows.js +10 -10
- package/build/flush/JoinRows.js.map +1 -1
- package/build/flush/PendingChanges.d.cts +0 -2
- package/build/flush/PendingChanges.d.cts.map +1 -1
- package/build/flush/PendingChanges.d.mts +0 -2
- package/build/flush/PendingChanges.d.mts.map +1 -1
- package/build/flush/ReadDrift.cjs +7 -8
- package/build/flush/ReadDrift.cjs.map +1 -1
- package/build/flush/ReadDrift.d.cts +2 -4
- package/build/flush/ReadDrift.d.cts.map +1 -1
- package/build/flush/ReadDrift.d.mts +2 -4
- package/build/flush/ReadDrift.d.mts.map +1 -1
- package/build/flush/ReadDrift.js +7 -8
- package/build/flush/ReadDrift.js.map +1 -1
- package/build/flush/Todo.cjs +3 -4
- package/build/flush/Todo.d.cts +2 -4
- package/build/flush/Todo.d.cts.map +1 -1
- package/build/flush/Todo.d.mts +2 -4
- package/build/flush/Todo.d.mts.map +1 -1
- package/build/flush/Todo.js +3 -4
- package/build/getProperties.cjs +3 -4
- package/build/getProperties.d.cts +0 -2
- package/build/getProperties.d.cts.map +1 -1
- package/build/getProperties.d.mts +0 -2
- package/build/getProperties.d.mts.map +1 -1
- package/build/getProperties.js +3 -4
- package/build/index.cjs +59 -57
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +51 -53
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +51 -53
- package/build/index.d.mts.map +1 -1
- package/build/index.js +59 -58
- package/build/index.js.map +1 -1
- package/build/json.cjs +12 -13
- package/build/json.cjs.map +1 -1
- package/build/json.d.cts +5 -7
- package/build/json.d.cts.map +1 -1
- package/build/json.d.mts +5 -7
- package/build/json.d.mts.map +1 -1
- package/build/json.js +12 -13
- package/build/json.js.map +1 -1
- package/build/k.cjs +1 -2
- package/build/k.js +1 -2
- package/build/keys.cjs +5 -6
- package/build/keys.d.cts +3 -5
- package/build/keys.d.cts.map +1 -1
- package/build/keys.d.mts +3 -5
- package/build/keys.d.mts.map +1 -1
- package/build/keys.js +5 -6
- package/build/loading/HintTree.cjs +1 -2
- package/build/loading/HintTree.d.cts +2 -4
- package/build/loading/HintTree.d.cts.map +1 -1
- package/build/loading/HintTree.d.mts +2 -4
- package/build/loading/HintTree.d.mts.map +1 -1
- package/build/loading/HintTree.js +1 -2
- package/build/loading/IsLoadedCache.cjs +1 -2
- package/build/loading/IsLoadedCache.d.cts +0 -2
- package/build/loading/IsLoadedCache.d.cts.map +1 -1
- package/build/loading/IsLoadedCache.d.mts +0 -2
- package/build/loading/IsLoadedCache.d.mts.map +1 -1
- package/build/loading/IsLoadedCache.js +1 -2
- package/build/loading/loadHints.cjs +1 -2
- package/build/loading/loadHints.d.cts +4 -6
- package/build/loading/loadHints.d.cts.map +1 -1
- package/build/loading/loadHints.d.mts +4 -6
- package/build/loading/loadHints.d.mts.map +1 -1
- package/build/loading/loadHints.js +1 -2
- package/build/loading/loadLens.cjs +11 -8
- package/build/loading/loadLens.cjs.map +1 -1
- package/build/loading/loadLens.d.cts +2 -4
- package/build/loading/loadLens.d.cts.map +1 -1
- package/build/loading/loadLens.d.mts +2 -4
- package/build/loading/loadLens.d.mts.map +1 -1
- package/build/loading/loadLens.js +11 -8
- package/build/loading/loadLens.js.map +1 -1
- package/build/loading/withLoaded.cjs +1 -2
- package/build/loading/withLoaded.d.cts +2 -4
- package/build/loading/withLoaded.d.cts.map +1 -1
- package/build/loading/withLoaded.d.mts +2 -4
- package/build/loading/withLoaded.d.mts.map +1 -1
- package/build/loading/withLoaded.js +1 -2
- package/build/logging/FactoryLogger.cjs +2 -3
- package/build/logging/FactoryLogger.d.cts +1 -3
- package/build/logging/FactoryLogger.d.cts.map +1 -1
- package/build/logging/FactoryLogger.d.mts +1 -3
- package/build/logging/FactoryLogger.d.mts.map +1 -1
- package/build/logging/FactoryLogger.js +2 -3
- package/build/logging/FieldLogger.cjs +1 -2
- package/build/logging/FieldLogger.d.cts +0 -2
- package/build/logging/FieldLogger.d.cts.map +1 -1
- package/build/logging/FieldLogger.d.mts +0 -2
- package/build/logging/FieldLogger.d.mts.map +1 -1
- package/build/logging/FieldLogger.js +1 -2
- package/build/logging/ReactionLogger.cjs +3 -4
- package/build/logging/ReactionLogger.d.cts +3 -5
- package/build/logging/ReactionLogger.d.cts.map +1 -1
- package/build/logging/ReactionLogger.d.mts +3 -5
- package/build/logging/ReactionLogger.d.mts.map +1 -1
- package/build/logging/ReactionLogger.js +3 -4
- package/build/metrics/EntityMetrics.cjs +1 -2
- package/build/metrics/EntityMetrics.d.cts +0 -2
- package/build/metrics/EntityMetrics.d.cts.map +1 -1
- package/build/metrics/EntityMetrics.d.mts +0 -2
- package/build/metrics/EntityMetrics.d.mts.map +1 -1
- package/build/metrics/EntityMetrics.js +1 -2
- package/build/newEntity.cjs +5 -6
- package/build/newEntity.cjs.map +1 -1
- package/build/newEntity.d.cts +2 -4
- package/build/newEntity.d.cts.map +1 -1
- package/build/newEntity.d.mts +2 -4
- package/build/newEntity.d.mts.map +1 -1
- package/build/newEntity.js +5 -6
- package/build/newEntity.js.map +1 -1
- package/build/newTestInstance.cjs +9 -10
- package/build/newTestInstance.d.cts +3 -5
- package/build/newTestInstance.d.cts.map +1 -1
- package/build/newTestInstance.d.mts +3 -5
- package/build/newTestInstance.d.mts.map +1 -1
- package/build/newTestInstance.js +9 -10
- package/build/normalizeHints.cjs +1 -2
- package/build/normalizeHints.d.cts +1 -3
- package/build/normalizeHints.d.cts.map +1 -1
- package/build/normalizeHints.d.mts +1 -3
- package/build/normalizeHints.d.mts.map +1 -1
- package/build/normalizeHints.js +1 -2
- package/build/nowUTC.cjs +1 -2
- package/build/nowUTC.d.cts +0 -2
- package/build/nowUTC.d.cts.map +1 -1
- package/build/nowUTC.d.mts +0 -2
- package/build/nowUTC.d.mts.map +1 -1
- package/build/nowUTC.js +1 -2
- package/build/plugins/ImmutableEntitiesPlugin.cjs +3 -4
- package/build/plugins/ImmutableEntitiesPlugin.d.cts +1 -3
- package/build/plugins/ImmutableEntitiesPlugin.d.cts.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.mts +1 -3
- package/build/plugins/ImmutableEntitiesPlugin.d.mts.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.js +3 -4
- package/build/plugins/PreloadPlugin.cjs +1 -1
- package/build/plugins/PreloadPlugin.d.cts +4 -6
- package/build/plugins/PreloadPlugin.d.cts.map +1 -1
- package/build/plugins/PreloadPlugin.d.mts +4 -6
- package/build/plugins/PreloadPlugin.d.mts.map +1 -1
- package/build/plugins/PreloadPlugin.js +1 -1
- package/build/preloading/JsonAggregatePreloader.cjs +13 -13
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.cts +3 -5
- package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.mts +3 -5
- package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.js +13 -13
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/canPreload.cjs +1 -2
- package/build/preloading/canPreload.d.cts +0 -2
- package/build/preloading/canPreload.d.cts.map +1 -1
- package/build/preloading/canPreload.d.mts +0 -2
- package/build/preloading/canPreload.d.mts.map +1 -1
- package/build/preloading/canPreload.js +1 -2
- package/build/preloading/partitionHint.cjs +4 -5
- package/build/preloading/partitionHint.d.cts +1 -3
- package/build/preloading/partitionHint.d.cts.map +1 -1
- package/build/preloading/partitionHint.d.mts +1 -3
- package/build/preloading/partitionHint.d.mts.map +1 -1
- package/build/preloading/partitionHint.js +4 -5
- package/build/queries/ConditionBuilder.cjs +2 -3
- package/build/queries/ConditionBuilder.d.cts +1 -3
- package/build/queries/ConditionBuilder.d.cts.map +1 -1
- package/build/queries/ConditionBuilder.d.mts +1 -3
- package/build/queries/ConditionBuilder.d.mts.map +1 -1
- package/build/queries/ConditionBuilder.js +2 -3
- package/build/queries/conditions.cjs +1 -2
- package/build/queries/conditions.d.cts +0 -2
- package/build/queries/conditions.d.cts.map +1 -1
- package/build/queries/conditions.d.mts +0 -2
- package/build/queries/conditions.d.mts.map +1 -1
- package/build/queries/conditions.js +1 -2
- package/build/queries/entityQueryUtils.cjs +2 -3
- package/build/queries/entityQueryUtils.d.cts +1 -3
- package/build/queries/entityQueryUtils.d.cts.map +1 -1
- package/build/queries/entityQueryUtils.d.mts +1 -3
- package/build/queries/entityQueryUtils.d.mts.map +1 -1
- package/build/queries/entityQueryUtils.js +2 -3
- package/build/queries/find/Aliases.cjs +4 -5
- package/build/queries/find/Aliases.d.cts +5 -7
- package/build/queries/find/Aliases.d.cts.map +1 -1
- package/build/queries/find/Aliases.d.mts +5 -7
- package/build/queries/find/Aliases.d.mts.map +1 -1
- package/build/queries/find/Aliases.js +4 -5
- package/build/queries/find/DeferredAlias.cjs +1 -2
- package/build/queries/find/DeferredAlias.d.cts +2 -4
- package/build/queries/find/DeferredAlias.d.cts.map +1 -1
- package/build/queries/find/DeferredAlias.d.mts +2 -4
- package/build/queries/find/DeferredAlias.d.mts.map +1 -1
- package/build/queries/find/DeferredAlias.js +1 -2
- package/build/queries/find/EntityFilter.cjs +1 -2
- package/build/queries/find/EntityFilter.d.cts +3 -5
- package/build/queries/find/EntityFilter.d.cts.map +1 -1
- package/build/queries/find/EntityFilter.d.mts +3 -5
- package/build/queries/find/EntityFilter.d.mts.map +1 -1
- package/build/queries/find/EntityFilter.js +1 -2
- package/build/queries/find/EntityGraphQLFilter.cjs +1 -2
- package/build/queries/find/EntityGraphQLFilter.d.cts +2 -4
- package/build/queries/find/EntityGraphQLFilter.d.cts.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.d.mts +2 -4
- package/build/queries/find/EntityGraphQLFilter.d.mts.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.js +1 -2
- package/build/queries/find/QueryParser.cjs +9 -10
- package/build/queries/find/QueryParser.cjs.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.cjs +1 -2
- package/build/queries/find/QueryParser.collectionJoins.d.cts +0 -2
- package/build/queries/find/QueryParser.collectionJoins.d.cts.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.mts +0 -2
- package/build/queries/find/QueryParser.collectionJoins.d.mts.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.js +1 -2
- package/build/queries/find/QueryParser.d.cts +4 -4
- package/build/queries/find/QueryParser.d.cts.map +1 -1
- package/build/queries/find/QueryParser.d.mts +4 -4
- package/build/queries/find/QueryParser.d.mts.map +1 -1
- package/build/queries/find/QueryParser.js +9 -10
- package/build/queries/find/QueryParser.js.map +1 -1
- package/build/queries/find/QueryParser.pruning.cjs +2 -3
- package/build/queries/find/QueryParser.pruning.d.cts +0 -2
- package/build/queries/find/QueryParser.pruning.d.cts.map +1 -1
- package/build/queries/find/QueryParser.pruning.d.mts +0 -2
- package/build/queries/find/QueryParser.pruning.d.mts.map +1 -1
- package/build/queries/find/QueryParser.pruning.js +2 -3
- package/build/queries/find/QueryVisitor.cjs +1 -2
- package/build/queries/find/QueryVisitor.d.cts +0 -2
- package/build/queries/find/QueryVisitor.d.cts.map +1 -1
- package/build/queries/find/QueryVisitor.d.mts +0 -2
- package/build/queries/find/QueryVisitor.d.mts.map +1 -1
- package/build/queries/find/QueryVisitor.js +1 -2
- package/build/queries/find/buildFindQuery.cjs +5 -6
- package/build/queries/find/buildFindQuery.cjs.map +1 -1
- package/build/queries/find/buildFindQuery.d.cts +0 -2
- package/build/queries/find/buildFindQuery.d.cts.map +1 -1
- package/build/queries/find/buildFindQuery.d.mts +0 -2
- package/build/queries/find/buildFindQuery.d.mts.map +1 -1
- package/build/queries/find/buildFindQuery.js +5 -6
- package/build/queries/find/buildFindQuery.js.map +1 -1
- package/build/queries/find/scopes.cjs +1 -2
- package/build/queries/find/scopes.d.cts +5 -7
- package/build/queries/find/scopes.d.cts.map +1 -1
- package/build/queries/find/scopes.d.mts +5 -7
- package/build/queries/find/scopes.d.mts.map +1 -1
- package/build/queries/find/scopes.js +1 -2
- package/build/queries/parsedConditions.cjs +1 -2
- package/build/queries/parsedConditions.d.cts +0 -2
- package/build/queries/parsedConditions.d.cts.map +1 -1
- package/build/queries/parsedConditions.d.mts +0 -2
- package/build/queries/parsedConditions.d.mts.map +1 -1
- package/build/queries/parsedConditions.js +1 -2
- package/build/queries/renderConditions.cjs +3 -4
- package/build/queries/renderConditions.d.cts +0 -2
- package/build/queries/renderConditions.d.cts.map +1 -1
- package/build/queries/renderConditions.d.mts +0 -2
- package/build/queries/renderConditions.d.mts.map +1 -1
- package/build/queries/renderConditions.js +3 -4
- package/build/queries/skipCondition.cjs +1 -2
- package/build/queries/skipCondition.d.cts +0 -2
- package/build/queries/skipCondition.d.cts.map +1 -1
- package/build/queries/skipCondition.d.mts +0 -2
- package/build/queries/skipCondition.d.mts.map +1 -1
- package/build/queries/skipCondition.js +1 -2
- package/build/queries/sql/AliasAssigner.cjs +1 -2
- package/build/queries/sql/AliasAssigner.d.cts +0 -2
- package/build/queries/sql/AliasAssigner.d.cts.map +1 -1
- package/build/queries/sql/AliasAssigner.d.mts +0 -2
- package/build/queries/sql/AliasAssigner.d.mts.map +1 -1
- package/build/queries/sql/AliasAssigner.js +1 -2
- package/build/queries/sql/Expr.cjs +3 -4
- package/build/queries/sql/Expr.d.cts +2 -4
- package/build/queries/sql/Expr.d.cts.map +1 -1
- package/build/queries/sql/Expr.d.mts +2 -4
- package/build/queries/sql/Expr.d.mts.map +1 -1
- package/build/queries/sql/Expr.js +3 -4
- package/build/queries/sql/JoinTree.cjs +3 -4
- package/build/queries/sql/JoinTree.d.cts +5 -7
- package/build/queries/sql/JoinTree.d.cts.map +1 -1
- package/build/queries/sql/JoinTree.d.mts +5 -7
- package/build/queries/sql/JoinTree.d.mts.map +1 -1
- package/build/queries/sql/JoinTree.js +3 -4
- package/build/queries/sql/Tables.cjs +8 -9
- package/build/queries/sql/Tables.d.cts +5 -7
- package/build/queries/sql/Tables.d.cts.map +1 -1
- package/build/queries/sql/Tables.d.mts +5 -7
- package/build/queries/sql/Tables.d.mts.map +1 -1
- package/build/queries/sql/Tables.js +8 -9
- package/build/queries/sql/custom.cjs +1 -2
- package/build/queries/sql/custom.d.cts +2 -4
- package/build/queries/sql/custom.d.cts.map +1 -1
- package/build/queries/sql/custom.d.mts +2 -4
- package/build/queries/sql/custom.d.mts.map +1 -1
- package/build/queries/sql/custom.js +1 -2
- package/build/queries/sql/execute.cjs +6 -7
- package/build/queries/sql/execute.d.cts +6 -8
- package/build/queries/sql/execute.d.cts.map +1 -1
- package/build/queries/sql/execute.d.mts +6 -8
- package/build/queries/sql/execute.d.mts.map +1 -1
- package/build/queries/sql/execute.js +6 -7
- package/build/queries/sql/expressions/arrayAgg.cjs +2 -3
- package/build/queries/sql/expressions/arrayAgg.d.cts +1 -3
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.mts +1 -3
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.js +2 -3
- package/build/queries/sql/expressions/case.cjs +2 -3
- package/build/queries/sql/expressions/case.d.cts +1 -3
- package/build/queries/sql/expressions/case.d.cts.map +1 -1
- package/build/queries/sql/expressions/case.d.mts +1 -3
- package/build/queries/sql/expressions/case.d.mts.map +1 -1
- package/build/queries/sql/expressions/case.js +2 -3
- package/build/queries/sql/expressions/coalesce.cjs +2 -3
- package/build/queries/sql/expressions/coalesce.d.cts +1 -3
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -1
- package/build/queries/sql/expressions/coalesce.d.mts +1 -3
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -1
- package/build/queries/sql/expressions/coalesce.js +2 -3
- package/build/queries/sql/expressions/codecs.cjs +2 -3
- package/build/queries/sql/expressions/codecs.d.cts +0 -2
- package/build/queries/sql/expressions/codecs.d.cts.map +1 -1
- package/build/queries/sql/expressions/codecs.d.mts +0 -2
- package/build/queries/sql/expressions/codecs.d.mts.map +1 -1
- package/build/queries/sql/expressions/codecs.js +2 -3
- package/build/queries/sql/expressions/expression.cjs +4 -5
- package/build/queries/sql/expressions/expression.d.cts +2 -4
- package/build/queries/sql/expressions/expression.d.cts.map +1 -1
- package/build/queries/sql/expressions/expression.d.mts +2 -4
- package/build/queries/sql/expressions/expression.d.mts.map +1 -1
- package/build/queries/sql/expressions/expression.js +4 -5
- package/build/queries/sql/expressions/greatest.cjs +2 -3
- package/build/queries/sql/expressions/greatest.d.cts +1 -3
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -1
- package/build/queries/sql/expressions/greatest.d.mts +1 -3
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -1
- package/build/queries/sql/expressions/greatest.js +2 -3
- package/build/queries/sql/expressions/least.cjs +2 -3
- package/build/queries/sql/expressions/least.d.cts +1 -3
- package/build/queries/sql/expressions/least.d.cts.map +1 -1
- package/build/queries/sql/expressions/least.d.mts +1 -3
- package/build/queries/sql/expressions/least.d.mts.map +1 -1
- package/build/queries/sql/expressions/least.js +2 -3
- package/build/queries/sql/expressions/nullIf.cjs +2 -3
- package/build/queries/sql/expressions/nullIf.d.cts +1 -3
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -1
- package/build/queries/sql/expressions/nullIf.d.mts +1 -3
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -1
- package/build/queries/sql/expressions/nullIf.js +2 -3
- package/build/queries/sql/expressions/parseExpression.cjs +3 -4
- package/build/queries/sql/expressions/parseExpression.d.cts +0 -2
- package/build/queries/sql/expressions/parseExpression.d.cts.map +1 -1
- package/build/queries/sql/expressions/parseExpression.d.mts +0 -2
- package/build/queries/sql/expressions/parseExpression.d.mts.map +1 -1
- package/build/queries/sql/expressions/parseExpression.js +3 -4
- package/build/queries/sql/expressions/types.d.cts +1 -3
- package/build/queries/sql/expressions/types.d.cts.map +1 -1
- package/build/queries/sql/expressions/types.d.mts +1 -3
- package/build/queries/sql/expressions/types.d.mts.map +1 -1
- package/build/queries/sql/keywords.cjs +1 -2
- package/build/queries/sql/keywords.d.cts +0 -2
- package/build/queries/sql/keywords.d.cts.map +1 -1
- package/build/queries/sql/keywords.d.mts +0 -2
- package/build/queries/sql/keywords.d.mts.map +1 -1
- package/build/queries/sql/keywords.js +1 -2
- package/build/queries/sql/query.cjs +9 -10
- package/build/queries/sql/query.d.cts +6 -8
- package/build/queries/sql/query.d.cts.map +1 -1
- package/build/queries/sql/query.d.mts +6 -8
- package/build/queries/sql/query.d.mts.map +1 -1
- package/build/queries/sql/query.js +9 -10
- package/build/queries/unnest.cjs +1 -2
- package/build/queries/unnest.d.cts +1 -3
- package/build/queries/unnest.d.cts.map +1 -1
- package/build/queries/unnest.d.mts +1 -3
- package/build/queries/unnest.d.mts.map +1 -1
- package/build/queries/unnest.js +1 -2
- package/build/queries/valueFilters.cjs +3 -4
- package/build/queries/valueFilters.d.cts +2 -4
- package/build/queries/valueFilters.d.cts.map +1 -1
- package/build/queries/valueFilters.d.mts +2 -4
- package/build/queries/valueFilters.d.mts.map +1 -1
- package/build/queries/valueFilters.js +3 -4
- package/build/reactivity/ReactionsManager.cjs +6 -7
- package/build/reactivity/ReactionsManager.d.cts +2 -4
- package/build/reactivity/ReactionsManager.d.cts.map +1 -1
- package/build/reactivity/ReactionsManager.d.mts +2 -4
- package/build/reactivity/ReactionsManager.d.mts.map +1 -1
- package/build/reactivity/ReactionsManager.js +6 -7
- package/build/reactivity/reactiveHints.cjs +8 -9
- package/build/reactivity/reactiveHints.d.cts +8 -10
- package/build/reactivity/reactiveHints.d.cts.map +1 -1
- package/build/reactivity/reactiveHints.d.mts +8 -10
- package/build/reactivity/reactiveHints.d.mts.map +1 -1
- package/build/reactivity/reactiveHints.js +8 -9
- package/build/relations/AbstractPropertyImpl.cjs +1 -2
- package/build/relations/AbstractPropertyImpl.d.cts +0 -2
- package/build/relations/AbstractPropertyImpl.d.cts.map +1 -1
- package/build/relations/AbstractPropertyImpl.d.mts +0 -2
- package/build/relations/AbstractPropertyImpl.d.mts.map +1 -1
- package/build/relations/AbstractPropertyImpl.js +1 -2
- package/build/relations/AbstractRelationImpl.cjs +1 -2
- package/build/relations/AbstractRelationImpl.d.cts +0 -2
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -1
- package/build/relations/AbstractRelationImpl.d.mts +0 -2
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -1
- package/build/relations/AbstractRelationImpl.js +1 -2
- package/build/relations/AsyncProperty.cjs +3 -4
- package/build/relations/AsyncProperty.d.cts +2 -4
- package/build/relations/AsyncProperty.d.cts.map +1 -1
- package/build/relations/AsyncProperty.d.mts +2 -4
- package/build/relations/AsyncProperty.d.mts.map +1 -1
- package/build/relations/AsyncProperty.js +3 -4
- package/build/relations/AsyncReactiveField.cjs +10 -11
- package/build/relations/AsyncReactiveField.d.cts +4 -6
- package/build/relations/AsyncReactiveField.d.cts.map +1 -1
- package/build/relations/AsyncReactiveField.d.mts +4 -6
- package/build/relations/AsyncReactiveField.d.mts.map +1 -1
- package/build/relations/AsyncReactiveField.js +10 -11
- package/build/relations/Collection.cjs +3 -4
- package/build/relations/Collection.d.cts +2 -4
- package/build/relations/Collection.d.cts.map +1 -1
- package/build/relations/Collection.d.mts +2 -4
- package/build/relations/Collection.d.mts.map +1 -1
- package/build/relations/Collection.js +3 -4
- package/build/relations/CustomCollection.cjs +40 -8
- package/build/relations/CustomCollection.cjs.map +1 -1
- package/build/relations/CustomCollection.d.cts +6 -6
- package/build/relations/CustomCollection.d.cts.map +1 -1
- package/build/relations/CustomCollection.d.mts +6 -6
- package/build/relations/CustomCollection.d.mts.map +1 -1
- package/build/relations/CustomCollection.js +40 -8
- package/build/relations/CustomCollection.js.map +1 -1
- package/build/relations/CustomReference.cjs +36 -8
- package/build/relations/CustomReference.cjs.map +1 -1
- package/build/relations/CustomReference.d.cts +8 -8
- package/build/relations/CustomReference.d.cts.map +1 -1
- package/build/relations/CustomReference.d.mts +8 -8
- package/build/relations/CustomReference.d.mts.map +1 -1
- package/build/relations/CustomReference.js +36 -8
- package/build/relations/CustomReference.js.map +1 -1
- package/build/relations/EnumCollection.cjs +4 -5
- package/build/relations/EnumCollection.d.cts +3 -5
- package/build/relations/EnumCollection.d.cts.map +1 -1
- package/build/relations/EnumCollection.d.mts +3 -5
- package/build/relations/EnumCollection.d.mts.map +1 -1
- package/build/relations/EnumCollection.js +4 -5
- package/build/relations/LargeCollection.cjs +2 -2
- package/build/relations/LargeCollection.d.cts +2 -4
- package/build/relations/LargeCollection.d.cts.map +1 -1
- package/build/relations/LargeCollection.d.mts +2 -4
- package/build/relations/LargeCollection.d.mts.map +1 -1
- package/build/relations/LargeCollection.js +2 -2
- package/build/relations/LazyField.cjs +14 -15
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.d.cts +2 -4
- package/build/relations/LazyField.d.cts.map +1 -1
- package/build/relations/LazyField.d.mts +2 -4
- package/build/relations/LazyField.d.mts.map +1 -1
- package/build/relations/LazyField.js +14 -15
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ManyToManyCollection.cjs +68 -13
- package/build/relations/ManyToManyCollection.cjs.map +1 -1
- package/build/relations/ManyToManyCollection.d.cts +2 -4
- package/build/relations/ManyToManyCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyCollection.d.mts +2 -4
- package/build/relations/ManyToManyCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyCollection.js +68 -13
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +35 -13
- package/build/relations/ManyToManyLargeCollection.cjs.map +1 -1
- package/build/relations/ManyToManyLargeCollection.d.cts +6 -8
- package/build/relations/ManyToManyLargeCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyLargeCollection.d.mts +6 -8
- package/build/relations/ManyToManyLargeCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyLargeCollection.js +35 -13
- package/build/relations/ManyToManyLargeCollection.js.map +1 -1
- package/build/relations/ManyToOneReference.cjs +35 -19
- package/build/relations/ManyToOneReference.cjs.map +1 -1
- package/build/relations/ManyToOneReference.d.cts +6 -8
- package/build/relations/ManyToOneReference.d.cts.map +1 -1
- package/build/relations/ManyToOneReference.d.mts +6 -8
- package/build/relations/ManyToOneReference.d.mts.map +1 -1
- package/build/relations/ManyToOneReference.js +35 -19
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +71 -15
- package/build/relations/OneToManyCollection.cjs.map +1 -1
- package/build/relations/OneToManyCollection.d.cts +3 -5
- package/build/relations/OneToManyCollection.d.cts.map +1 -1
- package/build/relations/OneToManyCollection.d.mts +3 -5
- package/build/relations/OneToManyCollection.d.mts.map +1 -1
- package/build/relations/OneToManyCollection.js +71 -15
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +25 -10
- package/build/relations/OneToManyLargeCollection.cjs.map +1 -1
- package/build/relations/OneToManyLargeCollection.d.cts +4 -6
- package/build/relations/OneToManyLargeCollection.d.cts.map +1 -1
- package/build/relations/OneToManyLargeCollection.d.mts +4 -6
- package/build/relations/OneToManyLargeCollection.d.mts.map +1 -1
- package/build/relations/OneToManyLargeCollection.js +25 -10
- package/build/relations/OneToManyLargeCollection.js.map +1 -1
- package/build/relations/OneToOneReference.cjs +41 -13
- package/build/relations/OneToOneReference.cjs.map +1 -1
- package/build/relations/OneToOneReference.d.cts +6 -8
- package/build/relations/OneToOneReference.d.cts.map +1 -1
- package/build/relations/OneToOneReference.d.mts +6 -8
- package/build/relations/OneToOneReference.d.mts.map +1 -1
- package/build/relations/OneToOneReference.js +41 -13
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +33 -17
- package/build/relations/PolymorphicReference.cjs.map +1 -1
- package/build/relations/PolymorphicReference.d.cts +5 -7
- package/build/relations/PolymorphicReference.d.cts.map +1 -1
- package/build/relations/PolymorphicReference.d.mts +5 -7
- package/build/relations/PolymorphicReference.d.mts.map +1 -1
- package/build/relations/PolymorphicReference.js +33 -17
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/PropertySymbols.cjs +1 -2
- package/build/relations/PropertySymbols.d.cts +0 -2
- package/build/relations/PropertySymbols.d.cts.map +1 -1
- package/build/relations/PropertySymbols.d.mts +0 -2
- package/build/relations/PropertySymbols.d.mts.map +1 -1
- package/build/relations/PropertySymbols.js +1 -2
- package/build/relations/ReactiveField.cjs +9 -10
- package/build/relations/ReactiveField.d.cts +4 -6
- package/build/relations/ReactiveField.d.cts.map +1 -1
- package/build/relations/ReactiveField.d.mts +4 -6
- package/build/relations/ReactiveField.d.mts.map +1 -1
- package/build/relations/ReactiveField.js +9 -10
- package/build/relations/ReactiveGetter.cjs +2 -3
- package/build/relations/ReactiveGetter.d.cts +2 -4
- package/build/relations/ReactiveGetter.d.cts.map +1 -1
- package/build/relations/ReactiveGetter.d.mts +2 -4
- package/build/relations/ReactiveGetter.d.mts.map +1 -1
- package/build/relations/ReactiveGetter.js +2 -3
- package/build/relations/ReactiveManyToMany.cjs +59 -17
- package/build/relations/ReactiveManyToMany.cjs.map +1 -1
- package/build/relations/ReactiveManyToMany.d.cts +7 -6
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
- package/build/relations/ReactiveManyToMany.d.mts +7 -6
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
- package/build/relations/ReactiveManyToMany.js +59 -17
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +41 -10
- package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.cts +4 -6
- package/build/relations/ReactiveManyToManyOtherSide.d.cts.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.mts +4 -6
- package/build/relations/ReactiveManyToManyOtherSide.d.mts.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.js +41 -10
- package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
- package/build/relations/ReactiveReference.cjs +29 -12
- package/build/relations/ReactiveReference.cjs.map +1 -1
- package/build/relations/ReactiveReference.d.cts +7 -9
- package/build/relations/ReactiveReference.d.cts.map +1 -1
- package/build/relations/ReactiveReference.d.mts +7 -9
- package/build/relations/ReactiveReference.d.mts.map +1 -1
- package/build/relations/ReactiveReference.js +29 -12
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/ReadOnlyCollection.cjs +3 -4
- package/build/relations/ReadOnlyCollection.d.cts +1 -3
- package/build/relations/ReadOnlyCollection.d.cts.map +1 -1
- package/build/relations/ReadOnlyCollection.d.mts +1 -3
- package/build/relations/ReadOnlyCollection.d.mts.map +1 -1
- package/build/relations/ReadOnlyCollection.js +3 -4
- package/build/relations/RecursiveCollection.cjs +60 -11
- package/build/relations/RecursiveCollection.cjs.map +1 -1
- package/build/relations/RecursiveCollection.d.cts +3 -5
- package/build/relations/RecursiveCollection.d.cts.map +1 -1
- package/build/relations/RecursiveCollection.d.mts +3 -5
- package/build/relations/RecursiveCollection.d.mts.map +1 -1
- package/build/relations/RecursiveCollection.js +60 -11
- package/build/relations/RecursiveCollection.js.map +1 -1
- package/build/relations/RecursiveCycleError.cjs +1 -2
- package/build/relations/RecursiveCycleError.d.cts +0 -2
- package/build/relations/RecursiveCycleError.d.cts.map +1 -1
- package/build/relations/RecursiveCycleError.d.mts +0 -2
- package/build/relations/RecursiveCycleError.d.mts.map +1 -1
- package/build/relations/RecursiveCycleError.js +1 -2
- package/build/relations/Reference.cjs +4 -5
- package/build/relations/Reference.d.cts +3 -5
- package/build/relations/Reference.d.cts.map +1 -1
- package/build/relations/Reference.d.mts +3 -5
- package/build/relations/Reference.d.mts.map +1 -1
- package/build/relations/Reference.js +4 -5
- package/build/relations/ReferenceSymbols.cjs +1 -2
- package/build/relations/ReferenceSymbols.d.cts +0 -2
- package/build/relations/ReferenceSymbols.d.cts.map +1 -1
- package/build/relations/ReferenceSymbols.d.mts +0 -2
- package/build/relations/ReferenceSymbols.d.mts.map +1 -1
- package/build/relations/ReferenceSymbols.js +1 -2
- package/build/relations/Relation.cjs +3 -4
- package/build/relations/Relation.d.cts +1 -3
- package/build/relations/Relation.d.cts.map +1 -1
- package/build/relations/Relation.d.mts +1 -3
- package/build/relations/Relation.d.mts.map +1 -1
- package/build/relations/Relation.js +3 -4
- package/build/relations/RelationSymbols.cjs +1 -2
- package/build/relations/RelationSymbols.d.cts +0 -2
- package/build/relations/RelationSymbols.d.cts.map +1 -1
- package/build/relations/RelationSymbols.d.mts +0 -2
- package/build/relations/RelationSymbols.d.mts.map +1 -1
- package/build/relations/RelationSymbols.js +1 -2
- package/build/relations/hasAsyncMethod.cjs +6 -7
- package/build/relations/hasAsyncMethod.d.cts +2 -4
- package/build/relations/hasAsyncMethod.d.cts.map +1 -1
- package/build/relations/hasAsyncMethod.d.mts +2 -4
- package/build/relations/hasAsyncMethod.d.mts.map +1 -1
- package/build/relations/hasAsyncMethod.js +6 -7
- package/build/relations/hasManyDerived.cjs +5 -6
- package/build/relations/hasManyDerived.cjs.map +1 -1
- package/build/relations/hasManyDerived.d.cts +2 -4
- package/build/relations/hasManyDerived.d.cts.map +1 -1
- package/build/relations/hasManyDerived.d.mts +2 -4
- package/build/relations/hasManyDerived.d.mts.map +1 -1
- package/build/relations/hasManyDerived.js +5 -6
- package/build/relations/hasManyDerived.js.map +1 -1
- package/build/relations/hasManyThrough.cjs +4 -5
- package/build/relations/hasManyThrough.cjs.map +1 -1
- package/build/relations/hasManyThrough.d.cts +0 -2
- package/build/relations/hasManyThrough.d.cts.map +1 -1
- package/build/relations/hasManyThrough.d.mts +0 -2
- package/build/relations/hasManyThrough.d.mts.map +1 -1
- package/build/relations/hasManyThrough.js +4 -5
- package/build/relations/hasManyThrough.js.map +1 -1
- package/build/relations/hasOneDerived.cjs +5 -6
- package/build/relations/hasOneDerived.cjs.map +1 -1
- package/build/relations/hasOneDerived.d.cts +2 -4
- package/build/relations/hasOneDerived.d.cts.map +1 -1
- package/build/relations/hasOneDerived.d.mts +2 -4
- package/build/relations/hasOneDerived.d.mts.map +1 -1
- package/build/relations/hasOneDerived.js +5 -6
- package/build/relations/hasOneDerived.js.map +1 -1
- package/build/relations/hasOneThrough.cjs +4 -5
- package/build/relations/hasOneThrough.cjs.map +1 -1
- package/build/relations/hasOneThrough.d.cts +0 -2
- package/build/relations/hasOneThrough.d.cts.map +1 -1
- package/build/relations/hasOneThrough.d.mts +0 -2
- package/build/relations/hasOneThrough.d.mts.map +1 -1
- package/build/relations/hasOneThrough.js +4 -5
- package/build/relations/hasOneThrough.js.map +1 -1
- package/build/relations/hasProperty.cjs +5 -6
- package/build/relations/hasProperty.d.cts +2 -4
- package/build/relations/hasProperty.d.cts.map +1 -1
- package/build/relations/hasProperty.d.mts +2 -4
- package/build/relations/hasProperty.d.mts.map +1 -1
- package/build/relations/hasProperty.js +5 -6
- package/build/relations/hasReactiveAsyncMethod.cjs +5 -6
- package/build/relations/hasReactiveAsyncMethod.d.cts +3 -5
- package/build/relations/hasReactiveAsyncMethod.d.cts.map +1 -1
- package/build/relations/hasReactiveAsyncMethod.d.mts +3 -5
- package/build/relations/hasReactiveAsyncMethod.d.mts.map +1 -1
- package/build/relations/hasReactiveAsyncMethod.js +5 -6
- package/build/relations/index.cjs +9 -9
- package/build/relations/index.d.cts +3 -3
- package/build/relations/index.d.mts +3 -3
- package/build/relations/index.js +9 -9
- package/build/relations/isCascadeDelete.cjs +1 -2
- package/build/relations/isCascadeDelete.d.cts +0 -2
- package/build/relations/isCascadeDelete.d.cts.map +1 -1
- package/build/relations/isCascadeDelete.d.mts +0 -2
- package/build/relations/isCascadeDelete.d.mts.map +1 -1
- package/build/relations/isCascadeDelete.js +1 -2
- package/build/relations/relationVisibility.cjs +51 -0
- package/build/relations/relationVisibility.cjs.map +1 -0
- package/build/relations/relationVisibility.d.cts +10 -0
- package/build/relations/relationVisibility.d.cts.map +1 -0
- package/build/relations/relationVisibility.d.mts +10 -0
- package/build/relations/relationVisibility.d.mts.map +1 -0
- package/build/relations/relationVisibility.js +47 -0
- package/build/relations/relationVisibility.js.map +1 -0
- package/build/resurrection.cjs +4 -5
- package/build/resurrection.d.cts +2 -4
- package/build/resurrection.d.cts.map +1 -1
- package/build/resurrection.d.mts +2 -4
- package/build/resurrection.d.mts.map +1 -1
- package/build/resurrection.js +4 -5
- package/build/rules.cjs +6 -7
- package/build/rules.d.cts +3 -5
- package/build/rules.d.cts.map +1 -1
- package/build/rules.d.mts +3 -5
- package/build/rules.d.mts.map +1 -1
- package/build/rules.js +6 -7
- package/build/runtimeConfig.cjs +1 -2
- package/build/runtimeConfig.d.cts +0 -2
- package/build/runtimeConfig.d.cts.map +1 -1
- package/build/runtimeConfig.d.mts +0 -2
- package/build/runtimeConfig.d.mts.map +1 -1
- package/build/runtimeConfig.js +1 -2
- package/build/serde/TypeInfo.cjs +1 -2
- package/build/serde/TypeInfo.d.cts +0 -2
- package/build/serde/TypeInfo.d.cts.map +1 -1
- package/build/serde/TypeInfo.d.mts +0 -2
- package/build/serde/TypeInfo.d.mts.map +1 -1
- package/build/serde/TypeInfo.js +1 -2
- package/build/serde/columns.cjs +1 -2
- package/build/serde/columns.d.cts +2 -4
- package/build/serde/columns.d.cts.map +1 -1
- package/build/serde/columns.d.mts +2 -4
- package/build/serde/columns.d.mts.map +1 -1
- package/build/serde/columns.js +1 -2
- package/build/serde/fieldSerde.cjs +4 -5
- package/build/serde/fieldSerde.d.cts +4 -6
- package/build/serde/fieldSerde.d.cts.map +1 -1
- package/build/serde/fieldSerde.d.mts +4 -6
- package/build/serde/fieldSerde.d.mts.map +1 -1
- package/build/serde/fieldSerde.js +4 -5
- package/build/serde/serde.cjs +4 -5
- package/build/serde/serde.cjs.map +1 -1
- package/build/serde/serde.d.cts +0 -2
- package/build/serde/serde.d.cts.map +1 -1
- package/build/serde/serde.d.mts +0 -2
- package/build/serde/serde.d.mts.map +1 -1
- package/build/serde/serde.js +4 -5
- package/build/serde/temporal.cjs +1 -2
- package/build/serde/temporal.cjs.map +1 -1
- package/build/serde/temporal.d.cts +0 -2
- package/build/serde/temporal.d.cts.map +1 -1
- package/build/serde/temporal.d.mts +0 -2
- package/build/serde/temporal.d.mts.map +1 -1
- package/build/serde/temporal.js +1 -2
- package/build/serde/temporalMappers.cjs +1 -2
- package/build/serde/temporalMappers.d.cts +1 -3
- package/build/serde/temporalMappers.d.cts.map +1 -1
- package/build/serde/temporalMappers.d.mts +1 -3
- package/build/serde/temporalMappers.d.mts.map +1 -1
- package/build/serde/temporalMappers.js +1 -2
- package/build/transitions.cjs +2 -3
- package/build/transitions.d.cts +3 -5
- package/build/transitions.d.cts.map +1 -1
- package/build/transitions.d.mts +3 -5
- package/build/transitions.d.mts.map +1 -1
- package/build/transitions.js +2 -3
- package/build/trusted.cjs +1 -2
- package/build/trusted.cjs.map +1 -1
- package/build/trusted.d.cts +0 -2
- package/build/trusted.d.cts.map +1 -1
- package/build/trusted.d.mts +0 -2
- package/build/trusted.d.mts.map +1 -1
- package/build/trusted.js +1 -2
- package/build/typeMap.cjs +1 -1
- package/build/typeMap.d.cts +1 -3
- package/build/typeMap.d.cts.map +1 -1
- package/build/typeMap.d.mts +1 -3
- package/build/typeMap.d.mts.map +1 -1
- package/build/typeMap.js +1 -1
- package/build/upsert.cjs +7 -8
- package/build/upsert.d.cts +3 -5
- package/build/upsert.d.cts.map +1 -1
- package/build/upsert.d.mts +3 -5
- package/build/upsert.d.mts.map +1 -1
- package/build/upsert.js +7 -8
- package/build/utils.cjs +3 -4
- package/build/utils.d.cts +2 -4
- package/build/utils.d.cts.map +1 -1
- package/build/utils.d.mts +2 -4
- package/build/utils.d.mts.map +1 -1
- package/build/utils.js +3 -4
- package/package.json +6 -6
package/build/serde/TypeInfo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/serde/TypeInfo.ts
|
|
2
2
|
/**
|
|
3
3
|
* Normalizes known PostgreSQL type synonyms without treating coercible types or user types as equal.
|
|
4
4
|
* The output compatibility checks compare these names, so normalize only spellings of the same type.
|
|
@@ -72,7 +72,6 @@ function arrayOutputType(outputType) {
|
|
|
72
72
|
domain
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
export { arrayOutputType, canonicalDbType };
|
|
77
76
|
|
|
78
77
|
//# sourceMappingURL=TypeInfo.js.map
|
package/build/serde/columns.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/serde/columns.ts
|
|
3
3
|
/** A physical column owns one scalar codec, shared with every field binding for that column. */
|
|
4
4
|
var Column = class {
|
|
5
5
|
columnName;
|
|
@@ -60,7 +60,6 @@ var Column = class {
|
|
|
60
60
|
return this.codec.mapFromJsonAgg(value);
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
exports.Column = Column;
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=columns.cjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { TypeInfo } from "./TypeInfo.cjs";
|
|
2
|
-
import { ScalarCodec } from "./serde.cjs";
|
|
3
1
|
import { EntityMetadata } from "../EntityMetadata.cjs";
|
|
4
|
-
|
|
2
|
+
import { ScalarCodec } from "./serde.cjs";
|
|
3
|
+
import { TypeInfo } from "./TypeInfo.cjs";
|
|
5
4
|
/** A physical column owns one scalar codec, shared with every field binding for that column. */
|
|
6
5
|
export declare class Column {
|
|
7
6
|
readonly columnName: string;
|
|
@@ -34,5 +33,4 @@ export declare class Column {
|
|
|
34
33
|
mapFromJsonAgg(value: any): any;
|
|
35
34
|
}
|
|
36
35
|
export type ColumnDescriptors = Record<string, Column>;
|
|
37
|
-
//#endregion
|
|
38
36
|
//# sourceMappingURL=columns.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.cts","names":[],"sources":["../../src/serde/columns.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"columns.d.cts","names":[],"sources":["../../src/serde/columns.ts"],"mappings":";;;;qBAMa;WAKA;WACA;WACA;WACA;;WAEA;;WAEA;WACA,mBAAmB;WACnB,OAAO;WAbT;WACA;;EAET,YACW,oBACA,sBACA,qBACA;;EAEA;;EAEA,mBACA,mBAAmB,6BACnB,OAAO;MAYd;MAGA;MAGA;MAGA;;MAKA,cAAc;EASlB,QAAQ;EAGR,aAAa;EAGb,UAAU;EAGV,eAAe;;YAKL,oBAAoB,eAAe"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { TypeInfo } from "./TypeInfo.mjs";
|
|
2
|
-
import { ScalarCodec } from "./serde.mjs";
|
|
3
1
|
import { EntityMetadata } from "../EntityMetadata.mjs";
|
|
4
|
-
|
|
2
|
+
import { ScalarCodec } from "./serde.mjs";
|
|
3
|
+
import { TypeInfo } from "./TypeInfo.mjs";
|
|
5
4
|
/** A physical column owns one scalar codec, shared with every field binding for that column. */
|
|
6
5
|
export declare class Column {
|
|
7
6
|
readonly columnName: string;
|
|
@@ -34,5 +33,4 @@ export declare class Column {
|
|
|
34
33
|
mapFromJsonAgg(value: any): any;
|
|
35
34
|
}
|
|
36
35
|
export type ColumnDescriptors = Record<string, Column>;
|
|
37
|
-
//#endregion
|
|
38
36
|
//# sourceMappingURL=columns.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.mts","names":[],"sources":["../../src/serde/columns.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"columns.d.mts","names":[],"sources":["../../src/serde/columns.ts"],"mappings":";;;;qBAMa;WAKA;WACA;WACA;WACA;;WAEA;;WAEA;WACA,mBAAmB;WACnB,OAAO;WAbT;WACA;;EAET,YACW,oBACA,sBACA,qBACA;;EAEA;;EAEA,mBACA,mBAAmB,6BACnB,OAAO;MAYd;MAGA;MAGA;MAGA;;MAKA,cAAc;EASlB,QAAQ;EAGR,aAAa;EAGb,UAAU;EAGV,eAAe;;YAKL,oBAAoB,eAAe"}
|
package/build/serde/columns.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/serde/columns.ts
|
|
2
2
|
/** A physical column owns one scalar codec, shared with every field binding for that column. */
|
|
3
3
|
var Column = class {
|
|
4
4
|
columnName;
|
|
@@ -59,7 +59,6 @@ var Column = class {
|
|
|
59
59
|
return this.codec.mapFromJsonAgg(value);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { Column };
|
|
64
63
|
|
|
65
64
|
//# sourceMappingURL=columns.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_keys = require("../keys.cjs");
|
|
3
|
-
const require_utils = require("../utils.cjs");
|
|
4
2
|
const require_configure = require("../configure.cjs");
|
|
5
|
-
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
6
3
|
const require_Entity = require("../Entity.cjs");
|
|
7
|
-
|
|
4
|
+
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
5
|
+
const require_keys = require("../keys.cjs");
|
|
6
|
+
const require_utils = require("../utils.cjs");
|
|
7
|
+
// src/serde/fieldSerde.ts
|
|
8
8
|
function hasSerde(field) {
|
|
9
9
|
return !!field.serde;
|
|
10
10
|
}
|
|
@@ -180,7 +180,6 @@ var PolymorphicFieldColumn = class extends FieldColumn {
|
|
|
180
180
|
return this.dbValue(data);
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
//#endregion
|
|
184
183
|
exports.FieldColumn = FieldColumn;
|
|
185
184
|
exports.PolyComponent = PolyComponent;
|
|
186
185
|
exports.PolymorphicKeySerde = PolymorphicKeySerde;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { TypeInfo } from "./TypeInfo.cjs";
|
|
2
1
|
import { ScalarCodec } from "./serde.cjs";
|
|
3
|
-
import {
|
|
2
|
+
import { TypeInfo } from "./TypeInfo.cjs";
|
|
4
3
|
import { InsertFixup } from "../drivers/EntityWriter.cjs";
|
|
5
|
-
import { RowData } from "../RowData.cjs";
|
|
6
|
-
import { EntityMetadata, Field, PolymorphicField, PolymorphicFieldComponent, SerdeField } from "../EntityMetadata.cjs";
|
|
7
4
|
import { Entity } from "../Entity.cjs";
|
|
8
|
-
|
|
5
|
+
import { EntityMetadata, Field, PolymorphicField, PolymorphicFieldComponent, SerdeField } from "../EntityMetadata.cjs";
|
|
6
|
+
import { RowData } from "../RowData.cjs";
|
|
7
|
+
import { Column } from "./columns.cjs";
|
|
9
8
|
export declare function hasSerde(field: Field): field is SerdeField;
|
|
10
9
|
/** Entity hydration and flush bindings; a polymorphic relationship spans several physical columns. */
|
|
11
10
|
export interface FieldSerde {
|
|
@@ -83,6 +82,5 @@ declare class PolymorphicFieldColumn extends FieldColumn {
|
|
|
83
82
|
dbValue(data: any): any;
|
|
84
83
|
rowValue(data: any): any;
|
|
85
84
|
}
|
|
86
|
-
//#endregion
|
|
87
85
|
export {};
|
|
88
86
|
//# sourceMappingURL=fieldSerde.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldSerde.d.cts","names":["_$src_serde_serde_ts0.ScalarCodec","_$__TypeInfo_ts0.TypeInfo"],"sources":["../../src/serde/fieldSerde.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fieldSerde.d.cts","names":["_$src_serde_serde_ts0.ScalarCodec","_$__TypeInfo_ts0.TypeInfo"],"sources":["../../src/serde/fieldSerde.ts"],"mappings":";;;;;;;wBAkBgB,SAAS,OAAO,QAAQ,SAAS;;iBAKhC;EACf,SAAS;;EAET,QAAQ,SAAS,SAAS;;iBAGX,eAAe,WAAW;EACzC,WAAW,KAAK,OAAO;EACvB,QAAQ;;;qBAIG;WAEA;WACA,QAAQ;EAFnB,YACW,mBACA,QAAQ;MAEf,SAFeA;MAKf;MAGA;MAGA;MAGA;MAGA,qBAAU;MAGV;MAGA;MAGA;MAGA;MAGA;MAGA;MAGA;MAGA;MAGA,cA3BUC;EA8Bd,QAAQ;EAGR,aAAa;EAGb,UAAU;EAGV,eAAe;;EAKf,QAAQ,WAAW,QAAQ,QAAQ,mBAAmB,QAAQ;;EAkB9D,SAAS;;;qBAME,yBAAyB,uBAAuB;WAClD,SAAS;;EAElB,QAAQ,SAAS,SAAS;EAG1B,WAAW,KAAK;;;qBAML,+BAA+B;WAG/B;WAFF,SAAS;EAClB,YACW,mBACT,YAAY;;EAKd,QAAQ,SAAS,SAAS;;;wBAcZ,iBACd,mBACA,mBACA,YAAY,8BACX;;qBAaU,yBAAyB;WAEzB,QAAQ;WACR;mBACQ;EAHnB,YACW,QAAQ,QACR,wBACQ,gBAAe;MAE9B;MAGA,uBAAuB;;;cAMvB,+BAA+B;mBAGhB;mBACA;EAHnB,YACE,mBACiB,WAAW,2BACX,YAAY;MAI3B,uBAAa;;EAKjB,aAAa;EAqBb,QAAQ;EAGR,SAAS"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { TypeInfo } from "./TypeInfo.mjs";
|
|
2
1
|
import { ScalarCodec } from "./serde.mjs";
|
|
3
|
-
import {
|
|
2
|
+
import { TypeInfo } from "./TypeInfo.mjs";
|
|
4
3
|
import { InsertFixup } from "../drivers/EntityWriter.mjs";
|
|
5
|
-
import { RowData } from "../RowData.mjs";
|
|
6
|
-
import { EntityMetadata, Field, PolymorphicField, PolymorphicFieldComponent, SerdeField } from "../EntityMetadata.mjs";
|
|
7
4
|
import { Entity } from "../Entity.mjs";
|
|
8
|
-
|
|
5
|
+
import { EntityMetadata, Field, PolymorphicField, PolymorphicFieldComponent, SerdeField } from "../EntityMetadata.mjs";
|
|
6
|
+
import { RowData } from "../RowData.mjs";
|
|
7
|
+
import { Column } from "./columns.mjs";
|
|
9
8
|
export declare function hasSerde(field: Field): field is SerdeField;
|
|
10
9
|
/** Entity hydration and flush bindings; a polymorphic relationship spans several physical columns. */
|
|
11
10
|
export interface FieldSerde {
|
|
@@ -83,6 +82,5 @@ declare class PolymorphicFieldColumn extends FieldColumn {
|
|
|
83
82
|
dbValue(data: any): any;
|
|
84
83
|
rowValue(data: any): any;
|
|
85
84
|
}
|
|
86
|
-
//#endregion
|
|
87
85
|
export {};
|
|
88
86
|
//# sourceMappingURL=fieldSerde.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldSerde.d.mts","names":["_$src_serde_serde_ts0.ScalarCodec","_$__TypeInfo_ts0.TypeInfo"],"sources":["../../src/serde/fieldSerde.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fieldSerde.d.mts","names":["_$src_serde_serde_ts0.ScalarCodec","_$__TypeInfo_ts0.TypeInfo"],"sources":["../../src/serde/fieldSerde.ts"],"mappings":";;;;;;;wBAkBgB,SAAS,OAAO,QAAQ,SAAS;;iBAKhC;EACf,SAAS;;EAET,QAAQ,SAAS,SAAS;;iBAGX,eAAe,WAAW;EACzC,WAAW,KAAK,OAAO;EACvB,QAAQ;;;qBAIG;WAEA;WACA,QAAQ;EAFnB,YACW,mBACA,QAAQ;MAEf,SAFeA;MAKf;MAGA;MAGA;MAGA;MAGA,qBAAU;MAGV;MAGA;MAGA;MAGA;MAGA;MAGA;MAGA;MAGA;MAGA,cA3BUC;EA8Bd,QAAQ;EAGR,aAAa;EAGb,UAAU;EAGV,eAAe;;EAKf,QAAQ,WAAW,QAAQ,QAAQ,mBAAmB,QAAQ;;EAkB9D,SAAS;;;qBAME,yBAAyB,uBAAuB;WAClD,SAAS;;EAElB,QAAQ,SAAS,SAAS;EAG1B,WAAW,KAAK;;;qBAML,+BAA+B;WAG/B;WAFF,SAAS;EAClB,YACW,mBACT,YAAY;;EAKd,QAAQ,SAAS,SAAS;;;wBAcZ,iBACd,mBACA,mBACA,YAAY,8BACX;;qBAaU,yBAAyB;WAEzB,QAAQ;WACR;mBACQ;EAHnB,YACW,QAAQ,QACR,wBACQ,gBAAe;MAE9B;MAGA,uBAAuB;;;cAMvB,+BAA+B;mBAGhB;mBACA;EAHnB,YACE,mBACiB,WAAW,2BACX,YAAY;MAI3B,uBAAa;;EAKjB,aAAa;EAqBb,QAAQ;EAGR,SAAS"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { maybeResolveReferenceToId } from "../keys.js";
|
|
2
|
-
import { groupBy } from "../utils.js";
|
|
3
1
|
import { getConstructorFromTaggedId } from "../configure.js";
|
|
4
|
-
import { getBaseMeta, getMetadata } from "../EntityMetadata.js";
|
|
5
2
|
import { isEntity } from "../Entity.js";
|
|
6
|
-
|
|
3
|
+
import { getBaseMeta, getMetadata } from "../EntityMetadata.js";
|
|
4
|
+
import { maybeResolveReferenceToId } from "../keys.js";
|
|
5
|
+
import { groupBy } from "../utils.js";
|
|
6
|
+
// src/serde/fieldSerde.ts
|
|
7
7
|
function hasSerde(field) {
|
|
8
8
|
return !!field.serde;
|
|
9
9
|
}
|
|
@@ -179,7 +179,6 @@ var PolymorphicFieldColumn = class extends FieldColumn {
|
|
|
179
179
|
return this.dbValue(data);
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
//#endregion
|
|
183
182
|
export { FieldColumn, PolyComponent, PolymorphicKeySerde, SimpleFieldSerde, hasSerde, polymorphicField };
|
|
184
183
|
|
|
185
184
|
//# sourceMappingURL=fieldSerde.js.map
|
package/build/serde/serde.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_EntityManager = require("../EntityManager.cjs");
|
|
3
3
|
const require_keys = require("../keys.cjs");
|
|
4
|
-
const require_serde_TypeInfo = require("./TypeInfo.cjs");
|
|
5
4
|
const require_runtimeConfig = require("../runtimeConfig.cjs");
|
|
5
|
+
const require_serde_temporal = require("./temporal.cjs");
|
|
6
6
|
const require_serde_temporalMappers = require("./temporalMappers.cjs");
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const require_serde_TypeInfo = require("./TypeInfo.cjs");
|
|
8
|
+
// src/serde/serde.ts
|
|
9
9
|
const runtimeRequire = (0, require("node:module").createRequire)(require("url").pathToFileURL(__filename).href);
|
|
10
10
|
var CustomSerdeAdapter = class CustomSerdeAdapter {
|
|
11
11
|
dbType;
|
|
@@ -538,7 +538,6 @@ function primitiveOutputDomain(dbType) {
|
|
|
538
538
|
function maybeNullToUndefined(value) {
|
|
539
539
|
return value === null ? void 0 : value;
|
|
540
540
|
}
|
|
541
|
-
//#endregion
|
|
542
541
|
exports.BigIntSerde = BigIntSerde;
|
|
543
542
|
exports.CustomSerdeAdapter = CustomSerdeAdapter;
|
|
544
543
|
exports.DateSerde = DateSerde;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serde.cjs","names":["createRequire","canonicalDbType","arrayOutputType","plainDateMapper","plainTimeMapper","plainDateTimeMapper","getRuntimeConfig","requireTemporal","zonedDateTimeMapper","keyToNumber","maybeResolveReferenceToId","keyToTaggedId","isDefined"],"sources":["../../src/serde/serde.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nimport { isDefined } from \"src/EntityManager.ts\";\nimport { keyToNumber, keyToTaggedId, maybeResolveReferenceToId } from \"src/keys.ts\";\nimport { getRuntimeConfig } from \"src/runtimeConfig.ts\";\nimport { type Temporal, requireTemporal } from \"src/serde/temporal.ts\";\nimport {\n plainDateMapper,\n plainDateTimeMapper,\n plainTimeMapper,\n zonedDateTimeMapper,\n} from \"src/serde/temporalMappers.ts\";\nimport { type TypeInfo, arrayOutputType, canonicalDbType } from \"src/serde/TypeInfo.ts\";\n\nconst runtimeRequire = createRequire(import.meta.url);\n\n/** Scalar conversion only: no field names, entity hydration, or FK fixups. */\nexport interface ScalarCodec {\n dbType: string;\n isArray: boolean;\n /** The unnest null/set marker as the physical db type; never persisted in the column. */\n readonly notNullMarker?: unknown;\n /** Compatibility evidence for scalar conversion, absent for unknown codecs. */\n readonly outputType?: TypeInfo;\n /** Encodes a domain value for a filter, i.e. an em.find WHERE parameter. */\n mapToDb(value: any): any;\n /**\n * Encodes a domain value for an INSERT or UPDATE binding.\n *\n * Callers must handle omission, SQL NULL, and SQL expressions before encoding. JSON null and\n * codec defaults can differ from SQL NULL. Direct mutations must validate reference targets\n * and reject new or unflushed entities before encoding.\n */\n mapToDbValue?(value: unknown): unknown;\n /** Converts a driver value to its domain value, including the codec's null/default handling. */\n mapFromDb(value: unknown): unknown;\n /**\n * Converts a json_agg cell to a driver-row value, not a domain value.\n *\n * Lazy field hydration subsequently calls mapFromDb. I.e. Date codecs reconstruct a Date\n * from the JSON string, while Temporal codecs retain the driver's string representation.\n */\n mapFromJsonAgg(value: any): any;\n /** Reconstructs a driver value from a domain value, not a SQL binding. */\n mapToRow(value: any): any;\n}\n\n/** Converts the ORM clock to the timestamp's domain representation. */\nexport interface TimestampCodec<T> extends ScalarCodec {\n mapFromNow(now: Date): T;\n}\n\n/**\n * Provides a simplified, public API for mapping between db/domain values.\n *\n * Joist's internal `FieldSerde` API is admittedly a little crufty, and so this\n * API is intended to be a simpler, more user-friendly way to define custom types.\n */\nexport interface CustomSerde<DomainType, DbType> {\n toDb(value: DomainType): DbType;\n fromDb(value: DbType): DomainType;\n /**\n * Return a domain value for the unnest null/set marker, before conversion to the physical db type.\n *\n * Optional to preserve legacy serdes, including scalar serdes that never need markers.\n * Without this hook, the adapter passes a default physical db value through fromDb, then converts it\n * back with the normal array writer. Temporal mappers and restricted custom domains can provide an\n * accepted domain value instead.\n */\n getUnnestMarker?(): DomainType;\n}\n\nexport class CustomSerdeAdapter implements ScalarCodec {\n isArray: boolean = false;\n\n constructor(\n public dbType: string,\n private mapper: CustomSerde<any, any>,\n isArray?: boolean,\n ) {\n if (isArray !== undefined) this.isArray = isArray;\n }\n\n /** Return the unnest null/set marker as the physical db type. */\n get notNullMarker(): unknown {\n const seed = this.mapper.getUnnestMarker\n ? this.mapper.getUnnestMarker()\n : this.mapper.fromDb(defaultArrayElementMarker(this.dbType));\n return (this.mapToDbValue([seed]) as unknown[])[0];\n }\n\n /** Only known adapters share their mapper's identity and elementwise array conversion. */\n get outputType(): TypeInfo | undefined {\n if (\n this.isArray !== this.dbType.endsWith(\"[]\") ||\n (this.constructor !== CustomSerdeAdapter &&\n this.constructor !== PlainDateSerde &&\n this.constructor !== PlainTimeSerde &&\n this.constructor !== PlainDateTimeSerde &&\n this.constructor !== ZonedDateTimeSerde)\n ) {\n return undefined;\n }\n const dbType = canonicalDbType(this.dbType);\n // A numeric mapper may require scalar text; classic pg decodes numeric[] elements as numbers.\n const elementType = this.isArray ? dbType.slice(0, -2) : dbType;\n const outputType = { dbType: elementType, domain: this.mapper, arrayElementSafe: elementType !== \"numeric\" };\n if (!this.isArray) return outputType;\n // Physical arrays pass null elements to the mapper, unlike scalar arrayAgg; keep their domains distinct.\n return arrayOutputType(outputType) || [\"date\", \"time\", \"timestamp\", \"timestamptz\"].includes(elementType)\n ? { dbType, domain: this.mapper }\n : undefined;\n }\n\n /** Encodes each physical array element once. */\n mapToDbValue(value: unknown): unknown {\n return value !== undefined\n ? this.isArray\n ? (value as readonly unknown[]).map((element) => this.mapper.toDb(element))\n : this.mapper.toDb(value)\n : undefined;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any): any {\n return value === null\n ? value\n : this.isArray\n ? value.map((element: unknown) => this.mapper.toDb(element))\n : this.mapper.toDb(value);\n }\n\n /** Converts a driver value with the custom mapper, including array elements. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n return dbValue !== undefined\n ? this.isArray\n ? dbValue.map((value: unknown) => this.mapper.fromDb(value))\n : this.mapper.fromDb(dbValue)\n : undefined;\n }\n\n mapFromJsonAgg(value: any): any {\n // Assume the database JSON value matches the ResultSet value\n return value;\n // return value === null\n // ? value\n // : this.isArray\n // ? value.map((value: any) => this.mapper.fromDb(value))\n // : this.mapper.fromDb(value);\n }\n}\n\n/**\n * Supports `string`, `int`, etc., as well as `string[]`, `int[]`, etc.\n *\n * This is not generally meant for subclassing, because it assumes things like\n * `string[]`s can be mapped 1:1. See `CustomSerdeAdapter` a good base class\n * that will handle converting individual elements.\n */\nexport class PrimitiveSerde implements ScalarCodec {\n constructor(\n public dbType: string,\n public isArray = false,\n ) {}\n\n /** Return the unnest null/set marker as the physical db type. */\n get notNullMarker(): unknown {\n const seed = defaultArrayElementMarker(this.dbType);\n return this.isArray ? (this.mapToDbValue([seed]) as unknown[])[0] : this.mapToDbValue(seed);\n }\n\n /** Exact-class checks prevent an unknown subclass's overridden converters from sharing this codec. */\n get outputType(): TypeInfo | undefined {\n if (this.constructor !== PrimitiveSerde) return undefined;\n const dbType = canonicalDbType(this.dbType);\n const elementType = dbType.endsWith(\"[]\") ? dbType.slice(0, -2) : dbType;\n if (this.isArray !== dbType.endsWith(\"[]\")) return undefined;\n const outputType = {\n dbType: elementType,\n domain: primitiveOutputDomain(elementType),\n arrayElementSafe: elementType !== \"numeric\",\n };\n return this.isArray ? arrayOutputType(outputType) : outputType;\n }\n\n /** Primitive writes share their scalar/filter conversion, including subclass overrides. */\n mapToDbValue(value: unknown): unknown {\n return this.mapToDb(value);\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return value;\n }\n\n /** Keeps driver values as-is, with SQL NULL represented as an unset entity field. */\n mapFromDb(value: unknown): unknown {\n return maybeNullToUndefined(value);\n }\n\n mapFromJsonAgg(value: any): any {\n return value;\n }\n}\n\nexport class DateSerde extends PrimitiveSerde implements TimestampCodec<Date> {\n /** Date bindings use ISO strings; mapToDb does not support physical Date arrays. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === DateSerde && !this.isArray && !this.dbType.endsWith(\"[]\")\n ? { dbType: canonicalDbType(this.dbType), domain: DateSerde }\n : undefined;\n }\n\n /** Accept the caller's date as-is. */\n mapFromNow(now: Date): Date {\n return now;\n }\n\n mapFromJsonAgg(value: any): any {\n if (value === null) return value;\n return new Date(value);\n }\n\n /**\n * Returns the `Date` a driver hands back on a read, and not `mapToDb`'s ISO string.\n *\n * Otherwise callers that round-trip a row through `rowValue` and back through `fromRow` (i.e.\n * `RunPlugin` mirroring writes into the test em) turn every date into a string, because our\n * `mapFromDb` returns the row value as-is.\n */\n mapToRow(value: any): any {\n return value;\n }\n\n mapToDb(value: Date) {\n // bun.sql needs this, node-pg does it out of the box\n return value?.toISOString();\n }\n}\n\n/** Converts `DATE`s `Temporal.PlainDate`s. */\nexport class PlainDateSerde extends CustomSerdeAdapter {\n constructor(dbType: string, isArray = false) {\n super(dbType, plainDateMapper, isArray);\n }\n}\n\n/** Converts `TIME`s to `Temporal.PlainTime`s. */\nexport class PlainTimeSerde extends CustomSerdeAdapter {\n constructor(dbType: string, isArray = false) {\n super(dbType, plainTimeMapper, isArray);\n }\n}\n\n/** Converts `TIMESTAMP`s to `Temporal.PlainDateTime`s. */\nexport class PlainDateTimeSerde extends CustomSerdeAdapter implements TimestampCodec<Temporal.PlainDateTime> {\n constructor(dbType: string, isArray = false) {\n super(dbType, plainDateTimeMapper, isArray);\n }\n\n mapFromNow(now: Date): Temporal.PlainDateTime {\n const { timeZone } = getRuntimeConfig().temporal as any;\n return requireTemporal().toTemporalInstant.call(now).toZonedDateTimeISO(timeZone).toPlainDateTime();\n }\n}\n\n/** Converts `TIMESTAMP WITH TIME ZONE`s to `Temporal.ZonedDateTime`s. */\nexport class ZonedDateTimeSerde extends CustomSerdeAdapter implements TimestampCodec<Temporal.ZonedDateTime> {\n constructor(dbType: string, isArray = false) {\n super(dbType, zonedDateTimeMapper, isArray);\n }\n\n mapFromNow(now: Date): Temporal.ZonedDateTime {\n const { timeZone } = getRuntimeConfig().temporal as any;\n return requireTemporal().toTemporalInstant.call(now).toZonedDateTimeISO(timeZone);\n }\n}\n\nexport class BigIntSerde implements ScalarCodec {\n dbType: string;\n\n constructor(public isArray = false) {\n this.dbType = isArray ? \"bigint[]\" : \"bigint\";\n }\n\n /** BigInt conversion is distinct from both the driver's int8 value and Number aggregates. */\n get outputType(): TypeInfo | undefined {\n if (this.constructor !== BigIntSerde) return undefined;\n const elementType = { dbType: \"int8\", domain: BigIntSerde, arrayElementSafe: true };\n return this.isArray ? arrayOutputType(elementType) : elementType;\n }\n\n /** Drivers accept native bigint values without conversion. */\n mapToDbValue(value: unknown): unknown {\n if (this.isArray) assertFlatNumericArray(value);\n return value;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return value;\n }\n\n /** Converts the driver's bigint representation to the entity value. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n if (this.isArray && dbValue !== undefined) {\n assertFlatNumericArray(dbValue);\n return dbValue.map((element: string | bigint | number | null) => (element === null ? null : BigInt(element)));\n }\n return dbValue ? BigInt(dbValue) : dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : this.isArray ? this.mapFromDb(value) : BigInt(value);\n }\n}\n\n/**\n * Maps `decimal(...)` database types to the JS `number`.\n *\n * Note that we assume the db values are within the range of the JS `number`;\n * we should eventually sanity check that.\n *\n * Also note that knex/pg accept `number`s as input, so we only need\n * to handle from-database -> to JS translation.\n */\nexport class DecimalToNumberSerde implements ScalarCodec {\n dbType: string;\n\n constructor(public isArray = false) {\n this.dbType = isArray ? \"numeric[]\" : \"decimal\";\n }\n\n /** Numeric aggregates use the same Number conversion and identity binding encoder. */\n get outputType(): TypeInfo | undefined {\n if (this.constructor !== DecimalToNumberSerde) return undefined;\n const elementType = { dbType: \"numeric\", domain: Number, arrayElementSafe: true };\n return this.isArray ? arrayOutputType(elementType) : elementType;\n }\n\n /** Drivers accept decimal numbers without conversion. */\n mapToDbValue(value: unknown): unknown {\n if (this.isArray) assertFlatNumericArray(value);\n return value;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return value;\n }\n\n /** Converts a driver decimal value to a JavaScript number. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n if (this.isArray && dbValue !== undefined) {\n assertFlatNumericArray(dbValue);\n return dbValue.map((element: string | number | null) => (element === null ? null : Number(element)));\n }\n return dbValue !== undefined ? Number(dbValue) : dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : this.isArray ? this.mapFromDb(value) : Number(value);\n }\n}\n\n/** Maps physical integer keys to logical string IDs \"because GraphQL\". */\nexport class KeySerde implements ScalarCodec {\n isArray = false;\n\n private meta: {\n tagName: string;\n idDbType: \"bigint\" | \"int\" | \"uuid\" | \"text\";\n };\n\n constructor(\n tagName: string,\n public dbType: \"bigint\" | \"int\" | \"uuid\" | \"text\",\n ) {\n this.meta = {\n tagName,\n idDbType: dbType,\n };\n }\n\n /** PKs and FKs share a tag and SQL representation; the alias supplies the exact target idMeta. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === KeySerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: `key:${this.meta.tagName}`, arrayElementSafe: true }\n : undefined;\n }\n\n /** Resolves references and tagged, untagged, or numeric ids using the column's tag and storage type. */\n mapToDbValue(value: unknown): unknown {\n return keyToNumber(\n this.meta,\n typeof value === \"number\"\n ? value\n : maybeResolveReferenceToId(value as Parameters<typeof maybeResolveReferenceToId>[0]),\n );\n }\n\n mapToRow(value: any): any {\n // we don't have any fixups since we are trying to recreate what comes out of the db, so this is safe\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n // Numeric IDs are already database values; tagged string IDs still need to be resolved and untagged.\n if (value === null || typeof value === \"number\") return value;\n // We go through `maybeResolveReferenceToId` because filters like `in: [a1, a2]` pass entities directly.\n return keyToNumber(this.meta, maybeResolveReferenceToId(value));\n }\n\n /** Converts a physical primary or foreign key to a tagged id. */\n mapFromDb(value: unknown): string | undefined {\n return keyToTaggedId(this.meta, value as string | number);\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\nexport class EnumFieldSerde implements ScalarCodec {\n isArray = false;\n\n constructor(\n public dbType: \"int\" | \"uuid\",\n private enumObject: any,\n ) {}\n\n /** Separate fields of the same generated enum share its code/id mapping. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === EnumFieldSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: this.enumObject, arrayElementSafe: true }\n : undefined;\n }\n\n /** Resolves the enum code to its stored id, leaving an unknown code unset. */\n mapToDbValue(value: unknown): unknown {\n return this.enumObject.findByCode(value)?.id;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return this.enumObject.findByCode(value)?.id;\n }\n\n /** Converts a stored enum id to its enum code. */\n mapFromDb(value: unknown): unknown {\n return this.enumObject.findById(value)?.code;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\nexport class EnumArrayFieldSerde implements ScalarCodec {\n isArray = true;\n\n constructor(\n public dbType: \"int[]\" | \"uuid[]\",\n private enumObject: any,\n ) {}\n\n /**\n * Return the unnest null/set marker as the physical db type.\n *\n * The marker is removed before enum IDs are stored, so it need not identify an enum row.\n */\n get notNullMarker(): unknown {\n return defaultArrayElementMarker(this.dbType);\n }\n\n /** Physical enum arrays reject null elements, unlike scalar enum arrayAgg; leave them unknown. */\n get outputType(): undefined {\n return undefined;\n }\n\n /** Resolves each enum code to its stored id, retaining the entity's empty-array default. */\n mapToDbValue(value: unknown): unknown {\n return (value as readonly unknown[] | null | undefined)?.map((code) => this.enumObject.getByCode(code).id) || [];\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return !value ? [] : value.map((code: any) => this.enumObject.getByCode(code).id);\n }\n\n /** Converts stored enum ids to codes, defaulting an unset entity field to an empty array. */\n mapFromDb(value: unknown): unknown[] {\n return (value as readonly unknown[] | null | undefined)?.map((id) => this.enumObject.findById(id).code) || [];\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\n/** Similar to SimpleSerde, but applies the superstruct `assert` function when reading values from the db. */\nexport class SuperstructSerde implements ScalarCodec {\n dbType = \"jsonb\";\n isArray = false;\n\n // Use a dynamic require so that downstream projects don't have to depend on superstruct\n // until they want to, i.e. we don't have superstruct in the joist-orm package.json.\n private assert = runtimeRequire(\"superstruct\").assert;\n\n constructor(private superstruct: any) {}\n\n /** JSON schemas describe a jsonb value, even when that value is a JSON array. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === SuperstructSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: this.superstruct, arrayElementSafe: true }\n : undefined;\n }\n\n /** Serializes the domain JSON value without running the read-time schema validation. */\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n // JSON is returned by postgres already parsed, so we should just be able to return our data directly. Unlike with\n // JsonSerde, we can assume that superstruct would have parsed any complex types in the json correctly so we don't\n // need to do a round trip through JSON.stringify.\n mapToRow(value: any): any {\n return value;\n }\n\n mapToDb(value: any) {\n return JSON.stringify(value);\n }\n\n /** Validates a driver JSON value with the field's Superstruct schema. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n if (dbValue) this.assert(dbValue, this.superstruct);\n return dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\nexport class JsonSerde implements ScalarCodec {\n dbType = \"jsonb\";\n isArray = false;\n\n constructor() {}\n\n /** Unvalidated JSON uses its own encoder, not a primitive or schema-specific codec. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === JsonSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: JsonSerde, arrayElementSafe: true }\n : undefined;\n }\n\n /** Serializes the whole JSON value, including JSON arrays and custom toJSON methods. */\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n // JSON is returned by postgres already parsed, so if we are trying to recreate then we need to stringify, then parse.\n // It's necessary to do this instead of just returning the object directly because any complex types in the json need\n // to be stringified to correctly reflect the db value.\n mapToRow(value: any): any {\n const json = JSON.stringify(value);\n return isDefined(json) ? JSON.parse(json) : undefined;\n }\n\n mapToDb(value: any) {\n return JSON.stringify(value);\n }\n\n /** Keeps the driver's parsed JSON value, normalizing SQL NULL for entity fields. */\n mapFromDb(value: unknown): unknown {\n return maybeNullToUndefined(value);\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\n/**\n * Maps pgvector `vector(N)` columns to `number[]`s.\n *\n * pgvector has no pg array OID, so text results are its `[1,2,3]` literal, which is also valid\n * JSON (pgvector rejects NaN/Infinity elements). Writes send the same literal, which the batch\n * `unnest(?::vector[])` casts, because node-pg would otherwise encode a JS array as `{1,2,3}`.\n */\nexport class VectorSerde implements ScalarCodec {\n dbType = \"vector\";\n isArray = false;\n\n get outputType(): TypeInfo | undefined {\n return this.constructor === VectorSerde ? { dbType: this.dbType, domain: VectorSerde } : undefined;\n }\n\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n mapToRow(value: any): any {\n return JSON.stringify(value);\n }\n\n mapToDb(value: any) {\n return value === null ? value : JSON.stringify(value);\n }\n\n /** Parses the text literal, and passes through arrays already decoded by the binary row path. */\n mapFromDb(value: unknown): unknown {\n return typeof value === \"string\" ? JSON.parse(value) : maybeNullToUndefined(value);\n }\n\n /** `to_json(vector)` falls back to the text literal, i.e. the same value as a driver row. */\n mapFromJsonAgg(value: any): any {\n return value;\n }\n}\n\n/** Similar to SimpleSerde, but applies the zod's `parse` function when reading values from the db. */\nexport class ZodSerde implements ScalarCodec {\n dbType = \"jsonb\";\n isArray = false;\n\n constructor(private zodSchema: any) {}\n\n /** Parsing and transformations are compatible only for the same schema object. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === ZodSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: this.zodSchema, arrayElementSafe: true }\n : undefined;\n }\n\n /** Serializes the domain JSON value without running the read-time Zod parser or transforms. */\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n // JSON is returned by postgres already parsed, so we should just be able to return our data directly. Unlike with\n // JsonSerde, we can assume that zod would have parsed any complex types in the json correctly so we don't need to\n // do a round trip through JSON.stringify.\n mapToRow(value: any): any {\n return value;\n }\n\n mapToDb(value: any) {\n return JSON.stringify(value);\n }\n\n /** Parses a driver JSON value with the field's Zod schema. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n return dbValue ? this.zodSchema.parse(dbValue) : dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\n/** Return a default unnest null/set marker as the physical db type, before codec-specific conversion. */\nfunction defaultArrayElementMarker(dbType: string): unknown {\n if (dbType.startsWith(\"varchar\") || dbType.startsWith(\"character\") || dbType.startsWith(\"text\")) {\n return \"\";\n } else if (dbType.startsWith(\"int\")) {\n return 1;\n } else if (dbType.startsWith(\"date\") || dbType.startsWith(\"timestamp\")) {\n return new Date(\"2000-01-01T00:00:00.000Z\");\n } else {\n throw new Error(\"Unhandled nullable array column type \" + dbType);\n }\n}\n\n/** PostgreSQL does not enforce declared array dimensions; reject nested values rather than coercing subarrays. */\nfunction assertFlatNumericArray(value: unknown): void {\n if (Array.isArray(value) && value.some(Array.isArray)) {\n throw new Error(\"Native numeric arrays must be one-dimensional\");\n }\n}\n\n/** Only driver-native numbers agree with Number aggregates; int8/numeric identity values do not. */\nfunction primitiveOutputDomain(dbType: string): unknown {\n switch (dbType) {\n case \"int2\":\n case \"int4\":\n case \"float4\":\n case \"float8\":\n return Number;\n case \"text\":\n case \"varchar\":\n case \"bpchar\":\n return String;\n default:\n return PrimitiveSerde;\n }\n}\n\n/** Normalizes SQL NULL to an unset entity field. */\nfunction maybeNullToUndefined(value: any): any {\n return value === null ? undefined : value;\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,kBAAA,wBAAiBA,CAAAA,CAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AA0DpD,IAAa,qBA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;;AAGA,SAAS,0BAA0B,QAAyB;CAC1D,IAAI,OAAO,WAAW,SAAS,KAAK,OAAO,WAAW,WAAW,KAAK,OAAO,WAAW,MAAM,GAC5F,OAAO;MACF,IAAI,OAAO,WAAW,KAAK,GAChC,OAAO;MACF,IAAI,OAAO,WAAW,MAAM,KAAK,OAAO,WAAW,WAAW,GACnE,uBAAO,IAAI,KAAK,0BAA0B;MAE1C,MAAM,IAAI,MAAM,0CAA0C,MAAM;AAEpE;;AAGA,SAAS,uBAAuB,OAAsB;CACpD,IAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,MAAM,OAAO,GAClD,MAAM,IAAI,MAAM,+CAA+C;AAEnE;;AAGA,SAAS,sBAAsB,QAAyB;CACtD,QAAQ,QAAR;EACE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,UACH,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK,UACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;AAGA,SAAS,qBAAqB,OAAiB;CAC7C,OAAO,UAAU,OAAO,KAAA,IAAY;AACtC"}
|
|
1
|
+
{"version":3,"file":"serde.cjs","names":["createRequire","canonicalDbType","arrayOutputType","plainDateMapper","plainTimeMapper","plainDateTimeMapper","getRuntimeConfig","requireTemporal","zonedDateTimeMapper","keyToNumber","maybeResolveReferenceToId","keyToTaggedId","isDefined"],"sources":["../../src/serde/serde.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nimport { isDefined } from \"src/EntityManager.ts\";\nimport { keyToNumber, keyToTaggedId, maybeResolveReferenceToId } from \"src/keys.ts\";\nimport { getRuntimeConfig } from \"src/runtimeConfig.ts\";\nimport { type Temporal, requireTemporal } from \"src/serde/temporal.ts\";\nimport {\n plainDateMapper,\n plainDateTimeMapper,\n plainTimeMapper,\n zonedDateTimeMapper,\n} from \"src/serde/temporalMappers.ts\";\nimport { type TypeInfo, arrayOutputType, canonicalDbType } from \"src/serde/TypeInfo.ts\";\n\nconst runtimeRequire = createRequire(import.meta.url);\n\n/** Scalar conversion only: no field names, entity hydration, or FK fixups. */\nexport interface ScalarCodec {\n dbType: string;\n isArray: boolean;\n /** The unnest null/set marker as the physical db type; never persisted in the column. */\n readonly notNullMarker?: unknown;\n /** Compatibility evidence for scalar conversion, absent for unknown codecs. */\n readonly outputType?: TypeInfo;\n /** Encodes a domain value for a filter, i.e. an em.find WHERE parameter. */\n mapToDb(value: any): any;\n /**\n * Encodes a domain value for an INSERT or UPDATE binding.\n *\n * Callers must handle omission, SQL NULL, and SQL expressions before encoding. JSON null and\n * codec defaults can differ from SQL NULL. Direct mutations must validate reference targets\n * and reject new or unflushed entities before encoding.\n */\n mapToDbValue?(value: unknown): unknown;\n /** Converts a driver value to its domain value, including the codec's null/default handling. */\n mapFromDb(value: unknown): unknown;\n /**\n * Converts a json_agg cell to a driver-row value, not a domain value.\n *\n * Lazy field hydration subsequently calls mapFromDb. I.e. Date codecs reconstruct a Date\n * from the JSON string, while Temporal codecs retain the driver's string representation.\n */\n mapFromJsonAgg(value: any): any;\n /** Reconstructs a driver value from a domain value, not a SQL binding. */\n mapToRow(value: any): any;\n}\n\n/** Converts the ORM clock to the timestamp's domain representation. */\nexport interface TimestampCodec<T> extends ScalarCodec {\n mapFromNow(now: Date): T;\n}\n\n/**\n * Provides a simplified, public API for mapping between db/domain values.\n *\n * Joist's internal `FieldSerde` API is admittedly a little crufty, and so this\n * API is intended to be a simpler, more user-friendly way to define custom types.\n */\nexport interface CustomSerde<DomainType, DbType> {\n toDb(value: DomainType): DbType;\n fromDb(value: DbType): DomainType;\n /**\n * Return a domain value for the unnest null/set marker, before conversion to the physical db type.\n *\n * Optional to preserve legacy serdes, including scalar serdes that never need markers.\n * Without this hook, the adapter passes a default physical db value through fromDb, then converts it\n * back with the normal array writer. Temporal mappers and restricted custom domains can provide an\n * accepted domain value instead.\n */\n getUnnestMarker?(): DomainType;\n}\n\nexport class CustomSerdeAdapter implements ScalarCodec {\n isArray: boolean = false;\n\n constructor(\n public dbType: string,\n private mapper: CustomSerde<any, any>,\n isArray?: boolean,\n ) {\n if (isArray !== undefined) this.isArray = isArray;\n }\n\n /** Return the unnest null/set marker as the physical db type. */\n get notNullMarker(): unknown {\n const seed = this.mapper.getUnnestMarker\n ? this.mapper.getUnnestMarker()\n : this.mapper.fromDb(defaultArrayElementMarker(this.dbType));\n return (this.mapToDbValue([seed]) as unknown[])[0];\n }\n\n /** Only known adapters share their mapper's identity and elementwise array conversion. */\n get outputType(): TypeInfo | undefined {\n if (\n this.isArray !== this.dbType.endsWith(\"[]\") ||\n (this.constructor !== CustomSerdeAdapter &&\n this.constructor !== PlainDateSerde &&\n this.constructor !== PlainTimeSerde &&\n this.constructor !== PlainDateTimeSerde &&\n this.constructor !== ZonedDateTimeSerde)\n ) {\n return undefined;\n }\n const dbType = canonicalDbType(this.dbType);\n // A numeric mapper may require scalar text; classic pg decodes numeric[] elements as numbers.\n const elementType = this.isArray ? dbType.slice(0, -2) : dbType;\n const outputType = { dbType: elementType, domain: this.mapper, arrayElementSafe: elementType !== \"numeric\" };\n if (!this.isArray) return outputType;\n // Physical arrays pass null elements to the mapper, unlike scalar arrayAgg; keep their domains distinct.\n return arrayOutputType(outputType) || [\"date\", \"time\", \"timestamp\", \"timestamptz\"].includes(elementType)\n ? { dbType, domain: this.mapper }\n : undefined;\n }\n\n /** Encodes each physical array element once. */\n mapToDbValue(value: unknown): unknown {\n return value !== undefined\n ? this.isArray\n ? (value as readonly unknown[]).map((element) => this.mapper.toDb(element))\n : this.mapper.toDb(value)\n : undefined;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any): any {\n return value === null\n ? value\n : this.isArray\n ? value.map((element: unknown) => this.mapper.toDb(element))\n : this.mapper.toDb(value);\n }\n\n /** Converts a driver value with the custom mapper, including array elements. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n return dbValue !== undefined\n ? this.isArray\n ? dbValue.map((value: unknown) => this.mapper.fromDb(value))\n : this.mapper.fromDb(dbValue)\n : undefined;\n }\n\n mapFromJsonAgg(value: any): any {\n // Assume the database JSON value matches the ResultSet value\n return value;\n // return value === null\n // ? value\n // : this.isArray\n // ? value.map((value: any) => this.mapper.fromDb(value))\n // : this.mapper.fromDb(value);\n }\n}\n\n/**\n * Supports `string`, `int`, etc., as well as `string[]`, `int[]`, etc.\n *\n * This is not generally meant for subclassing, because it assumes things like\n * `string[]`s can be mapped 1:1. See `CustomSerdeAdapter` a good base class\n * that will handle converting individual elements.\n */\nexport class PrimitiveSerde implements ScalarCodec {\n constructor(\n public dbType: string,\n public isArray = false,\n ) {}\n\n /** Return the unnest null/set marker as the physical db type. */\n get notNullMarker(): unknown {\n const seed = defaultArrayElementMarker(this.dbType);\n return this.isArray ? (this.mapToDbValue([seed]) as unknown[])[0] : this.mapToDbValue(seed);\n }\n\n /** Exact-class checks prevent an unknown subclass's overridden converters from sharing this codec. */\n get outputType(): TypeInfo | undefined {\n if (this.constructor !== PrimitiveSerde) return undefined;\n const dbType = canonicalDbType(this.dbType);\n const elementType = dbType.endsWith(\"[]\") ? dbType.slice(0, -2) : dbType;\n if (this.isArray !== dbType.endsWith(\"[]\")) return undefined;\n const outputType = {\n dbType: elementType,\n domain: primitiveOutputDomain(elementType),\n arrayElementSafe: elementType !== \"numeric\",\n };\n return this.isArray ? arrayOutputType(outputType) : outputType;\n }\n\n /** Primitive writes share their scalar/filter conversion, including subclass overrides. */\n mapToDbValue(value: unknown): unknown {\n return this.mapToDb(value);\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return value;\n }\n\n /** Keeps driver values as-is, with SQL NULL represented as an unset entity field. */\n mapFromDb(value: unknown): unknown {\n return maybeNullToUndefined(value);\n }\n\n mapFromJsonAgg(value: any): any {\n return value;\n }\n}\n\nexport class DateSerde extends PrimitiveSerde implements TimestampCodec<Date> {\n /** Date bindings use ISO strings; mapToDb does not support physical Date arrays. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === DateSerde && !this.isArray && !this.dbType.endsWith(\"[]\")\n ? { dbType: canonicalDbType(this.dbType), domain: DateSerde }\n : undefined;\n }\n\n /** Accept the caller's date as-is. */\n mapFromNow(now: Date): Date {\n return now;\n }\n\n mapFromJsonAgg(value: any): any {\n if (value === null) return value;\n return new Date(value);\n }\n\n /**\n * Returns the `Date` a driver hands back on a read, and not `mapToDb`'s ISO string.\n *\n * Otherwise callers that round-trip a row through `rowValue` and back through `fromRow` (i.e.\n * `RunPlugin` mirroring writes into the test em) turn every date into a string, because our\n * `mapFromDb` returns the row value as-is.\n */\n mapToRow(value: any): any {\n return value;\n }\n\n mapToDb(value: Date) {\n // bun.sql needs this, node-pg does it out of the box\n return value?.toISOString();\n }\n}\n\n/** Converts `DATE`s `Temporal.PlainDate`s. */\nexport class PlainDateSerde extends CustomSerdeAdapter {\n constructor(dbType: string, isArray = false) {\n super(dbType, plainDateMapper, isArray);\n }\n}\n\n/** Converts `TIME`s to `Temporal.PlainTime`s. */\nexport class PlainTimeSerde extends CustomSerdeAdapter {\n constructor(dbType: string, isArray = false) {\n super(dbType, plainTimeMapper, isArray);\n }\n}\n\n/** Converts `TIMESTAMP`s to `Temporal.PlainDateTime`s. */\nexport class PlainDateTimeSerde extends CustomSerdeAdapter implements TimestampCodec<Temporal.PlainDateTime> {\n constructor(dbType: string, isArray = false) {\n super(dbType, plainDateTimeMapper, isArray);\n }\n\n mapFromNow(now: Date): Temporal.PlainDateTime {\n const { timeZone } = getRuntimeConfig().temporal as any;\n return requireTemporal().toTemporalInstant.call(now).toZonedDateTimeISO(timeZone).toPlainDateTime();\n }\n}\n\n/** Converts `TIMESTAMP WITH TIME ZONE`s to `Temporal.ZonedDateTime`s. */\nexport class ZonedDateTimeSerde extends CustomSerdeAdapter implements TimestampCodec<Temporal.ZonedDateTime> {\n constructor(dbType: string, isArray = false) {\n super(dbType, zonedDateTimeMapper, isArray);\n }\n\n mapFromNow(now: Date): Temporal.ZonedDateTime {\n const { timeZone } = getRuntimeConfig().temporal as any;\n return requireTemporal().toTemporalInstant.call(now).toZonedDateTimeISO(timeZone);\n }\n}\n\nexport class BigIntSerde implements ScalarCodec {\n dbType: string;\n\n constructor(public isArray = false) {\n this.dbType = isArray ? \"bigint[]\" : \"bigint\";\n }\n\n /** BigInt conversion is distinct from both the driver's int8 value and Number aggregates. */\n get outputType(): TypeInfo | undefined {\n if (this.constructor !== BigIntSerde) return undefined;\n const elementType = { dbType: \"int8\", domain: BigIntSerde, arrayElementSafe: true };\n return this.isArray ? arrayOutputType(elementType) : elementType;\n }\n\n /** Drivers accept native bigint values without conversion. */\n mapToDbValue(value: unknown): unknown {\n if (this.isArray) assertFlatNumericArray(value);\n return value;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return value;\n }\n\n /** Converts the driver's bigint representation to the entity value. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n if (this.isArray && dbValue !== undefined) {\n assertFlatNumericArray(dbValue);\n return dbValue.map((element: string | bigint | number | null) => (element === null ? null : BigInt(element)));\n }\n return dbValue ? BigInt(dbValue) : dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : this.isArray ? this.mapFromDb(value) : BigInt(value);\n }\n}\n\n/**\n * Maps `decimal(...)` database types to the JS `number`.\n *\n * Note that we assume the db values are within the range of the JS `number`;\n * we should eventually sanity check that.\n *\n * Also note that knex/pg accept `number`s as input, so we only need\n * to handle from-database -> to JS translation.\n */\nexport class DecimalToNumberSerde implements ScalarCodec {\n dbType: string;\n\n constructor(public isArray = false) {\n this.dbType = isArray ? \"numeric[]\" : \"decimal\";\n }\n\n /** Numeric aggregates use the same Number conversion and identity binding encoder. */\n get outputType(): TypeInfo | undefined {\n if (this.constructor !== DecimalToNumberSerde) return undefined;\n const elementType = { dbType: \"numeric\", domain: Number, arrayElementSafe: true };\n return this.isArray ? arrayOutputType(elementType) : elementType;\n }\n\n /** Drivers accept decimal numbers without conversion. */\n mapToDbValue(value: unknown): unknown {\n if (this.isArray) assertFlatNumericArray(value);\n return value;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return value;\n }\n\n /** Converts a driver decimal value to a JavaScript number. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n if (this.isArray && dbValue !== undefined) {\n assertFlatNumericArray(dbValue);\n return dbValue.map((element: string | number | null) => (element === null ? null : Number(element)));\n }\n return dbValue !== undefined ? Number(dbValue) : dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : this.isArray ? this.mapFromDb(value) : Number(value);\n }\n}\n\n/** Maps physical integer keys to logical string IDs \"because GraphQL\". */\nexport class KeySerde implements ScalarCodec {\n isArray = false;\n\n private meta: {\n tagName: string;\n idDbType: \"bigint\" | \"int\" | \"uuid\" | \"text\";\n };\n\n constructor(\n tagName: string,\n public dbType: \"bigint\" | \"int\" | \"uuid\" | \"text\",\n ) {\n this.meta = {\n tagName,\n idDbType: dbType,\n };\n }\n\n /** PKs and FKs share a tag and SQL representation; the alias supplies the exact target idMeta. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === KeySerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: `key:${this.meta.tagName}`, arrayElementSafe: true }\n : undefined;\n }\n\n /** Resolves references and tagged, untagged, or numeric ids using the column's tag and storage type. */\n mapToDbValue(value: unknown): unknown {\n return keyToNumber(\n this.meta,\n typeof value === \"number\"\n ? value\n : maybeResolveReferenceToId(value as Parameters<typeof maybeResolveReferenceToId>[0]),\n );\n }\n\n mapToRow(value: any): any {\n // we don't have any fixups since we are trying to recreate what comes out of the db, so this is safe\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n // Numeric IDs are already database values; tagged string IDs still need to be resolved and untagged.\n if (value === null || typeof value === \"number\") return value;\n // We go through `maybeResolveReferenceToId` because filters like `in: [a1, a2]` pass entities directly.\n return keyToNumber(this.meta, maybeResolveReferenceToId(value));\n }\n\n /** Converts a physical primary or foreign key to a tagged id. */\n mapFromDb(value: unknown): string | undefined {\n return keyToTaggedId(this.meta, value as string | number);\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\nexport class EnumFieldSerde implements ScalarCodec {\n isArray = false;\n\n constructor(\n public dbType: \"int\" | \"uuid\",\n private enumObject: any,\n ) {}\n\n /** Separate fields of the same generated enum share its code/id mapping. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === EnumFieldSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: this.enumObject, arrayElementSafe: true }\n : undefined;\n }\n\n /** Resolves the enum code to its stored id, leaving an unknown code unset. */\n mapToDbValue(value: unknown): unknown {\n return this.enumObject.findByCode(value)?.id;\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return this.enumObject.findByCode(value)?.id;\n }\n\n /** Converts a stored enum id to its enum code. */\n mapFromDb(value: unknown): unknown {\n return this.enumObject.findById(value)?.code;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\nexport class EnumArrayFieldSerde implements ScalarCodec {\n isArray = true;\n\n constructor(\n public dbType: \"int[]\" | \"uuid[]\",\n private enumObject: any,\n ) {}\n\n /**\n * Return the unnest null/set marker as the physical db type.\n *\n * The marker is removed before enum IDs are stored, so it need not identify an enum row.\n */\n get notNullMarker(): unknown {\n return defaultArrayElementMarker(this.dbType);\n }\n\n /** Physical enum arrays reject null elements, unlike scalar enum arrayAgg; leave them unknown. */\n get outputType(): undefined {\n return undefined;\n }\n\n /** Resolves each enum code to its stored id, retaining the entity's empty-array default. */\n mapToDbValue(value: unknown): unknown {\n return (value as readonly unknown[] | null | undefined)?.map((code) => this.enumObject.getByCode(code).id) || [];\n }\n\n mapToRow(value: any): any {\n return this.mapToDbValue(value);\n }\n\n mapToDb(value: any) {\n return !value ? [] : value.map((code: any) => this.enumObject.getByCode(code).id);\n }\n\n /** Converts stored enum ids to codes, defaulting an unset entity field to an empty array. */\n mapFromDb(value: unknown): unknown[] {\n return (value as readonly unknown[] | null | undefined)?.map((id) => this.enumObject.findById(id).code) || [];\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\n/** Similar to SimpleSerde, but applies the superstruct `assert` function when reading values from the db. */\nexport class SuperstructSerde implements ScalarCodec {\n dbType = \"jsonb\";\n isArray = false;\n\n // Use a dynamic require so that downstream projects don't have to depend on superstruct\n // until they want to, i.e. we don't have superstruct in the joist-orm package.json.\n private assert = runtimeRequire(\"superstruct\").assert;\n\n constructor(private superstruct: any) {}\n\n /** JSON schemas describe a jsonb value, even when that value is a JSON array. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === SuperstructSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: this.superstruct, arrayElementSafe: true }\n : undefined;\n }\n\n /** Serializes the domain JSON value without running the read-time schema validation. */\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n // JSON is returned by postgres already parsed, so we should just be able to return our data directly. Unlike with\n // JsonSerde, we can assume that superstruct would have parsed any complex types in the json correctly so we don't\n // need to do a round trip through JSON.stringify.\n mapToRow(value: any): any {\n return value;\n }\n\n mapToDb(value: any) {\n return JSON.stringify(value);\n }\n\n /** Validates a driver JSON value with the field's Superstruct schema. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n if (dbValue) this.assert(dbValue, this.superstruct);\n return dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\nexport class JsonSerde implements ScalarCodec {\n dbType = \"jsonb\";\n isArray = false;\n\n constructor() {}\n\n /** Unvalidated JSON uses its own encoder, not a primitive or schema-specific codec. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === JsonSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: JsonSerde, arrayElementSafe: true }\n : undefined;\n }\n\n /** Serializes the whole JSON value, including JSON arrays and custom toJSON methods. */\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n // JSON is returned by postgres already parsed, so if we are trying to recreate then we need to stringify, then parse.\n // It's necessary to do this instead of just returning the object directly because any complex types in the json need\n // to be stringified to correctly reflect the db value.\n mapToRow(value: any): any {\n const json = JSON.stringify(value);\n return isDefined(json) ? JSON.parse(json) : undefined;\n }\n\n mapToDb(value: any) {\n return JSON.stringify(value);\n }\n\n /** Keeps the driver's parsed JSON value, normalizing SQL NULL for entity fields. */\n mapFromDb(value: unknown): unknown {\n return maybeNullToUndefined(value);\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\n/**\n * Maps pgvector `vector(N)` columns to `number[]`s.\n *\n * pgvector has no pg array OID, so text results are its `[1,2,3]` literal, which is also valid\n * JSON (pgvector rejects NaN/Infinity elements). Writes send the same literal, which the batch\n * `unnest(?::vector[])` casts, because node-pg would otherwise encode a JS array as `{1,2,3}`.\n */\nexport class VectorSerde implements ScalarCodec {\n dbType = \"vector\";\n isArray = false;\n\n get outputType(): TypeInfo | undefined {\n return this.constructor === VectorSerde ? { dbType: this.dbType, domain: VectorSerde } : undefined;\n }\n\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n mapToRow(value: any): any {\n return JSON.stringify(value);\n }\n\n mapToDb(value: any) {\n return value === null ? value : JSON.stringify(value);\n }\n\n /** Parses the text literal, and passes through arrays already decoded by the binary row path. */\n mapFromDb(value: unknown): unknown {\n return typeof value === \"string\" ? JSON.parse(value) : maybeNullToUndefined(value);\n }\n\n /** `to_json(vector)` falls back to the text literal, i.e. the same value as a driver row. */\n mapFromJsonAgg(value: any): any {\n return value;\n }\n}\n\n/** Similar to SimpleSerde, but applies the zod's `parse` function when reading values from the db. */\nexport class ZodSerde implements ScalarCodec {\n dbType = \"jsonb\";\n isArray = false;\n\n constructor(private zodSchema: any) {}\n\n /** Parsing and transformations are compatible only for the same schema object. */\n get outputType(): TypeInfo | undefined {\n return this.constructor === ZodSerde && !this.isArray\n ? { dbType: canonicalDbType(this.dbType), domain: this.zodSchema, arrayElementSafe: true }\n : undefined;\n }\n\n /** Serializes the domain JSON value without running the read-time Zod parser or transforms. */\n mapToDbValue(value: unknown): unknown {\n return JSON.stringify(value);\n }\n\n // JSON is returned by postgres already parsed, so we should just be able to return our data directly. Unlike with\n // JsonSerde, we can assume that zod would have parsed any complex types in the json correctly so we don't need to\n // do a round trip through JSON.stringify.\n mapToRow(value: any): any {\n return value;\n }\n\n mapToDb(value: any) {\n return JSON.stringify(value);\n }\n\n /** Parses a driver JSON value with the field's Zod schema. */\n mapFromDb(value: unknown): unknown {\n const dbValue = maybeNullToUndefined(value);\n return dbValue ? this.zodSchema.parse(dbValue) : dbValue;\n }\n\n mapFromJsonAgg(value: any): any {\n return value === null ? value : value;\n }\n}\n\n/** Return a default unnest null/set marker as the physical db type, before codec-specific conversion. */\nfunction defaultArrayElementMarker(dbType: string): unknown {\n if (dbType.startsWith(\"varchar\") || dbType.startsWith(\"character\") || dbType.startsWith(\"text\")) {\n return \"\";\n } else if (dbType.startsWith(\"int\")) {\n return 1;\n } else if (dbType.startsWith(\"date\") || dbType.startsWith(\"timestamp\")) {\n return new Date(\"2000-01-01T00:00:00.000Z\");\n } else {\n throw new Error(\"Unhandled nullable array column type \" + dbType);\n }\n}\n\n/** PostgreSQL does not enforce declared array dimensions; reject nested values rather than coercing subarrays. */\nfunction assertFlatNumericArray(value: unknown): void {\n if (Array.isArray(value) && value.some(Array.isArray)) {\n throw new Error(\"Native numeric arrays must be one-dimensional\");\n }\n}\n\n/** Only driver-native numbers agree with Number aggregates; int8/numeric identity values do not. */\nfunction primitiveOutputDomain(dbType: string): unknown {\n switch (dbType) {\n case \"int2\":\n case \"int4\":\n case \"float4\":\n case \"float8\":\n return Number;\n case \"text\":\n case \"varchar\":\n case \"bpchar\":\n return String;\n default:\n return PrimitiveSerde;\n }\n}\n\n/** Normalizes SQL NULL to an unset entity field. */\nfunction maybeNullToUndefined(value: any): any {\n return value === null ? undefined : value;\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,kBAAA,G,qBAAiBA,CAAAA,CAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AA0DpD,IAAa,qBAAb,MAAa,mBAA0C;CAI5C;CACC;CAJV,UAAmB;CAEnB,YACE,QACA,QACA,SACA;EAHO,KAAA,SAAA;EACC,KAAA,SAAA;EAGR,IAAI,YAAY,KAAA,GAAW,KAAK,UAAU;CAC5C;;CAGA,IAAI,gBAAyB;EAC3B,MAAM,OAAO,KAAK,OAAO,kBACrB,KAAK,OAAO,gBAAgB,IAC5B,KAAK,OAAO,OAAO,0BAA0B,KAAK,MAAM,CAAC;EAC7D,OAAQ,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC,CAAe;CAClD;;CAGA,IAAI,aAAmC;EACrC,IACE,KAAK,YAAY,KAAK,OAAO,SAAS,IAAI,KACzC,KAAK,gBAAgB,sBACpB,KAAK,gBAAgB,kBACrB,KAAK,gBAAgB,kBACrB,KAAK,gBAAgB,sBACrB,KAAK,gBAAgB,oBAEvB;EAEF,MAAM,SAASC,uBAAAA,gBAAgB,KAAK,MAAM;EAE1C,MAAM,cAAc,KAAK,UAAU,OAAO,MAAM,GAAG,EAAE,IAAI;EACzD,MAAM,aAAa;GAAE,QAAQ;GAAa,QAAQ,KAAK;GAAQ,kBAAkB,gBAAgB;EAAU;EAC3G,IAAI,CAAC,KAAK,SAAS,OAAO;EAE1B,OAAOC,uBAAAA,gBAAgB,UAAU,KAAK;GAAC;GAAQ;GAAQ;GAAa;EAAa,CAAC,CAAC,SAAS,WAAW,IACnG;GAAE;GAAQ,QAAQ,KAAK;EAAO,IAC9B,KAAA;CACN;;CAGA,aAAa,OAAyB;EACpC,OAAO,UAAU,KAAA,IACb,KAAK,UACF,MAA6B,KAAK,Y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EACxB,OAAO;CACT;CAEA,QAAQ,OAAY;EAClB,OAAO,KAAK,UAAU,KAAK;CAC7B;;CAGA,UAAU,OAAyB;EACjC,MAAM,UAAU,qBAAqB,KAAK;EAC1C,OAAO,UAAU,KAAK,UAAU,MAAM,OAAO,IAAI;CACnD;CAEA,eAAe,OAAiB;EAC9B,OAAO,UAAU,OAAO,QAAQ;CAClC;AACF;;AAGA,SAAS,0BAA0B,QAAyB;CAC1D,IAAI,OAAO,WAAW,SAAS,KAAK,OAAO,WAAW,WAAW,KAAK,OAAO,WAAW,MAAM,GAC5F,OAAO;MACF,IAAI,OAAO,WAAW,KAAK,GAChC,OAAO;MACF,IAAI,OAAO,WAAW,MAAM,KAAK,OAAO,WAAW,WAAW,GACnE,uBAAO,IAAI,KAAK,0BAA0B;MAE1C,MAAM,IAAI,MAAM,0CAA0C,MAAM;AAEpE;;AAGA,SAAS,uBAAuB,OAAsB;CACpD,IAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,MAAM,OAAO,GAClD,MAAM,IAAI,MAAM,+CAA+C;AAEnE;;AAGA,SAAS,sBAAsB,QAAyB;CACtD,QAAQ,QAAR;EACE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,UACH,OAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK,UACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;AAGA,SAAS,qBAAqB,OAAiB;CAC7C,OAAO,UAAU,OAAO,KAAA,IAAY;AACtC"}
|
package/build/serde/serde.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "./temporal.cjs";
|
|
2
2
|
import { TypeInfo } from "./TypeInfo.cjs";
|
|
3
|
-
//#region src/serde/serde.d.ts
|
|
4
3
|
/** Scalar conversion only: no field names, entity hydration, or FK fixups. */
|
|
5
4
|
export interface ScalarCodec {
|
|
6
5
|
dbType: string;
|
|
@@ -283,5 +282,4 @@ export declare class ZodSerde implements ScalarCodec {
|
|
|
283
282
|
mapFromDb(value: unknown): unknown;
|
|
284
283
|
mapFromJsonAgg(value: any): any;
|
|
285
284
|
}
|
|
286
|
-
//#endregion
|
|
287
285
|
//# sourceMappingURL=serde.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serde.d.cts","names":[],"sources":["../../src/serde/serde.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"serde.d.cts","names":[],"sources":["../../src/serde/serde.ts"],"mappings":";;;iBAiBiB;EACf;EACA;;WAES;;WAEA,aAAa;;EAEtB,QAAQ;;;;;;;;EAQR,cAAc;;EAEd,UAAU;;;;;;;EAOV,eAAe;;EAEf,SAAS;;;iBAIM,eAAe,WAAW;EACzC,WAAW,KAAK,OAAO;;;;;;;;iBASR,YAAY,YAAY;EACvC,KAAK,OAAO,aAAa;EACzB,OAAO,OAAO,SAAS;;;;;;;;;EASvB,oBAAoB;;qBAGT,8BAA8B;EAIhC;UACC;EAJV;EAEA,YACS,gBACC,QAAQ,uBAChB;;MAME;;MAQA,cAAc;;EAuBlB,aAAa;EAQb,SAAS;EAIT,QAAQ;;EASR,UAAU;EASV,eAAe;;;;;;;;;qBAkBJ,0BAA0B;EAE5B;EACA;EAFT,YACS,gBACA;;MAIL;;MAMA,cAAc;;EAclB,aAAa;EAIb,SAAS;EAIT,QAAQ;;EAKR,UAAU;EAIV,eAAe;;qBAKJ,kBAAkB,0BAA0B,eAAe;;MAElE,cAAc;;EAOlB,WAAW,KAAK,OAAO;EAIvB,eAAe;;;;;;;;EAYf,SAAS;EAIT,QAAQ,OAAO;;;qBAOJ,uBAAuB;EAClC,YAAY,gBAAgB;;;qBAMjB,uBAAuB;EAClC,YAAY,gBAAgB;;;qBAMjB,2BAA2B,8BAA8B,eAAe,SAAS;EAC5F,YAAY,gBAAgB;EAI5B,WAAW,KAAK,OAAO,SAAS;;;qBAOrB,2BAA2B,8BAA8B,eAAe,SAAS;EAC5F,YAAY,gBAAgB;EAI5B,WAAW,KAAK,OAAO,SAA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al.mjs";
|
|
2
2
|
import { TypeInfo } from "./TypeInfo.mjs";
|
|
3
|
-
//#region src/serde/serde.d.ts
|
|
4
3
|
/** Scalar conversion only: no field names, entity hydration, or FK fixups. */
|
|
5
4
|
export interface ScalarCodec {
|
|
6
5
|
dbType: string;
|
|
@@ -283,5 +282,4 @@ export declare class ZodSerde implements ScalarCodec {
|
|
|
283
282
|
mapFromDb(value: unknown): unknown;
|
|
284
283
|
mapFromJsonAgg(value: any): any;
|
|
285
284
|
}
|
|
286
|
-
//#endregion
|
|
287
285
|
//# sourceMappingURL=serde.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serde.d.mts","names":[],"sources":["../../src/serde/serde.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"serde.d.mts","names":[],"sources":["../../src/serde/serde.ts"],"mappings":";;;iBAiBiB;EACf;EACA;;WAES;;WAEA,aAAa;;EAEtB,QAAQ;;;;;;;;EAQR,cAAc;;EAEd,UAAU;;;;;;;EAOV,eAAe;;EAEf,SAAS;;;iBAIM,eAAe,WAAW;EACzC,WAAW,KAAK,OAAO;;;;;;;;iBASR,YAAY,YAAY;EACvC,KAAK,OAAO,aAAa;EACzB,OAAO,OAAO,SAAS;;;;;;;;;EASvB,oBAAoB;;qBAGT,8BAA8B;EAIhC;UACC;EAJV;EAEA,YACS,gBACC,QAAQ,uBAChB;;MAME;;MAQA,cAAc;;EAuBlB,aAAa;EAQb,SAAS;EAIT,QAAQ;;EASR,UAAU;EASV,eAAe;;;;;;;;;qBAkBJ,0BAA0B;EAE5B;EACA;EAFT,YACS,gBACA;;MAIL;;MAMA,cAAc;;EAclB,aAAa;EAIb,SAAS;EAIT,QAAQ;;EAKR,UAAU;EAIV,eAAe;;qBAKJ,kBAAkB,0BAA0B,eAAe;;MAElE,cAAc;;EAOlB,WAAW,KAAK,OAAO;EAIvB,eAAe;;;;;;;;EAYf,SAAS;EAIT,QAAQ,OAAO;;;qBAOJ,uBAAuB;EAClC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;;EAKR,UAAU;;EAKV,eAAe;;;qBAMJ,oBAAoB;UAIX;EAHpB;EACA;EAEA,YAAoB;;MAGhB,cAAc;;EAOlB,aAAa;EAOb,SAAS;EAIT,QAAQ;;EAKR,UAAU;EAKV,eAAe"}
|
package/build/serde/serde.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isDefined } from "../EntityManager.js";
|
|
2
2
|
import { keyToNumber, keyToTaggedId, maybeResolveReferenceToId } from "../keys.js";
|
|
3
|
-
import { arrayOutputType, canonicalDbType } from "./TypeInfo.js";
|
|
4
3
|
import { getRuntimeConfig } from "../runtimeConfig.js";
|
|
4
|
+
import { requireTemporal } from "./temporal.js";
|
|
5
5
|
import { plainDateMapper, plainDateTimeMapper, plainTimeMapper, zonedDateTimeMapper } from "./temporalMappers.js";
|
|
6
|
-
import {
|
|
6
|
+
import { arrayOutputType, canonicalDbType } from "./TypeInfo.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
|
-
|
|
8
|
+
// src/serde/serde.ts
|
|
9
9
|
const runtimeRequire = createRequire(import.meta.url);
|
|
10
10
|
var CustomSerdeAdapter = class CustomSerdeAdapter {
|
|
11
11
|
dbType;
|
|
@@ -538,7 +538,6 @@ function primitiveOutputDomain(dbType) {
|
|
|
538
538
|
function maybeNullToUndefined(value) {
|
|
539
539
|
return value === null ? void 0 : value;
|
|
540
540
|
}
|
|
541
|
-
//#endregion
|
|
542
541
|
export { BigIntSerde, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, EnumArrayFieldSerde, EnumFieldSerde, JsonSerde, KeySerde, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, PrimitiveSerde, SuperstructSerde, VectorSerde, ZodSerde, ZonedDateTimeSerde };
|
|
543
542
|
|
|
544
543
|
//# sourceMappingURL=serde.js.map
|
package/build/serde/temporal.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/serde/temporal.ts
|
|
3
3
|
const runtimeRequire = (0, require("node:module").createRequire)(require("url").pathToFileURL(__filename).href);
|
|
4
4
|
let temporal;
|
|
5
5
|
/**
|
|
@@ -44,7 +44,6 @@ function requireTemporal() {
|
|
|
44
44
|
if (!temporal) throw new Error("Unable to find a Temporal implementation");
|
|
45
45
|
return temporal;
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
exports.Temporal = Temporal;
|
|
49
48
|
exports.maybeRequireTemporal = maybeRequireTemporal;
|
|
50
49
|
exports.requireTemporal = requireTemporal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporal.cjs","names":["createRequire"],"sources":["../../src/serde/temporal.ts"],"sourcesContent":["/// <reference types=\"temporal-spec/global\" preserve=\"true\" />\n\nimport { createRequire } from \"node:module\";\n\nconst runtimeRequire = createRequire(import.meta.url);\n\n// Native Temporal and temporal-polyfill expose this shape; use the shared spec types instead of duplicating it.\ntype TemporalModule = typeof import(\"temporal-spec\");\nlet temporal: TemporalModule | undefined | false;\n\n/**\n * Lazily exposes Joist's native-first / polyfill-fallback Temporal detection.\n *\n * This is useful while the joist-orm repo itself has both pre-Node 26, and post-Node 26\n * test coverage, b/c our CI test suite needs the same a) codegen output and b) test suites\n * to \"just work\" with either Node 24/25 or Node 26, which means they can't have an explicit\n * import to either `temporal-polyfill` or the `Temporal` global.\n *\n * This is exactly what Joist's internal temporal resolution was already working around, so\n * this just exposes an `import { Temporal } from joist-orm` that lets the codegen & tests\n * reuse the same abstraction.\n */\nexport const Temporal = new Proxy(\n {},\n {\n get(_target, property, receiver) {\n return Reflect.get(requireTemporal().Temporal, property, receiver);\n },\n },\n) as typeof globalThis.Temporal;\n\n/**\n * A type-only `Temporal` namespace that merges with the `const Temporal` above.\n *\n * The `const` is only a value, so using `Temporal.PlainDate` / `Temporal.ZonedDateTime` as a\n * type needs a namespace to resolve against. Node 26 has that as a global, but older Node\n * versions don't, so `temporal-spec/global` supplies the same global namespace as a fallback.\n */\nexport declare namespace Temporal {\n export type Instant = globalThis.Temporal.Instant;\n export type ZonedDateTime = globalThis.Temporal.ZonedDateTime;\n export type PlainDate = globalThis.Temporal.PlainDate;\n export type PlainTime = globalThis.Temporal.PlainTime;\n export type PlainDateTime = globalThis.Temporal.PlainDateTime;\n export type PlainYearMonth = globalThis.Temporal.PlainYearMonth;\n export type PlainMonthDay = globalThis.Temporal.PlainMonthDay;\n export type Duration = globalThis.Temporal.Duration;\n}\n\n/**\n * Installs temporal-polyfill globally when native Temporal is unavailable.\n *\n * We want to avoid directly importing/requiring `temporal-polyfill` because\n * it will introduce the dependency to all users of Joist.\n */\nexport function maybeRequireTemporal(): TemporalModule | undefined {\n // if we've already failed to find a temporal implementation before, early exit\n if (temporal === false) return undefined;\n // if we already required temporal, just return that\n if (temporal) return temporal;\n // Share one implementation with database clients that resolve Temporal from the global.\n if (typeof globalThis.Temporal === \"undefined\") {\n try {\n runtimeRequire(\"temporal-polyfill/global\");\n } catch (e) {}\n }\n // use built in temporal or the installed polyfill\n if (typeof globalThis.Temporal !== \"undefined\") {\n temporal = {\n Temporal: globalThis.Temporal,\n toTemporalInstant: Date.prototype.toTemporalInstant,\n Intl: globalThis.Intl,\n };\n return temporal;\n }\n // don't try to load temporal again\n temporal = false;\n return undefined;\n}\n\nexport function requireTemporal(): TemporalModule {\n const temporal = maybeRequireTemporal();\n if (!temporal) throw new Error(\"Unable to find a Temporal implementation\");\n return temporal;\n}\n"],"mappings":";;AAIA,MAAM,kBAAA,
|
|
1
|
+
{"version":3,"file":"temporal.cjs","names":["createRequire"],"sources":["../../src/serde/temporal.ts"],"sourcesContent":["/// <reference types=\"temporal-spec/global\" preserve=\"true\" />\n\nimport { createRequire } from \"node:module\";\n\nconst runtimeRequire = createRequire(import.meta.url);\n\n// Native Temporal and temporal-polyfill expose this shape; use the shared spec types instead of duplicating it.\ntype TemporalModule = typeof import(\"temporal-spec\");\nlet temporal: TemporalModule | undefined | false;\n\n/**\n * Lazily exposes Joist's native-first / polyfill-fallback Temporal detection.\n *\n * This is useful while the joist-orm repo itself has both pre-Node 26, and post-Node 26\n * test coverage, b/c our CI test suite needs the same a) codegen output and b) test suites\n * to \"just work\" with either Node 24/25 or Node 26, which means they can't have an explicit\n * import to either `temporal-polyfill` or the `Temporal` global.\n *\n * This is exactly what Joist's internal temporal resolution was already working around, so\n * this just exposes an `import { Temporal } from joist-orm` that lets the codegen & tests\n * reuse the same abstraction.\n */\nexport const Temporal = new Proxy(\n {},\n {\n get(_target, property, receiver) {\n return Reflect.get(requireTemporal().Temporal, property, receiver);\n },\n },\n) as typeof globalThis.Temporal;\n\n/**\n * A type-only `Temporal` namespace that merges with the `const Temporal` above.\n *\n * The `const` is only a value, so using `Temporal.PlainDate` / `Temporal.ZonedDateTime` as a\n * type needs a namespace to resolve against. Node 26 has that as a global, but older Node\n * versions don't, so `temporal-spec/global` supplies the same global namespace as a fallback.\n */\nexport declare namespace Temporal {\n export type Instant = globalThis.Temporal.Instant;\n export type ZonedDateTime = globalThis.Temporal.ZonedDateTime;\n export type PlainDate = globalThis.Temporal.PlainDate;\n export type PlainTime = globalThis.Temporal.PlainTime;\n export type PlainDateTime = globalThis.Temporal.PlainDateTime;\n export type PlainYearMonth = globalThis.Temporal.PlainYearMonth;\n export type PlainMonthDay = globalThis.Temporal.PlainMonthDay;\n export type Duration = globalThis.Temporal.Duration;\n}\n\n/**\n * Installs temporal-polyfill globally when native Temporal is unavailable.\n *\n * We want to avoid directly importing/requiring `temporal-polyfill` because\n * it will introduce the dependency to all users of Joist.\n */\nexport function maybeRequireTemporal(): TemporalModule | undefined {\n // if we've already failed to find a temporal implementation before, early exit\n if (temporal === false) return undefined;\n // if we already required temporal, just return that\n if (temporal) return temporal;\n // Share one implementation with database clients that resolve Temporal from the global.\n if (typeof globalThis.Temporal === \"undefined\") {\n try {\n runtimeRequire(\"temporal-polyfill/global\");\n } catch (e) {}\n }\n // use built in temporal or the installed polyfill\n if (typeof globalThis.Temporal !== \"undefined\") {\n temporal = {\n Temporal: globalThis.Temporal,\n toTemporalInstant: Date.prototype.toTemporalInstant,\n Intl: globalThis.Intl,\n };\n return temporal;\n }\n // don't try to load temporal again\n temporal = false;\n return undefined;\n}\n\nexport function requireTemporal(): TemporalModule {\n const temporal = maybeRequireTemporal();\n if (!temporal) throw new Error(\"Unable to find a Temporal implementation\");\n return temporal;\n}\n"],"mappings":";;AAIA,MAAM,kBAAA,G,qBAAiBA,CAAAA,CAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AAIpD,IAAI;;;;;;;;;;;;;AAcJ,MAAa,WAAW,IAAI,MAC1B,CAAC,GACD,EACE,IAAI,SAAS,UAAU,UAAU;CAC/B,OAAO,QAAQ,IAAI,gBAAgB,CAAC,CAAC,UAAU,UAAU,QAAQ;AACnE,EACF,CACF;;;;;;;AA0BA,SAAgB,uBAAmD;CAEjE,IAAI,aAAa,OAAO,OAAO,KAAA;CAE/B,IAAI,UAAU,OAAO;CAErB,IAAI,OAAO,WAAW,aAAa,aACjC,IAAI;EACF,eAAe,0BAA0B;CAC3C,SAAS,GAAG,CAAC;CAGf,IAAI,OAAO,WAAW,aAAa,aAAa;EAC9C,WAAW;GACT,UAAU,WAAW;GACrB,mBAAmB,KAAK,UAAU;GAClC,MAAM,WAAW;EACnB;EACA,OAAO;CACT;CAEA,WAAW;AAEb;AAEA,SAAgB,kBAAkC;CAChD,MAAM,WAAW,qBAAqB;CACtC,IAAI,CAAC,UAAU,MAAM,IAAI,MAAM,0CAA0C;CACzE,OAAO;AACT"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="temporal-spec/global" preserve="true" />
|
|
2
|
-
//#region src/serde/temporal.d.ts
|
|
3
2
|
type TemporalModule = typeof import("temporal-spec");
|
|
4
3
|
/**
|
|
5
4
|
* Lazily exposes Joist's native-first / polyfill-fallback Temporal detection.
|
|
@@ -39,6 +38,5 @@ export declare namespace Temporal {
|
|
|
39
38
|
*/
|
|
40
39
|
export declare function maybeRequireTemporal(): TemporalModule | undefined;
|
|
41
40
|
export declare function requireTemporal(): TemporalModule;
|
|
42
|
-
//#endregion
|
|
43
41
|
export {};
|
|
44
42
|
//# sourceMappingURL=temporal.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporal.d.cts","names":[],"sources":["../../src/serde/temporal.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"temporal.d.cts","names":[],"sources":["../../src/serde/temporal.ts"],"mappings":";KAOK;;;;;;;;;;;;;qBAeQ,iBAOD,WAAW;;;;;;;;yBASE;OACX,UAAU,WAAW,SAAS;OAC9B,gBAAgB,WAAW,SAAS;OACpC,YAAY,WAAW,SAAS;OAChC,YAAY,WAAW,SAAS;OAChC,gBAAgB,WAAW,SAAS;OACpC,iBAAiB,WAAW,SAAS;OACrC,gBAAgB,WAAW,SAAS;OACpC,WAAW,WAAW,SAAS;;;;;;;;wBAS7B,wBAAwB;wBAyBxB,mBAAmB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="temporal-spec/global" preserve="true" />
|
|
2
|
-
//#region src/serde/temporal.d.ts
|
|
3
2
|
type TemporalModule = typeof import("temporal-spec");
|
|
4
3
|
/**
|
|
5
4
|
* Lazily exposes Joist's native-first / polyfill-fallback Temporal detection.
|
|
@@ -39,6 +38,5 @@ export declare namespace Temporal {
|
|
|
39
38
|
*/
|
|
40
39
|
export declare function maybeRequireTemporal(): TemporalModule | undefined;
|
|
41
40
|
export declare function requireTemporal(): TemporalModule;
|
|
42
|
-
//#endregion
|
|
43
41
|
export {};
|
|
44
42
|
//# sourceMappingURL=temporal.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporal.d.mts","names":[],"sources":["../../src/serde/temporal.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"temporal.d.mts","names":[],"sources":["../../src/serde/temporal.ts"],"mappings":";KAOK;;;;;;;;;;;;;qBAeQ,iBAOD,WAAW;;;;;;;;yBASE;OACX,UAAU,WAAW,SAAS;OAC9B,gBAAgB,WAAW,SAAS;OACpC,YAAY,WAAW,SAAS;OAChC,YAAY,WAAW,SAAS;OAChC,gBAAgB,WAAW,SAAS;OACpC,iBAAiB,WAAW,SAAS;OACrC,gBAAgB,WAAW,SAAS;OACpC,WAAW,WAAW,SAAS;;;;;;;;wBAS7B,wBAAwB;wBAyBxB,mBAAmB"}
|
package/build/serde/temporal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
|
|
2
|
+
// src/serde/temporal.ts
|
|
3
3
|
const runtimeRequire = createRequire(import.meta.url);
|
|
4
4
|
let temporal;
|
|
5
5
|
/**
|
|
@@ -44,7 +44,6 @@ function requireTemporal() {
|
|
|
44
44
|
if (!temporal) throw new Error("Unable to find a Temporal implementation");
|
|
45
45
|
return temporal;
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
export { Temporal, maybeRequireTemporal, requireTemporal };
|
|
49
48
|
|
|
50
49
|
//# sourceMappingURL=temporal.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_serde_temporal = require("./temporal.cjs");
|
|
3
3
|
const require_utils = require("../utils.cjs");
|
|
4
|
-
|
|
4
|
+
// src/serde/temporalMappers.ts
|
|
5
5
|
const { Temporal: t } = require_serde_temporal.maybeRequireTemporal() ?? {};
|
|
6
6
|
const temporalNotAvailable = {
|
|
7
7
|
fromDb: () => require_utils.fail("Temporal not available"),
|
|
@@ -57,7 +57,6 @@ const zonedDateTimeMapper = t ? {
|
|
|
57
57
|
toDb: (zdt) => zdt.toString({ timeZoneName: "never" }),
|
|
58
58
|
getUnnestMarker: () => t.ZonedDateTime.from("2000-01-01T00:00:00+00:00[UTC]")
|
|
59
59
|
} : temporalNotAvailable;
|
|
60
|
-
//#endregion
|
|
61
60
|
exports.plainDateMapper = plainDateMapper;
|
|
62
61
|
exports.plainDateTimeMapper = plainDateTimeMapper;
|
|
63
62
|
exports.plainTimeMapper = plainTimeMapper;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Temporal } from "./temporal.cjs";
|
|
2
1
|
import { CustomSerde } from "./serde.cjs";
|
|
3
|
-
|
|
2
|
+
import { Temporal } from "./temporal.cjs";
|
|
4
3
|
/**
|
|
5
4
|
* Converts Postgres `DATE` to/from Temporal.PlainDate.
|
|
6
5
|
*
|
|
@@ -31,5 +30,4 @@ export declare const plainDateTimeMapper: CustomSerde<Temporal.PlainDateTime, st
|
|
|
31
30
|
* theoretically. If, somehow, we don't get an offset, then we assume UTC.
|
|
32
31
|
*/
|
|
33
32
|
export declare const zonedDateTimeMapper: CustomSerde<Temporal.ZonedDateTime, string>;
|
|
34
|
-
//#endregion
|
|
35
33
|
//# sourceMappingURL=temporalMappers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporalMappers.d.cts","names":[],"sources":["../../src/serde/temporalMappers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"temporalMappers.d.cts","names":[],"sources":["../../src/serde/temporalMappers.ts"],"mappings":";;;;;;;;qBAgBa,iBAAiB,YAAY,SAAS;;qBAStC,iBAAiB,YAAY,SAAS;;;;;qBAYtC,qBAAqB,YAAY,SAAS;;;;;;;;;;;;;;;;qBAyB1C,qBAAqB,YAAY,SAAS"}
|