remult 0.22.6 → 0.22.7-exp.0
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/SseSubscriptionServer.d.ts +3 -3
- package/ably.d.ts +1 -1
- package/esm/SseSubscriptionServer.d.ts +3 -3
- package/esm/ably.d.ts +1 -1
- package/esm/graphql.d.ts +1 -1
- package/esm/graphql.js +32 -31
- package/esm/index.d.ts +6 -2
- package/esm/index.js +5 -5
- package/esm/live-query/data-provider-live-query-storage.d.ts +4 -3
- package/esm/live-query/data-provider-live-query-storage.js +2 -1
- package/esm/postgres/postgres-data-provider.d.ts +3 -3
- package/esm/postgres/postgres-data-provider.js +1 -1
- package/esm/postgres/schema-builder.d.ts +8 -5
- package/esm/postgres/schema-builder.js +52 -15
- package/esm/remult-fastify.d.ts +1 -1
- package/esm/remult-fresh.d.ts +1 -1
- package/esm/remult-fresh.js +1 -1
- package/esm/remult-knex/index.d.ts +5 -4
- package/esm/remult-knex/index.js +13 -9
- package/esm/remult-mongo.d.ts +3 -3
- package/esm/remult-mongo.js +5 -4
- package/esm/remult-next.d.ts +2 -2
- package/esm/remult-next.js +1 -1
- package/esm/remult-sveltekit.d.ts +2 -2
- package/esm/remult-sveltekit.js +1 -1
- package/esm/server/JsonEntityFileStorage.d.ts +2 -1
- package/esm/server/JsonEntityFileStorage.js +1 -1
- package/esm/server/expressBridge.d.ts +7 -5
- package/esm/server/expressBridge.js +11 -8
- package/esm/server/index.d.ts +4 -4
- package/esm/server/index.js +3 -3
- package/esm/server/initDataProvider.d.ts +1 -1
- package/esm/src/CompoundIdField.d.ts +27 -0
- package/esm/src/CompoundIdField.js +41 -0
- package/esm/src/buildRestDataProvider.d.ts +1 -1
- package/esm/src/column-interfaces.d.ts +10 -4
- package/esm/src/column.d.ts +2 -29
- package/esm/src/column.js +2 -58
- package/esm/src/context.d.ts +5 -5
- package/esm/src/context.js +3 -3
- package/esm/src/data-api.d.ts +2 -2
- package/esm/src/data-api.js +5 -4
- package/esm/src/data-interfaces.d.ts +2 -2
- package/esm/src/data-providers/array-entity-data-provider.d.ts +2 -2
- package/esm/src/data-providers/array-entity-data-provider.js +2 -2
- package/esm/src/data-providers/in-memory-database.d.ts +3 -3
- package/esm/src/data-providers/json-data-provider.d.ts +2 -2
- package/esm/src/data-providers/rest-data-provider.d.ts +3 -3
- package/esm/src/data-providers/rest-data-provider.js +2 -2
- package/esm/src/data-providers/sql-database.d.ts +6 -5
- package/esm/src/data-providers/sql-database.js +5 -5
- package/esm/src/data-providers/web-sql-data-provider.d.ts +4 -4
- package/esm/src/data-providers/web-sql-data-provider.js +2 -2
- package/esm/src/entity.d.ts +7 -3
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.d.ts +5 -5
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.js +1 -1
- package/esm/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -1
- package/esm/src/filter/filter-consumer-bridge-to-url-builder.js +0 -1
- package/esm/src/filter/filter-interfaces.d.ts +4 -3
- package/esm/src/filter/filter-interfaces.js +24 -1
- package/esm/src/live-query/LiveQueryClient.js +3 -3
- package/esm/src/live-query/SseSubscriptionClient.d.ts +1 -1
- package/esm/src/live-query/SseSubscriptionClient.js +2 -2
- package/esm/src/live-query/SubscriptionChannel.d.ts +1 -1
- package/esm/src/live-query/SubscriptionChannel.js +2 -1
- package/esm/src/remult-proxy.js +9 -2
- package/esm/src/remult3/DecoratorReplacer.d.ts +1 -1
- package/esm/src/remult3/RepositoryImplementation.d.ts +9 -40
- package/esm/src/remult3/RepositoryImplementation.js +20 -132
- package/esm/src/remult3/__updateEntityBasedOnWhere.d.ts +2 -0
- package/esm/src/remult3/__updateEntityBasedOnWhere.js +24 -0
- package/esm/src/remult3/entity.d.ts +28 -0
- package/esm/src/remult3/entity.js +70 -0
- package/esm/src/remult3/getEntityRef.d.ts +9 -0
- package/esm/src/remult3/getEntityRef.js +27 -0
- package/esm/src/remult3/remult3.d.ts +7 -7
- package/esm/src/resultCompoundIdFilter.d.ts +3 -0
- package/esm/src/resultCompoundIdFilter.js +16 -0
- package/esm/src/server-action-info.d.ts +10 -0
- package/esm/src/server-action-info.js +12 -0
- package/esm/src/server-action.d.ts +4 -13
- package/esm/src/server-action.js +4 -14
- package/esm/src/sort.d.ts +2 -2
- package/esm/src/sort.js +1 -1
- package/esm/src/sql-command.d.ts +1 -1
- package/esm/src/validators.d.ts +1 -1
- package/esm/src/valueConverters.d.ts +1 -1
- package/graphql.d.ts +1 -1
- package/graphql.js +5 -4
- package/index.d.ts +6 -2
- package/index.js +19 -19
- package/live-query/data-provider-live-query-storage.d.ts +4 -3
- package/live-query/data-provider-live-query-storage.js +8 -7
- package/package.json +1 -1
- package/postgres/postgres-data-provider.d.ts +3 -3
- package/postgres/postgres-data-provider.js +1 -1
- package/postgres/schema-builder.d.ts +8 -5
- package/postgres/schema-builder.js +54 -13
- package/remult-fastify.d.ts +1 -1
- package/remult-fresh.d.ts +1 -1
- package/remult-knex/index.d.ts +5 -4
- package/remult-knex/index.js +15 -13
- package/remult-mongo.d.ts +3 -3
- package/remult-mongo.js +4 -3
- package/remult-next.d.ts +2 -2
- package/remult-sveltekit.d.ts +2 -2
- package/server/JsonEntityFileStorage.d.ts +2 -1
- package/server/JsonEntityFileStorage.js +1 -1
- package/server/expressBridge.d.ts +7 -5
- package/server/expressBridge.js +25 -22
- package/server/index.d.ts +4 -4
- package/server/index.js +5 -5
- package/server/initDataProvider.d.ts +1 -1
- package/src/CompoundIdField.d.ts +27 -0
- package/src/CompoundIdField.js +54 -0
- package/src/buildRestDataProvider.d.ts +1 -1
- package/src/column-interfaces.d.ts +10 -4
- package/src/column.d.ts +2 -29
- package/src/column.js +5 -72
- package/src/context.d.ts +5 -5
- package/src/context.js +5 -5
- package/src/data-api.d.ts +2 -2
- package/src/data-api.js +7 -6
- package/src/data-interfaces.d.ts +2 -2
- package/src/data-providers/array-entity-data-provider.d.ts +2 -2
- package/src/data-providers/array-entity-data-provider.js +2 -2
- package/src/data-providers/in-memory-database.d.ts +3 -3
- package/src/data-providers/json-data-provider.d.ts +2 -2
- package/src/data-providers/rest-data-provider.d.ts +3 -3
- package/src/data-providers/rest-data-provider.js +3 -3
- package/src/data-providers/sql-database.d.ts +6 -5
- package/src/data-providers/sql-database.js +6 -6
- package/src/data-providers/web-sql-data-provider.d.ts +4 -4
- package/src/data-providers/web-sql-data-provider.js +4 -4
- package/src/entity.d.ts +7 -3
- package/src/filter/filter-consumer-bridge-to-sql-request.d.ts +5 -5
- package/src/filter/filter-consumer-bridge-to-sql-request.js +2 -2
- package/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -1
- package/src/filter/filter-consumer-bridge-to-url-builder.js +0 -2
- package/src/filter/filter-interfaces.d.ts +4 -3
- package/src/filter/filter-interfaces.js +28 -4
- package/src/live-query/LiveQueryClient.js +2 -2
- package/src/live-query/SseSubscriptionClient.d.ts +1 -1
- package/src/live-query/SseSubscriptionClient.js +3 -3
- package/src/live-query/SubscriptionChannel.d.ts +1 -1
- package/src/live-query/SubscriptionChannel.js +5 -4
- package/src/remult-proxy.js +9 -2
- package/src/remult3/DecoratorReplacer.d.ts +1 -1
- package/src/remult3/RepositoryImplementation.d.ts +9 -40
- package/src/remult3/RepositoryImplementation.js +57 -188
- package/src/remult3/__updateEntityBasedOnWhere.d.ts +2 -0
- package/src/remult3/__updateEntityBasedOnWhere.js +28 -0
- package/src/remult3/entity.d.ts +28 -0
- package/src/remult3/entity.js +88 -0
- package/src/remult3/getEntityRef.d.ts +9 -0
- package/src/remult3/getEntityRef.js +35 -0
- package/src/remult3/remult3.d.ts +7 -7
- package/src/resultCompoundIdFilter.d.ts +3 -0
- package/src/resultCompoundIdFilter.js +20 -0
- package/src/server-action-info.d.ts +10 -0
- package/src/server-action-info.js +15 -0
- package/src/server-action.d.ts +4 -13
- package/src/server-action.js +21 -31
- package/src/sort.d.ts +2 -2
- package/src/sort.js +3 -3
- package/src/sql-command.d.ts +1 -1
- package/src/validators.d.ts +1 -1
- package/src/valueConverters.d.ts +1 -1
- package/esm/angular/interfaces/index.d.ts +0 -1
- package/esm/angular/interfaces/index.js +0 -1
- package/esm/angular/interfaces/src/column-collection.d.ts +0 -70
- package/esm/angular/interfaces/src/column-collection.js +0 -341
- package/esm/angular/interfaces/src/data-area-settings.d.ts +0 -15
- package/esm/angular/interfaces/src/data-area-settings.js +0 -35
- package/esm/angular/interfaces/src/data-control-interfaces.d.ts +0 -36
- package/esm/angular/interfaces/src/data-control-interfaces.js +0 -57
- package/esm/angular/interfaces/src/dataList.d.ts +0 -13
- package/esm/angular/interfaces/src/dataList.js +0 -42
- package/esm/angular/interfaces/src/filter-helper.d.ts +0 -13
- package/esm/angular/interfaces/src/filter-helper.js +0 -59
- package/esm/angular/interfaces/src/grid-settings.d.ts +0 -145
- package/esm/angular/interfaces/src/grid-settings.js +0 -387
- package/esm/angular/interfaces/src/public_api.d.ts +0 -4
- package/esm/angular/interfaces/src/public_api.js +0 -4
- package/esm/angular/src/angular/RemultAngularPluginsService.d.ts +0 -4
- package/esm/angular/src/angular/RemultAngularPluginsService.js +0 -3
- package/esm/angular/src/angular/data-control/data-control2.component.d.ts +0 -49
- package/esm/angular/src/angular/data-control/data-control2.component.js +0 -138
- package/esm/core/SseSubscriptionServer.d.ts +0 -33
- package/esm/core/SseSubscriptionServer.js +0 -107
- package/esm/core/assign.d.ts +0 -1
- package/esm/core/assign.js +0 -5
- package/esm/core/classType.d.ts +0 -3
- package/esm/core/classType.js +0 -1
- package/esm/core/index.d.ts +0 -27
- package/esm/core/index.js +0 -25
- package/esm/core/inputTypes.d.ts +0 -9
- package/esm/core/inputTypes.js +0 -9
- package/esm/core/live-query/data-provider-live-query-storage.d.ts +0 -22
- package/esm/core/live-query/data-provider-live-query-storage.js +0 -71
- package/esm/core/postgres/index.d.ts +0 -2
- package/esm/core/postgres/index.js +0 -2
- package/esm/core/postgres/postgres-data-provider.d.ts +0 -36
- package/esm/core/postgres/postgres-data-provider.js +0 -120
- package/esm/core/postgres/schema-builder.d.ts +0 -17
- package/esm/core/postgres/schema-builder.js +0 -153
- package/esm/core/remult-fresh.d.ts +0 -17
- package/esm/core/remult-fresh.js +0 -29
- package/esm/core/remult-knex/index.d.ts +0 -30
- package/esm/core/remult-knex/index.js +0 -446
- package/esm/core/remult-mongo.d.ts +0 -24
- package/esm/core/remult-mongo.js +0 -254
- package/esm/core/server/JsonEntityFileStorage.d.ts +0 -10
- package/esm/core/server/JsonEntityFileStorage.js +0 -25
- package/esm/core/server/core.d.ts +0 -4
- package/esm/core/server/core.js +0 -4
- package/esm/core/server/expressBridge.d.ts +0 -182
- package/esm/core/server/expressBridge.js +0 -938
- package/esm/core/server/index.d.ts +0 -6
- package/esm/core/server/index.js +0 -9
- package/esm/core/server/initAsyncHooks.d.ts +0 -1
- package/esm/core/server/initAsyncHooks.js +0 -9
- package/esm/core/server/initDataProvider.d.ts +0 -2
- package/esm/core/server/initDataProvider.js +0 -14
- package/esm/core/src/__EntityValueProvider.d.ts +0 -11
- package/esm/core/src/__EntityValueProvider.js +0 -1
- package/esm/core/src/__RowsOfDataForTesting.d.ts +0 -3
- package/esm/core/src/__RowsOfDataForTesting.js +0 -1
- package/esm/core/src/backend-tests/backend-database-test-setup.backend-spec.d.ts +0 -6
- package/esm/core/src/backend-tests/backend-database-test-setup.backend-spec.js +0 -147
- package/esm/core/src/backend-tests/my-test.backend-spec.d.ts +0 -1
- package/esm/core/src/backend-tests/my-test.backend-spec.js +0 -197
- package/esm/core/src/backend-tests/test-http-server.backend-spec.d.ts +0 -1
- package/esm/core/src/backend-tests/test-http-server.backend-spec.js +0 -167
- package/esm/core/src/buildRestDataProvider.d.ts +0 -31
- package/esm/core/src/buildRestDataProvider.js +0 -113
- package/esm/core/src/column-interfaces.d.ts +0 -154
- package/esm/core/src/column-interfaces.js +0 -7
- package/esm/core/src/column.d.ts +0 -58
- package/esm/core/src/column.js +0 -174
- package/esm/core/src/context.d.ts +0 -134
- package/esm/core/src/context.js +0 -286
- package/esm/core/src/data-api.d.ts +0 -39
- package/esm/core/src/data-api.js +0 -279
- package/esm/core/src/data-interfaces.d.ts +0 -41
- package/esm/core/src/data-interfaces.js +0 -12
- package/esm/core/src/data-providers/array-entity-data-provider.d.ts +0 -22
- package/esm/core/src/data-providers/array-entity-data-provider.js +0 -252
- package/esm/core/src/data-providers/in-memory-database.d.ts +0 -9
- package/esm/core/src/data-providers/in-memory-database.js +0 -14
- package/esm/core/src/data-providers/json-data-provider.d.ts +0 -12
- package/esm/core/src/data-providers/json-data-provider.js +0 -55
- package/esm/core/src/data-providers/rest-data-provider.d.ts +0 -49
- package/esm/core/src/data-providers/rest-data-provider.js +0 -256
- package/esm/core/src/data-providers/sql-database.d.ts +0 -33
- package/esm/core/src/data-providers/sql-database.js +0 -384
- package/esm/core/src/data-providers/web-sql-data-provider.d.ts +0 -24
- package/esm/core/src/data-providers/web-sql-data-provider.js +0 -143
- package/esm/core/src/entity.d.ts +0 -91
- package/esm/core/src/entity.js +0 -1
- package/esm/core/src/filter/filter-consumer-bridge-to-sql-request.d.ts +0 -50
- package/esm/core/src/filter/filter-consumer-bridge-to-sql-request.js +0 -150
- package/esm/core/src/filter/filter-consumer-bridge-to-url-builder.d.ts +0 -1
- package/esm/core/src/filter/filter-consumer-bridge-to-url-builder.js +0 -1
- package/esm/core/src/filter/filter-interfaces.d.ts +0 -85
- package/esm/core/src/filter/filter-interfaces.js +0 -477
- package/esm/core/src/live-query/LiveQueryClient.d.ts +0 -20
- package/esm/core/src/live-query/LiveQueryClient.js +0 -188
- package/esm/core/src/live-query/SseSubscriptionClient.d.ts +0 -5
- package/esm/core/src/live-query/SseSubscriptionClient.js +0 -86
- package/esm/core/src/live-query/SubscriptionChannel.d.ts +0 -72
- package/esm/core/src/live-query/SubscriptionChannel.js +0 -123
- package/esm/core/src/live-query/SubscriptionServer.d.ts +0 -53
- package/esm/core/src/live-query/SubscriptionServer.js +0 -111
- package/esm/core/src/live-query/live-query-tests.spec.d.ts +0 -6
- package/esm/core/src/live-query/live-query-tests.spec.js +0 -952
- package/esm/core/src/remult-proxy.d.ts +0 -35
- package/esm/core/src/remult-proxy.js +0 -113
- package/esm/core/src/remult3/DecoratorReplacer.d.ts +0 -10
- package/esm/core/src/remult3/DecoratorReplacer.js +0 -20
- package/esm/core/src/remult3/RepositoryImplementation.d.ts +0 -355
- package/esm/core/src/remult3/RepositoryImplementation.js +0 -2109
- package/esm/core/src/remult3/index.d.ts +0 -2
- package/esm/core/src/remult3/index.js +0 -2
- package/esm/core/src/remult3/remult3.d.ts +0 -395
- package/esm/core/src/remult3/remult3.js +0 -2
- package/esm/core/src/server-action.d.ts +0 -81
- package/esm/core/src/server-action.js +0 -394
- package/esm/core/src/shared-tests/db-tests-setup.d.ts +0 -32
- package/esm/core/src/shared-tests/db-tests-setup.js +0 -78
- package/esm/core/src/shared-tests/db-tests.db-tests.d.ts +0 -25
- package/esm/core/src/shared-tests/db-tests.db-tests.js +0 -810
- package/esm/core/src/shared-tests/deleteAll.d.ts +0 -2
- package/esm/core/src/shared-tests/deleteAll.js +0 -4
- package/esm/core/src/shared-tests/entityWithValidations.d.ts +0 -14
- package/esm/core/src/shared-tests/entityWithValidations.js +0 -43
- package/esm/core/src/shared-tests/index.d.ts +0 -4
- package/esm/core/src/shared-tests/index.js +0 -4
- package/esm/core/src/shared-tests/test-custom-id-column.spec.d.ts +0 -1
- package/esm/core/src/shared-tests/test-custom-id-column.spec.js +0 -67
- package/esm/core/src/shared-tests/test-special-value.spec.d.ts +0 -10
- package/esm/core/src/shared-tests/test-special-value.spec.js +0 -73
- package/esm/core/src/shared-tests/test-update-with-null.spec.d.ts +0 -1
- package/esm/core/src/shared-tests/test-update-with-null.spec.js +0 -31
- package/esm/core/src/sort.d.ts +0 -16
- package/esm/core/src/sort.js +0 -103
- package/esm/core/src/sql-command.d.ts +0 -19
- package/esm/core/src/sql-command.js +0 -1
- package/esm/core/src/test.d.ts +0 -3
- package/esm/core/src/test.js +0 -12
- package/esm/core/src/tests/Done.d.ts +0 -5
- package/esm/core/src/tests/Done.js +0 -9
- package/esm/core/src/tests/RowProvider.spec.d.ts +0 -16
- package/esm/core/src/tests/RowProvider.spec.js +0 -631
- package/esm/core/src/tests/TestDataApiResponse.d.ts +0 -10
- package/esm/core/src/tests/TestDataApiResponse.js +0 -22
- package/esm/core/src/tests/basicRowFunctionality.spec.d.ts +0 -8
- package/esm/core/src/tests/basicRowFunctionality.spec.js +0 -2103
- package/esm/core/src/tests/c.d.ts +0 -8
- package/esm/core/src/tests/c.js +0 -13
- package/esm/core/src/tests/createData.d.ts +0 -7
- package/esm/core/src/tests/createData.js +0 -22
- package/esm/core/src/tests/d.d.ts +0 -6
- package/esm/core/src/tests/d.js +0 -11
- package/esm/core/src/tests/dWithPrefilter.d.ts +0 -7
- package/esm/core/src/tests/dWithPrefilter.js +0 -18
- package/esm/core/src/tests/entityForCustomFilter.d.ts +0 -16
- package/esm/core/src/tests/entityForCustomFilter.js +0 -33
- package/esm/core/src/tests/entityWithValidationsOnColumn.d.ts +0 -5
- package/esm/core/src/tests/entityWithValidationsOnColumn.js +0 -13
- package/esm/core/src/tests/frontend-database-tests-setup.spec.d.ts +0 -4
- package/esm/core/src/tests/frontend-database-tests-setup.spec.js +0 -37
- package/esm/core/src/tests/h.d.ts +0 -6
- package/esm/core/src/tests/h.js +0 -24
- package/esm/core/src/tests/remult-3-basic-tests.spec.d.ts +0 -1
- package/esm/core/src/tests/remult-3-basic-tests.spec.js +0 -236
- package/esm/core/src/tests/remult-3-entities.d.ts +0 -23
- package/esm/core/src/tests/remult-3-entities.js +0 -39
- package/esm/core/src/tests/tasks.d.ts +0 -6
- package/esm/core/src/tests/tasks.js +0 -10
- package/esm/core/src/tests/test-context-as-storage.spec.d.ts +0 -0
- package/esm/core/src/tests/test-context-as-storage.spec.js +0 -1
- package/esm/core/src/tests/test-data-api/predefined-filter.spec.d.ts +0 -1
- package/esm/core/src/tests/test-data-api/predefined-filter.spec.js +0 -389
- package/esm/core/src/tests/test-data-api/test-put-with-validation.spec.d.ts +0 -5
- package/esm/core/src/tests/test-data-api/test-put-with-validation.spec.js +0 -152
- package/esm/core/src/tests/test-decorator-precedence.spec.d.ts +0 -1
- package/esm/core/src/tests/test-decorator-precedence.spec.js +0 -38
- package/esm/core/src/tests/test-default-value.spec.d.ts +0 -1
- package/esm/core/src/tests/test-default-value.spec.js +0 -33
- package/esm/core/src/tests/test-entity-inheritance.spec.d.ts +0 -14
- package/esm/core/src/tests/test-entity-inheritance.spec.js +0 -82
- package/esm/core/src/tests/test-exceptions.spec.d.ts +0 -1
- package/esm/core/src/tests/test-exceptions.spec.js +0 -375
- package/esm/core/src/tests/test-json.spec.d.ts +0 -1
- package/esm/core/src/tests/test-json.spec.js +0 -115
- package/esm/core/src/tests/test-many-to-one-relation-in-entity.spec.d.ts +0 -9
- package/esm/core/src/tests/test-many-to-one-relation-in-entity.spec.js +0 -809
- package/esm/core/src/tests/test-non-active-record.spec.d.ts +0 -1
- package/esm/core/src/tests/test-non-active-record.spec.js +0 -66
- package/esm/core/src/tests/test-object-column.spec.d.ts +0 -1
- package/esm/core/src/tests/test-object-column.spec.js +0 -189
- package/esm/core/src/tests/test-paged-foreach.spec.d.ts +0 -1
- package/esm/core/src/tests/test-paged-foreach.spec.js +0 -328
- package/esm/core/src/tests/test-remult-angular.spec.d.ts +0 -1
- package/esm/core/src/tests/test-remult-angular.spec.js +0 -23
- package/esm/core/src/tests/test-server-controller.spec.d.ts +0 -7
- package/esm/core/src/tests/test-server-controller.spec.js +0 -489
- package/esm/core/src/tests/test-server-expressions.spec.d.ts +0 -1
- package/esm/core/src/tests/test-server-expressions.spec.js +0 -178
- package/esm/core/src/tests/test-server-method-on-entity.spec.d.ts +0 -1
- package/esm/core/src/tests/test-server-method-on-entity.spec.js +0 -306
- package/esm/core/src/tests/test-sql-expression.spec.d.ts +0 -5
- package/esm/core/src/tests/test-sql-expression.spec.js +0 -205
- package/esm/core/src/tests/test-sql.spec.d.ts +0 -1
- package/esm/core/src/tests/test-sql.spec.js +0 -170
- package/esm/core/src/tests/test-subscribe.spec.d.ts +0 -1
- package/esm/core/src/tests/test-subscribe.spec.js +0 -135
- package/esm/core/src/tests/test-type-recovery.spec.d.ts +0 -1
- package/esm/core/src/tests/test-type-recovery.spec.js +0 -49
- package/esm/core/src/tests/test-where-api.spec.d.ts +0 -1
- package/esm/core/src/tests/test-where-api.spec.js +0 -434
- package/esm/core/src/tests/testHelper.spec.d.ts +0 -36
- package/esm/core/src/tests/testHelper.spec.js +0 -226
- package/esm/core/src/tests/testModel/models.d.ts +0 -16
- package/esm/core/src/tests/testModel/models.js +0 -25
- package/esm/core/src/validators.d.ts +0 -14
- package/esm/core/src/validators.js +0 -33
- package/esm/core/src/valueConverters.d.ts +0 -13
- package/esm/core/src/valueConverters.js +0 -197
- package/esm/core/urlBuilder.d.ts +0 -6
- package/esm/core/urlBuilder.js +0 -20
- package/esm/src/backend-tests/backend-database-test-setup.backend-spec.d.ts +0 -7
- package/esm/src/backend-tests/backend-database-test-setup.backend-spec.js +0 -233
- package/esm/src/remult3/index.d.ts +0 -2
- package/esm/src/remult3/index.js +0 -2
- package/esm/src/shared-tests/db-tests-setup.d.ts +0 -34
- package/esm/src/shared-tests/db-tests-setup.js +0 -80
- package/esm/src/shared-tests/db-tests.db-tests.d.ts +0 -25
- package/esm/src/shared-tests/db-tests.db-tests.js +0 -1176
- package/esm/src/shared-tests/deleteAll.d.ts +0 -2
- package/esm/src/shared-tests/deleteAll.js +0 -4
- package/esm/src/shared-tests/entityWithValidations.d.ts +0 -14
- package/esm/src/shared-tests/entityWithValidations.js +0 -53
- package/esm/src/shared-tests/index.d.ts +0 -4
- package/esm/src/shared-tests/index.js +0 -4
- package/esm/src/shared-tests/test-custom-id-column.spec.d.ts +0 -1
- package/esm/src/shared-tests/test-custom-id-column.spec.js +0 -63
- package/esm/src/shared-tests/test-special-value.spec.d.ts +0 -10
- package/esm/src/shared-tests/test-special-value.spec.js +0 -88
- package/esm/src/shared-tests/test-update-with-null.spec.d.ts +0 -1
- package/esm/src/shared-tests/test-update-with-null.spec.js +0 -49
- package/esm/src/tests/Done.d.ts +0 -5
- package/esm/src/tests/Done.js +0 -11
- package/esm/src/tests/TestDataApiResponse.d.ts +0 -10
- package/esm/src/tests/TestDataApiResponse.js +0 -21
- package/esm/src/tests/c.d.ts +0 -8
- package/esm/src/tests/c.js +0 -22
- package/esm/src/tests/createData.d.ts +0 -7
- package/esm/src/tests/createData.js +0 -22
- package/esm/src/tests/d.d.ts +0 -6
- package/esm/src/tests/d.js +0 -19
- package/esm/src/tests/dWithPrefilter.d.ts +0 -7
- package/esm/src/tests/dWithPrefilter.js +0 -32
- package/esm/src/tests/entityForCustomFilter.d.ts +0 -16
- package/esm/src/tests/entityForCustomFilter.js +0 -51
- package/esm/src/tests/entityWithValidationsOnColumn.d.ts +0 -5
- package/esm/src/tests/entityWithValidationsOnColumn.js +0 -21
- package/esm/src/tests/frontend-database-tests-setup.spec.d.ts +0 -4
- package/esm/src/tests/frontend-database-tests-setup.spec.js +0 -37
- package/esm/src/tests/h.d.ts +0 -6
- package/esm/src/tests/h.js +0 -35
- package/esm/src/tests/remult-3-entities.d.ts +0 -23
- package/esm/src/tests/remult-3-entities.js +0 -72
- package/esm/src/tests/tasks.d.ts +0 -6
- package/esm/src/tests/tasks.js +0 -24
- package/esm/src/tests/testHelper.spec.d.ts +0 -36
- package/esm/src/tests/testHelper.spec.js +0 -236
- package/esm/src/tests/testModel/models.d.ts +0 -16
- package/esm/src/tests/testModel/models.js +0 -31
- package/esm/test-servers/shared/Task.d.ts +0 -9
- package/esm/test-servers/shared/Task.js +0 -32
- package/esm/test.d.ts +0 -5
- package/esm/test.js +0 -6
- package/src/backend-tests/backend-database-test-setup.backend-spec.d.ts +0 -7
- package/src/backend-tests/backend-database-test-setup.backend-spec.js +0 -454
- package/src/remult3/index.d.ts +0 -2
- package/src/remult3/index.js +0 -5
- package/src/shared-tests/db-tests-setup.d.ts +0 -34
- package/src/shared-tests/db-tests-setup.js +0 -185
- package/src/shared-tests/db-tests.db-tests.d.ts +0 -25
- package/src/shared-tests/db-tests.db-tests.js +0 -2540
- package/src/shared-tests/deleteAll.d.ts +0 -2
- package/src/shared-tests/deleteAll.js +0 -21
- package/src/shared-tests/entityWithValidations.d.ts +0 -14
- package/src/shared-tests/entityWithValidations.js +0 -80
- package/src/shared-tests/index.d.ts +0 -4
- package/src/shared-tests/index.js +0 -6
- package/src/shared-tests/test-custom-id-column.spec.d.ts +0 -1
- package/src/shared-tests/test-custom-id-column.spec.js +0 -111
- package/src/shared-tests/test-special-value.spec.d.ts +0 -10
- package/src/shared-tests/test-special-value.spec.js +0 -128
- package/src/shared-tests/test-update-with-null.spec.d.ts +0 -1
- package/src/shared-tests/test-update-with-null.spec.js +0 -91
- package/src/tests/Done.d.ts +0 -5
- package/src/tests/Done.js +0 -17
- package/src/tests/TestDataApiResponse.d.ts +0 -10
- package/src/tests/TestDataApiResponse.js +0 -28
- package/src/tests/c.d.ts +0 -8
- package/src/tests/c.js +0 -28
- package/src/tests/createData.d.ts +0 -7
- package/src/tests/createData.js +0 -50
- package/src/tests/d.d.ts +0 -6
- package/src/tests/d.js +0 -27
- package/src/tests/dWithPrefilter.d.ts +0 -7
- package/src/tests/dWithPrefilter.js +0 -45
- package/src/tests/entityForCustomFilter.d.ts +0 -16
- package/src/tests/entityForCustomFilter.js +0 -77
- package/src/tests/entityWithValidationsOnColumn.d.ts +0 -5
- package/src/tests/entityWithValidationsOnColumn.js +0 -29
- package/src/tests/frontend-database-tests-setup.spec.d.ts +0 -4
- package/src/tests/frontend-database-tests-setup.spec.js +0 -100
- package/src/tests/h.d.ts +0 -6
- package/src/tests/h.js +0 -44
- package/src/tests/remult-3-entities.d.ts +0 -23
- package/src/tests/remult-3-entities.js +0 -85
- package/src/tests/tasks.d.ts +0 -6
- package/src/tests/tasks.js +0 -30
- package/src/tests/testHelper.spec.d.ts +0 -36
- package/src/tests/testHelper.spec.js +0 -395
- package/src/tests/testModel/models.d.ts +0 -16
- package/src/tests/testModel/models.js +0 -39
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Entity, Fields, getEntityKey, IdEntity, } from '../src/remult3';
|
|
6
|
-
import { LiveQueryPublisher, InMemoryLiveQueryStorage, } from '../src/live-query/SubscriptionServer';
|
|
2
|
+
import { SseSubscriptionServer } from '../SseSubscriptionServer';
|
|
3
|
+
import { Remult, RemultAsyncLocalStorage, allEntities } from '../src/context';
|
|
4
|
+
import { DataApi, serializeError } from '../src/data-api';
|
|
7
5
|
import { liveQueryKeepAliveRoute, streamUrl, } from '../src/live-query/SubscriptionChannel';
|
|
6
|
+
import { InMemoryLiveQueryStorage, LiveQueryPublisher, } from '../src/live-query/SubscriptionServer';
|
|
7
|
+
import { Fields, IdEntity } from '../src/remult3/RepositoryImplementation';
|
|
8
|
+
import { Entity } from '../src/remult3/entity';
|
|
9
|
+
import { getEntityKey } from '../src/remult3/getEntityRef';
|
|
10
|
+
import { Action, classBackendMethodsArray } from '../src/server-action';
|
|
11
|
+
import { actionInfo, serverActionField } from '../src/server-action-info';
|
|
8
12
|
import { initDataProvider } from './initDataProvider';
|
|
9
|
-
import { SseSubscriptionServer, } from '../SseSubscriptionServer';
|
|
10
13
|
export function createRemultServerCore(options, serverCoreOptions) {
|
|
11
14
|
if (!options) {
|
|
12
15
|
options = {};
|
|
@@ -38,7 +41,7 @@ export function createRemultServerCore(options, serverCoreOptions) {
|
|
|
38
41
|
if (started)
|
|
39
42
|
return;
|
|
40
43
|
started = true;
|
|
41
|
-
console.time('
|
|
44
|
+
console.time('Schema ensured');
|
|
42
45
|
};
|
|
43
46
|
entitiesMetaData.push(...options.entities.map((e) => remult.repo(e).metadata));
|
|
44
47
|
if (dp.ensureSchema) {
|
|
@@ -55,7 +58,7 @@ export function createRemultServerCore(options, serverCoreOptions) {
|
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
if (started)
|
|
58
|
-
console.timeEnd('
|
|
61
|
+
console.timeEnd('Schema ensured');
|
|
59
62
|
}
|
|
60
63
|
if (options.initApi)
|
|
61
64
|
await options.initApi(remult);
|
package/esm/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RemultServer, RemultServerOptions, ServerCoreOptions } from './expressBridge';
|
|
2
|
-
export { queuedJobInfo, QueueStorage, GenericRequestInfo, GenericRequestHandler, RemultServerCore, GenericResponse, GenericRouter, RemultServerOptions, SpecificRoute, RemultServer, InitRequestOptions, } from './expressBridge';
|
|
3
|
-
export { JsonEntityFileStorage, JsonFileDataProvider, } from './JsonEntityFileStorage';
|
|
4
|
-
export { DataProviderLiveQueryStorage } from '../live-query/data-provider-live-query-storage';
|
|
1
|
+
import type { RemultServer, RemultServerOptions, ServerCoreOptions } from './expressBridge';
|
|
5
2
|
export { SseSubscriptionServer } from '../SseSubscriptionServer';
|
|
3
|
+
export { DataProviderLiveQueryStorage } from '../live-query/data-provider-live-query-storage';
|
|
4
|
+
export { JsonEntityFileStorage, JsonFileDataProvider, } from './JsonEntityFileStorage';
|
|
5
|
+
export { GenericRequestHandler, GenericRequestInfo, GenericResponse, GenericRouter, InitRequestOptions, QueueStorage, RemultServer, RemultServerCore, RemultServerOptions, SpecificRoute, queuedJobInfo, } from './expressBridge';
|
|
6
6
|
export declare function createRemultServer<RequestType>(options: RemultServerOptions<RequestType>, serverCoreOptions?: ServerCoreOptions<RequestType>): RemultServer<RequestType>;
|
package/esm/server/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createRemultServerCore
|
|
1
|
+
import { createRemultServerCore } from './expressBridge';
|
|
2
2
|
import { initAsyncHooks } from './initAsyncHooks';
|
|
3
|
-
export { JsonEntityFileStorage, JsonFileDataProvider, } from './JsonEntityFileStorage';
|
|
4
|
-
export { DataProviderLiveQueryStorage } from '../live-query/data-provider-live-query-storage';
|
|
5
3
|
export { SseSubscriptionServer } from '../SseSubscriptionServer';
|
|
4
|
+
export { DataProviderLiveQueryStorage } from '../live-query/data-provider-live-query-storage';
|
|
5
|
+
export { JsonEntityFileStorage, JsonFileDataProvider, } from './JsonEntityFileStorage';
|
|
6
6
|
export function createRemultServer(options, serverCoreOptions) {
|
|
7
7
|
initAsyncHooks();
|
|
8
8
|
return createRemultServerCore(options, serverCoreOptions || {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataProvider } from '../src/data-interfaces';
|
|
1
|
+
import type { DataProvider } from '../src/data-interfaces';
|
|
2
2
|
export declare function initDataProvider(optionsDataProvider?: DataProvider | Promise<DataProvider> | (() => Promise<DataProvider | undefined>)): Promise<DataProvider>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ClassType } from '../classType';
|
|
2
|
+
import type { FieldMetadata, FieldOptions, ValueConverter } from './column-interfaces';
|
|
3
|
+
import type { EntityFilter } from './remult3/remult3';
|
|
4
|
+
export declare class CompoundIdField implements FieldMetadata<string> {
|
|
5
|
+
fields: FieldMetadata[];
|
|
6
|
+
constructor(...columns: FieldMetadata[]);
|
|
7
|
+
apiUpdateAllowed(item: any): boolean;
|
|
8
|
+
displayValue(item: any): string;
|
|
9
|
+
includedInApi: boolean;
|
|
10
|
+
toInput(value: string, inputType?: string): string;
|
|
11
|
+
fromInput(inputValue: string, inputType?: string): string;
|
|
12
|
+
getDbName(): Promise<string>;
|
|
13
|
+
getId(instance: any): string;
|
|
14
|
+
options: FieldOptions<any, any>;
|
|
15
|
+
get valueConverter(): Required<ValueConverter<string>>;
|
|
16
|
+
target: ClassType<any>;
|
|
17
|
+
readonly: true;
|
|
18
|
+
allowNull: boolean;
|
|
19
|
+
dbReadOnly: boolean;
|
|
20
|
+
isServerExpression: boolean;
|
|
21
|
+
key: string;
|
|
22
|
+
caption: string;
|
|
23
|
+
inputType: string;
|
|
24
|
+
dbName: string;
|
|
25
|
+
valueType: any;
|
|
26
|
+
isEqualTo(value: FieldMetadata<string> | string): EntityFilter<any>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export class CompoundIdField {
|
|
2
|
+
constructor(...columns) {
|
|
3
|
+
this.fields = columns;
|
|
4
|
+
}
|
|
5
|
+
apiUpdateAllowed(item) {
|
|
6
|
+
throw new Error('Method not implemented.');
|
|
7
|
+
}
|
|
8
|
+
displayValue(item) {
|
|
9
|
+
throw new Error('Method not implemented.');
|
|
10
|
+
}
|
|
11
|
+
toInput(value, inputType) {
|
|
12
|
+
throw new Error('Method not implemented.');
|
|
13
|
+
}
|
|
14
|
+
fromInput(inputValue, inputType) {
|
|
15
|
+
throw new Error('Method not implemented.');
|
|
16
|
+
}
|
|
17
|
+
getDbName() {
|
|
18
|
+
return Promise.resolve('');
|
|
19
|
+
}
|
|
20
|
+
getId(instance) {
|
|
21
|
+
let r = '';
|
|
22
|
+
this.fields.forEach((c) => {
|
|
23
|
+
if (r.length > 0)
|
|
24
|
+
r += ',';
|
|
25
|
+
r += instance[c.key];
|
|
26
|
+
});
|
|
27
|
+
return r;
|
|
28
|
+
}
|
|
29
|
+
get valueConverter() {
|
|
30
|
+
throw new Error('cant get value converter of compound id');
|
|
31
|
+
}
|
|
32
|
+
isEqualTo(value) {
|
|
33
|
+
let result = {};
|
|
34
|
+
let val = value.toString();
|
|
35
|
+
let id = val.split(',');
|
|
36
|
+
this.fields.forEach((c, i) => {
|
|
37
|
+
result[c.key] = id[i];
|
|
38
|
+
});
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RestDataProviderHttpProvider } from './data-interfaces';
|
|
1
|
+
import type { RestDataProviderHttpProvider } from './data-interfaces';
|
|
2
2
|
import { RestDataProviderHttpProviderUsingFetch } from './data-providers/rest-data-provider';
|
|
3
3
|
export declare function buildRestDataProvider(provider: ExternalHttpProvider | typeof fetch): RestDataProviderHttpProviderUsingFetch | RestDataProviderHttpProvider;
|
|
4
4
|
export declare function isExternalHttpProvider(item: any): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClassType } from '../classType';
|
|
2
|
-
import { Allowed, AllowedForInstance } from './context';
|
|
3
|
-
import { EntityMetadata, FieldRef, OmitEB } from './remult3';
|
|
1
|
+
import type { ClassType } from '../classType';
|
|
2
|
+
import type { Allowed, AllowedForInstance } from './context';
|
|
3
|
+
import type { EntityMetadata, FieldRef, OmitEB } from './remult3/remult3';
|
|
4
4
|
export interface FieldOptions<entityType = any, valueType = any> {
|
|
5
5
|
/** A human readable name for the field. Can be used to achieve a consistent caption for a field throughout the app
|
|
6
6
|
* @example
|
|
@@ -40,7 +40,13 @@ export interface FieldOptions<entityType = any, valueType = any> {
|
|
|
40
40
|
saving?: (entity: entityType, fieldRef: FieldRef<entityType, valueType>) => any | Promise<any>;
|
|
41
41
|
/** An expression that will determine this fields value on the backend and be provided to the front end*/
|
|
42
42
|
serverExpression?: (entity: entityType) => valueType | Promise<valueType>;
|
|
43
|
-
/** The name of the column in the database that holds the data for this field. If no name is set, the key will be used instead.
|
|
43
|
+
/** The name of the column in the database that holds the data for this field. If no name is set, the key will be used instead.
|
|
44
|
+
* Be aware that if you are using postgres and want to keep your casing, you have to escape your string with double quotes.
|
|
45
|
+
* @example
|
|
46
|
+
*
|
|
47
|
+
* @Fields.string({ dbName: '"userName"'})
|
|
48
|
+
* userName=''
|
|
49
|
+
*/
|
|
44
50
|
dbName?: string;
|
|
45
51
|
/** Used or fields that are based on an sql expressions, instead of a physical table column
|
|
46
52
|
* @example
|
package/esm/src/column.d.ts
CHANGED
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Filter } from './filter/filter-interfaces';
|
|
4
|
-
import { EntityFilter, FindOptions, idType, Repository, RepositoryImplementation } from './remult3';
|
|
1
|
+
import type { FindOptions, idType, Repository } from './remult3/remult3';
|
|
2
|
+
import type { RepositoryImplementation } from './remult3/RepositoryImplementation';
|
|
5
3
|
export declare function makeTitle(name: string): string;
|
|
6
|
-
export declare class CompoundIdField implements FieldMetadata<string> {
|
|
7
|
-
fields: FieldMetadata[];
|
|
8
|
-
constructor(...columns: FieldMetadata[]);
|
|
9
|
-
apiUpdateAllowed(item: any): boolean;
|
|
10
|
-
displayValue(item: any): string;
|
|
11
|
-
includedInApi: boolean;
|
|
12
|
-
toInput(value: string, inputType?: string): string;
|
|
13
|
-
fromInput(inputValue: string, inputType?: string): string;
|
|
14
|
-
getDbName(): Promise<string>;
|
|
15
|
-
getId(instance: any): string;
|
|
16
|
-
options: FieldOptions<any, any>;
|
|
17
|
-
get valueConverter(): Required<ValueConverter<string>>;
|
|
18
|
-
target: ClassType<any>;
|
|
19
|
-
readonly: true;
|
|
20
|
-
allowNull: boolean;
|
|
21
|
-
dbReadOnly: boolean;
|
|
22
|
-
isServerExpression: boolean;
|
|
23
|
-
key: string;
|
|
24
|
-
caption: string;
|
|
25
|
-
inputType: string;
|
|
26
|
-
dbName: string;
|
|
27
|
-
valueType: any;
|
|
28
|
-
isEqualTo(value: FieldMetadata<string> | string): EntityFilter<any>;
|
|
29
|
-
resultIdFilter(id: string, data: any): Filter;
|
|
30
|
-
}
|
|
31
4
|
export declare class LookupColumn<T> {
|
|
32
5
|
private repository;
|
|
33
6
|
id: idType<T>;
|
package/esm/src/column.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assign } from '../assign';
|
|
2
|
-
import {
|
|
3
|
-
import { getEntityRef
|
|
2
|
+
import { __updateEntityBasedOnWhere } from './remult3/__updateEntityBasedOnWhere';
|
|
3
|
+
import { getEntityRef } from './remult3/getEntityRef';
|
|
4
4
|
export function makeTitle(name) {
|
|
5
5
|
// insert a space before all caps
|
|
6
6
|
return (name
|
|
@@ -10,62 +10,6 @@ export function makeTitle(name) {
|
|
|
10
10
|
.replace('Email', 'eMail')
|
|
11
11
|
.replace(' I D', ' ID'));
|
|
12
12
|
}
|
|
13
|
-
export class CompoundIdField {
|
|
14
|
-
constructor(...columns) {
|
|
15
|
-
this.fields = columns;
|
|
16
|
-
}
|
|
17
|
-
apiUpdateAllowed(item) {
|
|
18
|
-
throw new Error('Method not implemented.');
|
|
19
|
-
}
|
|
20
|
-
displayValue(item) {
|
|
21
|
-
throw new Error('Method not implemented.');
|
|
22
|
-
}
|
|
23
|
-
toInput(value, inputType) {
|
|
24
|
-
throw new Error('Method not implemented.');
|
|
25
|
-
}
|
|
26
|
-
fromInput(inputValue, inputType) {
|
|
27
|
-
throw new Error('Method not implemented.');
|
|
28
|
-
}
|
|
29
|
-
getDbName() {
|
|
30
|
-
return Promise.resolve('');
|
|
31
|
-
}
|
|
32
|
-
getId(instance) {
|
|
33
|
-
let r = '';
|
|
34
|
-
this.fields.forEach((c) => {
|
|
35
|
-
if (r.length > 0)
|
|
36
|
-
r += ',';
|
|
37
|
-
r += instance[c.key];
|
|
38
|
-
});
|
|
39
|
-
return r;
|
|
40
|
-
}
|
|
41
|
-
get valueConverter() {
|
|
42
|
-
throw new Error('cant get value converter of compound id');
|
|
43
|
-
}
|
|
44
|
-
isEqualTo(value) {
|
|
45
|
-
let result = {};
|
|
46
|
-
let val = value.toString();
|
|
47
|
-
let id = val.split(',');
|
|
48
|
-
this.fields.forEach((c, i) => {
|
|
49
|
-
result[c.key] = id[i];
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
resultIdFilter(id, data) {
|
|
54
|
-
return new Filter((add) => {
|
|
55
|
-
let idParts = [];
|
|
56
|
-
if (id != undefined)
|
|
57
|
-
idParts = id.split(',');
|
|
58
|
-
this.fields.forEach((c, i) => {
|
|
59
|
-
let val = undefined;
|
|
60
|
-
if (i < idParts.length)
|
|
61
|
-
val = idParts[i];
|
|
62
|
-
if (data[c.key] != undefined)
|
|
63
|
-
val = data[c.key];
|
|
64
|
-
add.isEqualTo(c, val);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
13
|
export class LookupColumn {
|
|
70
14
|
constructor(repository, id) {
|
|
71
15
|
this.repository = repository;
|
package/esm/src/context.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ClassType } from '../classType';
|
|
2
|
+
import type { DataProvider } from './data-interfaces';
|
|
3
|
+
import type { EntityMetadata, EntityRef, FindOptions, Repository } from './remult3/remult3';
|
|
4
|
+
import type { ExternalHttpProvider } from './buildRestDataProvider';
|
|
5
|
+
import type { SubscriptionClient, Unsubscribe } from './live-query/SubscriptionChannel';
|
|
4
6
|
import type { SubscriptionServer } from './live-query/SubscriptionServer';
|
|
5
|
-
import { ExternalHttpProvider } from './buildRestDataProvider';
|
|
6
|
-
import { SubscriptionClient, Unsubscribe } from './live-query/SubscriptionChannel';
|
|
7
7
|
export declare class RemultAsyncLocalStorage {
|
|
8
8
|
private readonly remultObjectStorage;
|
|
9
9
|
static enable(): void;
|
package/esm/src/context.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { actionInfo, serverActionField } from './server-action';
|
|
2
1
|
import { RestDataProvider } from './data-providers/rest-data-provider';
|
|
3
|
-
import { RepositoryImplementation } from './remult3/RepositoryImplementation';
|
|
4
2
|
import { LiveQueryClient } from './live-query/LiveQueryClient';
|
|
5
3
|
import { SseSubscriptionClient } from './live-query/SseSubscriptionClient';
|
|
6
4
|
import { RemultProxy, remult } from './remult-proxy';
|
|
5
|
+
import { RepositoryImplementation } from './remult3/RepositoryImplementation';
|
|
6
|
+
import { actionInfo, serverActionField } from './server-action-info';
|
|
7
7
|
import { buildRestDataProvider, isExternalHttpProvider, } from './buildRestDataProvider';
|
|
8
8
|
export class RemultAsyncLocalStorage {
|
|
9
9
|
constructor(remultObjectStorage) {
|
|
@@ -180,7 +180,7 @@ export class Remult {
|
|
|
180
180
|
}
|
|
181
181
|
/** A helper callback that can be used to debug and trace all find operations. Useful in debugging scenarios */
|
|
182
182
|
Remult.onFind = (metadata, options) => { };
|
|
183
|
-
RemultProxy.
|
|
183
|
+
RemultProxy.defaultRemultFactory = () => new Remult();
|
|
184
184
|
export const allEntities = [];
|
|
185
185
|
export const classHelpers = new Map();
|
|
186
186
|
export class ClassHelper {
|
package/esm/src/data-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remult } from './context';
|
|
2
|
-
import type { FindOptions, Repository } from './remult3';
|
|
1
|
+
import type { Remult } from './context';
|
|
3
2
|
import type { ErrorInfo } from './data-interfaces';
|
|
3
|
+
import type { FindOptions, Repository } from './remult3/remult3';
|
|
4
4
|
export declare class DataApi<T = any> {
|
|
5
5
|
private repository;
|
|
6
6
|
private remult;
|
package/esm/src/data-api.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { customUrlToken, buildFilterFromRequestParameters, } from './filter/filter-interfaces';
|
|
2
1
|
import { doTransaction } from './context';
|
|
3
|
-
import { Filter } from './filter/filter-interfaces';
|
|
4
|
-
import { ForbiddenError } from './server-action';
|
|
5
2
|
import { findOptionsToJson, liveQueryAction, } from './data-providers/rest-data-provider';
|
|
3
|
+
import { Filter, buildFilterFromRequestParameters, customUrlToken, } from './filter/filter-interfaces';
|
|
4
|
+
import { ForbiddenError } from './server-action';
|
|
6
5
|
export class DataApi {
|
|
7
6
|
constructor(repository, remult) {
|
|
8
7
|
this.repository = repository;
|
|
@@ -159,7 +158,9 @@ export class DataApi {
|
|
|
159
158
|
where.push(buildFilterFromRequestParameters(this.repository.metadata, {
|
|
160
159
|
get: (key) => {
|
|
161
160
|
let result = request.get(key);
|
|
162
|
-
if (key.startsWith(customUrlToken) &&
|
|
161
|
+
if (key.startsWith(customUrlToken) &&
|
|
162
|
+
result &&
|
|
163
|
+
typeof result === 'string')
|
|
163
164
|
return JSON.parse(result);
|
|
164
165
|
return result;
|
|
165
166
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { Filter } from './filter/filter-interfaces';
|
|
2
|
+
import type { EntityMetadata, OmitEB } from './remult3/remult3';
|
|
1
3
|
import { Sort } from './sort';
|
|
2
|
-
import { Filter } from './filter/filter-interfaces';
|
|
3
|
-
import { EntityMetadata, OmitEB } from './remult3';
|
|
4
4
|
export interface DataProvider {
|
|
5
5
|
getEntityDataProvider(entity: EntityMetadata): EntityDataProvider;
|
|
6
6
|
transaction(action: (dataProvider: DataProvider) => Promise<void>): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityDataProvider, EntityDataProviderFindOptions } from '../data-interfaces';
|
|
1
|
+
import type { EntityDataProvider, EntityDataProviderFindOptions } from '../data-interfaces';
|
|
2
2
|
import { Filter } from '../filter/filter-interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import type { EntityFilter, EntityMetadata } from '../remult3/remult3';
|
|
4
4
|
export declare class ArrayEntityDataProvider implements EntityDataProvider {
|
|
5
5
|
private entity;
|
|
6
6
|
private rows?;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CompoundIdField } from '../CompoundIdField';
|
|
2
|
+
import { Filter, customDatabaseFilterToken } from '../filter/filter-interfaces';
|
|
3
3
|
export class ArrayEntityDataProvider {
|
|
4
4
|
constructor(entity, rows) {
|
|
5
5
|
this.entity = entity;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { EntityMetadata } from '../remult3';
|
|
1
|
+
import type { __RowsOfDataForTesting } from '../__RowsOfDataForTesting';
|
|
2
|
+
import type { DataProvider, EntityDataProvider } from '../data-interfaces';
|
|
3
|
+
import type { EntityMetadata } from '../remult3/remult3';
|
|
4
4
|
export declare class InMemoryDataProvider implements DataProvider, __RowsOfDataForTesting {
|
|
5
5
|
transaction(action: (dataProvider: DataProvider) => Promise<void>): Promise<void>;
|
|
6
6
|
rows: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EntityMetadata } from '../remult3';
|
|
1
|
+
import type { DataProvider, EntityDataProvider } from '../data-interfaces';
|
|
2
|
+
import type { EntityMetadata } from '../remult3/remult3';
|
|
3
3
|
export interface JsonEntityStorage {
|
|
4
4
|
getItem(entityDbName: string): string | null;
|
|
5
5
|
setItem(entityDbName: string, json: string): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DataProvider, EntityDataProvider, EntityDataProviderFindOptions, RestDataProviderHttpProvider } from '../data-interfaces';
|
|
2
2
|
import { UrlBuilder } from '../../urlBuilder';
|
|
3
|
+
import type { ApiClient } from '../context';
|
|
3
4
|
import { Filter } from '../filter/filter-interfaces';
|
|
4
|
-
import { EntityMetadata } from '../remult3';
|
|
5
|
-
import { ApiClient } from '../context';
|
|
5
|
+
import type { EntityMetadata } from '../remult3/remult3';
|
|
6
6
|
export declare class RestDataProvider implements DataProvider {
|
|
7
7
|
private apiProvider;
|
|
8
8
|
constructor(apiProvider: () => ApiClient);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UrlBuilder } from '../../urlBuilder';
|
|
2
|
-
import { customUrlToken, Filter } from '../filter/filter-interfaces';
|
|
3
2
|
import { buildRestDataProvider, retry } from '../buildRestDataProvider';
|
|
4
|
-
import {
|
|
3
|
+
import { customUrlToken, Filter } from '../filter/filter-interfaces';
|
|
4
|
+
import { actionInfo } from '../server-action-info';
|
|
5
5
|
export class RestDataProvider {
|
|
6
6
|
constructor(apiProvider) {
|
|
7
7
|
this.apiProvider = apiProvider;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SqlCommand, SqlCommandWithParameters, SqlImplementation, SqlResult } from '../sql-command';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { DataProvider, EntityDataProvider } from '../data-interfaces';
|
|
2
|
+
import type { SqlCommand, SqlCommandWithParameters, SqlImplementation, SqlResult } from '../sql-command';
|
|
3
|
+
import type { Remult } from '../context';
|
|
4
|
+
import type { CustomSqlFilterBuilderFunction } from '../filter/filter-consumer-bridge-to-sql-request';
|
|
5
|
+
import type { EntityFilter, EntityMetadata } from '../remult3/remult3';
|
|
6
|
+
import type { RepositoryOverloads } from '../remult3/RepositoryImplementation';
|
|
6
7
|
export declare class SqlDatabase implements DataProvider {
|
|
7
8
|
private sql;
|
|
8
9
|
static getDb(remult?: Remult): SqlDatabase;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CompoundIdField } from '../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Sort } from '../sort';
|
|
5
|
-
import { getRepository, } from '../remult3';
|
|
1
|
+
import { CompoundIdField } from '../CompoundIdField';
|
|
2
|
+
import { FilterConsumerBridgeToSqlRequest, dbNamesOf, isDbReadonly, } from '../filter/filter-consumer-bridge-to-sql-request';
|
|
3
|
+
import { Filter, customDatabaseFilterToken } from '../filter/filter-interfaces';
|
|
6
4
|
import { remult as defaultRemult } from '../remult-proxy';
|
|
5
|
+
import { getRepository } from '../remult3/RepositoryImplementation';
|
|
6
|
+
import { Sort } from '../sort';
|
|
7
7
|
import { ValueConverters } from '../valueConverters';
|
|
8
8
|
// @dynamic
|
|
9
9
|
export class SqlDatabase {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __RowsOfDataForTesting } from '../__RowsOfDataForTesting';
|
|
2
|
-
import { SqlCommand, SqlImplementation } from '../sql-command';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { __RowsOfDataForTesting } from '../__RowsOfDataForTesting';
|
|
2
|
+
import type { SqlCommand, SqlImplementation } from '../sql-command';
|
|
3
|
+
import type { Remult } from '../context';
|
|
4
|
+
import type { EntityMetadata } from '../remult3/remult3';
|
|
5
5
|
export declare class WebSqlDataProvider implements SqlImplementation, __RowsOfDataForTesting {
|
|
6
6
|
private databaseName;
|
|
7
7
|
rows: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isAutoIncrement } from '../remult3';
|
|
2
|
-
import { SqlDatabase } from './sql-database';
|
|
3
1
|
import { dbNamesOf, isDbReadonly, } from '../filter/filter-consumer-bridge-to-sql-request';
|
|
2
|
+
import { isAutoIncrement } from '../remult3/RepositoryImplementation';
|
|
3
|
+
import { SqlDatabase } from './sql-database';
|
|
4
4
|
//SqlDatabase.LogToConsole = true;
|
|
5
5
|
export class WebSqlDataProvider {
|
|
6
6
|
constructor(databaseName, databaseSize = 2 * 1024 * 1024) {
|
package/esm/src/entity.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Allowed, AllowedForInstance } from './context';
|
|
2
|
-
import { FieldMetadata } from './column-interfaces';
|
|
3
|
-
import {
|
|
1
|
+
import type { Allowed, AllowedForInstance } from './context';
|
|
2
|
+
import type { FieldMetadata } from './column-interfaces';
|
|
3
|
+
import type { EntityFilter, EntityMetadata, EntityOrderBy, EntityRef, FieldsMetadata } from './remult3/remult3';
|
|
4
4
|
export interface EntityOptions<entityType = any> {
|
|
5
5
|
/**A human readable name for the entity */
|
|
6
6
|
caption?: string;
|
|
@@ -73,6 +73,10 @@ export interface EntityOptions<entityType = any> {
|
|
|
73
73
|
* If no name is set, the `key` will be used instead.
|
|
74
74
|
* @example
|
|
75
75
|
* dbName:'myProducts'
|
|
76
|
+
*
|
|
77
|
+
* You can also add your schema name to the table name
|
|
78
|
+
* @example
|
|
79
|
+
* dbName:'public."myProducts"'
|
|
76
80
|
*/
|
|
77
81
|
dbName?: string;
|
|
78
82
|
/** For entities that are based on SQL expressions instead of a physical table or view*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { FieldMetadata } from '../column-interfaces';
|
|
2
|
+
import type { EntityMetadataOverloads, RepositoryOverloads } from '../remult3/RepositoryImplementation';
|
|
3
|
+
import type { EntityFilter, OmitEB } from '../remult3/remult3';
|
|
4
|
+
import type { SqlCommandWithParameters } from '../sql-command';
|
|
5
|
+
import type { Filter, FilterConsumer } from './filter-interfaces';
|
|
6
6
|
export declare class FilterConsumerBridgeToSqlRequest implements FilterConsumer {
|
|
7
7
|
private r;
|
|
8
8
|
private nameProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getEntityMetadata, } from '../remult3';
|
|
2
1
|
import { SqlDatabase } from '../data-providers/sql-database';
|
|
2
|
+
import { getEntityMetadata } from '../remult3/RepositoryImplementation';
|
|
3
3
|
export class FilterConsumerBridgeToSqlRequest {
|
|
4
4
|
constructor(r, nameProvider) {
|
|
5
5
|
this.r = r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FieldMetadata } from '../column-interfaces';
|
|
2
|
-
import { Remult } from '../context';
|
|
3
|
-
import {
|
|
1
|
+
import type { FieldMetadata } from '../column-interfaces';
|
|
2
|
+
import type { Remult } from '../context';
|
|
3
|
+
import type { EntityFilter, EntityMetadata } from '../remult3/remult3';
|
|
4
4
|
export declare class Filter {
|
|
5
5
|
private apply?;
|
|
6
6
|
constructor(apply?: (add: FilterConsumer) => void);
|
|
@@ -83,3 +83,4 @@ export interface customFilterInfo<entityType> {
|
|
|
83
83
|
rawFilterTranslator: (args: any, r: Remult) => EntityFilter<entityType> | Promise<EntityFilter<entityType>>;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
+
export declare function __updateEntityBasedOnWhere<T>(entityDefs: EntityMetadata<T>, where: EntityFilter<T>, r: T): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEntityRef, getEntitySettings
|
|
1
|
+
import { getEntityRef, getEntitySettings } from '../remult3/getEntityRef';
|
|
2
2
|
export class Filter {
|
|
3
3
|
constructor(apply) {
|
|
4
4
|
this.apply = apply;
|
|
@@ -490,3 +490,26 @@ class customTranslator {
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
+
export function __updateEntityBasedOnWhere(entityDefs, where, r) {
|
|
494
|
+
let w = Filter.fromEntityFilter(entityDefs, where);
|
|
495
|
+
const emptyFunction = () => { };
|
|
496
|
+
if (w) {
|
|
497
|
+
w.__applyToConsumer({
|
|
498
|
+
custom: emptyFunction,
|
|
499
|
+
databaseCustom: emptyFunction,
|
|
500
|
+
containsCaseInsensitive: emptyFunction,
|
|
501
|
+
isDifferentFrom: emptyFunction,
|
|
502
|
+
isEqualTo: (col, val) => {
|
|
503
|
+
r[col.key] = val;
|
|
504
|
+
},
|
|
505
|
+
isGreaterOrEqualTo: emptyFunction,
|
|
506
|
+
isGreaterThan: emptyFunction,
|
|
507
|
+
isIn: emptyFunction,
|
|
508
|
+
isLessOrEqualTo: emptyFunction,
|
|
509
|
+
isLessThan: emptyFunction,
|
|
510
|
+
isNotNull: emptyFunction,
|
|
511
|
+
isNull: emptyFunction,
|
|
512
|
+
or: emptyFunction,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RestDataProvider, } from '../data-providers/rest-data-provider';
|
|
2
1
|
import { buildRestDataProvider } from '../buildRestDataProvider';
|
|
3
|
-
import {
|
|
2
|
+
import { RestDataProvider } from '../data-providers/rest-data-provider';
|
|
3
|
+
import { liveQueryKeepAliveRoute, LiveQuerySubscriber, } from './SubscriptionChannel';
|
|
4
4
|
/* @internal*/
|
|
5
5
|
export class LiveQueryClient {
|
|
6
6
|
constructor(apiProvider, getUserId) {
|
|
@@ -160,7 +160,7 @@ export class LiveQueryClient {
|
|
|
160
160
|
}
|
|
161
161
|
if (ids.length > 0) {
|
|
162
162
|
let p = this.apiProvider();
|
|
163
|
-
let { actionInfo } = await import('../server-action');
|
|
163
|
+
let { actionInfo } = await import('../server-action-info');
|
|
164
164
|
const invalidIds = await this.runPromise(await actionInfo.runActionWithoutBlockingUI(() => buildRestDataProvider(p.httpClient).post(p.url + '/' + liveQueryKeepAliveRoute, ids)));
|
|
165
165
|
for (const id of invalidIds) {
|
|
166
166
|
for (const q of this.queries.values()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SubscriptionClient, SubscriptionClientConnection } from './SubscriptionChannel';
|
|
1
|
+
import type { SubscriptionClient, SubscriptionClientConnection } from './SubscriptionChannel';
|
|
2
2
|
export declare class SseSubscriptionClient implements SubscriptionClient {
|
|
3
3
|
openConnection(onReconnect: VoidFunction): Promise<SubscriptionClientConnection>;
|
|
4
4
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildRestDataProvider } from '../buildRestDataProvider';
|
|
2
2
|
import { remult } from '../remult-proxy';
|
|
3
|
-
import { actionInfo } from '../server-action';
|
|
4
|
-
import { streamUrl
|
|
3
|
+
import { actionInfo } from '../server-action-info';
|
|
4
|
+
import { streamUrl } from './SubscriptionChannel';
|
|
5
5
|
export class SseSubscriptionClient {
|
|
6
6
|
openConnection(onReconnect) {
|
|
7
7
|
let connectionId;
|