remult 0.21.1 → 0.22.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/README.md +47 -46
- package/SseSubscriptionServer.js +9 -9
- package/ably.js +1 -1
- package/esm/SseSubscriptionServer.js +11 -11
- package/esm/ably.js +2 -2
- package/esm/angular/interfaces/index.d.ts +1 -0
- package/esm/angular/interfaces/index.js +1 -0
- package/esm/angular/interfaces/src/column-collection.d.ts +70 -0
- package/esm/angular/interfaces/src/column-collection.js +341 -0
- package/esm/angular/interfaces/src/data-area-settings.d.ts +15 -0
- package/esm/angular/interfaces/src/data-area-settings.js +35 -0
- package/esm/angular/interfaces/src/data-control-interfaces.d.ts +36 -0
- package/esm/angular/interfaces/src/data-control-interfaces.js +57 -0
- package/esm/angular/interfaces/src/dataList.d.ts +13 -0
- package/esm/angular/interfaces/src/dataList.js +42 -0
- package/esm/angular/interfaces/src/filter-helper.d.ts +13 -0
- package/esm/angular/interfaces/src/filter-helper.js +59 -0
- package/esm/angular/interfaces/src/grid-settings.d.ts +145 -0
- package/esm/angular/interfaces/src/grid-settings.js +387 -0
- package/esm/angular/interfaces/src/public_api.d.ts +4 -0
- package/esm/angular/interfaces/src/public_api.js +4 -0
- package/esm/angular/src/angular/RemultAngularPluginsService.d.ts +4 -0
- package/esm/angular/src/angular/RemultAngularPluginsService.js +3 -0
- package/esm/angular/src/angular/data-control/data-control2.component.d.ts +49 -0
- package/esm/angular/src/angular/data-control/data-control2.component.js +138 -0
- package/esm/core/SseSubscriptionServer.d.ts +33 -0
- package/esm/core/SseSubscriptionServer.js +107 -0
- package/esm/core/assign.d.ts +1 -0
- package/esm/core/assign.js +5 -0
- package/esm/core/classType.d.ts +3 -0
- package/esm/core/classType.js +1 -0
- package/esm/core/index.d.ts +27 -0
- package/esm/core/index.js +25 -0
- package/esm/core/inputTypes.d.ts +9 -0
- package/esm/core/inputTypes.js +9 -0
- package/esm/core/live-query/data-provider-live-query-storage.d.ts +22 -0
- package/esm/core/live-query/data-provider-live-query-storage.js +71 -0
- package/esm/core/postgres/index.d.ts +2 -0
- package/esm/core/postgres/index.js +2 -0
- package/esm/core/postgres/postgres-data-provider.d.ts +36 -0
- package/esm/core/postgres/postgres-data-provider.js +120 -0
- package/esm/core/postgres/schema-builder.d.ts +17 -0
- package/esm/core/postgres/schema-builder.js +153 -0
- package/esm/core/remult-fresh.d.ts +17 -0
- package/esm/core/remult-fresh.js +29 -0
- package/esm/core/remult-knex/index.d.ts +30 -0
- package/esm/core/remult-knex/index.js +446 -0
- package/esm/core/remult-mongo.d.ts +24 -0
- package/esm/core/remult-mongo.js +254 -0
- package/esm/core/server/JsonEntityFileStorage.d.ts +10 -0
- package/esm/core/server/JsonEntityFileStorage.js +25 -0
- package/esm/core/server/core.d.ts +4 -0
- package/esm/core/server/core.js +4 -0
- package/esm/core/server/expressBridge.d.ts +182 -0
- package/esm/core/server/expressBridge.js +938 -0
- package/esm/core/server/index.d.ts +6 -0
- package/esm/core/server/index.js +9 -0
- package/esm/core/server/initAsyncHooks.d.ts +1 -0
- package/esm/core/server/initAsyncHooks.js +9 -0
- package/esm/core/server/initDataProvider.d.ts +2 -0
- package/esm/core/server/initDataProvider.js +14 -0
- package/esm/core/src/__EntityValueProvider.d.ts +11 -0
- package/esm/core/src/__EntityValueProvider.js +1 -0
- package/esm/core/src/__RowsOfDataForTesting.d.ts +3 -0
- package/esm/core/src/__RowsOfDataForTesting.js +1 -0
- package/esm/core/src/backend-tests/backend-database-test-setup.backend-spec.d.ts +6 -0
- package/esm/core/src/backend-tests/backend-database-test-setup.backend-spec.js +147 -0
- package/esm/core/src/backend-tests/my-test.backend-spec.d.ts +1 -0
- package/esm/core/src/backend-tests/my-test.backend-spec.js +197 -0
- package/esm/core/src/backend-tests/test-http-server.backend-spec.d.ts +1 -0
- package/esm/core/src/backend-tests/test-http-server.backend-spec.js +167 -0
- package/esm/core/src/buildRestDataProvider.d.ts +31 -0
- package/esm/core/src/buildRestDataProvider.js +113 -0
- package/esm/core/src/column-interfaces.d.ts +154 -0
- package/esm/core/src/column-interfaces.js +7 -0
- package/esm/core/src/column.d.ts +58 -0
- package/esm/core/src/column.js +174 -0
- package/esm/core/src/context.d.ts +134 -0
- package/esm/core/src/context.js +286 -0
- package/esm/core/src/data-api.d.ts +39 -0
- package/esm/core/src/data-api.js +279 -0
- package/esm/core/src/data-interfaces.d.ts +41 -0
- package/esm/core/src/data-interfaces.js +12 -0
- package/esm/core/src/data-providers/array-entity-data-provider.d.ts +22 -0
- package/esm/core/src/data-providers/array-entity-data-provider.js +252 -0
- package/esm/core/src/data-providers/in-memory-database.d.ts +9 -0
- package/esm/core/src/data-providers/in-memory-database.js +14 -0
- package/esm/core/src/data-providers/json-data-provider.d.ts +12 -0
- package/esm/core/src/data-providers/json-data-provider.js +55 -0
- package/esm/core/src/data-providers/rest-data-provider.d.ts +49 -0
- package/esm/core/src/data-providers/rest-data-provider.js +256 -0
- package/esm/core/src/data-providers/sql-database.d.ts +33 -0
- package/esm/core/src/data-providers/sql-database.js +384 -0
- package/esm/core/src/data-providers/web-sql-data-provider.d.ts +24 -0
- package/esm/core/src/data-providers/web-sql-data-provider.js +143 -0
- package/esm/core/src/entity.d.ts +91 -0
- package/esm/core/src/entity.js +1 -0
- package/esm/core/src/filter/filter-consumer-bridge-to-sql-request.d.ts +50 -0
- package/esm/core/src/filter/filter-consumer-bridge-to-sql-request.js +150 -0
- package/esm/core/src/filter/filter-consumer-bridge-to-url-builder.d.ts +1 -0
- package/esm/core/src/filter/filter-consumer-bridge-to-url-builder.js +1 -0
- package/esm/core/src/filter/filter-interfaces.d.ts +85 -0
- package/esm/core/src/filter/filter-interfaces.js +477 -0
- package/esm/core/src/live-query/LiveQueryClient.d.ts +20 -0
- package/esm/core/src/live-query/LiveQueryClient.js +188 -0
- package/esm/core/src/live-query/SseSubscriptionClient.d.ts +5 -0
- package/esm/core/src/live-query/SseSubscriptionClient.js +86 -0
- package/esm/core/src/live-query/SubscriptionChannel.d.ts +72 -0
- package/esm/core/src/live-query/SubscriptionChannel.js +123 -0
- package/esm/core/src/live-query/SubscriptionServer.d.ts +53 -0
- package/esm/core/src/live-query/SubscriptionServer.js +111 -0
- package/esm/core/src/live-query/live-query-tests.spec.d.ts +6 -0
- package/esm/core/src/live-query/live-query-tests.spec.js +952 -0
- package/esm/core/src/remult-proxy.d.ts +35 -0
- package/esm/core/src/remult-proxy.js +113 -0
- package/esm/core/src/remult3/DecoratorReplacer.d.ts +10 -0
- package/esm/core/src/remult3/DecoratorReplacer.js +20 -0
- package/esm/core/src/remult3/RepositoryImplementation.d.ts +355 -0
- package/esm/core/src/remult3/RepositoryImplementation.js +2109 -0
- package/esm/core/src/remult3/index.d.ts +2 -0
- package/esm/core/src/remult3/index.js +2 -0
- package/esm/core/src/remult3/remult3.d.ts +395 -0
- package/esm/core/src/remult3/remult3.js +2 -0
- package/esm/core/src/server-action.d.ts +81 -0
- package/esm/core/src/server-action.js +394 -0
- package/esm/core/src/shared-tests/db-tests-setup.d.ts +32 -0
- package/esm/core/src/shared-tests/db-tests-setup.js +78 -0
- package/esm/core/src/shared-tests/db-tests.db-tests.d.ts +25 -0
- package/esm/core/src/shared-tests/db-tests.db-tests.js +810 -0
- package/esm/core/src/shared-tests/deleteAll.d.ts +2 -0
- package/esm/core/src/shared-tests/deleteAll.js +4 -0
- package/esm/core/src/shared-tests/entityWithValidations.d.ts +14 -0
- package/esm/core/src/shared-tests/entityWithValidations.js +43 -0
- package/esm/core/src/shared-tests/index.d.ts +4 -0
- package/esm/core/src/shared-tests/index.js +4 -0
- package/esm/core/src/shared-tests/test-custom-id-column.spec.d.ts +1 -0
- package/esm/core/src/shared-tests/test-custom-id-column.spec.js +67 -0
- package/esm/core/src/shared-tests/test-special-value.spec.d.ts +10 -0
- package/esm/core/src/shared-tests/test-special-value.spec.js +73 -0
- package/esm/core/src/shared-tests/test-update-with-null.spec.d.ts +1 -0
- package/esm/core/src/shared-tests/test-update-with-null.spec.js +31 -0
- package/esm/core/src/sort.d.ts +16 -0
- package/esm/core/src/sort.js +103 -0
- package/esm/core/src/sql-command.d.ts +19 -0
- package/esm/core/src/sql-command.js +1 -0
- package/esm/core/src/test.d.ts +3 -0
- package/esm/core/src/test.js +12 -0
- package/esm/core/src/tests/Done.d.ts +5 -0
- package/esm/core/src/tests/Done.js +9 -0
- package/esm/core/src/tests/RowProvider.spec.d.ts +16 -0
- package/esm/core/src/tests/RowProvider.spec.js +631 -0
- package/esm/core/src/tests/TestDataApiResponse.d.ts +10 -0
- package/esm/core/src/tests/TestDataApiResponse.js +22 -0
- package/esm/core/src/tests/basicRowFunctionality.spec.d.ts +8 -0
- package/esm/core/src/tests/basicRowFunctionality.spec.js +2103 -0
- package/esm/core/src/tests/c.d.ts +8 -0
- package/esm/core/src/tests/c.js +13 -0
- package/esm/core/src/tests/createData.d.ts +7 -0
- package/esm/core/src/tests/createData.js +22 -0
- package/esm/core/src/tests/d.d.ts +6 -0
- package/esm/core/src/tests/d.js +11 -0
- package/esm/core/src/tests/dWithPrefilter.d.ts +7 -0
- package/esm/core/src/tests/dWithPrefilter.js +18 -0
- package/esm/core/src/tests/entityForCustomFilter.d.ts +16 -0
- package/esm/core/src/tests/entityForCustomFilter.js +33 -0
- package/esm/core/src/tests/entityWithValidationsOnColumn.d.ts +5 -0
- package/esm/core/src/tests/entityWithValidationsOnColumn.js +13 -0
- package/esm/core/src/tests/frontend-database-tests-setup.spec.d.ts +4 -0
- package/esm/core/src/tests/frontend-database-tests-setup.spec.js +37 -0
- package/esm/core/src/tests/h.d.ts +6 -0
- package/esm/core/src/tests/h.js +24 -0
- package/esm/core/src/tests/remult-3-basic-tests.spec.d.ts +1 -0
- package/esm/core/src/tests/remult-3-basic-tests.spec.js +236 -0
- package/esm/core/src/tests/remult-3-entities.d.ts +23 -0
- package/esm/core/src/tests/remult-3-entities.js +39 -0
- package/esm/core/src/tests/tasks.d.ts +6 -0
- package/esm/core/src/tests/tasks.js +10 -0
- 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 +1 -0
- package/esm/core/src/tests/test-data-api/predefined-filter.spec.d.ts +1 -0
- package/esm/core/src/tests/test-data-api/predefined-filter.spec.js +389 -0
- package/esm/core/src/tests/test-data-api/test-put-with-validation.spec.d.ts +5 -0
- package/esm/core/src/tests/test-data-api/test-put-with-validation.spec.js +152 -0
- package/esm/core/src/tests/test-decorator-precedence.spec.d.ts +1 -0
- package/esm/core/src/tests/test-decorator-precedence.spec.js +38 -0
- package/esm/core/src/tests/test-default-value.spec.d.ts +1 -0
- package/esm/core/src/tests/test-default-value.spec.js +33 -0
- package/esm/core/src/tests/test-entity-inheritance.spec.d.ts +14 -0
- package/esm/core/src/tests/test-entity-inheritance.spec.js +82 -0
- package/esm/core/src/tests/test-exceptions.spec.d.ts +1 -0
- package/esm/core/src/tests/test-exceptions.spec.js +375 -0
- package/esm/core/src/tests/test-json.spec.d.ts +1 -0
- package/esm/core/src/tests/test-json.spec.js +115 -0
- package/esm/core/src/tests/test-many-to-one-relation-in-entity.spec.d.ts +9 -0
- package/esm/core/src/tests/test-many-to-one-relation-in-entity.spec.js +809 -0
- package/esm/core/src/tests/test-non-active-record.spec.d.ts +1 -0
- package/esm/core/src/tests/test-non-active-record.spec.js +66 -0
- package/esm/core/src/tests/test-object-column.spec.d.ts +1 -0
- package/esm/core/src/tests/test-object-column.spec.js +189 -0
- package/esm/core/src/tests/test-paged-foreach.spec.d.ts +1 -0
- package/esm/core/src/tests/test-paged-foreach.spec.js +328 -0
- package/esm/core/src/tests/test-remult-angular.spec.d.ts +1 -0
- package/esm/core/src/tests/test-remult-angular.spec.js +23 -0
- package/esm/core/src/tests/test-server-controller.spec.d.ts +7 -0
- package/esm/core/src/tests/test-server-controller.spec.js +489 -0
- package/esm/core/src/tests/test-server-expressions.spec.d.ts +1 -0
- package/esm/core/src/tests/test-server-expressions.spec.js +178 -0
- package/esm/core/src/tests/test-server-method-on-entity.spec.d.ts +1 -0
- package/esm/core/src/tests/test-server-method-on-entity.spec.js +306 -0
- package/esm/core/src/tests/test-sql-expression.spec.d.ts +5 -0
- package/esm/core/src/tests/test-sql-expression.spec.js +205 -0
- package/esm/core/src/tests/test-sql.spec.d.ts +1 -0
- package/esm/core/src/tests/test-sql.spec.js +170 -0
- package/esm/core/src/tests/test-subscribe.spec.d.ts +1 -0
- package/esm/core/src/tests/test-subscribe.spec.js +135 -0
- package/esm/core/src/tests/test-type-recovery.spec.d.ts +1 -0
- package/esm/core/src/tests/test-type-recovery.spec.js +49 -0
- package/esm/core/src/tests/test-where-api.spec.d.ts +1 -0
- package/esm/core/src/tests/test-where-api.spec.js +434 -0
- package/esm/core/src/tests/testHelper.spec.d.ts +36 -0
- package/esm/core/src/tests/testHelper.spec.js +226 -0
- package/esm/core/src/tests/testModel/models.d.ts +16 -0
- package/esm/core/src/tests/testModel/models.js +25 -0
- package/esm/core/src/validators.d.ts +14 -0
- package/esm/core/src/validators.js +33 -0
- package/esm/core/src/valueConverters.d.ts +13 -0
- package/esm/core/src/valueConverters.js +197 -0
- package/esm/core/urlBuilder.d.ts +6 -0
- package/esm/core/urlBuilder.js +20 -0
- package/esm/graphql.js +194 -73
- package/esm/index.d.ts +10 -10
- package/esm/index.js +8 -8
- package/esm/inputTypes.js +1 -1
- package/esm/live-query/data-provider-live-query-storage.d.ts +3 -3
- package/esm/live-query/data-provider-live-query-storage.js +12 -9
- package/esm/myLog.js +2 -2
- package/esm/postgres/postgres-data-provider.d.ts +2 -2
- package/esm/postgres/postgres-data-provider.js +20 -14
- package/esm/postgres/schema-builder.d.ts +1 -1
- package/esm/postgres/schema-builder.js +28 -21
- package/esm/remult-express.js +2 -2
- package/esm/remult-fastify.js +9 -7
- package/esm/remult-fresh.d.ts +1 -1
- package/esm/remult-fresh.js +5 -8
- package/esm/remult-knex/index.d.ts +4 -4
- package/esm/remult-knex/index.js +75 -59
- package/esm/remult-mongo.js +36 -27
- package/esm/remult-next.d.ts +3 -3
- package/esm/remult-next.js +17 -11
- package/esm/remult-sveltekit.js +10 -10
- package/esm/server/JsonEntityFileStorage.js +3 -1
- package/esm/server/core.d.ts +2 -2
- package/esm/server/core.js +2 -2
- package/esm/server/expressBridge.d.ts +3 -12
- package/esm/server/expressBridge.js +265 -278
- package/esm/server/index.d.ts +2 -2
- package/esm/server/index.js +5 -2
- package/esm/server/initAsyncHooks.js +1 -1
- package/esm/server/initDataProvider.js +1 -1
- package/esm/src/backend-tests/backend-database-test-setup.backend-spec.d.ts +1 -1
- package/esm/src/backend-tests/backend-database-test-setup.backend-spec.js +47 -38
- package/esm/src/buildRestDataProvider.d.ts +1 -1
- package/esm/src/buildRestDataProvider.js +21 -13
- package/esm/src/column-interfaces.d.ts +9 -9
- package/esm/src/column.d.ts +4 -0
- package/esm/src/column.js +23 -11
- package/esm/src/context.d.ts +20 -8
- package/esm/src/context.js +65 -24
- package/esm/src/data-api.d.ts +0 -1
- package/esm/src/data-api.js +38 -37
- package/esm/src/data-interfaces.d.ts +1 -1
- package/esm/src/data-interfaces.js +1 -1
- package/esm/src/data-providers/array-entity-data-provider.js +9 -9
- package/esm/src/data-providers/in-memory-database.d.ts +1 -1
- package/esm/src/data-providers/in-memory-database.js +3 -1
- package/esm/src/data-providers/json-data-provider.js +8 -8
- package/esm/src/data-providers/rest-data-provider.d.ts +1 -1
- package/esm/src/data-providers/rest-data-provider.js +52 -36
- package/esm/src/data-providers/sql-database.d.ts +5 -5
- package/esm/src/data-providers/sql-database.js +53 -36
- package/esm/src/data-providers/web-sql-data-provider.d.ts +4 -4
- package/esm/src/data-providers/web-sql-data-provider.js +15 -13
- package/esm/src/entity.d.ts +24 -24
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.d.ts +4 -4
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.js +35 -20
- package/esm/src/filter/filter-interfaces.d.ts +7 -7
- package/esm/src/filter/filter-interfaces.js +108 -88
- package/esm/src/live-query/LiveQueryClient.js +37 -29
- package/esm/src/live-query/SseSubscriptionClient.d.ts +1 -1
- package/esm/src/live-query/SseSubscriptionClient.js +14 -14
- package/esm/src/live-query/SubscriptionChannel.d.ts +3 -3
- package/esm/src/live-query/SubscriptionChannel.js +27 -25
- package/esm/src/live-query/SubscriptionServer.js +24 -20
- package/esm/src/remult-proxy.d.ts +1 -1
- package/esm/src/remult-proxy.js +87 -29
- package/esm/src/remult3/DecoratorReplacer.d.ts +2 -2
- package/esm/src/remult3/RepositoryImplementation.d.ts +51 -41
- package/esm/src/remult3/RepositoryImplementation.js +336 -206
- package/esm/src/remult3/remult3.d.ts +56 -51
- package/esm/src/remult3/remult3.js +0 -1
- package/esm/src/server-action.d.ts +12 -5
- package/esm/src/server-action.js +79 -53
- package/esm/src/shared-tests/db-tests-setup.d.ts +8 -8
- package/esm/src/shared-tests/db-tests-setup.js +10 -10
- package/esm/src/shared-tests/db-tests.db-tests.d.ts +1 -1
- package/esm/src/shared-tests/db-tests.db-tests.js +279 -177
- package/esm/src/shared-tests/deleteAll.d.ts +1 -1
- package/esm/src/shared-tests/deleteAll.js +1 -1
- package/esm/src/shared-tests/entityWithValidations.js +1 -1
- package/esm/src/shared-tests/test-custom-id-column.spec.js +4 -4
- package/esm/src/shared-tests/test-special-value.spec.js +12 -12
- package/esm/src/shared-tests/test-update-with-null.spec.js +10 -6
- package/esm/src/sort.d.ts +2 -2
- package/esm/src/sort.js +12 -10
- package/esm/src/tests/TestDataApiResponse.d.ts +1 -1
- package/esm/src/tests/TestDataApiResponse.js +3 -4
- package/esm/src/tests/createData.js +2 -2
- package/esm/src/tests/d.js +1 -1
- package/esm/src/tests/dWithPrefilter.js +1 -1
- package/esm/src/tests/entityForCustomFilter.d.ts +4 -4
- package/esm/src/tests/entityForCustomFilter.js +12 -4
- package/esm/src/tests/entityWithValidationsOnColumn.js +1 -1
- package/esm/src/tests/frontend-database-tests-setup.spec.d.ts +1 -1
- package/esm/src/tests/frontend-database-tests-setup.spec.js +14 -14
- package/esm/src/tests/h.js +4 -4
- package/esm/src/tests/remult-3-entities.d.ts +2 -2
- package/esm/src/tests/remult-3-entities.js +6 -6
- package/esm/src/tests/testHelper.spec.d.ts +7 -7
- package/esm/src/tests/testHelper.spec.js +50 -39
- package/esm/src/tests/testModel/models.js +4 -4
- package/esm/src/validators.d.ts +1 -1
- package/esm/src/validators.js +10 -7
- package/esm/src/valueConverters.d.ts +1 -1
- package/esm/src/valueConverters.js +68 -55
- package/esm/test-servers/shared/Task.d.ts +9 -0
- package/esm/test-servers/shared/Task.js +32 -0
- package/esm/test.d.ts +5 -0
- package/esm/test.js +6 -0
- package/graphql.js +157 -45
- package/index.d.ts +10 -10
- package/inputTypes.js +1 -1
- package/live-query/data-provider-live-query-storage.d.ts +3 -3
- package/live-query/data-provider-live-query-storage.js +7 -4
- package/myLog.js +2 -2
- package/package.json +2 -2
- package/postgres/postgres-data-provider.d.ts +2 -2
- package/postgres/postgres-data-provider.js +21 -16
- package/postgres/schema-builder.d.ts +1 -1
- package/postgres/schema-builder.js +22 -15
- package/remult-express.js +1 -1
- package/remult-fastify.js +7 -7
- package/remult-fresh.d.ts +1 -1
- package/remult-fresh.js +1 -4
- package/remult-knex/index.d.ts +4 -4
- package/remult-knex/index.js +50 -35
- package/remult-mongo.js +33 -23
- package/remult-next.d.ts +3 -3
- package/remult-next.js +15 -11
- package/remult-sveltekit.js +14 -15
- package/server/core.d.ts +2 -2
- package/server/expressBridge.d.ts +3 -12
- package/server/expressBridge.js +278 -279
- package/server/index.d.ts +2 -2
- package/server/index.js +5 -2
- package/server/initAsyncHooks.js +2 -2
- package/server/initDataProvider.js +1 -1
- package/src/backend-tests/backend-database-test-setup.backend-spec.d.ts +1 -1
- package/src/backend-tests/backend-database-test-setup.backend-spec.js +40 -31
- package/src/buildRestDataProvider.d.ts +1 -1
- package/src/buildRestDataProvider.js +18 -10
- package/src/column-interfaces.d.ts +9 -9
- package/src/column.d.ts +4 -0
- package/src/column.js +20 -8
- package/src/context.d.ts +20 -8
- package/src/context.js +61 -18
- package/src/data-api.d.ts +0 -1
- package/src/data-api.js +40 -43
- package/src/data-interfaces.d.ts +1 -1
- package/src/data-providers/array-entity-data-provider.js +2 -2
- package/src/data-providers/in-memory-database.d.ts +1 -1
- package/src/data-providers/in-memory-database.js +3 -1
- package/src/data-providers/json-data-provider.js +33 -15
- package/src/data-providers/rest-data-provider.d.ts +1 -1
- package/src/data-providers/rest-data-provider.js +47 -32
- package/src/data-providers/sql-database.d.ts +5 -5
- package/src/data-providers/sql-database.js +41 -24
- package/src/data-providers/web-sql-data-provider.d.ts +4 -4
- package/src/data-providers/web-sql-data-provider.js +10 -8
- package/src/entity.d.ts +24 -24
- package/src/filter/filter-consumer-bridge-to-sql-request.d.ts +4 -4
- package/src/filter/filter-consumer-bridge-to-sql-request.js +34 -17
- package/src/filter/filter-interfaces.d.ts +7 -7
- package/src/filter/filter-interfaces.js +73 -47
- package/src/live-query/LiveQueryClient.js +35 -25
- package/src/live-query/SseSubscriptionClient.d.ts +1 -1
- package/src/live-query/SseSubscriptionClient.js +80 -76
- package/src/live-query/SubscriptionChannel.d.ts +3 -3
- package/src/live-query/SubscriptionChannel.js +26 -18
- package/src/live-query/SubscriptionServer.js +23 -17
- package/src/remult-proxy.d.ts +1 -1
- package/src/remult-proxy.js +84 -35
- package/src/remult3/DecoratorReplacer.d.ts +2 -2
- package/src/remult3/RepositoryImplementation.d.ts +51 -41
- package/src/remult3/RepositoryImplementation.js +402 -257
- package/src/remult3/remult3.d.ts +56 -51
- package/src/remult3/remult3.js +0 -1
- package/src/server-action.d.ts +12 -5
- package/src/server-action.js +78 -48
- package/src/shared-tests/db-tests-setup.d.ts +8 -8
- package/src/shared-tests/db-tests-setup.js +6 -6
- package/src/shared-tests/db-tests.db-tests.d.ts +1 -1
- package/src/shared-tests/db-tests.db-tests.js +350 -153
- package/src/shared-tests/deleteAll.d.ts +1 -1
- package/src/shared-tests/entityWithValidations.js +1 -1
- package/src/shared-tests/test-custom-id-column.spec.js +4 -4
- package/src/shared-tests/test-special-value.spec.js +9 -9
- package/src/shared-tests/test-update-with-null.spec.js +8 -4
- package/src/sort.d.ts +2 -2
- package/src/sort.js +9 -7
- package/src/tests/TestDataApiResponse.d.ts +1 -1
- package/src/tests/TestDataApiResponse.js +3 -4
- package/src/tests/createData.js +1 -1
- package/src/tests/d.js +1 -1
- package/src/tests/dWithPrefilter.js +1 -1
- package/src/tests/entityForCustomFilter.d.ts +4 -4
- package/src/tests/entityForCustomFilter.js +16 -6
- package/src/tests/entityWithValidationsOnColumn.js +1 -1
- package/src/tests/frontend-database-tests-setup.spec.d.ts +1 -1
- package/src/tests/frontend-database-tests-setup.spec.js +8 -8
- package/src/tests/h.js +3 -3
- package/src/tests/remult-3-entities.d.ts +2 -2
- package/src/tests/remult-3-entities.js +8 -4
- package/src/tests/testHelper.spec.d.ts +7 -7
- package/src/tests/testHelper.spec.js +38 -27
- package/src/tests/testModel/models.js +3 -3
- package/src/validators.d.ts +1 -1
- package/src/validators.js +18 -9
- package/src/valueConverters.d.ts +1 -1
- package/src/valueConverters.js +38 -21
- package/esm/remult-svletekit.d.ts +0 -3
- package/esm/remult-svletekit.js +0 -83
- package/esm/src/id-entity.d.ts +0 -4
- package/esm/src/id-entity.js +0 -8
- package/esm/src/remult3/getId.d.ts +0 -2
- package/esm/src/remult3/getId.js +0 -7
- package/postgres/getEntityTypescriptPostgres.d.ts +0 -1
- package/postgres/getEntityTypescriptPostgres.js +0 -125
- package/src/id-entity.d.ts +0 -4
- package/src/id-entity.js +0 -17
- package/src/remult3/getId.d.ts +0 -2
- package/src/remult3/getId.js +0 -11
package/server/expressBridge.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JobsInQueueEntity = exports.EntityQueueStorage = exports.RemultServerImplementation = exports.
|
|
3
|
+
exports.JobsInQueueEntity = exports.EntityQueueStorage = exports.RemultServerImplementation = exports.createRemultServerCore = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var server_action_1 = require("../src/server-action");
|
|
6
6
|
var data_api_1 = require("../src/data-api");
|
|
7
7
|
var context_1 = require("../src/context");
|
|
8
8
|
var remult3_1 = require("../src/remult3");
|
|
9
|
-
var remult_proxy_1 = require("../src/remult-proxy");
|
|
10
9
|
var SubscriptionServer_1 = require("../src/live-query/SubscriptionServer");
|
|
11
10
|
var SubscriptionChannel_1 = require("../src/live-query/SubscriptionChannel");
|
|
12
11
|
var initDataProvider_1 = require("./initDataProvider");
|
|
13
12
|
var SseSubscriptionServer_1 = require("../SseSubscriptionServer");
|
|
14
|
-
;
|
|
15
13
|
function createRemultServerCore(options, serverCoreOptions) {
|
|
16
14
|
var _this = this;
|
|
17
15
|
if (!options) {
|
|
@@ -32,7 +30,7 @@ function createRemultServerCore(options, serverCoreOptions) {
|
|
|
32
30
|
var dataProvider = initDataProvider_1.initDataProvider(options.dataProvider);
|
|
33
31
|
if (options.ensureSchema === undefined)
|
|
34
32
|
options.ensureSchema = true;
|
|
35
|
-
RemultAsyncLocalStorage.enable();
|
|
33
|
+
context_1.RemultAsyncLocalStorage.enable();
|
|
36
34
|
var entitiesMetaData = [];
|
|
37
35
|
dataProvider = dataProvider.then(function (dp) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
38
36
|
var remult;
|
|
@@ -42,7 +40,7 @@ function createRemultServerCore(options, serverCoreOptions) {
|
|
|
42
40
|
case 0:
|
|
43
41
|
remult = new context_1.Remult(dp);
|
|
44
42
|
return [4 /*yield*/, new Promise(function (res) {
|
|
45
|
-
RemultAsyncLocalStorage.instance.run(remult, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
43
|
+
context_1.RemultAsyncLocalStorage.instance.run(remult, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
46
44
|
var started_1, startConsoleLog, _a, _b, item, e_1_1;
|
|
47
45
|
var e_1, _c;
|
|
48
46
|
return tslib_1.__generator(this, function (_d) {
|
|
@@ -54,7 +52,7 @@ function createRemultServerCore(options, serverCoreOptions) {
|
|
|
54
52
|
if (started_1)
|
|
55
53
|
return;
|
|
56
54
|
started_1 = true;
|
|
57
|
-
console.time(
|
|
55
|
+
console.time('Ensure Schema');
|
|
58
56
|
};
|
|
59
57
|
entitiesMetaData.push.apply(entitiesMetaData, tslib_1.__spread(options.entities.map(function (e) { return remult.repo(e).metadata; })));
|
|
60
58
|
if (!dp.ensureSchema) return [3 /*break*/, 2];
|
|
@@ -65,7 +63,10 @@ function createRemultServerCore(options, serverCoreOptions) {
|
|
|
65
63
|
_d.label = 2;
|
|
66
64
|
case 2:
|
|
67
65
|
_d.trys.push([2, 7, 8, 9]);
|
|
68
|
-
_a = tslib_1.__values([
|
|
66
|
+
_a = tslib_1.__values([
|
|
67
|
+
options.liveQueryStorage,
|
|
68
|
+
options.queueStorage,
|
|
69
|
+
]), _b = _a.next();
|
|
69
70
|
_d.label = 3;
|
|
70
71
|
case 3:
|
|
71
72
|
if (!!_b.done) return [3 /*break*/, 6];
|
|
@@ -92,7 +93,7 @@ function createRemultServerCore(options, serverCoreOptions) {
|
|
|
92
93
|
return [7 /*endfinally*/];
|
|
93
94
|
case 9:
|
|
94
95
|
if (started_1)
|
|
95
|
-
console.timeEnd(
|
|
96
|
+
console.timeEnd('Ensure Schema');
|
|
96
97
|
_d.label = 10;
|
|
97
98
|
case 10:
|
|
98
99
|
if (!options.initApi) return [3 /*break*/, 12];
|
|
@@ -130,39 +131,6 @@ function createRemultServerCore(options, serverCoreOptions) {
|
|
|
130
131
|
return bridge;
|
|
131
132
|
}
|
|
132
133
|
exports.createRemultServerCore = createRemultServerCore;
|
|
133
|
-
;
|
|
134
|
-
var RemultAsyncLocalStorage = /** @class */ (function () {
|
|
135
|
-
function RemultAsyncLocalStorage(remultObjectStorage) {
|
|
136
|
-
this.remultObjectStorage = remultObjectStorage;
|
|
137
|
-
}
|
|
138
|
-
RemultAsyncLocalStorage.enable = function () {
|
|
139
|
-
remult_proxy_1.remult.remultFactory = function () {
|
|
140
|
-
var r = RemultAsyncLocalStorage.instance.getRemult();
|
|
141
|
-
if (r)
|
|
142
|
-
return r;
|
|
143
|
-
else
|
|
144
|
-
throw new Error("remult object was requested outside of a valid context, try running it within initApi or a remult request cycle");
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
RemultAsyncLocalStorage.disable = function () {
|
|
148
|
-
remult_proxy_1.remult.resetFactory();
|
|
149
|
-
};
|
|
150
|
-
RemultAsyncLocalStorage.prototype.run = function (remult, callback) {
|
|
151
|
-
if (this.remultObjectStorage)
|
|
152
|
-
this.remultObjectStorage.run(remult, callback);
|
|
153
|
-
else
|
|
154
|
-
callback();
|
|
155
|
-
};
|
|
156
|
-
RemultAsyncLocalStorage.prototype.getRemult = function () {
|
|
157
|
-
if (!this.remultObjectStorage) {
|
|
158
|
-
throw new Error("can't use static remult in this environment, `async_hooks` were not initialized");
|
|
159
|
-
}
|
|
160
|
-
return this.remultObjectStorage.getStore();
|
|
161
|
-
};
|
|
162
|
-
RemultAsyncLocalStorage.instance = new RemultAsyncLocalStorage(undefined);
|
|
163
|
-
return RemultAsyncLocalStorage;
|
|
164
|
-
}());
|
|
165
|
-
exports.RemultAsyncLocalStorage = RemultAsyncLocalStorage;
|
|
166
134
|
/* @internal*/
|
|
167
135
|
var RemultServerImplementation = /** @class */ (function () {
|
|
168
136
|
function RemultServerImplementation(queue, options, dataProvider, coreOptions, entitiesMetaData) {
|
|
@@ -200,7 +168,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
200
168
|
},
|
|
201
169
|
set liveQueryStorage(value) {
|
|
202
170
|
remult.liveQueryStorage = value;
|
|
203
|
-
}
|
|
171
|
+
},
|
|
204
172
|
})];
|
|
205
173
|
case 1:
|
|
206
174
|
_a.sent();
|
|
@@ -253,10 +221,12 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
253
221
|
});
|
|
254
222
|
}); };
|
|
255
223
|
this.withRemult = function (req, res, next) {
|
|
256
|
-
_this.process(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
224
|
+
_this.process(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
225
|
+
return tslib_1.__generator(this, function (_a) {
|
|
226
|
+
next();
|
|
227
|
+
return [2 /*return*/];
|
|
228
|
+
});
|
|
229
|
+
}); })(req, res);
|
|
260
230
|
};
|
|
261
231
|
this.registeredRouter = false;
|
|
262
232
|
this.hasQueue = false;
|
|
@@ -285,7 +255,6 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
285
255
|
var r = new context_1.Remult();
|
|
286
256
|
return this.options.entities.map(function (x) { return r.repo(x).metadata; });
|
|
287
257
|
};
|
|
288
|
-
;
|
|
289
258
|
RemultServerImplementation.prototype.getRouteImpl = function () {
|
|
290
259
|
if (!this.routeImpl) {
|
|
291
260
|
this.routeImpl = new RouteImplementation(this.coreOptions);
|
|
@@ -300,7 +269,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
300
269
|
var e_3, _a, e_4, _b;
|
|
301
270
|
var _this = this;
|
|
302
271
|
if (this.registeredRouter)
|
|
303
|
-
throw
|
|
272
|
+
throw 'Router already registered';
|
|
304
273
|
this.registeredRouter = true;
|
|
305
274
|
{
|
|
306
275
|
try {
|
|
@@ -358,12 +327,13 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
358
327
|
});
|
|
359
328
|
}); });
|
|
360
329
|
},
|
|
361
|
-
doWork: undefined
|
|
330
|
+
doWork: undefined,
|
|
362
331
|
}, r);
|
|
363
332
|
if (this.options.subscriptionServer instanceof SseSubscriptionServer_1.SseSubscriptionServer) {
|
|
364
333
|
var streamPath = this.options.rootPath + '/' + SubscriptionChannel_1.streamUrl;
|
|
365
334
|
r.route(streamPath).get(this.process(function (remult, req, res, origReq, origRes) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
366
335
|
return tslib_1.__generator(this, function (_a) {
|
|
336
|
+
;
|
|
367
337
|
remult.subscriptionServer.openHttpServerStream(origReq, origRes);
|
|
368
338
|
return [2 /*return*/];
|
|
369
339
|
});
|
|
@@ -376,7 +346,8 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
376
346
|
_b = (_a = remult.subscriptionServer).subscribeToChannel;
|
|
377
347
|
return [4 /*yield*/, this.coreOptions.getRequestBody(origReq)];
|
|
378
348
|
case 1:
|
|
379
|
-
body = _b.apply(_a, [_c.sent(), res,
|
|
349
|
+
body = _b.apply(_a, [_c.sent(), res,
|
|
350
|
+
remult]);
|
|
380
351
|
return [2 /*return*/];
|
|
381
352
|
}
|
|
382
353
|
});
|
|
@@ -386,10 +357,13 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
386
357
|
return tslib_1.__generator(this, function (_c) {
|
|
387
358
|
switch (_c.label) {
|
|
388
359
|
case 0:
|
|
360
|
+
;
|
|
389
361
|
_b = (_a = remult.subscriptionServer).subscribeToChannel;
|
|
390
362
|
return [4 /*yield*/, this.coreOptions.getRequestBody(origReq)];
|
|
391
363
|
case 1:
|
|
392
|
-
_b.apply(_a, [_c.sent(), res,
|
|
364
|
+
_b.apply(_a, [_c.sent(), res,
|
|
365
|
+
remult,
|
|
366
|
+
true]);
|
|
393
367
|
return [2 /*return*/];
|
|
394
368
|
}
|
|
395
369
|
});
|
|
@@ -427,7 +401,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
427
401
|
case 0:
|
|
428
402
|
result = {
|
|
429
403
|
user: remult.user,
|
|
430
|
-
context: undefined
|
|
404
|
+
context: undefined,
|
|
431
405
|
};
|
|
432
406
|
if (!this.options.contextSerializer) return [3 /*break*/, 2];
|
|
433
407
|
_a = result;
|
|
@@ -444,19 +418,24 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
444
418
|
var _this = this;
|
|
445
419
|
var myRoute = this.options.rootPath + '/' + key;
|
|
446
420
|
if (this.options.logApiEndPoints)
|
|
447
|
-
console.info(
|
|
421
|
+
console.info('[remult] ' + myRoute);
|
|
448
422
|
r.route(myRoute)
|
|
449
423
|
.get(this.process(function (c, req, res, orig) {
|
|
450
424
|
return dataApiFactory(c).httpGet(res, req, function () { return _this.serializeContext(c); });
|
|
451
|
-
}))
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
425
|
+
}))
|
|
426
|
+
.put(this.process(function (c, req, res, _, __, orig) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
427
|
+
var _a, _b, _c;
|
|
428
|
+
return tslib_1.__generator(this, function (_d) {
|
|
429
|
+
switch (_d.label) {
|
|
430
|
+
case 0:
|
|
431
|
+
_b = (_a = dataApiFactory(c)).put;
|
|
432
|
+
_c = [res,
|
|
433
|
+
''];
|
|
434
|
+
return [4 /*yield*/, this.coreOptions.getRequestBody(orig)];
|
|
435
|
+
case 1: return [2 /*return*/, _b.apply(_a, _c.concat([_d.sent()]))];
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}); }))
|
|
460
439
|
.delete(this.process(function (c, req, res, orig) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
|
|
461
440
|
return [2 /*return*/, dataApiFactory(c).delete(res, '')];
|
|
462
441
|
}); }); }))
|
|
@@ -467,9 +446,11 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
467
446
|
switch (_d.label) {
|
|
468
447
|
case 0:
|
|
469
448
|
_b = (_a = dataApiFactory(c)).httpPost;
|
|
470
|
-
_c = [res,
|
|
449
|
+
_c = [res,
|
|
450
|
+
req];
|
|
471
451
|
return [4 /*yield*/, this.coreOptions.getRequestBody(orig)];
|
|
472
|
-
case 1: return [2 /*return*/, _b.apply(_a, _c.concat([_d.sent(),
|
|
452
|
+
case 1: return [2 /*return*/, _b.apply(_a, _c.concat([_d.sent(),
|
|
453
|
+
function () { return _this.serializeContext(c); }]))];
|
|
473
454
|
}
|
|
474
455
|
});
|
|
475
456
|
}); }));
|
|
@@ -479,15 +460,19 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
479
460
|
return [2 /*return*/, dataApiFactory(c).get(res, orig.params.id)];
|
|
480
461
|
}); }); }))
|
|
481
462
|
//@ts-ignore
|
|
482
|
-
.put(this.process(function (c, req, res, reqInfo, _, orig) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
463
|
+
.put(this.process(function (c, req, res, reqInfo, _, orig) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
464
|
+
var _a, _b, _c;
|
|
465
|
+
return tslib_1.__generator(this, function (_d) {
|
|
466
|
+
switch (_d.label) {
|
|
467
|
+
case 0:
|
|
468
|
+
_b = (_a = dataApiFactory(c)).put;
|
|
469
|
+
_c = [res,
|
|
470
|
+
reqInfo.params.id];
|
|
471
|
+
return [4 /*yield*/, this.coreOptions.getRequestBody(orig)];
|
|
472
|
+
case 1: return [2 /*return*/, _b.apply(_a, _c.concat([_d.sent()]))];
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}); }))
|
|
491
476
|
//@ts-ignore
|
|
492
477
|
.delete(this.process(function (c, req, res, orig) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
|
|
493
478
|
return [2 /*return*/, dataApiFactory(c).delete(res, orig.params.id)];
|
|
@@ -506,11 +491,11 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
506
491
|
_a = remult;
|
|
507
492
|
return [4 /*yield*/, this.dataProvider];
|
|
508
493
|
case 1:
|
|
509
|
-
_a.dataProvider =
|
|
494
|
+
_a.dataProvider = _b.sent();
|
|
510
495
|
remult.subscriptionServer = this.subscriptionServer;
|
|
511
496
|
remult.liveQueryStorage = this.liveQueryStorage;
|
|
512
497
|
return [4 /*yield*/, new Promise(function (res) {
|
|
513
|
-
RemultAsyncLocalStorage.instance.run(remult, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
498
|
+
context_1.RemultAsyncLocalStorage.instance.run(remult, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
514
499
|
var _a;
|
|
515
500
|
return tslib_1.__generator(this, function (_b) {
|
|
516
501
|
switch (_b.label) {
|
|
@@ -541,10 +526,10 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
541
526
|
case 0:
|
|
542
527
|
genReq = this.coreOptions.buildGenericRequestInfo(req);
|
|
543
528
|
if (!genReq.query) {
|
|
544
|
-
genReq.query = req[
|
|
529
|
+
genReq.query = req['_tempQuery'];
|
|
545
530
|
}
|
|
546
531
|
if (!genReq.params)
|
|
547
|
-
genReq.params = req[
|
|
532
|
+
genReq.params = req['_tempParams'];
|
|
548
533
|
myReq = new ExpressRequestBridgeToDataApiRequest(genReq);
|
|
549
534
|
myRes = new ExpressResponseBridgeToDataApiResponse(origRes, req);
|
|
550
535
|
return [4 /*yield*/, this.runWithRemult(function (remult) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
@@ -566,7 +551,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
566
551
|
_a.label = 3;
|
|
567
552
|
case 3:
|
|
568
553
|
if (user)
|
|
569
|
-
remult.user =
|
|
554
|
+
remult.user = user;
|
|
570
555
|
if (!this.options.initRequest) return [3 /*break*/, 5];
|
|
571
556
|
return [4 /*yield*/, this.options.initRequest(req, {
|
|
572
557
|
remult: remult,
|
|
@@ -575,7 +560,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
575
560
|
},
|
|
576
561
|
set liveQueryStorage(value) {
|
|
577
562
|
remult.liveQueryStorage = value;
|
|
578
|
-
}
|
|
563
|
+
},
|
|
579
564
|
})];
|
|
580
565
|
case 4:
|
|
581
566
|
_a.sent();
|
|
@@ -594,7 +579,6 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
594
579
|
});
|
|
595
580
|
}); };
|
|
596
581
|
};
|
|
597
|
-
;
|
|
598
582
|
RemultServerImplementation.prototype.getRemult = function (req) {
|
|
599
583
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
600
584
|
var remult;
|
|
@@ -627,7 +611,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
627
611
|
})();
|
|
628
612
|
_this.backendMethodsOpenApi.push({ path: myUrl, allowed: allowed, tag: tag });
|
|
629
613
|
if (_this.options.logApiEndPoints)
|
|
630
|
-
console.info(
|
|
614
|
+
console.info('[remult] ' + myUrl);
|
|
631
615
|
if (queue) {
|
|
632
616
|
_this.hasQueue = true;
|
|
633
617
|
_this.queue.mapQueuedAction(myUrl, what);
|
|
@@ -641,7 +625,8 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
641
625
|
if (!queue) return [3 /*break*/, 3];
|
|
642
626
|
_e = {};
|
|
643
627
|
_b = (_a = this.queue).submitJob;
|
|
644
|
-
_c = [myUrl,
|
|
628
|
+
_c = [myUrl,
|
|
629
|
+
remult];
|
|
645
630
|
return [4 /*yield*/, this.coreOptions.getRequestBody(orig)];
|
|
646
631
|
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([_f.sent()]))];
|
|
647
632
|
case 2:
|
|
@@ -652,7 +637,8 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
652
637
|
case 3:
|
|
653
638
|
_d = what;
|
|
654
639
|
return [4 /*yield*/, this.coreOptions.getRequestBody(orig)];
|
|
655
|
-
case 4: return [2 /*return*/, _d.apply(void 0, [_f.sent(), remult,
|
|
640
|
+
case 4: return [2 /*return*/, _d.apply(void 0, [_f.sent(), remult,
|
|
641
|
+
res])];
|
|
656
642
|
case 5: return [2 /*return*/];
|
|
657
643
|
}
|
|
658
644
|
});
|
|
@@ -662,41 +648,41 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
662
648
|
RemultServerImplementation.prototype.openApiDoc = function (options) {
|
|
663
649
|
var e_5, _a, e_6, _b;
|
|
664
650
|
if (!options.version)
|
|
665
|
-
options.version =
|
|
651
|
+
options.version = '1.0.0';
|
|
666
652
|
var spec = {
|
|
667
653
|
info: { title: options.title, version: options.version },
|
|
668
|
-
openapi:
|
|
654
|
+
openapi: '3.0.0',
|
|
669
655
|
//swagger: "2.0",
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
}
|
|
678
|
-
}
|
|
656
|
+
components: {
|
|
657
|
+
schemas: {},
|
|
658
|
+
securitySchemes: {
|
|
659
|
+
bearerAuth: {
|
|
660
|
+
scheme: 'bearer',
|
|
661
|
+
bearerFormat: 'JWT',
|
|
662
|
+
type: 'http',
|
|
663
|
+
},
|
|
664
|
+
},
|
|
679
665
|
},
|
|
680
|
-
paths: {}
|
|
666
|
+
paths: {},
|
|
681
667
|
};
|
|
682
668
|
var validationError = {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
}
|
|
669
|
+
'400': {
|
|
670
|
+
description: 'Error: Bad Request',
|
|
671
|
+
content: {
|
|
672
|
+
'application/json': {
|
|
673
|
+
schema: {
|
|
674
|
+
$ref: '#/components/schemas/InvalidResponse',
|
|
675
|
+
},
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
},
|
|
693
679
|
};
|
|
694
680
|
var security = {
|
|
695
|
-
|
|
681
|
+
security: [
|
|
696
682
|
{
|
|
697
|
-
|
|
698
|
-
}
|
|
699
|
-
]
|
|
683
|
+
bearerAuth: [],
|
|
684
|
+
},
|
|
685
|
+
],
|
|
700
686
|
};
|
|
701
687
|
var secureBase = function (condition, def, item) {
|
|
702
688
|
if (condition === undefined)
|
|
@@ -704,7 +690,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
704
690
|
if (condition != false) {
|
|
705
691
|
if (condition != true) {
|
|
706
692
|
item = tslib_1.__assign(tslib_1.__assign({}, item), security);
|
|
707
|
-
item.responses[
|
|
693
|
+
item.responses['403'] = { description: 'forbidden' };
|
|
708
694
|
}
|
|
709
695
|
return item;
|
|
710
696
|
}
|
|
@@ -720,27 +706,33 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
720
706
|
try {
|
|
721
707
|
for (var _b = (e_7 = void 0, tslib_1.__values(meta.fields)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
722
708
|
var f = _c.value;
|
|
723
|
-
var type = f.valueType == String
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
709
|
+
var type = f.valueType == String
|
|
710
|
+
? 'string'
|
|
711
|
+
: f.valueType == Boolean
|
|
712
|
+
? 'boolean'
|
|
713
|
+
: f.valueType == Date
|
|
714
|
+
? 'string'
|
|
715
|
+
: f.valueType == Number
|
|
716
|
+
? 'number'
|
|
717
|
+
: 'object';
|
|
728
718
|
if (f.options.includeInApi !== false) {
|
|
729
719
|
properties[f.key] = {
|
|
730
|
-
type: type
|
|
720
|
+
type: type,
|
|
731
721
|
};
|
|
732
722
|
if (f.options.allowApiUpdate !== false) {
|
|
733
723
|
mutationProperties[f.key] = {
|
|
734
|
-
type: type
|
|
724
|
+
type: type,
|
|
735
725
|
};
|
|
736
726
|
}
|
|
737
727
|
parameters.push({
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
728
|
+
name: f.key,
|
|
729
|
+
in: 'query',
|
|
730
|
+
description: 'filter equal to ' +
|
|
731
|
+
f.key +
|
|
732
|
+
'. See [more filtering options](https://remult.dev/docs/rest-api.html#filter)',
|
|
733
|
+
required: false,
|
|
734
|
+
style: 'simple',
|
|
735
|
+
type: type,
|
|
744
736
|
});
|
|
745
737
|
}
|
|
746
738
|
}
|
|
@@ -753,18 +745,18 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
753
745
|
finally { if (e_7) throw e_7.error; }
|
|
754
746
|
}
|
|
755
747
|
spec.components.schemas[key] = {
|
|
756
|
-
type:
|
|
757
|
-
properties: properties
|
|
748
|
+
type: 'object',
|
|
749
|
+
properties: properties,
|
|
758
750
|
};
|
|
759
751
|
if (JSON.stringify(properties) !== JSON.stringify(mutationProperties)) {
|
|
760
752
|
mutationKey += 'Mutation';
|
|
761
753
|
spec.components.schemas[mutationKey] = {
|
|
762
|
-
type:
|
|
763
|
-
properties: mutationProperties
|
|
754
|
+
type: 'object',
|
|
755
|
+
properties: mutationProperties,
|
|
764
756
|
};
|
|
765
757
|
}
|
|
766
758
|
var definition = {
|
|
767
|
-
|
|
759
|
+
$ref: '#/components/schemas/' + key,
|
|
768
760
|
};
|
|
769
761
|
var secure = function (condition, def, item) {
|
|
770
762
|
item.tags = [meta.key];
|
|
@@ -772,125 +764,125 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
772
764
|
condition = meta.options.allowApiCrud;
|
|
773
765
|
return secureBase(condition, def, item);
|
|
774
766
|
};
|
|
775
|
-
var apiPath = spec.paths[this_2.options.rootPath + '/' + key] = {};
|
|
776
|
-
var apiPathWithId = spec.paths[this_2.options.rootPath + '/' + key +
|
|
767
|
+
var apiPath = (spec.paths[this_2.options.rootPath + '/' + key] = {});
|
|
768
|
+
var apiPathWithId = (spec.paths[this_2.options.rootPath + '/' + key + '/{id}'] = {});
|
|
777
769
|
//https://github.com/2fd/open-api.d.ts
|
|
778
770
|
apiPath.get = secure(meta.options.allowApiRead, true, {
|
|
779
|
-
description:
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
771
|
+
description: 'return an array of ' +
|
|
772
|
+
key +
|
|
773
|
+
'. supports filter operators. For more info on filtering [see this article](https://remult.dev/docs/rest-api.html#filter)',
|
|
774
|
+
parameters: tslib_1.__spread([
|
|
775
|
+
{
|
|
776
|
+
name: '_limit',
|
|
777
|
+
in: 'query',
|
|
778
|
+
description: 'limit the number of returned rows, default 100',
|
|
779
|
+
required: false,
|
|
780
|
+
style: 'simple',
|
|
781
|
+
schema: { type: 'integer' },
|
|
787
782
|
},
|
|
788
783
|
{
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
784
|
+
name: '_page',
|
|
785
|
+
in: 'query',
|
|
786
|
+
description: 'to be used for paging',
|
|
787
|
+
required: false,
|
|
788
|
+
schema: { type: 'integer' },
|
|
794
789
|
},
|
|
795
790
|
{
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
791
|
+
name: '_sort',
|
|
792
|
+
in: 'query',
|
|
793
|
+
description: 'the columns to sort on',
|
|
794
|
+
required: false,
|
|
795
|
+
schema: { type: 'string' },
|
|
801
796
|
},
|
|
802
797
|
{
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}
|
|
798
|
+
name: '_order',
|
|
799
|
+
in: 'query',
|
|
800
|
+
description: 'the sort order to user for the columns in `_sort`',
|
|
801
|
+
required: false,
|
|
802
|
+
schema: { type: 'string' },
|
|
803
|
+
}
|
|
804
|
+
], parameters),
|
|
809
805
|
responses: {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
}
|
|
806
|
+
'200': {
|
|
807
|
+
description: 'returns an array of ' + key,
|
|
808
|
+
content: {
|
|
809
|
+
'application/json': {
|
|
810
|
+
schema: {
|
|
811
|
+
type: 'array',
|
|
812
|
+
items: definition,
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
},
|
|
820
816
|
},
|
|
821
|
-
}
|
|
817
|
+
},
|
|
822
818
|
});
|
|
823
819
|
var idParameter = {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
820
|
+
name: 'id',
|
|
821
|
+
in: 'path',
|
|
822
|
+
description: 'id of ' + key,
|
|
823
|
+
required: true,
|
|
824
|
+
schema: { type: 'string' },
|
|
829
825
|
};
|
|
830
826
|
var itemInBody = {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
}
|
|
827
|
+
requestBody: {
|
|
828
|
+
content: {
|
|
829
|
+
'application/json': {
|
|
830
|
+
schema: {
|
|
831
|
+
$ref: '#/components/schemas/' + mutationKey,
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
},
|
|
835
|
+
},
|
|
840
836
|
};
|
|
841
837
|
apiPath.post = secure(meta.options.allowApiInsert, false, tslib_1.__assign(tslib_1.__assign({
|
|
842
838
|
//"summary": "insert a " + key,
|
|
843
839
|
//"description": "insert a " + key,
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
}
|
|
840
|
+
produces: ['application/json'] }, itemInBody), { responses: tslib_1.__assign({ '201': {
|
|
841
|
+
description: 'Created',
|
|
842
|
+
content: {
|
|
843
|
+
'application/json': {
|
|
844
|
+
schema: {
|
|
845
|
+
$ref: '#/components/schemas/' + key,
|
|
846
|
+
},
|
|
847
|
+
},
|
|
848
|
+
},
|
|
853
849
|
} }, validationError) }));
|
|
854
850
|
apiPathWithId.get = secure(meta.options.allowApiRead, true, {
|
|
855
851
|
parameters: [idParameter],
|
|
856
852
|
responses: {
|
|
857
|
-
|
|
853
|
+
'200': {
|
|
858
854
|
// "description": "returns an item of " + key,
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
}
|
|
855
|
+
content: {
|
|
856
|
+
'application/json': {
|
|
857
|
+
schema: {
|
|
858
|
+
$ref: '#/components/schemas/' + key,
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
},
|
|
866
862
|
},
|
|
867
|
-
}
|
|
863
|
+
},
|
|
868
864
|
});
|
|
869
865
|
apiPathWithId.put = secure(meta.options.allowApiUpdate, false, tslib_1.__assign(tslib_1.__assign({
|
|
870
866
|
//"summary": "Update a " + key,
|
|
871
867
|
//"description": "Update a " + key,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
}
|
|
882
|
-
}
|
|
868
|
+
produces: ['application/json'], parameters: [idParameter] }, itemInBody), { responses: tslib_1.__assign({ '200': {
|
|
869
|
+
description: 'successful operation',
|
|
870
|
+
content: {
|
|
871
|
+
'application/json': {
|
|
872
|
+
schema: {
|
|
873
|
+
$ref: '#/components/schemas/' + key,
|
|
874
|
+
},
|
|
875
|
+
},
|
|
876
|
+
},
|
|
883
877
|
} }, validationError) }));
|
|
884
878
|
apiPathWithId.delete = secure(meta.options.allowApiDelete, false, {
|
|
885
879
|
// "summary": "Delete a " + key,
|
|
886
880
|
// "description": "Delete a " + key,
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
"description": "Deleted"
|
|
893
|
-
} }, validationError)
|
|
881
|
+
produces: ['application/json'],
|
|
882
|
+
parameters: [idParameter],
|
|
883
|
+
responses: tslib_1.__assign({ '204': {
|
|
884
|
+
description: 'Deleted',
|
|
885
|
+
} }, validationError),
|
|
894
886
|
});
|
|
895
887
|
}
|
|
896
888
|
};
|
|
@@ -913,39 +905,39 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
913
905
|
var b = _f.value;
|
|
914
906
|
spec.paths[b.path] = {
|
|
915
907
|
post: secureBase(b.allowed, false, {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
908
|
+
produces: ['application/json'],
|
|
909
|
+
tags: [b.tag],
|
|
910
|
+
requestBody: {
|
|
911
|
+
content: {
|
|
912
|
+
'application/json': {
|
|
913
|
+
schema: {
|
|
914
|
+
type: 'object',
|
|
923
915
|
properties: {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
}
|
|
916
|
+
args: {
|
|
917
|
+
type: 'array',
|
|
918
|
+
items: { type: 'string' },
|
|
919
|
+
},
|
|
920
|
+
},
|
|
921
|
+
},
|
|
922
|
+
},
|
|
923
|
+
},
|
|
932
924
|
},
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
925
|
+
responses: tslib_1.__assign({ '201': {
|
|
926
|
+
description: 'Created',
|
|
927
|
+
content: {
|
|
928
|
+
'application/json': {
|
|
929
|
+
schema: {
|
|
930
|
+
type: 'object',
|
|
939
931
|
properties: {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
} }, validationError)
|
|
948
|
-
})
|
|
932
|
+
data: {
|
|
933
|
+
type: 'object',
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
},
|
|
937
|
+
},
|
|
938
|
+
},
|
|
939
|
+
} }, validationError),
|
|
940
|
+
}),
|
|
949
941
|
};
|
|
950
942
|
}
|
|
951
943
|
}
|
|
@@ -956,16 +948,16 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
956
948
|
}
|
|
957
949
|
finally { if (e_6) throw e_6.error; }
|
|
958
950
|
}
|
|
959
|
-
spec.components.schemas[
|
|
960
|
-
|
|
951
|
+
spec.components.schemas['InvalidResponse'] = {
|
|
952
|
+
type: 'object',
|
|
961
953
|
properties: {
|
|
962
|
-
|
|
963
|
-
|
|
954
|
+
message: {
|
|
955
|
+
type: 'string',
|
|
964
956
|
},
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
}
|
|
968
|
-
}
|
|
957
|
+
modelState: {
|
|
958
|
+
type: 'object',
|
|
959
|
+
},
|
|
960
|
+
},
|
|
969
961
|
};
|
|
970
962
|
return spec;
|
|
971
963
|
};
|
|
@@ -992,8 +984,7 @@ var ExpressResponseBridgeToDataApiResponse = /** @class */ (function () {
|
|
|
992
984
|
ExpressResponseBridgeToDataApiResponse.prototype.setStatus = function (status) {
|
|
993
985
|
return this.r.status(status);
|
|
994
986
|
};
|
|
995
|
-
ExpressResponseBridgeToDataApiResponse.prototype.progress = function (progress) {
|
|
996
|
-
};
|
|
987
|
+
ExpressResponseBridgeToDataApiResponse.prototype.progress = function (progress) { };
|
|
997
988
|
ExpressResponseBridgeToDataApiResponse.prototype.success = function (data) {
|
|
998
989
|
this.r.json(data);
|
|
999
990
|
};
|
|
@@ -1013,15 +1004,14 @@ var ExpressResponseBridgeToDataApiResponse = /** @class */ (function () {
|
|
|
1013
1004
|
message: data.message,
|
|
1014
1005
|
stack: (_a = data.stack) === null || _a === void 0 ? void 0 : _a.split('\n'),
|
|
1015
1006
|
url: this.req.url,
|
|
1016
|
-
method: this.req.method
|
|
1007
|
+
method: this.req.method,
|
|
1017
1008
|
});
|
|
1018
1009
|
this.setStatus(400).json(data);
|
|
1019
|
-
;
|
|
1020
1010
|
};
|
|
1021
1011
|
return ExpressResponseBridgeToDataApiResponse;
|
|
1022
1012
|
}());
|
|
1023
1013
|
function throwError() {
|
|
1024
|
-
throw
|
|
1014
|
+
throw 'Invalid';
|
|
1025
1015
|
}
|
|
1026
1016
|
var inProcessQueueHandler = /** @class */ (function () {
|
|
1027
1017
|
function inProcessQueueHandler(storage) {
|
|
@@ -1043,10 +1033,16 @@ var inProcessQueueHandler = /** @class */ (function () {
|
|
|
1043
1033
|
error: function (error) { return job.setErrorResult(data_api_1.serializeError(error)); },
|
|
1044
1034
|
success: function (result) { return job.setResult(result); },
|
|
1045
1035
|
progress: function (progress) { return job.setProgress(progress); },
|
|
1046
|
-
created: function () {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1036
|
+
created: function () {
|
|
1037
|
+
throw Error('Created response not expected for queue');
|
|
1038
|
+
},
|
|
1039
|
+
deleted: function () {
|
|
1040
|
+
throw Error('deleted response not expected for queue');
|
|
1041
|
+
},
|
|
1042
|
+
notFound: function () {
|
|
1043
|
+
throw Error('notFound response not expected for queue');
|
|
1044
|
+
},
|
|
1045
|
+
forbidden: function () { return job.setErrorResult('Forbidden'); },
|
|
1050
1046
|
});
|
|
1051
1047
|
return [2 /*return*/, id];
|
|
1052
1048
|
}
|
|
@@ -1087,7 +1083,7 @@ var InMemoryQueueStorage = /** @class */ (function () {
|
|
|
1087
1083
|
id = this.jobs.size.toString();
|
|
1088
1084
|
this.jobs.set(id, {
|
|
1089
1085
|
info: {
|
|
1090
|
-
done: false
|
|
1086
|
+
done: false,
|
|
1091
1087
|
},
|
|
1092
1088
|
userId: userId,
|
|
1093
1089
|
setErrorResult: function (error) {
|
|
@@ -1103,7 +1099,7 @@ var InMemoryQueueStorage = /** @class */ (function () {
|
|
|
1103
1099
|
setProgress: function (progress) {
|
|
1104
1100
|
var job = _this.jobs.get(id);
|
|
1105
1101
|
job.info.progress = progress;
|
|
1106
|
-
}
|
|
1102
|
+
},
|
|
1107
1103
|
});
|
|
1108
1104
|
return [2 /*return*/, id];
|
|
1109
1105
|
});
|
|
@@ -1118,7 +1114,7 @@ var EntityQueueStorage = /** @class */ (function () {
|
|
|
1118
1114
|
this.sync = Promise.resolve();
|
|
1119
1115
|
}
|
|
1120
1116
|
EntityQueueStorage.prototype.doSync = function (what) {
|
|
1121
|
-
return this.sync = this.sync.then(function () { return what(); });
|
|
1117
|
+
return (this.sync = this.sync.then(function () { return what(); }));
|
|
1122
1118
|
};
|
|
1123
1119
|
EntityQueueStorage.prototype.getJobInfo = function (queuedJobId) {
|
|
1124
1120
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
@@ -1136,7 +1132,7 @@ var EntityQueueStorage = /** @class */ (function () {
|
|
|
1136
1132
|
done: q.done,
|
|
1137
1133
|
error: q.error ? JSON.parse(q.result) : undefined,
|
|
1138
1134
|
result: q.done && !q.error ? JSON.parse(q.result) : undefined,
|
|
1139
|
-
progress: q.progress
|
|
1135
|
+
progress: q.progress,
|
|
1140
1136
|
},
|
|
1141
1137
|
setErrorResult: function (error) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
1142
1138
|
return tslib_1.__generator(this, function (_a) {
|
|
@@ -1193,7 +1189,7 @@ var EntityQueueStorage = /** @class */ (function () {
|
|
|
1193
1189
|
return [2 /*return*/];
|
|
1194
1190
|
}
|
|
1195
1191
|
});
|
|
1196
|
-
}); }
|
|
1192
|
+
}); },
|
|
1197
1193
|
}];
|
|
1198
1194
|
}
|
|
1199
1195
|
});
|
|
@@ -1234,21 +1230,21 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1234
1230
|
this.map.set(r, m);
|
|
1235
1231
|
var route = {
|
|
1236
1232
|
get: function (h) {
|
|
1237
|
-
m.set(
|
|
1233
|
+
m.set('get', h);
|
|
1238
1234
|
return route;
|
|
1239
1235
|
},
|
|
1240
1236
|
put: function (h) {
|
|
1241
|
-
m.set(
|
|
1237
|
+
m.set('put', h);
|
|
1242
1238
|
return route;
|
|
1243
1239
|
},
|
|
1244
1240
|
post: function (h) {
|
|
1245
|
-
m.set(
|
|
1241
|
+
m.set('post', h);
|
|
1246
1242
|
return route;
|
|
1247
1243
|
},
|
|
1248
1244
|
delete: function (h) {
|
|
1249
|
-
m.set(
|
|
1245
|
+
m.set('delete', h);
|
|
1250
1246
|
return route;
|
|
1251
|
-
}
|
|
1247
|
+
},
|
|
1252
1248
|
};
|
|
1253
1249
|
return route;
|
|
1254
1250
|
};
|
|
@@ -1257,14 +1253,16 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1257
1253
|
var _this = this;
|
|
1258
1254
|
return tslib_1.__generator(this, function (_a) {
|
|
1259
1255
|
return [2 /*return*/, new Promise(function (res) {
|
|
1260
|
-
var response = new /** @class */ (function () {
|
|
1256
|
+
var response = new (/** @class */ (function () {
|
|
1261
1257
|
function class_1() {
|
|
1262
1258
|
this.statusCode = 200;
|
|
1263
1259
|
}
|
|
1264
1260
|
class_1.prototype.write = function (data) {
|
|
1261
|
+
;
|
|
1265
1262
|
gRes.write(data);
|
|
1266
1263
|
};
|
|
1267
1264
|
class_1.prototype.writeHead = function (statusCode, headers) {
|
|
1265
|
+
;
|
|
1268
1266
|
gRes.writeHead(statusCode, headers);
|
|
1269
1267
|
this.statusCode = statusCode;
|
|
1270
1268
|
res({ statusCode: statusCode });
|
|
@@ -1288,11 +1286,11 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1288
1286
|
if (gRes !== undefined)
|
|
1289
1287
|
gRes.end();
|
|
1290
1288
|
res({
|
|
1291
|
-
statusCode: this.statusCode
|
|
1289
|
+
statusCode: this.statusCode,
|
|
1292
1290
|
});
|
|
1293
1291
|
};
|
|
1294
1292
|
return class_1;
|
|
1295
|
-
}());
|
|
1293
|
+
}()))();
|
|
1296
1294
|
_this.middleware(req, response, function () { return res(undefined); });
|
|
1297
1295
|
})];
|
|
1298
1296
|
});
|
|
@@ -1301,7 +1299,8 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1301
1299
|
RouteImplementation.prototype.middleware = function (origReq, res, next) {
|
|
1302
1300
|
var req = this.coreOptions.buildGenericRequestInfo(origReq);
|
|
1303
1301
|
var theUrl = req.url;
|
|
1304
|
-
if (theUrl.startsWith('/'))
|
|
1302
|
+
if (theUrl.startsWith('/'))
|
|
1303
|
+
//next sends a partial url '/api/tasks' and not the full url
|
|
1305
1304
|
theUrl = 'http://stam' + theUrl;
|
|
1306
1305
|
var url = new URL(theUrl);
|
|
1307
1306
|
var path = url.pathname;
|
|
@@ -1319,7 +1318,7 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1319
1318
|
}
|
|
1320
1319
|
query_1[key] = [current, val];
|
|
1321
1320
|
});
|
|
1322
|
-
origReq[
|
|
1321
|
+
origReq['_tempQuery'] = query_1;
|
|
1323
1322
|
req.query = query_1;
|
|
1324
1323
|
}
|
|
1325
1324
|
var lowerPath = path.toLowerCase();
|
|
@@ -1340,7 +1339,7 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1340
1339
|
if (h) {
|
|
1341
1340
|
if (!req.params) {
|
|
1342
1341
|
req.params = {};
|
|
1343
|
-
origReq[
|
|
1342
|
+
origReq['_tempParams'] = req.params;
|
|
1344
1343
|
}
|
|
1345
1344
|
req.params.id = path.substring(idPosition + 1);
|
|
1346
1345
|
h(origReq, res, next);
|
|
@@ -1391,7 +1390,7 @@ var JobsInQueueEntity = /** @class */ (function (_super) {
|
|
|
1391
1390
|
], JobsInQueueEntity.prototype, "progress", void 0);
|
|
1392
1391
|
JobsInQueueEntity = tslib_1.__decorate([
|
|
1393
1392
|
remult3_1.Entity(undefined, {
|
|
1394
|
-
dbName: 'jobsInQueue'
|
|
1393
|
+
dbName: 'jobsInQueue',
|
|
1395
1394
|
})
|
|
1396
1395
|
], JobsInQueueEntity);
|
|
1397
1396
|
return JobsInQueueEntity;
|