joist-orm 1.294.0 → 2.0.1
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/codegen.d.ts +2 -0
- package/build/codegen.d.ts.map +1 -0
- package/build/codegen.js +29 -0
- package/build/codegen.js.map +1 -0
- package/build/drivers/PostgresDriver.d.ts +1 -4
- package/build/drivers/PostgresDriver.d.ts.map +1 -1
- package/build/drivers/PostgresDriver.js +49 -58
- package/build/drivers/PostgresDriver.js.map +1 -1
- package/build/graphql-codegen-export.d.ts +2 -0
- package/build/graphql-codegen-export.d.ts.map +1 -0
- package/build/{drivers/index.js → graphql-codegen-export.js} +3 -5
- package/build/graphql-codegen-export.js.map +1 -0
- package/build/graphql-export.d.ts +2 -0
- package/build/graphql-export.d.ts.map +1 -0
- package/build/graphql-export.js +19 -0
- package/build/graphql-export.js.map +1 -0
- package/build/index.d.ts +3 -128
- package/build/index.d.ts.map +1 -1
- package/build/index.js +8 -284
- package/build/index.js.map +1 -1
- package/build/knex-export.d.ts +2 -0
- package/build/knex-export.d.ts.map +1 -0
- package/build/knex-export.js +19 -0
- package/build/knex-export.js.map +1 -0
- package/build/pg-export.d.ts +2 -0
- package/build/pg-export.d.ts.map +1 -0
- package/build/pg-export.js +7 -0
- package/build/pg-export.js.map +1 -0
- package/build/pg-migrate.d.ts +2 -0
- package/build/pg-migrate.d.ts.map +1 -0
- package/build/pg-migrate.js +30 -0
- package/build/pg-migrate.js.map +1 -0
- package/build/tests-export.d.ts +2 -0
- package/build/tests-export.d.ts.map +1 -0
- package/build/tests-export.js +19 -0
- package/build/tests-export.js.map +1 -0
- package/package.json +94 -16
- package/build/AliasAssigner.d.ts +0 -7
- package/build/AliasAssigner.d.ts.map +0 -1
- package/build/AliasAssigner.js +0 -30
- package/build/AliasAssigner.js.map +0 -1
- package/build/Aliases.d.ts +0 -110
- package/build/Aliases.d.ts.map +0 -1
- package/build/Aliases.js +0 -456
- package/build/Aliases.js.map +0 -1
- package/build/BaseEntity.d.ts +0 -66
- package/build/BaseEntity.d.ts.map +0 -1
- package/build/BaseEntity.js +0 -120
- package/build/BaseEntity.js.map +0 -1
- package/build/ConditionBuilder.d.ts +0 -50
- package/build/ConditionBuilder.d.ts.map +0 -1
- package/build/ConditionBuilder.js +0 -178
- package/build/ConditionBuilder.js.map +0 -1
- package/build/Entity.d.ts +0 -38
- package/build/Entity.d.ts.map +0 -1
- package/build/Entity.js +0 -8
- package/build/Entity.js.map +0 -1
- package/build/EntityFields.d.ts +0 -37
- package/build/EntityFields.d.ts.map +0 -1
- package/build/EntityFields.js +0 -3
- package/build/EntityFields.js.map +0 -1
- package/build/EntityFilter.d.ts +0 -113
- package/build/EntityFilter.d.ts.map +0 -1
- package/build/EntityFilter.js +0 -3
- package/build/EntityFilter.js.map +0 -1
- package/build/EntityGraphQLFilter.d.ts +0 -51
- package/build/EntityGraphQLFilter.d.ts.map +0 -1
- package/build/EntityGraphQLFilter.js +0 -54
- package/build/EntityGraphQLFilter.js.map +0 -1
- package/build/EntityManager.d.ts +0 -734
- package/build/EntityManager.d.ts.map +0 -1
- package/build/EntityManager.js +0 -2075
- package/build/EntityManager.js.map +0 -1
- package/build/EntityMetadata.d.ts +0 -185
- package/build/EntityMetadata.d.ts.map +0 -1
- package/build/EntityMetadata.js +0 -61
- package/build/EntityMetadata.js.map +0 -1
- package/build/EnumMetadata.d.ts +0 -15
- package/build/EnumMetadata.d.ts.map +0 -1
- package/build/EnumMetadata.js +0 -3
- package/build/EnumMetadata.js.map +0 -1
- package/build/FlushLock.d.ts +0 -26
- package/build/FlushLock.d.ts.map +0 -1
- package/build/FlushLock.js +0 -57
- package/build/FlushLock.js.map +0 -1
- package/build/HintTree.d.ts +0 -42
- package/build/HintTree.d.ts.map +0 -1
- package/build/HintTree.js +0 -64
- package/build/HintTree.js.map +0 -1
- package/build/IndexManager.d.ts +0 -30
- package/build/IndexManager.d.ts.map +0 -1
- package/build/IndexManager.js +0 -206
- package/build/IndexManager.js.map +0 -1
- package/build/InstanceData.d.ts +0 -59
- package/build/InstanceData.d.ts.map +0 -1
- package/build/InstanceData.js +0 -162
- package/build/InstanceData.js.map +0 -1
- package/build/IsLoadedCache.d.ts +0 -32
- package/build/IsLoadedCache.d.ts.map +0 -1
- package/build/IsLoadedCache.js +0 -80
- package/build/IsLoadedCache.js.map +0 -1
- package/build/JoinRows.d.ts +0 -75
- package/build/JoinRows.d.ts.map +0 -1
- package/build/JoinRows.js +0 -246
- package/build/JoinRows.js.map +0 -1
- package/build/PluginManager.d.ts +0 -90
- package/build/PluginManager.d.ts.map +0 -1
- package/build/PluginManager.js +0 -97
- package/build/PluginManager.js.map +0 -1
- package/build/QueryParser.d.ts +0 -271
- package/build/QueryParser.d.ts.map +0 -1
- package/build/QueryParser.js +0 -853
- package/build/QueryParser.js.map +0 -1
- package/build/QueryParser.pruning.d.ts +0 -5
- package/build/QueryParser.pruning.d.ts.map +0 -1
- package/build/QueryParser.pruning.js +0 -118
- package/build/QueryParser.pruning.js.map +0 -1
- package/build/QueryVisitor.d.ts +0 -19
- package/build/QueryVisitor.d.ts.map +0 -1
- package/build/QueryVisitor.js +0 -84
- package/build/QueryVisitor.js.map +0 -1
- package/build/ReactionsManager.d.ts +0 -84
- package/build/ReactionsManager.d.ts.map +0 -1
- package/build/ReactionsManager.js +0 -308
- package/build/ReactionsManager.js.map +0 -1
- package/build/Todo.d.ts +0 -31
- package/build/Todo.d.ts.map +0 -1
- package/build/Todo.js +0 -73
- package/build/Todo.js.map +0 -1
- package/build/caches.d.ts +0 -6
- package/build/caches.d.ts.map +0 -1
- package/build/caches.js +0 -42
- package/build/caches.js.map +0 -1
- package/build/changes.d.ts +0 -79
- package/build/changes.d.ts.map +0 -1
- package/build/changes.js +0 -251
- package/build/changes.js.map +0 -1
- package/build/config.d.ts +0 -237
- package/build/config.d.ts.map +0 -1
- package/build/config.js +0 -298
- package/build/config.js.map +0 -1
- package/build/config.test.d.ts +0 -2
- package/build/config.test.d.ts.map +0 -1
- package/build/config.test.js +0 -53
- package/build/config.test.js.map +0 -1
- package/build/configure.d.ts +0 -13
- package/build/configure.d.ts.map +0 -1
- package/build/configure.js +0 -329
- package/build/configure.js.map +0 -1
- package/build/dataloaders/findByUniqueDataLoader.d.ts +0 -7
- package/build/dataloaders/findByUniqueDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findByUniqueDataLoader.js +0 -47
- package/build/dataloaders/findByUniqueDataLoader.js.map +0 -1
- package/build/dataloaders/findCountDataLoader.d.ts +0 -7
- package/build/dataloaders/findCountDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findCountDataLoader.js +0 -74
- package/build/dataloaders/findCountDataLoader.js.map +0 -1
- package/build/dataloaders/findDataLoader.d.ts +0 -37
- package/build/dataloaders/findDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findDataLoader.js +0 -337
- package/build/dataloaders/findDataLoader.js.map +0 -1
- package/build/dataloaders/findIdsDataLoader.d.ts +0 -7
- package/build/dataloaders/findIdsDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findIdsDataLoader.js +0 -74
- package/build/dataloaders/findIdsDataLoader.js.map +0 -1
- package/build/dataloaders/findOrCreateDataLoader.d.ts +0 -13
- package/build/dataloaders/findOrCreateDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findOrCreateDataLoader.js +0 -174
- package/build/dataloaders/findOrCreateDataLoader.js.map +0 -1
- package/build/dataloaders/lensDataLoader.d.ts +0 -12
- package/build/dataloaders/lensDataLoader.d.ts.map +0 -1
- package/build/dataloaders/lensDataLoader.js +0 -180
- package/build/dataloaders/lensDataLoader.js.map +0 -1
- package/build/dataloaders/loadDataLoader.d.ts +0 -11
- package/build/dataloaders/loadDataLoader.d.ts.map +0 -1
- package/build/dataloaders/loadDataLoader.js +0 -54
- package/build/dataloaders/loadDataLoader.js.map +0 -1
- package/build/dataloaders/manyToManyDataLoader.d.ts +0 -8
- package/build/dataloaders/manyToManyDataLoader.d.ts.map +0 -1
- package/build/dataloaders/manyToManyDataLoader.js +0 -74
- package/build/dataloaders/manyToManyDataLoader.js.map +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.ts +0 -8
- package/build/dataloaders/manyToManyFindDataLoader.d.ts.map +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.js +0 -70
- package/build/dataloaders/manyToManyFindDataLoader.js.map +0 -1
- package/build/dataloaders/oneToManyDataLoader.d.ts +0 -7
- package/build/dataloaders/oneToManyDataLoader.d.ts.map +0 -1
- package/build/dataloaders/oneToManyDataLoader.js +0 -60
- package/build/dataloaders/oneToManyDataLoader.js.map +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.ts +0 -8
- package/build/dataloaders/oneToManyFindDataLoader.d.ts.map +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.js +0 -71
- package/build/dataloaders/oneToManyFindDataLoader.js.map +0 -1
- package/build/dataloaders/oneToOneDataLoader.d.ts +0 -7
- package/build/dataloaders/oneToOneDataLoader.d.ts.map +0 -1
- package/build/dataloaders/oneToOneDataLoader.js +0 -59
- package/build/dataloaders/oneToOneDataLoader.js.map +0 -1
- package/build/dataloaders/populateDataLoader.d.ts +0 -13
- package/build/dataloaders/populateDataLoader.d.ts.map +0 -1
- package/build/dataloaders/populateDataLoader.js +0 -148
- package/build/dataloaders/populateDataLoader.js.map +0 -1
- package/build/dataloaders/recursiveChildrenDataLoader.d.ts +0 -7
- package/build/dataloaders/recursiveChildrenDataLoader.d.ts.map +0 -1
- package/build/dataloaders/recursiveChildrenDataLoader.js +0 -77
- package/build/dataloaders/recursiveChildrenDataLoader.js.map +0 -1
- package/build/dataloaders/recursiveParentsDataLoader.d.ts +0 -7
- package/build/dataloaders/recursiveParentsDataLoader.d.ts.map +0 -1
- package/build/dataloaders/recursiveParentsDataLoader.js +0 -59
- package/build/dataloaders/recursiveParentsDataLoader.js.map +0 -1
- package/build/defaults.d.ts +0 -54
- package/build/defaults.d.ts.map +0 -1
- package/build/defaults.js +0 -282
- package/build/defaults.js.map +0 -1
- package/build/driverApi.d.ts +0 -19
- package/build/driverApi.d.ts.map +0 -1
- package/build/driverApi.js +0 -17
- package/build/driverApi.js.map +0 -1
- package/build/drivers/Driver.d.ts +0 -26
- package/build/drivers/Driver.d.ts.map +0 -1
- package/build/drivers/Driver.js +0 -3
- package/build/drivers/Driver.js.map +0 -1
- package/build/drivers/EntityWriter.d.ts +0 -64
- package/build/drivers/EntityWriter.d.ts.map +0 -1
- package/build/drivers/EntityWriter.js +0 -237
- package/build/drivers/EntityWriter.js.map +0 -1
- package/build/drivers/IdAssigner.d.ts +0 -50
- package/build/drivers/IdAssigner.d.ts.map +0 -1
- package/build/drivers/IdAssigner.js +0 -133
- package/build/drivers/IdAssigner.js.map +0 -1
- package/build/drivers/buildRawQuery.d.ts +0 -20
- package/build/drivers/buildRawQuery.d.ts.map +0 -1
- package/build/drivers/buildRawQuery.js +0 -148
- package/build/drivers/buildRawQuery.js.map +0 -1
- package/build/drivers/buildUtils.d.ts +0 -4
- package/build/drivers/buildUtils.d.ts.map +0 -1
- package/build/drivers/buildUtils.js +0 -79
- package/build/drivers/buildUtils.js.map +0 -1
- package/build/drivers/index.d.ts +0 -5
- package/build/drivers/index.d.ts.map +0 -1
- package/build/drivers/index.js.map +0 -1
- package/build/fields.d.ts +0 -24
- package/build/fields.d.ts.map +0 -1
- package/build/fields.js +0 -162
- package/build/fields.js.map +0 -1
- package/build/getProperties.d.ts +0 -28
- package/build/getProperties.d.ts.map +0 -1
- package/build/getProperties.js +0 -141
- package/build/getProperties.js.map +0 -1
- package/build/json.d.ts +0 -77
- package/build/json.d.ts.map +0 -1
- package/build/json.js +0 -116
- package/build/json.js.map +0 -1
- package/build/k.d.ts +0 -2
- package/build/k.d.ts.map +0 -1
- package/build/k.js +0 -9
- package/build/k.js.map +0 -1
- package/build/keys.d.ts +0 -49
- package/build/keys.d.ts.map +0 -1
- package/build/keys.js +0 -195
- package/build/keys.js.map +0 -1
- package/build/keywords.d.ts +0 -5
- package/build/keywords.d.ts.map +0 -1
- package/build/keywords.js +0 -124
- package/build/keywords.js.map +0 -1
- package/build/loadHints.d.ts +0 -112
- package/build/loadHints.d.ts.map +0 -1
- package/build/loadHints.js +0 -75
- package/build/loadHints.js.map +0 -1
- package/build/loadLens.d.ts +0 -66
- package/build/loadLens.d.ts.map +0 -1
- package/build/loadLens.js +0 -287
- package/build/loadLens.js.map +0 -1
- package/build/logging/FactoryLogger.d.ts +0 -24
- package/build/logging/FactoryLogger.d.ts.map +0 -1
- package/build/logging/FactoryLogger.js +0 -77
- package/build/logging/FactoryLogger.js.map +0 -1
- package/build/logging/FieldLogger.d.ts +0 -27
- package/build/logging/FieldLogger.d.ts.map +0 -1
- package/build/logging/FieldLogger.js +0 -69
- package/build/logging/FieldLogger.js.map +0 -1
- package/build/logging/ReactionLogger.d.ts +0 -23
- package/build/logging/ReactionLogger.d.ts.map +0 -1
- package/build/logging/ReactionLogger.js +0 -65
- package/build/logging/ReactionLogger.js.map +0 -1
- package/build/newEntity.d.ts +0 -45
- package/build/newEntity.d.ts.map +0 -1
- package/build/newEntity.js +0 -106
- package/build/newEntity.js.map +0 -1
- package/build/newTestInstance.d.ts +0 -193
- package/build/newTestInstance.d.ts.map +0 -1
- package/build/newTestInstance.js +0 -738
- package/build/newTestInstance.js.map +0 -1
- package/build/normalizeHints.d.ts +0 -16
- package/build/normalizeHints.d.ts.map +0 -1
- package/build/normalizeHints.js +0 -31
- package/build/normalizeHints.js.map +0 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.ts +0 -9
- package/build/plugins/ImmutableEntitiesPlugin.d.ts.map +0 -1
- package/build/plugins/ImmutableEntitiesPlugin.js +0 -21
- package/build/plugins/ImmutableEntitiesPlugin.js.map +0 -1
- package/build/plugins/PreloadPlugin.d.ts +0 -69
- package/build/plugins/PreloadPlugin.d.ts.map +0 -1
- package/build/plugins/PreloadPlugin.js +0 -3
- package/build/plugins/PreloadPlugin.js.map +0 -1
- package/build/preloading/JsonAggregatePreloader.d.ts +0 -16
- package/build/preloading/JsonAggregatePreloader.d.ts.map +0 -1
- package/build/preloading/JsonAggregatePreloader.js +0 -238
- package/build/preloading/JsonAggregatePreloader.js.map +0 -1
- package/build/preloading/canPreload.d.ts +0 -3
- package/build/preloading/canPreload.d.ts.map +0 -1
- package/build/preloading/canPreload.js +0 -21
- package/build/preloading/canPreload.js.map +0 -1
- package/build/preloading/partitionHint.d.ts +0 -5
- package/build/preloading/partitionHint.d.ts.map +0 -1
- package/build/preloading/partitionHint.js +0 -56
- package/build/preloading/partitionHint.js.map +0 -1
- package/build/reactiveHints.d.ts +0 -129
- package/build/reactiveHints.d.ts.map +0 -1
- package/build/reactiveHints.js +0 -458
- package/build/reactiveHints.js.map +0 -1
- package/build/relations/AbstractPropertyImpl.d.ts +0 -8
- package/build/relations/AbstractPropertyImpl.d.ts.map +0 -1
- package/build/relations/AbstractPropertyImpl.js +0 -15
- package/build/relations/AbstractPropertyImpl.js.map +0 -1
- package/build/relations/AbstractRelationImpl.d.ts +0 -36
- package/build/relations/AbstractRelationImpl.d.ts.map +0 -1
- package/build/relations/AbstractRelationImpl.js +0 -19
- package/build/relations/AbstractRelationImpl.js.map +0 -1
- package/build/relations/Collection.d.ts +0 -28
- package/build/relations/Collection.d.ts.map +0 -1
- package/build/relations/Collection.js +0 -18
- package/build/relations/Collection.js.map +0 -1
- package/build/relations/CustomCollection.d.ts +0 -69
- package/build/relations/CustomCollection.d.ts.map +0 -1
- package/build/relations/CustomCollection.js +0 -166
- package/build/relations/CustomCollection.js.map +0 -1
- package/build/relations/CustomReference.d.ts +0 -71
- package/build/relations/CustomReference.d.ts.map +0 -1
- package/build/relations/CustomReference.js +0 -152
- package/build/relations/CustomReference.js.map +0 -1
- package/build/relations/LargeCollection.d.ts +0 -19
- package/build/relations/LargeCollection.d.ts.map +0 -1
- package/build/relations/LargeCollection.js +0 -3
- package/build/relations/LargeCollection.js.map +0 -1
- package/build/relations/ManyToManyCollection.d.ts +0 -44
- package/build/relations/ManyToManyCollection.d.ts.map +0 -1
- package/build/relations/ManyToManyCollection.js +0 -268
- package/build/relations/ManyToManyCollection.js.map +0 -1
- package/build/relations/ManyToManyLargeCollection.d.ts +0 -30
- package/build/relations/ManyToManyLargeCollection.d.ts.map +0 -1
- package/build/relations/ManyToManyLargeCollection.js +0 -119
- package/build/relations/ManyToManyLargeCollection.js.map +0 -1
- package/build/relations/ManyToOneReference.d.ts +0 -121
- package/build/relations/ManyToOneReference.d.ts.map +0 -1
- package/build/relations/ManyToOneReference.js +0 -389
- package/build/relations/ManyToOneReference.js.map +0 -1
- package/build/relations/OneToManyCollection.d.ts +0 -58
- package/build/relations/OneToManyCollection.d.ts.map +0 -1
- package/build/relations/OneToManyCollection.js +0 -347
- package/build/relations/OneToManyCollection.js.map +0 -1
- package/build/relations/OneToManyLargeCollection.d.ts +0 -26
- package/build/relations/OneToManyLargeCollection.d.ts.map +0 -1
- package/build/relations/OneToManyLargeCollection.js +0 -102
- package/build/relations/OneToManyLargeCollection.js.map +0 -1
- package/build/relations/OneToOneReference.d.ts +0 -93
- package/build/relations/OneToOneReference.d.ts.map +0 -1
- package/build/relations/OneToOneReference.js +0 -228
- package/build/relations/OneToOneReference.js.map +0 -1
- package/build/relations/PolymorphicReference.d.ts +0 -89
- package/build/relations/PolymorphicReference.d.ts.map +0 -1
- package/build/relations/PolymorphicReference.js +0 -244
- package/build/relations/PolymorphicReference.js.map +0 -1
- package/build/relations/ReactiveField.d.ts +0 -87
- package/build/relations/ReactiveField.d.ts.map +0 -1
- package/build/relations/ReactiveField.js +0 -149
- package/build/relations/ReactiveField.js.map +0 -1
- package/build/relations/ReactiveGetter.d.ts +0 -30
- package/build/relations/ReactiveGetter.d.ts.map +0 -1
- package/build/relations/ReactiveGetter.js +0 -38
- package/build/relations/ReactiveGetter.js.map +0 -1
- package/build/relations/ReactiveManyToMany.d.ts +0 -56
- package/build/relations/ReactiveManyToMany.d.ts.map +0 -1
- package/build/relations/ReactiveManyToMany.js +0 -243
- package/build/relations/ReactiveManyToMany.js.map +0 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.ts +0 -47
- package/build/relations/ReactiveManyToManyOtherSide.d.ts.map +0 -1
- package/build/relations/ReactiveManyToManyOtherSide.js +0 -155
- package/build/relations/ReactiveManyToManyOtherSide.js.map +0 -1
- package/build/relations/ReactiveQueryField.d.ts +0 -41
- package/build/relations/ReactiveQueryField.d.ts.map +0 -1
- package/build/relations/ReactiveQueryField.js +0 -125
- package/build/relations/ReactiveQueryField.js.map +0 -1
- package/build/relations/ReactiveReference.d.ts +0 -119
- package/build/relations/ReactiveReference.d.ts.map +0 -1
- package/build/relations/ReactiveReference.js +0 -333
- package/build/relations/ReactiveReference.js.map +0 -1
- package/build/relations/ReadOnlyCollection.d.ts +0 -19
- package/build/relations/ReadOnlyCollection.d.ts.map +0 -1
- package/build/relations/ReadOnlyCollection.js +0 -15
- package/build/relations/ReadOnlyCollection.js.map +0 -1
- package/build/relations/RecursiveCollection.d.ts +0 -84
- package/build/relations/RecursiveCollection.d.ts.map +0 -1
- package/build/relations/RecursiveCollection.js +0 -296
- package/build/relations/RecursiveCollection.js.map +0 -1
- package/build/relations/Reference.d.ts +0 -35
- package/build/relations/Reference.d.ts.map +0 -1
- package/build/relations/Reference.js +0 -21
- package/build/relations/Reference.js.map +0 -1
- package/build/relations/Relation.d.ts +0 -14
- package/build/relations/Relation.d.ts.map +0 -1
- package/build/relations/Relation.js +0 -12
- package/build/relations/Relation.js.map +0 -1
- package/build/relations/hasAsyncMethod.d.ts +0 -27
- package/build/relations/hasAsyncMethod.d.ts.map +0 -1
- package/build/relations/hasAsyncMethod.js +0 -47
- package/build/relations/hasAsyncMethod.js.map +0 -1
- package/build/relations/hasAsyncProperty.d.ts +0 -49
- package/build/relations/hasAsyncProperty.d.ts.map +0 -1
- package/build/relations/hasAsyncProperty.js +0 -98
- package/build/relations/hasAsyncProperty.js.map +0 -1
- package/build/relations/hasManyDerived.d.ts +0 -22
- package/build/relations/hasManyDerived.d.ts.map +0 -1
- package/build/relations/hasManyDerived.js +0 -32
- package/build/relations/hasManyDerived.js.map +0 -1
- package/build/relations/hasManyThrough.d.ts +0 -10
- package/build/relations/hasManyThrough.d.ts.map +0 -1
- package/build/relations/hasManyThrough.js +0 -24
- package/build/relations/hasManyThrough.js.map +0 -1
- package/build/relations/hasOneDerived.d.ts +0 -12
- package/build/relations/hasOneDerived.d.ts.map +0 -1
- package/build/relations/hasOneDerived.js +0 -24
- package/build/relations/hasOneDerived.js.map +0 -1
- package/build/relations/hasOneThrough.d.ts +0 -10
- package/build/relations/hasOneThrough.d.ts.map +0 -1
- package/build/relations/hasOneThrough.js +0 -24
- package/build/relations/hasOneThrough.js.map +0 -1
- package/build/relations/index.d.ts +0 -28
- package/build/relations/index.d.ts.map +0 -1
- package/build/relations/index.js +0 -88
- package/build/relations/index.js.map +0 -1
- package/build/rules.d.ts +0 -123
- package/build/rules.d.ts.map +0 -1
- package/build/rules.js +0 -231
- package/build/rules.js.map +0 -1
- package/build/runtimeConfig.d.ts +0 -17
- package/build/runtimeConfig.d.ts.map +0 -1
- package/build/runtimeConfig.js +0 -18
- package/build/runtimeConfig.js.map +0 -1
- package/build/serde.d.ts +0 -277
- package/build/serde.d.ts.map +0 -1
- package/build/serde.js +0 -517
- package/build/serde.js.map +0 -1
- package/build/temporal.d.ts +0 -16
- package/build/temporal.d.ts.map +0 -1
- package/build/temporal.js +0 -48
- package/build/temporal.js.map +0 -1
- package/build/temporalMappers.d.ts +0 -25
- package/build/temporalMappers.d.ts.map +0 -1
- package/build/temporalMappers.js +0 -59
- package/build/temporalMappers.js.map +0 -1
- package/build/trusted.d.ts +0 -5
- package/build/trusted.d.ts.map +0 -1
- package/build/trusted.js +0 -15
- package/build/trusted.js.map +0 -1
- package/build/typeMap.d.ts +0 -68
- package/build/typeMap.d.ts.map +0 -1
- package/build/typeMap.js +0 -3
- package/build/typeMap.js.map +0 -1
- package/build/unnest.d.ts +0 -13
- package/build/unnest.d.ts.map +0 -1
- package/build/unnest.js +0 -85
- package/build/unnest.js.map +0 -1
- package/build/upsert.d.ts +0 -42
- package/build/upsert.d.ts.map +0 -1
- package/build/upsert.js +0 -265
- package/build/upsert.js.map +0 -1
- package/build/utils.d.ts +0 -58
- package/build/utils.d.ts.map +0 -1
- package/build/utils.js +0 -236
- package/build/utils.js.map +0 -1
- package/build/withLoaded.d.ts +0 -56
- package/build/withLoaded.d.ts.map +0 -1
- package/build/withLoaded.js +0 -76
- package/build/withLoaded.js.map +0 -1
package/build/changes.js
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newChangesProxy = newChangesProxy;
|
|
4
|
-
const BaseEntity_1 = require("./BaseEntity");
|
|
5
|
-
const fields_1 = require("./fields");
|
|
6
|
-
const index_1 = require("./index");
|
|
7
|
-
/**
|
|
8
|
-
* Provides a base class for field/primitive & m2o status impls.
|
|
9
|
-
*
|
|
10
|
-
* We use a separate base class so that the primitive & m2o subtypes can have their own
|
|
11
|
-
* `kind: ...` consts, that if the m2o just subtyped the primitive directly, wouldn't be
|
|
12
|
-
* allowed.
|
|
13
|
-
*/
|
|
14
|
-
class BaseFieldStatusImpl {
|
|
15
|
-
entity;
|
|
16
|
-
fieldName;
|
|
17
|
-
constructor(entity, fieldName) {
|
|
18
|
-
this.entity = entity;
|
|
19
|
-
this.fieldName = fieldName;
|
|
20
|
-
}
|
|
21
|
-
get originalValue() {
|
|
22
|
-
const { originalData, data } = (0, BaseEntity_1.getInstanceData)(this.entity);
|
|
23
|
-
// If `p` is in originalData, always respect that, even if it's undefined
|
|
24
|
-
return this.fieldName in originalData ? originalData[this.fieldName] : (0, fields_1.getField)(this.entity, this.fieldName);
|
|
25
|
-
}
|
|
26
|
-
get hasChanged() {
|
|
27
|
-
const { originalData, data } = (0, BaseEntity_1.getInstanceData)(this.entity);
|
|
28
|
-
// Use `__orm.data[p] !== undefined` instead of `p in entity.__orm.data` because if a new (or cloned) entity
|
|
29
|
-
// sets-then-unsets a value, it will return to `undefined` but still be present in `__orm.data`.
|
|
30
|
-
return this.entity.isNewEntity ? data[this.fieldName] !== undefined : this.fieldName in originalData;
|
|
31
|
-
}
|
|
32
|
-
get hasUpdated() {
|
|
33
|
-
const { originalData } = (0, BaseEntity_1.getInstanceData)(this.entity);
|
|
34
|
-
return !this.entity.isNewEntity && this.fieldName in originalData;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** Implements the primitive field status, by extend base & just adding our `kind` const. */
|
|
38
|
-
class PrimitiveFieldStatusImpl extends BaseFieldStatusImpl {
|
|
39
|
-
kind = "field";
|
|
40
|
-
}
|
|
41
|
-
/** Implements the m2o field status, by extend base, & adding `originalEntity`. */
|
|
42
|
-
class ManyToOneFieldStatusImpl extends BaseFieldStatusImpl {
|
|
43
|
-
kind = "m2o";
|
|
44
|
-
/**
|
|
45
|
-
* Returns our original entity's `id`.
|
|
46
|
-
*
|
|
47
|
-
* We can know `originalValue` has an `id` available (i.e. is not new), b/c original values defacto
|
|
48
|
-
* came from the database.
|
|
49
|
-
*
|
|
50
|
-
* We also return the id so that `entity.changes.m2oField.originalValue` has a consistent API,
|
|
51
|
-
* regardless of whether the `entity.m2oField` itself is loaded or unloaded.
|
|
52
|
-
*/
|
|
53
|
-
get originalValue() {
|
|
54
|
-
const originalValue = super.originalValue;
|
|
55
|
-
return (0, index_1.isEntity)(originalValue) ? originalValue.id : originalValue;
|
|
56
|
-
}
|
|
57
|
-
/** Returns the original entity instance, which may not be loaded into memory yet, or undefined. */
|
|
58
|
-
get originalEntity() {
|
|
59
|
-
const originalValue = this.originalValue;
|
|
60
|
-
if ((0, index_1.isEntity)(originalValue)) {
|
|
61
|
-
return Promise.resolve(originalValue);
|
|
62
|
-
}
|
|
63
|
-
else if ((0, index_1.isId)(originalValue)) {
|
|
64
|
-
return this.entity.em.load(originalValue);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
return Promise.resolve(undefined);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
class ManyToManyFieldStatusImpl {
|
|
72
|
-
kind = "m2m";
|
|
73
|
-
#entity;
|
|
74
|
-
#m2m;
|
|
75
|
-
#joinRows;
|
|
76
|
-
constructor(entity, fieldName) {
|
|
77
|
-
this.#entity = entity;
|
|
78
|
-
this.#m2m = entity[fieldName];
|
|
79
|
-
this.#joinRows = (0, index_1.getEmInternalApi)(entity.em).joinRows(this.#m2m);
|
|
80
|
-
}
|
|
81
|
-
// Similar to the o2m.added/removed methods, these don't have to be async because currently
|
|
82
|
-
// any m2m mutation requires having both entities in-memory anyway, i.e. we can't do id-only/unloaded
|
|
83
|
-
// mutation of m2m relations.
|
|
84
|
-
get added() {
|
|
85
|
-
return this.#added.sort(entityCompare);
|
|
86
|
-
}
|
|
87
|
-
get removed() {
|
|
88
|
-
return this.#removed.sort(entityCompare);
|
|
89
|
-
}
|
|
90
|
-
get changed() {
|
|
91
|
-
return [...this.#added, ...this.#removed].sort(entityCompare);
|
|
92
|
-
}
|
|
93
|
-
get hasChanged() {
|
|
94
|
-
// Calculating `changed: U[]` can be expensive if we sort, so just look at added/removed
|
|
95
|
-
return this.#added.length > 0 || this.#removed.length > 0;
|
|
96
|
-
}
|
|
97
|
-
get hasUpdated() {
|
|
98
|
-
return !this.#entity.isNewEntity && this.hasChanged;
|
|
99
|
-
}
|
|
100
|
-
get originalEntities() {
|
|
101
|
-
return this.#m2m.load().then((list) => {
|
|
102
|
-
const set = new Set(this.added);
|
|
103
|
-
const copy = list.filter((e) => !set.has(e));
|
|
104
|
-
copy.push(...this.removed);
|
|
105
|
-
return copy.sort(entityCompare);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
get #added() {
|
|
109
|
-
return this.#joinRows.addedFor(this.#m2m, this.#entity);
|
|
110
|
-
}
|
|
111
|
-
get #removed() {
|
|
112
|
-
return this.#joinRows.removedFor(this.#m2m, this.#entity);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/** Provides access to an o2m relation's added/removed/changed entities. */
|
|
116
|
-
class OneToManyFieldStatusImpl {
|
|
117
|
-
kind = "o2m";
|
|
118
|
-
#entity;
|
|
119
|
-
#o2m;
|
|
120
|
-
constructor(entity, fieldName) {
|
|
121
|
-
this.#entity = entity;
|
|
122
|
-
this.#o2m = entity[fieldName];
|
|
123
|
-
}
|
|
124
|
-
// This doesn't have to be a promise, b/c even if o2m is unloaded, to mutate
|
|
125
|
-
// the o2m (calling `add(other)` or `remove(other)` or `other.otherField = me`), all
|
|
126
|
-
// require having the "other entity" in memory.
|
|
127
|
-
get added() {
|
|
128
|
-
return this.#added.sort(entityCompare);
|
|
129
|
-
}
|
|
130
|
-
get removed() {
|
|
131
|
-
return this.#removed.sort(entityCompare);
|
|
132
|
-
}
|
|
133
|
-
get changed() {
|
|
134
|
-
return [...this.added, ...this.removed].sort(entityCompare);
|
|
135
|
-
}
|
|
136
|
-
get hasChanged() {
|
|
137
|
-
// Calculating `changed: U[]` can be expensive if we sort, so just look at added/removed
|
|
138
|
-
return this.#added.length > 0 || this.#removed.length > 0;
|
|
139
|
-
}
|
|
140
|
-
get hasUpdated() {
|
|
141
|
-
return !this.#entity.isNewEntity && this.hasChanged;
|
|
142
|
-
}
|
|
143
|
-
get originalEntities() {
|
|
144
|
-
return this.#o2m.load().then((list) => {
|
|
145
|
-
const set = new Set(this.added);
|
|
146
|
-
const copy = list.filter((e) => !set.has(e));
|
|
147
|
-
copy.push(...this.removed);
|
|
148
|
-
return copy.sort(entityCompare);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
// This doesn't have to be a promise, b/c even if o2m is unloaded, to mutate
|
|
152
|
-
// the o2m (calling `add(other)` or `remove(other)` or `other.otherField = me`), all
|
|
153
|
-
// require having the "other entity" in memory.
|
|
154
|
-
get #added() {
|
|
155
|
-
return [
|
|
156
|
-
...this.#o2m.added(),
|
|
157
|
-
...(this.#entity.isNewEntity
|
|
158
|
-
? []
|
|
159
|
-
: ((0, index_1.getEmInternalApi)(this.#entity.em).pendingChildren.get(this.#entity.idTagged)?.get(this.#o2m.fieldName)
|
|
160
|
-
?.adds ?? [])),
|
|
161
|
-
];
|
|
162
|
-
}
|
|
163
|
-
get #removed() {
|
|
164
|
-
return [
|
|
165
|
-
...this.#o2m.removed(),
|
|
166
|
-
...(this.#entity.isNewEntity
|
|
167
|
-
? []
|
|
168
|
-
: ((0, index_1.getEmInternalApi)(this.#entity.em).pendingChildren.get(this.#entity.idTagged)?.get(this.#o2m.fieldName)
|
|
169
|
-
?.removes ?? [])),
|
|
170
|
-
];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
function newChangesProxy(entity) {
|
|
174
|
-
return new Proxy(entity, {
|
|
175
|
-
get(target, p) {
|
|
176
|
-
if (p === "fields") {
|
|
177
|
-
return getChangedFieldNames(entity, true);
|
|
178
|
-
}
|
|
179
|
-
else if (p === "fieldsWithoutRelations") {
|
|
180
|
-
return getChangedFieldNames(entity, false);
|
|
181
|
-
}
|
|
182
|
-
else if (typeof p === "symbol") {
|
|
183
|
-
throw new Error(`Unsupported call to ${String(p)}`);
|
|
184
|
-
}
|
|
185
|
-
const kind = (0, index_1.getMetadata)(entity).allFields[p]?.kind;
|
|
186
|
-
if (kind === "m2m") {
|
|
187
|
-
return new ManyToManyFieldStatusImpl(entity, p);
|
|
188
|
-
}
|
|
189
|
-
else if (kind === "o2m") {
|
|
190
|
-
return new OneToManyFieldStatusImpl(entity, p);
|
|
191
|
-
}
|
|
192
|
-
else if (!(0, fields_1.isChangeableField)(entity, p)) {
|
|
193
|
-
throw new Error(`Invalid changes field ${p}`);
|
|
194
|
-
}
|
|
195
|
-
else if (kind === "m2o" || kind === "poly") {
|
|
196
|
-
return new ManyToOneFieldStatusImpl(entity, p);
|
|
197
|
-
}
|
|
198
|
-
else if (kind === "enum" || kind === "primitive" || kind === "primaryKey") {
|
|
199
|
-
return new PrimitiveFieldStatusImpl(entity, p);
|
|
200
|
-
}
|
|
201
|
-
else if (kind === "lo2m" || kind === "o2o") {
|
|
202
|
-
throw new Error(`changes are not supported for ${kind} ${p}`);
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return (0, index_1.assertNever)(kind);
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
const addOriginalEntity = {
|
|
211
|
-
m2o: true,
|
|
212
|
-
poly: true,
|
|
213
|
-
enum: false,
|
|
214
|
-
lo2m: false,
|
|
215
|
-
m2m: false,
|
|
216
|
-
o2m: false,
|
|
217
|
-
o2o: false,
|
|
218
|
-
primaryKey: false,
|
|
219
|
-
primitive: false,
|
|
220
|
-
};
|
|
221
|
-
/** Scans `entity` for changes primitive + m2m/o2m fields. */
|
|
222
|
-
function getChangedFieldNames(entity, includeRelations) {
|
|
223
|
-
const fieldsChanged = entity.isNewEntity
|
|
224
|
-
? // Cloning sometimes leaves unset keys in data as undefined, so drop them
|
|
225
|
-
Object.entries((0, BaseEntity_1.getInstanceData)(entity).data)
|
|
226
|
-
.filter(([, value]) => value !== undefined)
|
|
227
|
-
.map(([key]) => key)
|
|
228
|
-
: Object.keys((0, BaseEntity_1.getInstanceData)(entity).originalData);
|
|
229
|
-
// Calling `hasChanged` on these can be expensive, and we call this in a loop during em.flush
|
|
230
|
-
if (includeRelations) {
|
|
231
|
-
for (const field of Object.values((0, index_1.getMetadata)(entity).allFields)) {
|
|
232
|
-
if (field.kind === "m2m") {
|
|
233
|
-
const status = new ManyToManyFieldStatusImpl(entity, field.fieldName);
|
|
234
|
-
if (status.hasChanged) {
|
|
235
|
-
fieldsChanged.push(field.fieldName);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else if (field.kind === "o2m") {
|
|
239
|
-
const status = new OneToManyFieldStatusImpl(entity, field.fieldName);
|
|
240
|
-
if (status.hasChanged) {
|
|
241
|
-
fieldsChanged.push(field.fieldName);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return fieldsChanged;
|
|
247
|
-
}
|
|
248
|
-
const entityCompare = (a, b) => {
|
|
249
|
-
return a.toString().localeCompare(b.toString());
|
|
250
|
-
};
|
|
251
|
-
//# sourceMappingURL=changes.js.map
|
package/build/changes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../src/changes.ts"],"names":[],"mappings":";;AA4SA,0CAoCC;AAhVD,6CAA+C;AAG/C,qCAAuD;AACvD,mCAUiB;AAcjB;;;;;;GAMG;AACH,MAAe,mBAAmB;IAChC,MAAM,CAAS;IACf,SAAS,CAAS;IAElB,YAAY,MAAc,EAAE,SAAiB;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa;QACf,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAe,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,yEAAyE;QACzE,OAAO,IAAI,CAAC,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAgB,CAAC,CAAC;IACtH,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAe,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,4GAA4G;QAC5G,gGAAgG;QAChG,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,YAAY,CAAC;IACvG,CAAC;IAED,IA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,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAAA,mBAAW,EAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;YACjE,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACzB,MAAM,MAAM,GAAG,IAAI,yBAAyB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAoB,CAAC,CAAC;gBACjF,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACtB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,IAAI,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAoB,CAAC,CAAC;gBAChF,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACtB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,aAAoB,CAAC;AAC9B,CAAC;AAED,MAAM,aAAa,GAAqC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/D,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC"}
|
package/build/config.d.ts
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { AsyncDefault } from "./defaults";
|
|
2
|
-
import { Entity } from "./Entity";
|
|
3
|
-
import { EntityConstructor, EntityField, EntityMetadata, FieldsOf, Loaded, LoadHint, MaybeAbstractEntityConstructor, Reacted, ReactiveHint, RelationsIn, SettableFields } from "./index";
|
|
4
|
-
import { ValidationRule, ValidationRuleInternal } from "./rules";
|
|
5
|
-
import { MaybePromise } from "./utils";
|
|
6
|
-
export type EntityHook = "beforeFlush" | "beforeCreate" | "beforeUpdate" | "beforeDelete" | "afterValidation" | "beforeCommit" | "afterCommit";
|
|
7
|
-
type HookFn<T extends Entity, C> = (entity: T, ctx: C) => MaybePromise<unknown>;
|
|
8
|
-
type AddReactionOpts = {
|
|
9
|
-
runOnce?: boolean;
|
|
10
|
-
name?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const constraintNameToValidationError: Record<string, string>;
|
|
13
|
-
type Settable<T extends Entity> = keyof SettableFields<FieldsOf<T>> & string;
|
|
14
|
-
/**
|
|
15
|
-
* Called at the end of `configureMetadata` to indicate the boot process is complete.
|
|
16
|
-
*
|
|
17
|
-
* We use this flag to prevent users from mistakenly calling `config` methods after the boot
|
|
18
|
-
* process is complete, i.e. from hooks or other post-boot invocations, where the calls are
|
|
19
|
-
* not guaranteed to work because Joist's reactivity graph has already been initialized.
|
|
20
|
-
*/
|
|
21
|
-
export declare function setBooted(): void;
|
|
22
|
-
export declare function setAfterMetadataLocked(): void;
|
|
23
|
-
/** The public API to configure an Entity's hooks & validation rules. */
|
|
24
|
-
export declare class ConfigApi<T extends Entity, C> {
|
|
25
|
-
__data: ConfigData<T, C>;
|
|
26
|
-
/**
|
|
27
|
-
* Maps a given `constraintName`, i.e. `authors_publisher_id_unique_index`, to a hard-coded-but-pretty validation errors.
|
|
28
|
-
*
|
|
29
|
-
* Note that the validationError must be hard-coded b/c we cannot tease out "which entity" caused a given
|
|
30
|
-
* constraint failure from the SQL database. If you really need pretty-and-custom validation errors, you'll
|
|
31
|
-
* need to check the constraint by hand ahead of time, before calling `em.flush`.
|
|
32
|
-
*/
|
|
33
|
-
addConstraintMessage(constraintName: string, validationError: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Adds a validation rule for this entity.
|
|
36
|
-
*
|
|
37
|
-
* If `hint` is passed, then the rule's lambda will be: 1) passed a view of the entity with only
|
|
38
|
-
* the fields included in `hint` marked as accessible, and 2) the rule will be called reactively any
|
|
39
|
-
* time any field in the `hint` changes.
|
|
40
|
-
*
|
|
41
|
-
* If lambdas want to access fields w/o having them marked for reactivity, the rule can either
|
|
42
|
-
* include the field as readonly with a `:ro` suffix, i.e. `firstName:ro`, or the lambda can
|
|
43
|
-
* access the `reacted.entity` property to get a full view of the entity's fields and methods.
|
|
44
|
-
*/
|
|
45
|
-
addRule<H extends ReactiveHint<T>>(hint: H, rule: ValidationRule<Reacted<T, H>>): void;
|
|
46
|
-
addRule(rule: ValidationRule<T>): void;
|
|
47
|
-
/** If both this entity, and `cstr` entities, are in the same `em.flush`, run us first. */
|
|
48
|
-
runHooksBefore(cstr: EntityConstructor<any>): void;
|
|
49
|
-
/** Deletes any entity/entities pointed to by `relation` when this entity is deleted. */
|
|
50
|
-
cascadeDelete(relation: keyof RelationsIn<T> & LoadHint<T>): void;
|
|
51
|
-
touchOnChange(relation: keyof RelationsIn<T>): void;
|
|
52
|
-
private addHook;
|
|
53
|
-
afterMetadata(fn: AfterMetadataCallback<T>): void;
|
|
54
|
-
beforeDelete<H extends LoadHint<T>>(populate: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
55
|
-
beforeDelete(fn: HookFn<T, C>): void;
|
|
56
|
-
beforeFlush<H extends LoadHint<T>>(populate: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
57
|
-
beforeFlush(fn: HookFn<T, C>): void;
|
|
58
|
-
beforeCreate<H extends LoadHint<T>>(populate: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
59
|
-
beforeCreate(fn: HookFn<T, C>): void;
|
|
60
|
-
beforeUpdate<H extends LoadHint<T>>(populate: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
61
|
-
beforeUpdate(fn: HookFn<T, C>): void;
|
|
62
|
-
afterValidation<H extends LoadHint<T>>(populate: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
63
|
-
afterValidation(fn: HookFn<T, C>): void;
|
|
64
|
-
beforeCommit(fn: HookFn<T, C>): void;
|
|
65
|
-
afterCommit(fn: HookFn<T, C>): void;
|
|
66
|
-
/**
|
|
67
|
-
* Adds a reaction that runs during flush whenever fields in the `hint` change.
|
|
68
|
-
*
|
|
69
|
-
* Reactions are somewhere in between hooks and reactive fields/references:
|
|
70
|
-
* 1. Can make arbitrary changes to any entity like a hook
|
|
71
|
-
* 2. Only run when the provided hint has changes, not on every flush, like an RF/RR
|
|
72
|
-
* 3. Run when the entity itself has no changes, like an RF/RF
|
|
73
|
-
* 4. Can run multiple times per flush, like an RF/RF. Be careful to avoid creating
|
|
74
|
-
* circular dependencies in the hint and to make the function idempotent.
|
|
75
|
-
*
|
|
76
|
-
* @param hint The fields to watch for changes and load before running the reaction
|
|
77
|
-
* @param fn The reaction function to run
|
|
78
|
-
*/
|
|
79
|
-
addReaction<H extends ReactiveHint<T>>(hint: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
80
|
-
/**
|
|
81
|
-
* Adds a named reaction that runs during flush whenever fields in the `hint` change.
|
|
82
|
-
*
|
|
83
|
-
* Reactions are somewhere in between hooks and reactive fields/references:
|
|
84
|
-
* 1. Can make arbitrary changes to any entity like a hook
|
|
85
|
-
* 2. Only run when `hint` has changes, not on every flush, like an RF/RR
|
|
86
|
-
* 3. Can run when the entity itself has no changes, like an RF/RF
|
|
87
|
-
* 4. Can run multiple times per flush, like an RF/RF. Be careful to avoid creating
|
|
88
|
-
* circular dependencies in the hint and to make the function idempotent.
|
|
89
|
-
*
|
|
90
|
-
* @param name A name to identify this reaction for debugging
|
|
91
|
-
* @param hint The fields to watch for changes and load before running the reaction
|
|
92
|
-
* @param fn The reaction function to run
|
|
93
|
-
*/
|
|
94
|
-
addReaction<H extends ReactiveHint<T>>(name: string, hint: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
95
|
-
/**
|
|
96
|
-
* Adds a reaction that runs during flush whenever fields in the `hint` change.
|
|
97
|
-
*
|
|
98
|
-
* Reactions are somewhere in between hooks and reactive fields/references:
|
|
99
|
-
* 1. Can make arbitrary changes to any entity like a hook
|
|
100
|
-
* 2. Only run when `hint` has changes, not on every flush, like an RF/RR
|
|
101
|
-
* 3. Can run when the entity itself has no changes, like an RF/RF
|
|
102
|
-
* 4. Can run multiple times per flush, like an RF/RF. Be careful to avoid creating
|
|
103
|
-
* circular dependencies in the hint and to make the function idempotent.
|
|
104
|
-
*
|
|
105
|
-
* @param opts Options object containing:
|
|
106
|
-
* - runOnce - If true, the reaction will only run once per flush, not every time the hint changes. Optional.
|
|
107
|
-
* default: false.
|
|
108
|
-
* - name - A name to identify this reaction for debugging
|
|
109
|
-
* @param hint The fields to watch for changes and load before running the reaction
|
|
110
|
-
* @param fn The reaction function to run
|
|
111
|
-
*/
|
|
112
|
-
addReaction<H extends ReactiveHint<T>>(opts: AddReactionOpts, hint: H, fn: HookFn<Loaded<T, H>, C>): void;
|
|
113
|
-
/** Adds a synchronous default for `fieldName` to a hard-coded `value`. */
|
|
114
|
-
setDefault<K extends Settable<T>, F = FieldsOf<T>[K]>(fieldName: K, value: F extends EntityField ? F["type"] : never): void;
|
|
115
|
-
/** Adds a synchronous default for `fieldName` to the result of simple sync lambda. */
|
|
116
|
-
setDefault<K extends Settable<T>, F = FieldsOf<T>[K]>(fieldName: K, fn: (entity: T) => F extends EntityField ? F["type"] | undefined : never): void;
|
|
117
|
-
/** Adds an asynchronous default for `fieldName` to the result of a hinted lambda. */
|
|
118
|
-
setDefault<K extends Settable<T>, const H extends ReactiveHint<T>, F = FieldsOf<T>[K]>(fieldName: K, hint: H, fn: (entity: Reacted<T, H>, ctx: C) => F extends {
|
|
119
|
-
kind: "m2o";
|
|
120
|
-
type: infer T extends Entity;
|
|
121
|
-
} ? MaybePromise<T | Reacted<T, {}> | undefined> : F extends EntityField ? MaybePromise<F["type"] | undefined> : never): void;
|
|
122
|
-
/**
|
|
123
|
-
* A noop method that exists solely to keep the `config.placeholder()` line in the initial entity file,
|
|
124
|
-
* until the user is ready to use it. */
|
|
125
|
-
placeholder(): void;
|
|
126
|
-
private ensurePreBoot;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Allows projects to manually reset the internal `booted` flag.
|
|
130
|
-
*
|
|
131
|
-
* This is only necessary if they're using hot-reloading and reloading their entity files
|
|
132
|
-
* without restarting the server.
|
|
133
|
-
*
|
|
134
|
-
* Generally most tools like tsx or ts-node-dev reload the whole process, so don't need
|
|
135
|
-
* to call this, but if Joist is used in a framework that does actual-hot-reloading, this
|
|
136
|
-
* it will be necessary.
|
|
137
|
-
*/
|
|
138
|
-
export declare function resetBootFlag(): void;
|
|
139
|
-
/**
|
|
140
|
-
* Stores a path back to a reactive rule.
|
|
141
|
-
*
|
|
142
|
-
* I.e. if `Book` has a `ruleFn` that reacts to `Author.title`, then `Author`'s config will have
|
|
143
|
-
* a `ReactiveRule` with fields `["title"]`, path `books`, and rule `ruleFn`.
|
|
144
|
-
*/
|
|
145
|
-
export interface ReactiveRule {
|
|
146
|
-
/** The source we're reacting to, specifically which base/subtype cstr. */
|
|
147
|
-
source: MaybeAbstractEntityConstructor<any>;
|
|
148
|
-
/** The fields on this source entity that would trigger the downstream rule's eval. */
|
|
149
|
-
fields: string[];
|
|
150
|
-
/** The constructor of downstream entity that owns the reactive rule. */
|
|
151
|
-
cstr: MaybeAbstractEntityConstructor<any>;
|
|
152
|
-
/** The name (source location) of the downstream reactive rule. */
|
|
153
|
-
name: string;
|
|
154
|
-
/** The path from this source entity to the downstream entity that needs evaled. */
|
|
155
|
-
path: string[];
|
|
156
|
-
/** The downstream validation rule to eval. */
|
|
157
|
-
fn: ValidationRule<any>;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Stores a path back to a reactive derived field.
|
|
161
|
-
*
|
|
162
|
-
* I.e. if `Book.displayName` is an `asyncField` that reacts to `Author.title`, then `Author`'s config will have
|
|
163
|
-
* a `ReactiveFields` with fields `["title"]`, path `books`, and name `displayName`.
|
|
164
|
-
*/
|
|
165
|
-
export interface ReactiveField {
|
|
166
|
-
kind: "populate" | "query";
|
|
167
|
-
/** The fields on this source entity that would trigger the downstream field's recalc. */
|
|
168
|
-
fields: string[];
|
|
169
|
-
/** Read-only/immutable fields that are used in the derived field. */
|
|
170
|
-
isReadOnly: boolean;
|
|
171
|
-
/** The constructor of downstream entity that owns the derived field. */
|
|
172
|
-
cstr: MaybeAbstractEntityConstructor<any>;
|
|
173
|
-
/** The path from this source entity to the downstream entity that needs recalced. */
|
|
174
|
-
path: string[];
|
|
175
|
-
/** The name of the reactive field in the downstream entity to recalc. */
|
|
176
|
-
name: string;
|
|
177
|
-
runOnce: false;
|
|
178
|
-
}
|
|
179
|
-
export interface Reaction {
|
|
180
|
-
kind: "reaction";
|
|
181
|
-
/** The source we're reacting to, specifically which base/subtype cstr. */
|
|
182
|
-
source: MaybeAbstractEntityConstructor<any>;
|
|
183
|
-
/** The fields on this source entity that would trigger the downstream hook's eval. */
|
|
184
|
-
fields: string[];
|
|
185
|
-
/** Read-only/immutable fields that are used in the function. */
|
|
186
|
-
isReadOnly: boolean;
|
|
187
|
-
/** The constructor of downstream entity that owns the reaction. */
|
|
188
|
-
cstr: MaybeAbstractEntityConstructor<any>;
|
|
189
|
-
/** The name (source location) of the downstream reaction. */
|
|
190
|
-
name: string;
|
|
191
|
-
/** The path from this source entity to the downstream entity for this reaction. */
|
|
192
|
-
path: string[];
|
|
193
|
-
/** The downstream reaction function. */
|
|
194
|
-
fn: HookFn<any, any>;
|
|
195
|
-
/** If true, the reaction should only run once per flush, not every time the hint changes. */
|
|
196
|
-
runOnce: boolean;
|
|
197
|
-
}
|
|
198
|
-
export type Reactable = ReactiveField | Reaction;
|
|
199
|
-
interface ReactionInternal<T extends Entity, H extends ReactiveHint<T>, C> {
|
|
200
|
-
name: string;
|
|
201
|
-
fn: HookFn<Reacted<T, H>, C>;
|
|
202
|
-
hint: H;
|
|
203
|
-
runOnce: boolean;
|
|
204
|
-
}
|
|
205
|
-
type AfterMetadataCallback<T extends Entity> = (meta: EntityMetadata<T>) => void;
|
|
206
|
-
/** The internal state of an entity's configuration data, i.e. validation rules/hooks. */
|
|
207
|
-
export declare class ConfigData<T extends Entity, C> {
|
|
208
|
-
afterMetadataCallbacks: AfterMetadataCallback<T>[];
|
|
209
|
-
runHooksBefore: EntityConstructor<any>[];
|
|
210
|
-
/** The validation rules for this entity type. */
|
|
211
|
-
rules: ValidationRuleInternal<T>[];
|
|
212
|
-
/** The reactions for this entity type. */
|
|
213
|
-
reactions: ReactionInternal<T, any, C>[];
|
|
214
|
-
/** The hooks for this entity type. */
|
|
215
|
-
hooks: Record<EntityHook, HookFn<T, C>[]>;
|
|
216
|
-
/** Synchronous defaults for this entity type, invoked on `em.create`. */
|
|
217
|
-
syncDefaults: Record<string, ((entity: T) => void) | unknown>;
|
|
218
|
-
/** Asynchronous defaults for this entity type, invoked on `em.flush`. */
|
|
219
|
-
asyncDefaults: Record<string, AsyncDefault<T>>;
|
|
220
|
-
reactiveRules: ReactiveRule[];
|
|
221
|
-
reactables: Reactable[];
|
|
222
|
-
cascadeDeleteFields: Array<keyof RelationsIn<T>>;
|
|
223
|
-
touchOnChange: Set<keyof RelationsIn<T>>;
|
|
224
|
-
cachedReactiveLoadHints: Record<string, any>;
|
|
225
|
-
}
|
|
226
|
-
export declare function getCallerName(extraFrames?: number): string;
|
|
227
|
-
export declare function getFuzzyCallerName(): string;
|
|
228
|
-
/**
|
|
229
|
-
* Given a callstack line return the file name.
|
|
230
|
-
*
|
|
231
|
-
* I.e. `at Object.<anonymous> (/home/stephen/homebound/graphql-service/src/entities/Activity.ts:86:8)`
|
|
232
|
-
*/
|
|
233
|
-
export declare function getFilePath(line: string): string;
|
|
234
|
-
/** Given a callstack, uses heuristics to find the first line that looks like user code. */
|
|
235
|
-
export declare function findUserCodeLine(lines: string[]): string;
|
|
236
|
-
export {};
|
|
237
|
-
//# sourceMappingURL=config.d.ts.map
|
package/build/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EA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