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,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { GenericResponse } from './server/index';
|
|
3
|
-
import { Remult } from './src/context';
|
|
4
|
-
import { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
2
|
+
import type { GenericResponse } from './server/index';
|
|
3
|
+
import type { Remult } from './src/context';
|
|
4
|
+
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
5
5
|
export declare class SseSubscriptionServer implements SubscriptionServer {
|
|
6
6
|
private canUserConnectToChannel?;
|
|
7
7
|
constructor(canUserConnectToChannel?: (channel: string, remult: Remult) => boolean);
|
package/ably.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Ably from '../../node_modules/ably';
|
|
2
|
-
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
3
2
|
import type { SubscriptionClient, SubscriptionClientConnection } from './src/live-query/SubscriptionChannel';
|
|
3
|
+
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
4
4
|
export declare class AblySubscriptionClient implements SubscriptionClient {
|
|
5
5
|
private ably;
|
|
6
6
|
constructor(ably: Ably.Types.RealtimePromise);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { GenericResponse } from './server/index';
|
|
3
|
-
import { Remult } from './src/context';
|
|
4
|
-
import { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
2
|
+
import type { GenericResponse } from './server/index';
|
|
3
|
+
import type { Remult } from './src/context';
|
|
4
|
+
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
5
5
|
export declare class SseSubscriptionServer implements SubscriptionServer {
|
|
6
6
|
private canUserConnectToChannel?;
|
|
7
7
|
constructor(canUserConnectToChannel?: (channel: string, remult: Remult) => boolean);
|
package/esm/ably.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Ably from '../../node_modules/ably';
|
|
2
|
-
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
3
2
|
import type { SubscriptionClient, SubscriptionClientConnection } from './src/live-query/SubscriptionChannel';
|
|
3
|
+
import type { SubscriptionServer } from './src/live-query/SubscriptionServer';
|
|
4
4
|
export declare class AblySubscriptionClient implements SubscriptionClient {
|
|
5
5
|
private ably;
|
|
6
6
|
constructor(ably: Ably.Types.RealtimePromise);
|
package/esm/graphql.d.ts
CHANGED
package/esm/graphql.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataApi } from './src/data-api';
|
|
2
1
|
import { Remult, remult } from './index';
|
|
2
|
+
import { DataApi } from './src/data-api';
|
|
3
3
|
const v2ConnectionAndPagination = false;
|
|
4
4
|
const andImplementation = false;
|
|
5
5
|
let _removeComments = false;
|
|
@@ -208,16 +208,16 @@ export function remultGraphql(options) {
|
|
|
208
208
|
{
|
|
209
209
|
key: 'limit',
|
|
210
210
|
value: 'Int',
|
|
211
|
-
comment: `
|
|
212
|
-
For **page by page** pagination.
|
|
213
|
-
Limit the number of result.
|
|
211
|
+
comment: `
|
|
212
|
+
For **page by page** pagination.
|
|
213
|
+
Limit the number of result.
|
|
214
214
|
_Side note: \`Math.ceil(totalCount / limit)\` to determine how many pages there are._`,
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
key: 'page',
|
|
218
218
|
value: 'Int',
|
|
219
|
-
comment: `
|
|
220
|
-
For **page by page** pagination.
|
|
219
|
+
comment: `
|
|
220
|
+
For **page by page** pagination.
|
|
221
221
|
Select a dedicated page.`,
|
|
222
222
|
},
|
|
223
223
|
{
|
|
@@ -235,26 +235,26 @@ Select a dedicated page.`,
|
|
|
235
235
|
queryArgsConnection.push({
|
|
236
236
|
key: 'first',
|
|
237
237
|
value: 'Int',
|
|
238
|
-
comment: `
|
|
239
|
-
For **forward cursor** pagination
|
|
238
|
+
comment: `
|
|
239
|
+
For **forward cursor** pagination
|
|
240
240
|
Takes the \`first\`: \`n\` elements from the list.`,
|
|
241
241
|
}, {
|
|
242
242
|
key: 'after',
|
|
243
243
|
value: 'String',
|
|
244
|
-
comment: `
|
|
245
|
-
For **forward cursor** pagination
|
|
244
|
+
comment: `
|
|
245
|
+
For **forward cursor** pagination
|
|
246
246
|
\`after\` this \`cursor\`.`,
|
|
247
247
|
}, {
|
|
248
248
|
key: 'last',
|
|
249
249
|
value: 'Int',
|
|
250
|
-
comment: `
|
|
251
|
-
For **backward cursor** pagination
|
|
250
|
+
comment: `
|
|
251
|
+
For **backward cursor** pagination
|
|
252
252
|
Takes the \`last\`: \`n\` elements from the list.`,
|
|
253
253
|
}, {
|
|
254
254
|
key: 'before',
|
|
255
255
|
value: 'String',
|
|
256
|
-
comment: `
|
|
257
|
-
For **backward cursor** pagination
|
|
256
|
+
comment: `
|
|
257
|
+
For **backward cursor** pagination
|
|
258
258
|
\`before\` this \`cursor\`.`,
|
|
259
259
|
});
|
|
260
260
|
}
|
|
@@ -491,10 +491,11 @@ Select a dedicated page.`,
|
|
|
491
491
|
return null;
|
|
492
492
|
};
|
|
493
493
|
});
|
|
494
|
-
// will do: Category.tasks
|
|
494
|
+
// will do: Category.tasks (actually: Category.tasksOfcategory & tasksOfcategory2)
|
|
495
495
|
const refT = upsertTypes(getMetaType(ref), 'type_impl_node');
|
|
496
|
+
const keyOf = key + 'Of' + f.key;
|
|
496
497
|
refT.fields.push({
|
|
497
|
-
key,
|
|
498
|
+
key: keyOf,
|
|
498
499
|
args: queryArgsConnection,
|
|
499
500
|
value: connectionKey,
|
|
500
501
|
order: 10,
|
|
@@ -502,7 +503,7 @@ Select a dedicated page.`,
|
|
|
502
503
|
});
|
|
503
504
|
refT.query.resultProcessors.push((r) => {
|
|
504
505
|
const val = r.id;
|
|
505
|
-
r[
|
|
506
|
+
r[keyOf] = async (args, req, gqlInfo) => {
|
|
506
507
|
return await root[key]({
|
|
507
508
|
where: { ...args.where, [f.key]: { eq: val } },
|
|
508
509
|
options: { ...args.limit, ...args.page, ...args.orderBy },
|
|
@@ -668,7 +669,7 @@ Select a dedicated page.`,
|
|
|
668
669
|
: ``;
|
|
669
670
|
return `${type}${orderByStr}${whereTypeStr}${whereTypeSubFieldsStr}`;
|
|
670
671
|
})
|
|
671
|
-
.join(`\n\n`)}
|
|
672
|
+
.join(`\n\n`)}
|
|
672
673
|
`,
|
|
673
674
|
};
|
|
674
675
|
}
|
|
@@ -690,12 +691,12 @@ function blockFormat(obj) {
|
|
|
690
691
|
if (obj.data.length === 0) {
|
|
691
692
|
return ``;
|
|
692
693
|
}
|
|
693
|
-
const str = `${obj.prefix} {
|
|
694
|
-
${obj.data.join('\n ')}
|
|
694
|
+
const str = `${obj.prefix} {
|
|
695
|
+
${obj.data.join('\n ')}
|
|
695
696
|
}`;
|
|
696
|
-
let commentsStr = `"""
|
|
697
|
-
${obj.comment}
|
|
698
|
-
"""
|
|
697
|
+
let commentsStr = `"""
|
|
698
|
+
${obj.comment}
|
|
699
|
+
"""
|
|
699
700
|
`;
|
|
700
701
|
if (_removeComments) {
|
|
701
702
|
commentsStr = ``;
|
|
@@ -706,16 +707,16 @@ function argsFormat(args) {
|
|
|
706
707
|
if (args) {
|
|
707
708
|
return `(${args
|
|
708
709
|
.map((arg) => {
|
|
709
|
-
let strComment = `
|
|
710
|
-
"""
|
|
711
|
-
${arg.comment}
|
|
712
|
-
"""
|
|
710
|
+
let strComment = `
|
|
711
|
+
"""
|
|
712
|
+
${arg.comment}
|
|
713
|
+
"""
|
|
713
714
|
`;
|
|
714
715
|
if (_removeComments || !arg.comment) {
|
|
715
716
|
strComment = ``;
|
|
716
717
|
}
|
|
717
718
|
if (strComment) {
|
|
718
|
-
return `${strComment} ${arg.key}: ${arg.value}
|
|
719
|
+
return `${strComment} ${arg.key}: ${arg.value}
|
|
719
720
|
`;
|
|
720
721
|
}
|
|
721
722
|
return `${arg.key}: ${arg.value}`;
|
|
@@ -726,9 +727,9 @@ function argsFormat(args) {
|
|
|
726
727
|
}
|
|
727
728
|
function fieldFormat(field) {
|
|
728
729
|
// First, the comment
|
|
729
|
-
let strComment = `"""
|
|
730
|
-
${field.comment}
|
|
731
|
-
"""
|
|
730
|
+
let strComment = `"""
|
|
731
|
+
${field.comment}
|
|
732
|
+
"""
|
|
732
733
|
`;
|
|
733
734
|
if (_removeComments || !field.comment) {
|
|
734
735
|
strComment = ``;
|
package/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { OmitEB, FieldsMetadata, FieldRef, IdFieldRef, FieldsRef, EntityMetadata, EntityOrderBy, EntityFilter, FindOptions, QueryResult, QueryOptions, Repository, FindFirstOptions, ComparisonValueFilter, ValueFilter, IdFilter, ContainsStringValueFilter, EntityRef, SortSegments, Paginator, LiveQuery, LiveQueryChangeInfo, } from './src/remult3/remult3';
|
|
2
|
+
export { Field, Fields, IdEntity, EntityBase, ControllerBase, FieldType, getFields, ValueListFieldType, getValueList, ValueListFieldOptions, ValueListInfo, CaptionTransformer, } from './src/remult3/RepositoryImplementation';
|
|
3
|
+
export { Entity } from './src/remult3/entity';
|
|
4
|
+
export { getEntityRef } from './src/remult3/getEntityRef';
|
|
2
5
|
export { StringFieldOptions } from './src/remult3/RepositoryImplementation';
|
|
3
6
|
export { describeClass } from './src/remult3/DecoratorReplacer';
|
|
4
7
|
export { EntityOptions } from './src/entity';
|
|
@@ -17,7 +20,8 @@ export { Controller, BackendMethodOptions, BackendMethod, ProgressListener, } fr
|
|
|
17
20
|
export { Allowed, Allow, Remult, RemultContext, ApiClient, isBackend, AllowedForInstance, EventDispatcher, EventSource, UserInfo, } from './src/context';
|
|
18
21
|
export { ExternalHttpProvider } from './src/buildRestDataProvider';
|
|
19
22
|
export { SortSegment, Sort } from './src/sort';
|
|
20
|
-
export { OneToMany
|
|
23
|
+
export { OneToMany } from './src/column';
|
|
24
|
+
export { CompoundIdField } from './src/CompoundIdField';
|
|
21
25
|
export { Filter } from './src/filter/filter-interfaces';
|
|
22
26
|
export { UrlBuilder } from './urlBuilder';
|
|
23
27
|
export { Validators } from './src/validators';
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { Field, Fields, Entity, IdEntity, EntityBase, ControllerBase, FieldType, getFields, getEntityRef, ValueListFieldType, getValueList, ValueListInfo, CaptionTransformer, } from './src/remult3';
|
|
1
|
+
export { Field, Fields, IdEntity, EntityBase, ControllerBase, FieldType, getFields, ValueListFieldType, getValueList, ValueListInfo, CaptionTransformer, } from './src/remult3/RepositoryImplementation';
|
|
2
|
+
export { Entity } from './src/remult3/entity';
|
|
3
|
+
export { getEntityRef } from './src/remult3/getEntityRef';
|
|
5
4
|
export { describeClass } from './src/remult3/DecoratorReplacer';
|
|
6
5
|
export { RestDataProvider } from './src/data-providers/rest-data-provider'; //V
|
|
7
6
|
export { InMemoryDataProvider } from './src/data-providers/in-memory-database'; //V
|
|
@@ -14,7 +13,8 @@ export { JsonDataProvider, } from './src/data-providers/json-data-provider'; //V
|
|
|
14
13
|
export { Controller, BackendMethod, ProgressListener, } from './src/server-action';
|
|
15
14
|
export { Allow, Remult, isBackend, EventSource, } from './src/context';
|
|
16
15
|
export { Sort } from './src/sort';
|
|
17
|
-
export { OneToMany
|
|
16
|
+
export { OneToMany } from './src/column';
|
|
17
|
+
export { CompoundIdField } from './src/CompoundIdField';
|
|
18
18
|
export { Filter } from './src/filter/filter-interfaces';
|
|
19
19
|
export { UrlBuilder } from './urlBuilder';
|
|
20
20
|
export { Validators } from './src/validators';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LiveQueryStorage, StoredQuery } from '../src/live-query/SubscriptionServer';
|
|
3
|
-
import {
|
|
1
|
+
import type { DataProvider, Storage } from '../src/data-interfaces';
|
|
2
|
+
import type { LiveQueryStorage, StoredQuery } from '../src/live-query/SubscriptionServer';
|
|
3
|
+
import type { Repository } from '../src/remult3/remult3';
|
|
4
|
+
import { EntityBase } from '../src/remult3/RepositoryImplementation';
|
|
4
5
|
export declare class DataProviderLiveQueryStorage implements LiveQueryStorage, Storage {
|
|
5
6
|
repo: Promise<Repository<LiveQueryStorageEntity>>;
|
|
6
7
|
dataProvider: Promise<DataProvider>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { initDataProvider } from '../server/initDataProvider';
|
|
3
3
|
import { allEntities, Remult } from '../src/context';
|
|
4
|
-
import {
|
|
4
|
+
import { EntityBase, Fields } from '../src/remult3/RepositoryImplementation';
|
|
5
|
+
import { Entity } from '../src/remult3/entity';
|
|
5
6
|
export class DataProviderLiveQueryStorage {
|
|
6
7
|
constructor(dataProvider) {
|
|
7
8
|
this.dataProvider = initDataProvider(dataProvider);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ClientBase, PoolConfig, QueryResult } from 'pg';
|
|
1
|
+
import type { ClientBase, PoolConfig, QueryResult } from 'pg';
|
|
2
2
|
import { Remult } from '../src/context';
|
|
3
|
-
import { EntityMetadata } from '../src/remult3';
|
|
4
|
-
import { SqlCommand, SqlImplementation } from '../src/sql-command';
|
|
5
3
|
import { SqlDatabase } from '../src/data-providers/sql-database';
|
|
4
|
+
import type { EntityMetadata } from '../src/remult3/remult3';
|
|
5
|
+
import type { SqlCommand, SqlImplementation } from '../src/sql-command';
|
|
6
6
|
export interface PostgresPool extends PostgresCommandSource {
|
|
7
7
|
connect(): Promise<PostgresClient>;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Pool } from 'pg';
|
|
2
2
|
import { Remult } from '../src/context';
|
|
3
|
-
import { PostgresSchemaBuilder, } from './schema-builder';
|
|
4
3
|
import { SqlDatabase } from '../src/data-providers/sql-database';
|
|
4
|
+
import { PostgresSchemaBuilder } from './schema-builder';
|
|
5
5
|
export class PostgresDataProvider {
|
|
6
6
|
constructor(pool) {
|
|
7
7
|
this.pool = pool;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { FieldMetadata } from '../src/column-interfaces';
|
|
2
|
-
import { Remult } from '../src/context';
|
|
3
|
-
import { SqlDatabase } from '../src/data-providers/sql-database';
|
|
4
|
-
import { EntityMetadata } from '../src/remult3';
|
|
1
|
+
import type { FieldMetadata } from '../src/column-interfaces';
|
|
2
|
+
import type { Remult } from '../src/context';
|
|
3
|
+
import type { SqlDatabase } from '../src/data-providers/sql-database';
|
|
4
|
+
import type { EntityMetadata } from '../src/remult3/remult3';
|
|
5
5
|
export declare function postgresColumnSyntax(x: FieldMetadata, dbName: string): string;
|
|
6
6
|
export declare function verifyStructureOfAllEntities(db: SqlDatabase, remult: Remult): Promise<void>;
|
|
7
7
|
export declare class PostgresSchemaBuilder {
|
|
8
8
|
private pool;
|
|
9
|
+
private removeQuotes;
|
|
10
|
+
private whereTableAndSchema;
|
|
11
|
+
private schemaAndName;
|
|
9
12
|
verifyStructureOfAllEntities(remult?: Remult): Promise<void>;
|
|
10
13
|
ensureSchema(entities: EntityMetadata<any>[]): Promise<void>;
|
|
11
14
|
createIfNotExist(entity: EntityMetadata): Promise<void>;
|
|
12
15
|
addColumnIfNotExist<T extends EntityMetadata>(entity: T, c: (e: T) => FieldMetadata): Promise<void>;
|
|
13
16
|
verifyAllColumns<T extends EntityMetadata>(entity: T): Promise<void>;
|
|
14
|
-
|
|
17
|
+
specifiedSchema: string;
|
|
15
18
|
constructor(pool: SqlDatabase, schema?: string);
|
|
16
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { allEntities } from '../src/context';
|
|
2
2
|
import { dbNamesOf, isDbReadonly, } from '../src/filter/filter-consumer-bridge-to-sql-request';
|
|
3
3
|
import { remult as defaultRemult } from '../src/remult-proxy';
|
|
4
|
-
import { isAutoIncrement } from '../src/remult3';
|
|
4
|
+
import { isAutoIncrement } from '../src/remult3/RepositoryImplementation';
|
|
5
5
|
import { ValueConverters } from '../src/valueConverters';
|
|
6
6
|
export function postgresColumnSyntax(x, dbName) {
|
|
7
7
|
let result = dbName;
|
|
@@ -41,11 +41,48 @@ export async function verifyStructureOfAllEntities(db, remult) {
|
|
|
41
41
|
export class PostgresSchemaBuilder {
|
|
42
42
|
constructor(pool, schema) {
|
|
43
43
|
this.pool = pool;
|
|
44
|
-
this.
|
|
44
|
+
this.specifiedSchema = '';
|
|
45
45
|
if (schema) {
|
|
46
|
-
this.
|
|
46
|
+
this.specifiedSchema = schema;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
removeQuotes(s) {
|
|
50
|
+
if (s.startsWith('"') && s.endsWith('"')) {
|
|
51
|
+
return s.substring(1, s.length - 1);
|
|
52
|
+
}
|
|
53
|
+
return s.toLocaleLowerCase();
|
|
54
|
+
}
|
|
55
|
+
whereTableAndSchema(cmd, e) {
|
|
56
|
+
let table = '';
|
|
57
|
+
let schema = '';
|
|
58
|
+
if (this.specifiedSchema) {
|
|
59
|
+
schema = this.specifiedSchema;
|
|
60
|
+
}
|
|
61
|
+
const splited = e.$entityName.split('.');
|
|
62
|
+
// let's prioritize the specified schema at dbName level
|
|
63
|
+
if (splited.length > 1) {
|
|
64
|
+
schema = splited[0];
|
|
65
|
+
table = splited[1];
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
table = splited[0];
|
|
69
|
+
}
|
|
70
|
+
const where = [];
|
|
71
|
+
if (schema) {
|
|
72
|
+
where.push(`table_schema=${cmd.addParameterAndReturnSqlToken(this.removeQuotes(schema))}`);
|
|
73
|
+
}
|
|
74
|
+
where.push(`table_name=${cmd.addParameterAndReturnSqlToken(this.removeQuotes(table))}`);
|
|
75
|
+
return where.join(' AND ');
|
|
76
|
+
}
|
|
77
|
+
schemaAndName(e) {
|
|
78
|
+
if (e.$entityName.includes('.')) {
|
|
79
|
+
return e.$entityName;
|
|
80
|
+
}
|
|
81
|
+
if (this.specifiedSchema) {
|
|
82
|
+
return `${this.specifiedSchema}.${e.$entityName}`;
|
|
83
|
+
}
|
|
84
|
+
return e.$entityName;
|
|
85
|
+
}
|
|
49
86
|
async verifyStructureOfAllEntities(remult) {
|
|
50
87
|
if (!remult) {
|
|
51
88
|
remult = defaultRemult;
|
|
@@ -82,9 +119,8 @@ export class PostgresSchemaBuilder {
|
|
|
82
119
|
var c = this.pool.createCommand();
|
|
83
120
|
let e = await dbNamesOf(entity);
|
|
84
121
|
await c
|
|
85
|
-
.execute(
|
|
86
|
-
|
|
87
|
-
this.additionalWhere)
|
|
122
|
+
.execute(`SELECT 1 FROM information_Schema.tables WHERE ` +
|
|
123
|
+
`${this.whereTableAndSchema(c, e)}`)
|
|
88
124
|
.then(async (r) => {
|
|
89
125
|
if (r.rows.length == 0) {
|
|
90
126
|
let result = '';
|
|
@@ -102,7 +138,7 @@ export class PostgresSchemaBuilder {
|
|
|
102
138
|
result += ' primary key';
|
|
103
139
|
}
|
|
104
140
|
}
|
|
105
|
-
let sql =
|
|
141
|
+
let sql = `CREATE table ${this.schemaAndName(e)} (${result}\r\n)`;
|
|
106
142
|
if (PostgresSchemaBuilder.logToConsole)
|
|
107
143
|
console.info(sql);
|
|
108
144
|
await this.pool.execute(sql);
|
|
@@ -116,10 +152,11 @@ export class PostgresSchemaBuilder {
|
|
|
116
152
|
try {
|
|
117
153
|
let cmd = this.pool.createCommand();
|
|
118
154
|
const colName = e.$dbNameOf(c(entity));
|
|
119
|
-
if ((await cmd.execute(`
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
let sql = `
|
|
155
|
+
if ((await cmd.execute(`SELECT 1 FROM information_schema.columns WHERE ` +
|
|
156
|
+
`${this.whereTableAndSchema(cmd, e)} ` +
|
|
157
|
+
`AND column_name=${cmd.addParameterAndReturnSqlToken(colName.toLocaleLowerCase())}`)).rows.length == 0) {
|
|
158
|
+
let sql = `ALTER table ${this.schemaAndName(e)} ` +
|
|
159
|
+
`ADD column ${postgresColumnSyntax(c(entity), colName)}`;
|
|
123
160
|
if (PostgresSchemaBuilder.logToConsole)
|
|
124
161
|
console.info(sql);
|
|
125
162
|
await this.pool.execute(sql);
|
|
@@ -133,16 +170,16 @@ export class PostgresSchemaBuilder {
|
|
|
133
170
|
try {
|
|
134
171
|
let cmd = this.pool.createCommand();
|
|
135
172
|
let e = await dbNamesOf(entity);
|
|
136
|
-
let cols = (await cmd.execute(`
|
|
137
|
-
|
|
138
|
-
WHERE table_name=${cmd.addParameterAndReturnSqlToken(e.$entityName.toLocaleLowerCase())} ` + this.additionalWhere)).rows.map((x) => x.column_name.toLocaleLowerCase());
|
|
173
|
+
let cols = (await cmd.execute(`SELECT column_name FROM information_schema.columns WHERE ` +
|
|
174
|
+
`${this.whereTableAndSchema(cmd, e)}`)).rows.map((x) => x.column_name.toLocaleLowerCase());
|
|
139
175
|
for (const col of entity.fields) {
|
|
140
176
|
if (!isDbReadonly(col, e)) {
|
|
141
177
|
let colName = e.$dbNameOf(col).toLocaleLowerCase();
|
|
142
178
|
if (colName.startsWith('"') && colName.endsWith('"'))
|
|
143
179
|
colName = colName.substring(1, colName.length - 1);
|
|
144
180
|
if (!cols.includes(colName)) {
|
|
145
|
-
let sql = `
|
|
181
|
+
let sql = `ALTER table ${this.schemaAndName(e)} ` +
|
|
182
|
+
`add column ${postgresColumnSyntax(col, e.$dbNameOf(col))}`;
|
|
146
183
|
if (PostgresSchemaBuilder.logToConsole)
|
|
147
184
|
console.info(sql);
|
|
148
185
|
await this.pool.execute(sql);
|
package/esm/remult-fastify.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FastifyPluginCallback, FastifyRequest } from 'fastify';
|
|
2
|
-
import {
|
|
2
|
+
import type { RemultServerCore, RemultServerOptions } from './server/expressBridge';
|
|
3
3
|
export declare function remultFastify(options: RemultServerOptions<FastifyRequest>): RemultFastifyServer;
|
|
4
4
|
export declare type RemultFastifyServer = FastifyPluginCallback & RemultServerCore<FastifyRequest> & {
|
|
5
5
|
withRemult<T>(req: FastifyRequest, what: () => Promise<T>): Promise<T>;
|
package/esm/remult-fresh.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RemultServerCore, RemultServerOptions } from './server/expressBridge';
|
|
2
2
|
export declare function remultFresh(options: RemultServerOptions<FreshRequest>, response: FreshResponse): RemultFresh;
|
|
3
3
|
export interface RemultFresh extends RemultServerCore<FreshRequest> {
|
|
4
4
|
handle(req: FreshRequest, ctx: FreshContext): Promise<any>;
|
package/esm/remult-fresh.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
|
-
import { Remult } from '../src/context';
|
|
3
|
-
import {
|
|
4
|
-
import { DataProvider, EntityDataProvider } from '../src/data-interfaces';
|
|
5
|
-
import {
|
|
2
|
+
import type { Remult } from '../src/context';
|
|
3
|
+
import type { FieldMetadata } from '../src/column-interfaces';
|
|
4
|
+
import type { DataProvider, EntityDataProvider } from '../src/data-interfaces';
|
|
5
|
+
import type { EntityFilter, EntityMetadata } from '../src/remult3/remult3';
|
|
6
|
+
import type { RepositoryOverloads } from '../src/remult3/RepositoryImplementation';
|
|
6
7
|
export declare class KnexDataProvider implements DataProvider {
|
|
7
8
|
knex: Knex;
|
|
8
9
|
constructor(knex: Knex);
|
package/esm/remult-knex/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { customDatabaseFilterToken, Filter, } from '../src/filter/filter-interfaces';
|
|
2
|
-
import { dbNamesOf, isDbReadonly, } from '../src/filter/filter-consumer-bridge-to-sql-request';
|
|
3
1
|
import { allEntities } from '../src/context';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CompoundIdField } from '../src/
|
|
7
|
-
import { Sort } from '../src/sort';
|
|
2
|
+
import { dbNamesOf, isDbReadonly, } from '../src/filter/filter-consumer-bridge-to-sql-request';
|
|
3
|
+
import { customDatabaseFilterToken, Filter, } from '../src/filter/filter-interfaces';
|
|
4
|
+
import { CompoundIdField } from '../src/CompoundIdField';
|
|
8
5
|
import { remult as remultContext } from '../src/remult-proxy';
|
|
6
|
+
import { getRepository, isAutoIncrement, } from '../src/remult3/RepositoryImplementation';
|
|
7
|
+
import { Sort } from '../src/sort';
|
|
8
|
+
import { ValueConverters } from '../src/valueConverters';
|
|
9
|
+
import { resultCompoundIdFilter as resultCompoundIdFilter } from '../src/resultCompoundIdFilter';
|
|
9
10
|
export class KnexDataProvider {
|
|
10
11
|
constructor(knex) {
|
|
11
12
|
this.knex = knex;
|
|
@@ -174,7 +175,7 @@ class KnexEntityDataProvider {
|
|
|
174
175
|
const e = await this.init();
|
|
175
176
|
let resultFilter;
|
|
176
177
|
if (this.entity.idMetadata.field instanceof CompoundIdField)
|
|
177
|
-
resultFilter = this.entity.idMetadata.field
|
|
178
|
+
resultFilter = resultCompoundIdFilter(this.entity.idMetadata.field, undefined, data);
|
|
178
179
|
else
|
|
179
180
|
resultFilter = Filter.fromEntityFilter(this.entity, this.entity.idMetadata.getIdFilter(data[this.entity.idMetadata.field.key]));
|
|
180
181
|
let insertObject = {};
|
|
@@ -192,7 +193,8 @@ class KnexEntityDataProvider {
|
|
|
192
193
|
let insert = this.knex(e.$entityName).insert(insertObject);
|
|
193
194
|
if (isAutoIncrement(this.entity.idMetadata.field)) {
|
|
194
195
|
let newId;
|
|
195
|
-
if (this.knex.client.config.client === 'mysql2' ||
|
|
196
|
+
if (this.knex.client.config.client === 'mysql2' ||
|
|
197
|
+
this.knex.client.config.client === 'mysql') {
|
|
196
198
|
let result = await insert;
|
|
197
199
|
newId = result[0];
|
|
198
200
|
}
|
|
@@ -380,7 +382,9 @@ export class KnexSchemaBuilder {
|
|
|
380
382
|
KnexSchemaBuilder.logToConsole = true;
|
|
381
383
|
function supportsJson(knex) {
|
|
382
384
|
const client = knex.client.config.client;
|
|
383
|
-
if (client?.includes('sqlite3') ||
|
|
385
|
+
if (client?.includes('sqlite3') ||
|
|
386
|
+
client?.includes('mssql') ||
|
|
387
|
+
client?.includes('mysql'))
|
|
384
388
|
return false;
|
|
385
389
|
return true;
|
|
386
390
|
}
|
package/esm/remult-mongo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { DataProvider, EntityDataProvider, EntityFilter, EntityMetadata, Remult } from '.';
|
|
3
|
-
import { RepositoryOverloads } from './src/remult3';
|
|
1
|
+
import type { ClientSession, Db, MongoClient } from 'mongodb';
|
|
2
|
+
import type { DataProvider, EntityDataProvider, EntityFilter, EntityMetadata, Remult } from '.';
|
|
3
|
+
import type { RepositoryOverloads } from './src/remult3/RepositoryImplementation';
|
|
4
4
|
export declare class MongoDataProvider implements DataProvider {
|
|
5
5
|
private db;
|
|
6
6
|
private client;
|
package/esm/remult-mongo.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CompoundIdField, Filter
|
|
2
|
-
import { dbNamesOf
|
|
3
|
-
import { getRepository, } from './src/remult3';
|
|
1
|
+
import { CompoundIdField, Filter } from '.';
|
|
2
|
+
import { dbNamesOf } from './src/filter/filter-consumer-bridge-to-sql-request';
|
|
4
3
|
import { remult as remultContext } from './src/remult-proxy';
|
|
4
|
+
import { getRepository } from './src/remult3/RepositoryImplementation';
|
|
5
|
+
import { resultCompoundIdFilter } from './src/resultCompoundIdFilter';
|
|
5
6
|
export class MongoDataProvider {
|
|
6
7
|
constructor(db, client, options) {
|
|
7
8
|
this.db = db;
|
|
@@ -121,7 +122,7 @@ class MongoEntityDataProvider {
|
|
|
121
122
|
resultFilter = this.entity.idMetadata.getIdFilter(data.id);
|
|
122
123
|
for (const x of this.entity.fields) {
|
|
123
124
|
if (x instanceof CompoundIdField) {
|
|
124
|
-
resultFilter = x
|
|
125
|
+
resultFilter = resultCompoundIdFilter(x, id, data);
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
let newR = {};
|
package/esm/remult-next.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type { GetServerSideProps, NextApiRequest, PreviewData
|
|
2
|
+
import type { GetServerSideProps, NextApiHandler, NextApiRequest, PreviewData } from 'next';
|
|
3
3
|
import type { ParsedUrlQuery } from 'querystring';
|
|
4
|
-
import { RemultServerCore, RemultServerOptions } from './server';
|
|
4
|
+
import type { RemultServerCore, RemultServerOptions } from './server';
|
|
5
5
|
export declare function remultNext(options?: RemultServerOptions<NextApiRequest>): RemultNextServer;
|
|
6
6
|
export declare type RemultNextServer = RemultServerCore<NextApiRequest> & NextApiHandler & {
|
|
7
7
|
getServerSideProps<P extends {
|
package/esm/remult-next.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Handle, RequestEvent } from '@sveltejs/kit';
|
|
2
|
+
import type { RemultServerCore, RemultServerOptions } from './server';
|
|
3
3
|
export declare function remultSveltekit(options?: RemultServerOptions<RequestEvent>): RemultSveltekitServer;
|
|
4
4
|
export declare type RemultSveltekitServer = RemultServerCore<RequestEvent> & Handle;
|
package/esm/remult-sveltekit.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { JsonEntityStorage } from '../index';
|
|
2
|
+
import { JsonDataProvider } from '../index';
|
|
2
3
|
export declare class JsonEntityFileStorage implements JsonEntityStorage {
|
|
3
4
|
private folderPath;
|
|
4
5
|
getItem(entityDbName: string): string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { queuedJobInfoResponse } from '../src/server-action';
|
|
2
|
-
import type { DataProvider } from '../src/data-interfaces';
|
|
3
|
-
import { Remult, UserInfo } from '../src/context';
|
|
4
1
|
import type { ClassType } from '../classType';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import type { UserInfo } from '../src/context';
|
|
3
|
+
import { Remult } from '../src/context';
|
|
4
|
+
import type { DataProvider } from '../src/data-interfaces';
|
|
5
|
+
import type { LiveQueryStorage, SubscriptionServer } from '../src/live-query/SubscriptionServer';
|
|
6
|
+
import { IdEntity } from '../src/remult3/RepositoryImplementation';
|
|
7
|
+
import type { Repository } from '../src/remult3/remult3';
|
|
8
|
+
import type { queuedJobInfoResponse } from '../src/server-action';
|
|
7
9
|
export interface RemultServerOptions<RequestType> {
|
|
8
10
|
/**Entities to use for the api */
|
|
9
11
|
entities?: ClassType<any>[];
|