@rockster/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cache/cache-cleaner.d.ts +7 -0
- package/cache/cache-cleaner.js +28 -0
- package/cache/cache.controller.d.ts +10 -0
- package/cache/cache.controller.js +53 -0
- package/cache/constants.d.ts +5 -0
- package/cache/constants.js +6 -0
- package/cache/decorators/index.d.ts +2 -0
- package/cache/decorators/index.js +18 -0
- package/cache/decorators/inject-cache.decorator.d.ts +1 -0
- package/cache/decorators/inject-cache.decorator.js +14 -0
- package/cache/decorators/key-value.d.ts +2 -0
- package/cache/decorators/key-value.js +40 -0
- package/cache/functions/get-cache.d.ts +1 -0
- package/cache/functions/get-cache.js +8 -0
- package/cache/functions/get-key.-handle.d.ts +2 -0
- package/cache/functions/get-key.-handle.js +23 -0
- package/cache/index.d.ts +3 -0
- package/cache/index.js +19 -0
- package/cache/interfaces/cache-instance.d.ts +4 -0
- package/cache/interfaces/cache-instance.js +2 -0
- package/cache/interfaces/cache-key-options.d.ts +6 -0
- package/cache/interfaces/cache-key-options.js +2 -0
- package/cache/interfaces/cache-options.d.ts +12 -0
- package/cache/interfaces/cache-options.js +2 -0
- package/cache/interfaces/get-key-value-handle.d.ts +1 -0
- package/cache/interfaces/get-key-value-handle.js +2 -0
- package/cache/interfaces/index.d.ts +4 -0
- package/cache/interfaces/index.js +20 -0
- package/command/constants.d.ts +4 -0
- package/command/constants.js +7 -0
- package/command/decorators/index.d.ts +6 -0
- package/command/decorators/index.js +22 -0
- package/command/decorators/only-modify.decorator.d.ts +1 -0
- package/command/decorators/only-modify.decorator.js +14 -0
- package/command/decorators/post-action.decorator.d.ts +2 -0
- package/command/decorators/post-action.decorator.js +26 -0
- package/command/decorators/post-content.decorator.d.ts +1 -0
- package/command/decorators/post-content.decorator.js +11 -0
- package/command/decorators/read-only.decorator.d.ts +1 -0
- package/command/decorators/read-only.decorator.js +14 -0
- package/command/decorators/remove-action.decorator.d.ts +2 -0
- package/command/decorators/remove-action.decorator.js +27 -0
- package/command/decorators/remove-content.decorator.d.ts +1 -0
- package/command/decorators/remove-content.decorator.js +11 -0
- package/command/functions/execute-post.d.ts +2 -0
- package/command/functions/execute-post.js +50 -0
- package/command/functions/execute-remove.d.ts +4 -0
- package/command/functions/execute-remove.js +50 -0
- package/command/interfaces/command-property.d.ts +7 -0
- package/command/interfaces/command-property.js +2 -0
- package/command/interfaces/index.d.ts +5 -0
- package/command/interfaces/index.js +21 -0
- package/command/interfaces/post-action-options.d.ts +23 -0
- package/command/interfaces/post-action-options.js +2 -0
- package/command/interfaces/post-content.d.ts +8 -0
- package/command/interfaces/post-content.js +2 -0
- package/command/interfaces/remove-aciton-options.d.ts +23 -0
- package/command/interfaces/remove-aciton-options.js +2 -0
- package/command/interfaces/remove-content.d.ts +5 -0
- package/command/interfaces/remove-content.js +2 -0
- package/command/services/post-action-builder.d.ts +19 -0
- package/command/services/post-action-builder.js +219 -0
- package/command/services/remove-action-builder.d.ts +14 -0
- package/command/services/remove-action-builder.js +165 -0
- package/command/utils/deep-merge-keep-undefined.d.ts +1 -0
- package/command/utils/deep-merge-keep-undefined.js +18 -0
- package/common/entities/base-entity.d.ts +7 -0
- package/common/entities/base-entity.js +47 -0
- package/common/index.d.ts +1 -0
- package/common/index.js +17 -0
- package/common/interfaces/enum/index.d.ts +3 -0
- package/common/interfaces/enum/index.js +19 -0
- package/common/interfaces/enum/object-type.d.ts +12 -0
- package/common/interfaces/enum/object-type.js +16 -0
- package/common/interfaces/enum/property-type.d.ts +7 -0
- package/common/interfaces/enum/property-type.js +11 -0
- package/common/interfaces/enum/request-status.d.ts +3 -0
- package/common/interfaces/enum/request-status.js +7 -0
- package/common/interfaces/get-type-callback.d.ts +2 -0
- package/common/interfaces/get-type-callback.js +2 -0
- package/common/interfaces/index.d.ts +2 -0
- package/common/interfaces/index.js +18 -0
- package/common/models/executed-response.d.ts +3 -0
- package/common/models/executed-response.js +22 -0
- package/controllers/constants.d.ts +11 -0
- package/controllers/constants.js +14 -0
- package/controllers/controller.controller.d.ts +19 -0
- package/controllers/controller.controller.js +50 -0
- package/controllers/decorators/actions/action-content.decorator.d.ts +2 -0
- package/controllers/decorators/actions/action-content.decorator.js +20 -0
- package/controllers/decorators/actions/action.decorator.d.ts +2 -0
- package/controllers/decorators/actions/action.decorator.js +28 -0
- package/controllers/decorators/actions/index.d.ts +2 -0
- package/controllers/decorators/actions/index.js +18 -0
- package/controllers/decorators/controller.decorator.d.ts +3 -0
- package/controllers/decorators/controller.decorator.js +32 -0
- package/controllers/decorators/http-methods/custom-response.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/custom-response.decorator.js +14 -0
- package/controllers/decorators/http-methods/delete.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/delete.decorator.js +16 -0
- package/controllers/decorators/http-methods/from-body.decorator.d.ts +3 -0
- package/controllers/decorators/http-methods/from-body.decorator.js +24 -0
- package/controllers/decorators/http-methods/from-headers.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/from-headers.decorator.js +21 -0
- package/controllers/decorators/http-methods/from-params.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/from-params.decorator.js +21 -0
- package/controllers/decorators/http-methods/from-query.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/from-query.decorator.js +21 -0
- package/controllers/decorators/http-methods/get.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/get.decorator.js +16 -0
- package/controllers/decorators/http-methods/http-req.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/http-req.decorator.js +10 -0
- package/controllers/decorators/http-methods/index.d.ts +12 -0
- package/controllers/decorators/http-methods/index.js +28 -0
- package/controllers/decorators/http-methods/patch.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/patch.decorator.js +16 -0
- package/controllers/decorators/http-methods/post.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/post.decorator.js +16 -0
- package/controllers/decorators/http-methods/put.decorator.d.ts +1 -0
- package/controllers/decorators/http-methods/put.decorator.js +16 -0
- package/controllers/decorators/http-methods/response-type.decorator.d.ts +6 -0
- package/controllers/decorators/http-methods/response-type.decorator.js +19 -0
- package/controllers/decorators/index.d.ts +5 -0
- package/controllers/decorators/index.js +21 -0
- package/controllers/decorators/no-auth.decorator.d.ts +1 -0
- package/controllers/decorators/no-auth.decorator.js +11 -0
- package/controllers/decorators/request-context.decorator.d.ts +1 -0
- package/controllers/decorators/request-context.decorator.js +11 -0
- package/controllers/decorators/session.decorator.d.ts +1 -0
- package/controllers/decorators/session.decorator.js +10 -0
- package/controllers/index.d.ts +2 -0
- package/controllers/index.js +18 -0
- package/controllers/interfaces/action-options.d.ts +31 -0
- package/controllers/interfaces/action-options.js +2 -0
- package/controllers/interfaces/content-options.d.ts +5 -0
- package/controllers/interfaces/content-options.js +2 -0
- package/controllers/interfaces/controller-object.d.ts +7 -0
- package/controllers/interfaces/controller-object.js +2 -0
- package/controllers/interfaces/controller-options.d.ts +4 -0
- package/controllers/interfaces/controller-options.js +2 -0
- package/controllers/interfaces/controller-property.d.ts +34 -0
- package/controllers/interfaces/controller-property.js +2 -0
- package/controllers/interfaces/enum/index.d.ts +1 -0
- package/controllers/interfaces/enum/index.js +17 -0
- package/controllers/interfaces/enum/request-interceptor.d.ts +3 -0
- package/controllers/interfaces/enum/request-interceptor.js +6 -0
- package/controllers/interfaces/get-only-data.d.ts +3 -0
- package/controllers/interfaces/get-only-data.js +2 -0
- package/controllers/interfaces/index.d.ts +9 -0
- package/controllers/interfaces/index.js +25 -0
- package/controllers/interfaces/on-before-validation-data.d.ts +4 -0
- package/controllers/interfaces/on-before-validation-data.js +2 -0
- package/controllers/interfaces/response-options.d.ts +5 -0
- package/controllers/interfaces/response-options.js +3 -0
- package/controllers/services/default-action-builder.d.ts +14 -0
- package/controllers/services/default-action-builder.js +166 -0
- package/controllers/services/restful-action-builder.d.ts +11 -0
- package/controllers/services/restful-action-builder.js +132 -0
- package/core/core.controller.d.ts +41 -0
- package/core/core.controller.js +208 -0
- package/core/functions/bootstrap.d.ts +3 -0
- package/core/functions/bootstrap.js +13 -0
- package/core/functions/create-action.d.ts +2 -0
- package/core/functions/create-action.js +18 -0
- package/core/functions/create-interceptor.d.ts +12 -0
- package/core/functions/create-interceptor.js +76 -0
- package/core/functions/format-message.d.ts +2 -0
- package/core/functions/format-message.js +7 -0
- package/core/functions/get-action-path.d.ts +1 -0
- package/core/functions/get-action-path.js +7 -0
- package/core/functions/get-env.d.ts +11 -0
- package/core/functions/get-env.js +19 -0
- package/core/functions/get-node-key.d.ts +1 -0
- package/core/functions/get-node-key.js +7 -0
- package/core/functions/get-other-types.d.ts +2 -0
- package/core/functions/get-other-types.js +19 -0
- package/core/index.d.ts +10 -0
- package/core/index.js +26 -0
- package/core/interfaces/action-def.d.ts +16 -0
- package/core/interfaces/action-def.js +2 -0
- package/core/interfaces/action-docs.d.ts +10 -0
- package/core/interfaces/action-docs.js +2 -0
- package/core/interfaces/core-options.d.ts +32 -0
- package/core/interfaces/core-options.js +2 -0
- package/core/interfaces/docs-options.d.ts +3 -0
- package/core/interfaces/docs-options.js +2 -0
- package/core/interfaces/enum/connect-type.d.ts +4 -0
- package/core/interfaces/enum/connect-type.js +8 -0
- package/core/interfaces/enum/index.d.ts +1 -0
- package/core/interfaces/enum/index.js +17 -0
- package/core/interfaces/format-message-options.d.ts +6 -0
- package/core/interfaces/format-message-options.js +2 -0
- package/core/interfaces/forms-options.d.ts +3 -0
- package/core/interfaces/forms-options.js +2 -0
- package/core/interfaces/index.d.ts +23 -0
- package/core/interfaces/index.js +39 -0
- package/core/interfaces/interceptor.d.ts +38 -0
- package/core/interfaces/interceptor.js +7 -0
- package/core/interfaces/locale-options.d.ts +5 -0
- package/core/interfaces/locale-options.js +2 -0
- package/core/interfaces/mapper.d.ts +3 -0
- package/core/interfaces/mapper.js +2 -0
- package/core/interfaces/object-docs.d.ts +5 -0
- package/core/interfaces/object-docs.js +3 -0
- package/core/interfaces/object.d.ts +15 -0
- package/core/interfaces/object.js +2 -0
- package/core/interfaces/pending-action.d.ts +10 -0
- package/core/interfaces/pending-action.js +2 -0
- package/core/interfaces/property-docs.d.ts +5 -0
- package/core/interfaces/property-docs.js +2 -0
- package/core/interfaces/property.d.ts +9 -0
- package/core/interfaces/property.js +2 -0
- package/core/interfaces/request-callback-handle.d.ts +3 -0
- package/core/interfaces/request-callback-handle.js +2 -0
- package/core/interfaces/request-callback.d.ts +4 -0
- package/core/interfaces/request-callback.js +2 -0
- package/core/interfaces/request-callbacks.d.ts +5 -0
- package/core/interfaces/request-callbacks.js +2 -0
- package/core/interfaces/request-context.d.ts +28 -0
- package/core/interfaces/request-context.js +2 -0
- package/core/interfaces/request-data.d.ts +6 -0
- package/core/interfaces/request-data.js +2 -0
- package/core/interfaces/router-options.d.ts +5 -0
- package/core/interfaces/router-options.js +2 -0
- package/core/interfaces/sanitizer.d.ts +4 -0
- package/core/interfaces/sanitizer.js +2 -0
- package/core/interfaces/storage-options.d.ts +6 -0
- package/core/interfaces/storage-options.js +2 -0
- package/core/interfaces/translations-options.d.ts +7 -0
- package/core/interfaces/translations-options.js +2 -0
- package/core/interfaces/transport-options.d.ts +3 -0
- package/core/interfaces/transport-options.js +2 -0
- package/core/services/context-builder.d.ts +15 -0
- package/core/services/context-builder.js +91 -0
- package/core/services/locale-service.d.ts +13 -0
- package/core/services/locale-service.js +71 -0
- package/core/services/node-control.service.d.ts +5 -0
- package/core/services/node-control.service.js +46 -0
- package/core/services/object-loader.d.ts +10 -0
- package/core/services/object-loader.js +27 -0
- package/core/services/request-executor.d.ts +9 -0
- package/core/services/request-executor.js +108 -0
- package/core/services/request-router.d.ts +15 -0
- package/core/services/request-router.js +127 -0
- package/database/contexts/index.d.ts +1 -0
- package/database/contexts/index.js +17 -0
- package/database/contexts/transaction-context.d.ts +6 -0
- package/database/contexts/transaction-context.js +5 -0
- package/database/database.controller.d.ts +20 -0
- package/database/database.controller.js +92 -0
- package/database/decorators/column.decorator.d.ts +72 -0
- package/database/decorators/column.decorator.js +9 -0
- package/database/decorators/entity.decorator.d.ts +2 -0
- package/database/decorators/entity.decorator.js +10 -0
- package/database/decorators/id-generated.decorator.d.ts +30 -0
- package/database/decorators/id-generated.decorator.js +76 -0
- package/database/decorators/id.decorator.d.ts +13 -0
- package/database/decorators/id.decorator.js +27 -0
- package/database/decorators/index.d.ts +13 -0
- package/database/decorators/index.js +29 -0
- package/database/decorators/inject-data-source.decorator.d.ts +1 -0
- package/database/decorators/inject-data-source.decorator.js +13 -0
- package/database/decorators/inject-repository.decorator.d.ts +2 -0
- package/database/decorators/inject-repository.decorator.js +17 -0
- package/database/decorators/protect-context-column.decorator.d.ts +3 -0
- package/database/decorators/protect-context-column.decorator.js +11 -0
- package/database/decorators/protect-entity.decorator.d.ts +4 -0
- package/database/decorators/protect-entity.decorator.js +12 -0
- package/database/decorators/protect-key-column.decorator.d.ts +2 -0
- package/database/decorators/protect-key-column.decorator.js +11 -0
- package/database/decorators/protect-target-column.decorator.d.ts +3 -0
- package/database/decorators/protect-target-column.decorator.js +11 -0
- package/database/decorators/protected-entity.decorator.d.ts +8 -0
- package/database/decorators/protected-entity.decorator.js +25 -0
- package/database/decorators/relation.decorator.d.ts +3 -0
- package/database/decorators/relation.decorator.js +13 -0
- package/database/decorators/virtual-column.decorator.d.ts +4 -0
- package/database/decorators/virtual-column.decorator.js +16 -0
- package/database/environment.d.ts +21 -0
- package/database/environment.js +25 -0
- package/database/exports/index.d.ts +1 -0
- package/database/exports/index.js +17 -0
- package/database/exports/typeorm.d.ts +1 -0
- package/database/exports/typeorm.js +9 -0
- package/database/extensions/select-query-builder.d.ts +11 -0
- package/database/extensions/select-query-builder.js +21 -0
- package/database/functions/column-decorator.d.ts +6 -0
- package/database/functions/column-decorator.js +31 -0
- package/database/functions/create-entity.d.ts +7 -0
- package/database/functions/create-entity.js +51 -0
- package/database/functions/create-new-class.d.ts +1 -0
- package/database/functions/create-new-class.js +16 -0
- package/database/functions/entity-decorator.d.ts +3 -0
- package/database/functions/entity-decorator.js +29 -0
- package/database/functions/execute-if-not-exists-column.d.ts +3 -0
- package/database/functions/execute-if-not-exists-column.js +16 -0
- package/database/functions/execute-if-not-exists-table.d.ts +3 -0
- package/database/functions/execute-if-not-exists-table.js +14 -0
- package/database/functions/find-relation.d.ts +3 -0
- package/database/functions/find-relation.js +43 -0
- package/database/functions/generate-id.d.ts +2 -0
- package/database/functions/generate-id.js +14 -0
- package/database/functions/get-column-type.d.ts +3 -0
- package/database/functions/get-column-type.js +18 -0
- package/database/functions/get-id-property.d.ts +3 -0
- package/database/functions/get-id-property.js +14 -0
- package/database/functions/get-name-by-strategy.d.ts +6 -0
- package/database/functions/get-name-by-strategy.js +9 -0
- package/database/functions/get-primitive-type.d.ts +3 -0
- package/database/functions/get-primitive-type.js +8 -0
- package/database/functions/get-relations.d.ts +2 -0
- package/database/functions/get-relations.js +12 -0
- package/database/functions/has-update.d.ts +2 -0
- package/database/functions/has-update.js +7 -0
- package/database/functions/inject-repository-handle.d.ts +2 -0
- package/database/functions/inject-repository-handle.js +36 -0
- package/database/functions/object-to-jsonb.d.ts +1 -0
- package/database/functions/object-to-jsonb.js +36 -0
- package/database/functions/register-column.d.ts +7 -0
- package/database/functions/register-column.js +16 -0
- package/database/functions/register-entity.d.ts +5 -0
- package/database/functions/register-entity.js +8 -0
- package/database/functions/register-generated-id.d.ts +6 -0
- package/database/functions/register-generated-id.js +8 -0
- package/database/functions/register-id.d.ts +7 -0
- package/database/functions/register-id.js +8 -0
- package/database/functions/register-relation.d.ts +8 -0
- package/database/functions/register-relation.js +12 -0
- package/database/functions/relation-decorator.d.ts +4 -0
- package/database/functions/relation-decorator.js +74 -0
- package/database/functions/use-protector.d.ts +2 -0
- package/database/functions/use-protector.js +10 -0
- package/database/functions/use-repository.d.ts +2 -0
- package/database/functions/use-repository.js +10 -0
- package/database/functions/use-transaction.d.ts +1 -0
- package/database/functions/use-transaction.js +12 -0
- package/database/index.d.ts +16 -0
- package/database/index.js +32 -0
- package/database/interfaces/base-columns-name-override.d.ts +6 -0
- package/database/interfaces/base-columns-name-override.js +2 -0
- package/database/interfaces/column-def.d.ts +26 -0
- package/database/interfaces/column-def.js +2 -0
- package/database/interfaces/connection.options.d.ts +15 -0
- package/database/interfaces/connection.options.js +2 -0
- package/database/interfaces/direact-alias.d.ts +1 -0
- package/database/interfaces/direact-alias.js +2 -0
- package/database/interfaces/entity-object.d.ts +15 -0
- package/database/interfaces/entity-object.js +2 -0
- package/database/interfaces/entity-options.d.ts +15 -0
- package/database/interfaces/entity-options.js +2 -0
- package/database/interfaces/entity-property.d.ts +19 -0
- package/database/interfaces/entity-property.js +2 -0
- package/database/interfaces/enum/column-def-type.d.ts +5 -0
- package/database/interfaces/enum/column-def-type.js +9 -0
- package/database/interfaces/enum/index.d.ts +5 -0
- package/database/interfaces/enum/index.js +21 -0
- package/database/interfaces/enum/naming-strategy-type.d.ts +5 -0
- package/database/interfaces/enum/naming-strategy-type.js +9 -0
- package/database/interfaces/enum/nano-id-alphabet-type.d.ts +14 -0
- package/database/interfaces/enum/nano-id-alphabet-type.js +18 -0
- package/database/interfaces/enum/order-by-direction.d.ts +4 -0
- package/database/interfaces/enum/order-by-direction.js +8 -0
- package/database/interfaces/enum/primary-strategy-type.d.ts +5 -0
- package/database/interfaces/enum/primary-strategy-type.js +9 -0
- package/database/interfaces/enum/relation-path-type.d.ts +4 -0
- package/database/interfaces/enum/relation-path-type.js +8 -0
- package/database/interfaces/execute-callback.d.ts +3 -0
- package/database/interfaces/execute-callback.js +2 -0
- package/database/interfaces/id-column-def.d.ts +6 -0
- package/database/interfaces/id-column-def.js +2 -0
- package/database/interfaces/index.d.ts +17 -0
- package/database/interfaces/index.js +33 -0
- package/database/interfaces/inverse-alias.d.ts +5 -0
- package/database/interfaces/inverse-alias.js +2 -0
- package/database/interfaces/nano-id-column-options.d.ts +12 -0
- package/database/interfaces/nano-id-column-options.js +2 -0
- package/database/interfaces/path.d.ts +43 -0
- package/database/interfaces/path.js +2 -0
- package/database/interfaces/protector.d.ts +51 -0
- package/database/interfaces/protector.js +2 -0
- package/database/interfaces/register-one-to-many-handle.d.ts +3 -0
- package/database/interfaces/register-one-to-many-handle.js +2 -0
- package/database/interfaces/register-one-to-many.d.ts +6 -0
- package/database/interfaces/register-one-to-many.js +2 -0
- package/database/interfaces/relation-def.d.ts +8 -0
- package/database/interfaces/relation-def.js +2 -0
- package/database/interfaces/relation-path.d.ts +10 -0
- package/database/interfaces/relation-path.js +2 -0
- package/database/interfaces/relation.options.d.ts +9 -0
- package/database/interfaces/relation.options.js +2 -0
- package/database/interfaces/repository.d.ts +8 -0
- package/database/interfaces/repository.js +2 -0
- package/database/migrations/1737637321043-UUIDVarcharMigration.d.ts +5 -0
- package/database/migrations/1737637321043-UUIDVarcharMigration.js +81 -0
- package/database/migrations/use-uuid-varchar-migration.d.ts +2 -0
- package/database/migrations/use-uuid-varchar-migration.js +10 -0
- package/database/services/paths-builder.d.ts +12 -0
- package/database/services/paths-builder.js +82 -0
- package/database/services/protect-builder.d.ts +59 -0
- package/database/services/protect-builder.js +523 -0
- package/database/services/repository.service.d.ts +14 -0
- package/database/services/repository.service.js +75 -0
- package/forms/entities/form.d.ts +8 -0
- package/forms/entities/form.js +61 -0
- package/forms/entities/property.d.ts +7 -0
- package/forms/entities/property.js +51 -0
- package/forms/forms.controller.d.ts +8 -0
- package/forms/forms.controller.js +59 -0
- package/forms/interfaces/form-item.d.ts +5 -0
- package/forms/interfaces/form-item.js +2 -0
- package/forms/interfaces/form.d.ts +8 -0
- package/forms/interfaces/form.js +2 -0
- package/forms/interfaces/property.d.ts +6 -0
- package/forms/interfaces/property.js +2 -0
- package/forms/migrations/1725969116484-CreateFormsTables.d.ts +5 -0
- package/forms/migrations/1725969116484-CreateFormsTables.js +38 -0
- package/forms/models/form-load.request.d.ts +3 -0
- package/forms/models/form-load.request.js +21 -0
- package/forms/queries/form.query.d.ts +1 -0
- package/forms/queries/form.query.js +9 -0
- package/forms/queries/property.query.d.ts +1 -0
- package/forms/queries/property.query.js +9 -0
- package/forms/requests/form.request.d.ts +14 -0
- package/forms/requests/form.request.js +83 -0
- package/forms/requests/property.request.d.ts +8 -0
- package/forms/requests/property.request.js +65 -0
- package/forms/services/form.service.d.ts +20 -0
- package/forms/services/form.service.js +64 -0
- package/forms/services/property.service.d.ts +6 -0
- package/forms/services/property.service.js +30 -0
- package/forms/utils/build-form-validator.d.ts +11 -0
- package/forms/utils/build-form-validator.js +30 -0
- package/forms/utils/get-form-items.d.ts +2 -0
- package/forms/utils/get-form-items.js +20 -0
- package/global.d.ts +52 -0
- package/global.js +50 -0
- package/http/http.controller.d.ts +25 -0
- package/http/http.controller.js +137 -0
- package/http/index.d.ts +2 -0
- package/http/index.js +18 -0
- package/http/interfaces/csrf.options.d.ts +11 -0
- package/http/interfaces/csrf.options.js +2 -0
- package/http/interfaces/http-request.d.ts +6 -0
- package/http/interfaces/http-request.js +2 -0
- package/http/interfaces/http-response.d.ts +4 -0
- package/http/interfaces/http-response.js +3 -0
- package/http/interfaces/http-settings.d.ts +13 -0
- package/http/interfaces/http-settings.js +2 -0
- package/http/interfaces/http-use.d.ts +6 -0
- package/http/interfaces/http-use.js +2 -0
- package/http/interfaces/index.d.ts +6 -0
- package/http/interfaces/index.js +22 -0
- package/http/interfaces/route.d.ts +10 -0
- package/http/interfaces/route.js +2 -0
- package/index.d.ts +44 -0
- package/index.js +65 -0
- package/jobs/constants.d.ts +2 -0
- package/jobs/constants.js +4 -0
- package/jobs/decorators/index.d.ts +1 -0
- package/jobs/decorators/index.js +17 -0
- package/jobs/decorators/job.decorator.d.ts +11 -0
- package/jobs/decorators/job.decorator.js +26 -0
- package/jobs/interfaces/index.d.ts +3 -0
- package/jobs/interfaces/index.js +19 -0
- package/jobs/interfaces/job-data.d.ts +13 -0
- package/jobs/interfaces/job-data.js +2 -0
- package/jobs/interfaces/job-executor.d.ts +3 -0
- package/jobs/interfaces/job-executor.js +2 -0
- package/jobs/interfaces/job-object.d.ts +6 -0
- package/jobs/interfaces/job-object.js +2 -0
- package/jobs/interfaces/job.options.d.ts +1 -0
- package/jobs/interfaces/job.options.js +2 -0
- package/jobs/jobs.controller.d.ts +18 -0
- package/jobs/jobs.controller.js +122 -0
- package/module/decorators/index.d.ts +4 -0
- package/module/decorators/index.js +20 -0
- package/module/decorators/module.decorator.d.ts +2 -0
- package/module/decorators/module.decorator.js +16 -0
- package/module/decorators/on-after-app-start.d.ts +1 -0
- package/module/decorators/on-after-app-start.js +11 -0
- package/module/decorators/on-after-database-init.d.ts +1 -0
- package/module/decorators/on-after-database-init.js +11 -0
- package/module/decorators/on-module-init.d.ts +1 -0
- package/module/decorators/on-module-init.js +11 -0
- package/module/index.d.ts +3 -0
- package/module/index.js +19 -0
- package/module/interfaces/index.d.ts +3 -0
- package/module/interfaces/index.js +19 -0
- package/module/interfaces/module-events.d.ts +5 -0
- package/module/interfaces/module-events.js +2 -0
- package/module/interfaces/module-object.d.ts +7 -0
- package/module/interfaces/module-object.js +2 -0
- package/module/interfaces/module-options.d.ts +8 -0
- package/module/interfaces/module-options.js +2 -0
- package/module/module.controller.d.ts +31 -0
- package/module/module.controller.js +159 -0
- package/package.json +70 -0
- package/query/constants.d.ts +2 -0
- package/query/constants.js +5 -0
- package/query/decorators/index.d.ts +1 -0
- package/query/decorators/index.js +17 -0
- package/query/decorators/query-content.decorator.d.ts +1 -0
- package/query/decorators/query-content.decorator.js +11 -0
- package/query/functions/add-join.d.ts +5 -0
- package/query/functions/add-join.js +37 -0
- package/query/functions/create-query-builder.d.ts +4 -0
- package/query/functions/create-query-builder.js +54 -0
- package/query/functions/create-query.d.ts +5 -0
- package/query/functions/create-query.js +96 -0
- package/query/functions/describe-query-filter.d.ts +7 -0
- package/query/functions/describe-query-filter.js +298 -0
- package/query/functions/execute-query.d.ts +11 -0
- package/query/functions/execute-query.js +74 -0
- package/query/functions/get-column-path.d.ts +2 -0
- package/query/functions/get-column-path.js +14 -0
- package/query/functions/get-native-select.d.ts +2 -0
- package/query/functions/get-native-select.js +9 -0
- package/query/functions/load-properties.d.ts +19 -0
- package/query/functions/load-properties.js +138 -0
- package/query/functions/map-query-property-to-column-name.d.ts +3 -0
- package/query/functions/map-query-property-to-column-name.js +17 -0
- package/query/functions/replace-property-key-to-column-name.d.ts +1 -0
- package/query/functions/replace-property-key-to-column-name.js +10 -0
- package/query/interfaces/index.d.ts +3 -0
- package/query/interfaces/index.js +19 -0
- package/query/interfaces/query-action-options.d.ts +14 -0
- package/query/interfaces/query-action-options.js +2 -0
- package/query/interfaces/query-object.d.ts +10 -0
- package/query/interfaces/query-object.js +2 -0
- package/query/interfaces/query.d.ts +54 -0
- package/query/interfaces/query.js +2 -0
- package/query/models/base-query-response.d.ts +12 -0
- package/query/models/base-query-response.js +41 -0
- package/query/services/query-action-builder.d.ts +14 -0
- package/query/services/query-action-builder.js +145 -0
- package/security/auth.controller.d.ts +8 -0
- package/security/auth.controller.js +68 -0
- package/security/constants.d.ts +0 -0
- package/security/constants.js +2 -0
- package/security/env.d.ts +7 -0
- package/security/env.js +8 -0
- package/security/functions/add-protect.d.ts +2 -0
- package/security/functions/add-protect.js +10 -0
- package/security/functions/add-protected.d.ts +3 -0
- package/security/functions/add-protected.js +23 -0
- package/security/functions/create-authorization.d.ts +2 -0
- package/security/functions/create-authorization.js +12 -0
- package/security/functions/find-auth-context.d.ts +3 -0
- package/security/functions/find-auth-context.js +25 -0
- package/security/functions/is-auth-enabled.d.ts +1 -0
- package/security/functions/is-auth-enabled.js +7 -0
- package/security/functions/use-auth.d.ts +1 -0
- package/security/functions/use-auth.js +8 -0
- package/security/index.d.ts +3 -0
- package/security/index.js +19 -0
- package/security/interceptors/index.d.ts +1 -0
- package/security/interceptors/index.js +17 -0
- package/security/interceptors/is-authorized.interceptor.d.ts +2 -0
- package/security/interceptors/is-authorized.interceptor.js +34 -0
- package/security/interfaces/auth-controller.d.ts +7 -0
- package/security/interfaces/auth-controller.js +2 -0
- package/security/interfaces/auth-object.d.ts +6 -0
- package/security/interfaces/auth-object.js +2 -0
- package/security/interfaces/auth-property.d.ts +4 -0
- package/security/interfaces/auth-property.js +2 -0
- package/security/interfaces/authorization-schema.d.ts +26 -0
- package/security/interfaces/authorization-schema.js +2 -0
- package/security/interfaces/index.d.ts +6 -0
- package/security/interfaces/index.js +22 -0
- package/security/interfaces/security-options.d.ts +8 -0
- package/security/interfaces/security-options.js +2 -0
- package/security/interfaces/ssl-certificate.d.ts +4 -0
- package/security/interfaces/ssl-certificate.js +2 -0
- package/security/models/auth-context-data.d.ts +4 -0
- package/security/models/auth-context-data.js +25 -0
- package/security/models/auth-context.d.ts +9 -0
- package/security/models/auth-context.js +48 -0
- package/security/models/auth-key.d.ts +7 -0
- package/security/models/auth-key.js +36 -0
- package/security/models/get-user-permissions-payload.d.ts +4 -0
- package/security/models/get-user-permissions-payload.js +21 -0
- package/security/models/get-user-permissions-response.d.ts +3 -0
- package/security/models/get-user-permissions-response.js +22 -0
- package/security/models/set-user-permissions-payload.d.ts +5 -0
- package/security/models/set-user-permissions-payload.js +26 -0
- package/security/requests/security.request.d.ts +14 -0
- package/security/requests/security.request.js +75 -0
- package/security/services/authorization.service.d.ts +11 -0
- package/security/services/authorization.service.js +60 -0
- package/storage/entities/metadata.entity.d.ts +19 -0
- package/storage/entities/metadata.entity.js +86 -0
- package/storage/entities/storage.entity.d.ts +6 -0
- package/storage/entities/storage.entity.js +32 -0
- package/storage/env.d.ts +9 -0
- package/storage/env.js +9 -0
- package/storage/functions/index.d.ts +1 -0
- package/storage/functions/index.js +17 -0
- package/storage/functions/set-storage-settings.d.ts +2 -0
- package/storage/functions/set-storage-settings.js +13 -0
- package/storage/index.d.ts +2 -0
- package/storage/index.js +18 -0
- package/storage/interfaces/directory-metadata.d.ts +6 -0
- package/storage/interfaces/directory-metadata.js +2 -0
- package/storage/interfaces/enum/gcp-credentials-type.d.ts +3 -0
- package/storage/interfaces/enum/gcp-credentials-type.js +7 -0
- package/storage/interfaces/enum/index.d.ts +3 -0
- package/storage/interfaces/enum/index.js +19 -0
- package/storage/interfaces/enum/metadata-type.d.ts +4 -0
- package/storage/interfaces/enum/metadata-type.js +8 -0
- package/storage/interfaces/enum/storage-type.d.ts +3 -0
- package/storage/interfaces/enum/storage-type.js +7 -0
- package/storage/interfaces/file-metadata.d.ts +12 -0
- package/storage/interfaces/file-metadata.js +2 -0
- package/storage/interfaces/index.d.ts +7 -0
- package/storage/interfaces/index.js +23 -0
- package/storage/interfaces/metadata.d.ts +18 -0
- package/storage/interfaces/metadata.js +2 -0
- package/storage/interfaces/storage-controller.d.ts +13 -0
- package/storage/interfaces/storage-controller.js +2 -0
- package/storage/interfaces/storage-settings.d.ts +16 -0
- package/storage/interfaces/storage-settings.js +2 -0
- package/storage/interfaces/storage.d.ts +7 -0
- package/storage/interfaces/storage.js +2 -0
- package/storage/services/routes.service.d.ts +31 -0
- package/storage/services/routes.service.js +384 -0
- package/storage/services/storage.service.d.ts +10 -0
- package/storage/services/storage.service.js +92 -0
- package/storage/storage.controller.d.ts +10 -0
- package/storage/storage.controller.js +49 -0
- package/tasks/constants.d.ts +12 -0
- package/tasks/constants.js +21 -0
- package/tasks/decorators/index.d.ts +1 -0
- package/tasks/decorators/index.js +17 -0
- package/tasks/decorators/task.decorator.d.ts +2 -0
- package/tasks/decorators/task.decorator.js +45 -0
- package/tasks/functions/create-task-message-find.d.ts +3 -0
- package/tasks/functions/create-task-message-find.js +23 -0
- package/tasks/functions/create-task-message-model.d.ts +3 -0
- package/tasks/functions/create-task-message-model.js +11 -0
- package/tasks/functions/create-task-message-receptor.d.ts +3 -0
- package/tasks/functions/create-task-message-receptor.js +23 -0
- package/tasks/functions/create-task-message-retry.d.ts +3 -0
- package/tasks/functions/create-task-message-retry.js +22 -0
- package/tasks/functions/create-task-message-schema.d.ts +182 -0
- package/tasks/functions/create-task-message-schema.js +20 -0
- package/tasks/functions/create-task-message-trigger.d.ts +2 -0
- package/tasks/functions/create-task-message-trigger.js +18 -0
- package/tasks/functions/create-task-naming.d.ts +2 -0
- package/tasks/functions/create-task-naming.js +31 -0
- package/tasks/functions/generate-entity-id.d.ts +1 -0
- package/tasks/functions/generate-entity-id.js +5 -0
- package/tasks/functions/get-check-table-exists-script.d.ts +1 -0
- package/tasks/functions/get-check-table-exists-script.js +12 -0
- package/tasks/functions/get-create-table-partition-script.d.ts +2 -0
- package/tasks/functions/get-create-table-partition-script.js +10 -0
- package/tasks/functions/get-create-table-script.d.ts +1 -0
- package/tasks/functions/get-create-table-script.js +22 -0
- package/tasks/functions/get-database-connection-name.d.ts +1 -0
- package/tasks/functions/get-database-connection-name.js +8 -0
- package/tasks/functions/get-database-uri.d.ts +1 -0
- package/tasks/functions/get-database-uri.js +8 -0
- package/tasks/functions/get-partitions-of-table-script.d.ts +1 -0
- package/tasks/functions/get-partitions-of-table-script.js +10 -0
- package/tasks/functions/get-pending-task-script.d.ts +2 -0
- package/tasks/functions/get-pending-task-script.js +19 -0
- package/tasks/functions/parse-task-message-search.d.ts +20 -0
- package/tasks/functions/parse-task-message-search.js +62 -0
- package/tasks/functions/throw-task-error.d.ts +1 -0
- package/tasks/functions/throw-task-error.js +7 -0
- package/tasks/index.d.ts +3 -0
- package/tasks/index.js +19 -0
- package/tasks/interfaces/index.d.ts +6 -0
- package/tasks/interfaces/index.js +22 -0
- package/tasks/interfaces/task-naming.d.ts +11 -0
- package/tasks/interfaces/task-naming.js +2 -0
- package/tasks/interfaces/task-object.d.ts +17 -0
- package/tasks/interfaces/task-object.js +2 -0
- package/tasks/interfaces/task-post-intercept.d.ts +8 -0
- package/tasks/interfaces/task-post-intercept.js +2 -0
- package/tasks/interfaces/task-runner.d.ts +6 -0
- package/tasks/interfaces/task-runner.js +2 -0
- package/tasks/interfaces/task-search-intercept.d.ts +4 -0
- package/tasks/interfaces/task-search-intercept.js +2 -0
- package/tasks/interfaces/task-settings.d.ts +15 -0
- package/tasks/interfaces/task-settings.js +2 -0
- package/tasks/models/task-error.d.ts +8 -0
- package/tasks/models/task-error.js +40 -0
- package/tasks/models/task-message-find.d.ts +3 -0
- package/tasks/models/task-message-find.js +21 -0
- package/tasks/models/task-message.d.ts +13 -0
- package/tasks/models/task-message.js +57 -0
- package/tasks/requests/task.request.d.ts +17 -0
- package/tasks/requests/task.request.js +71 -0
- package/tasks/services/task-manager.service.d.ts +10 -0
- package/tasks/services/task-manager.service.js +60 -0
- package/tasks/services/task-runner.service.d.ts +16 -0
- package/tasks/services/task-runner.service.js +88 -0
- package/tasks/tasks.controller.d.ts +19 -0
- package/tasks/tasks.controller.js +75 -0
- package/translations/entities/translation-config.entity.d.ts +9 -0
- package/translations/entities/translation-config.entity.js +65 -0
- package/translations/entities/translation-values.entity.d.ts +10 -0
- package/translations/entities/translation-values.entity.js +53 -0
- package/translations/env.d.ts +2 -0
- package/translations/env.js +7 -0
- package/translations/functions/check-can-use.d.ts +1 -0
- package/translations/functions/check-can-use.js +10 -0
- package/translations/functions/create-translation-config.d.ts +3 -0
- package/translations/functions/create-translation-config.js +19 -0
- package/translations/functions/create-translation-values.d.ts +3 -0
- package/translations/functions/create-translation-values.js +22 -0
- package/translations/functions/get-translation-config.d.ts +3 -0
- package/translations/functions/get-translation-config.js +14 -0
- package/translations/interfaces/translation-config.d.ts +8 -0
- package/translations/interfaces/translation-config.js +2 -0
- package/translations/interfaces/translation-values.d.ts +9 -0
- package/translations/interfaces/translation-values.js +2 -0
- package/translations/interfaces/translator-handle.d.ts +4 -0
- package/translations/interfaces/translator-handle.js +2 -0
- package/translations/migrations/1723760669185-CreateTranslationTables.d.ts +5 -0
- package/translations/migrations/1723760669185-CreateTranslationTables.js +43 -0
- package/translations/models/get-values.request.d.ts +5 -0
- package/translations/models/get-values.request.js +25 -0
- package/translations/models/get-values.response.d.ts +4 -0
- package/translations/models/get-values.response.js +20 -0
- package/translations/queries/translation-config.query.d.ts +1 -0
- package/translations/queries/translation-config.query.js +9 -0
- package/translations/queries/translation-values.query.d.ts +1 -0
- package/translations/queries/translation-values.query.js +16 -0
- package/translations/requests/translation.request.d.ts +16 -0
- package/translations/requests/translation.request.js +99 -0
- package/translations/services/translations.service.d.ts +11 -0
- package/translations/services/translations.service.js +56 -0
- package/translations/services/translator.service.d.ts +11 -0
- package/translations/services/translator.service.js +56 -0
- package/translations/translations.controller.d.ts +8 -0
- package/translations/translations.controller.js +57 -0
- package/transport/entities/transport-client.d.ts +12 -0
- package/transport/entities/transport-client.js +67 -0
- package/transport/entities/transport-gateway-status.d.ts +9 -0
- package/transport/entities/transport-gateway-status.js +51 -0
- package/transport/entities/transport-gateway.d.ts +6 -0
- package/transport/entities/transport-gateway.js +35 -0
- package/transport/environment.d.ts +4 -0
- package/transport/environment.js +6 -0
- package/transport/index.d.ts +2 -0
- package/transport/index.js +18 -0
- package/transport/interfaces/index.d.ts +1 -0
- package/transport/interfaces/index.js +17 -0
- package/transport/interfaces/transport-module-options.d.ts +14 -0
- package/transport/interfaces/transport-module-options.js +8 -0
- package/transport/transport.module.d.ts +5 -0
- package/transport/transport.module.js +38 -0
- package/web-socket/constants.d.ts +1 -0
- package/web-socket/constants.js +4 -0
- package/web-socket/functions/encode-message.d.ts +2 -0
- package/web-socket/functions/encode-message.js +14 -0
- package/web-socket/functions/get-fake-http-context.d.ts +26 -0
- package/web-socket/functions/get-fake-http-context.js +55 -0
- package/web-socket/functions/get-ip-address.d.ts +1 -0
- package/web-socket/functions/get-ip-address.js +23 -0
- package/web-socket/functions/parse-message.d.ts +1 -0
- package/web-socket/functions/parse-message.js +10 -0
- package/web-socket/index.d.ts +5 -0
- package/web-socket/index.js +21 -0
- package/web-socket/interfaces/client.d.ts +15 -0
- package/web-socket/interfaces/client.js +2 -0
- package/web-socket/interfaces/enum/client-type.d.ts +4 -0
- package/web-socket/interfaces/enum/client-type.js +8 -0
- package/web-socket/interfaces/enum/index.d.ts +3 -0
- package/web-socket/interfaces/enum/index.js +19 -0
- package/web-socket/interfaces/enum/message-type.d.ts +6 -0
- package/web-socket/interfaces/enum/message-type.js +10 -0
- package/web-socket/interfaces/enum/ws-connection-type.d.ts +4 -0
- package/web-socket/interfaces/enum/ws-connection-type.js +8 -0
- package/web-socket/interfaces/index.d.ts +4 -0
- package/web-socket/interfaces/index.js +20 -0
- package/web-socket/interfaces/message.d.ts +30 -0
- package/web-socket/interfaces/message.js +2 -0
- package/web-socket/interfaces/ws-connection.d.ts +4 -0
- package/web-socket/interfaces/ws-connection.js +2 -0
- package/web-socket/web-socket.controller.d.ts +25 -0
- package/web-socket/web-socket.controller.js +184 -0
- package/workers/functions/decode-message.d.ts +2 -0
- package/workers/functions/decode-message.js +7 -0
- package/workers/functions/dispatch-task.d.ts +2 -0
- package/workers/functions/dispatch-task.js +23 -0
- package/workers/functions/encode-message.d.ts +2 -0
- package/workers/functions/encode-message.js +7 -0
- package/workers/interfaces/enum/index.d.ts +1 -0
- package/workers/interfaces/enum/index.js +17 -0
- package/workers/interfaces/enum/worker-message-type.d.ts +6 -0
- package/workers/interfaces/enum/worker-message-type.js +10 -0
- package/workers/interfaces/index.d.ts +3 -0
- package/workers/interfaces/index.js +19 -0
- package/workers/interfaces/worker-data.d.ts +9 -0
- package/workers/interfaces/worker-data.js +2 -0
- package/workers/interfaces/worker-message.d.ts +20 -0
- package/workers/interfaces/worker-message.js +2 -0
- package/workers/workers.controller.d.ts +6 -0
- package/workers/workers.controller.js +72 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TranslationConfig = void 0;
|
|
13
|
+
const common_1 = require("@rockster/common");
|
|
14
|
+
const database_1 = require("../../database");
|
|
15
|
+
const class_pipe_1 = require("@rockster/class-pipe");
|
|
16
|
+
let TranslationConfig = class TranslationConfig {
|
|
17
|
+
};
|
|
18
|
+
exports.TranslationConfig = TranslationConfig;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_pipe_1.Expose)(),
|
|
21
|
+
(0, class_pipe_1.IsOptional)(),
|
|
22
|
+
(0, class_pipe_1.IsString)(),
|
|
23
|
+
(0, database_1.IdGenerated)('nanoid'),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], TranslationConfig.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_pipe_1.Expose)(),
|
|
28
|
+
(0, class_pipe_1.IsString)(),
|
|
29
|
+
(0, database_1.Column)({
|
|
30
|
+
unique: true
|
|
31
|
+
}),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], TranslationConfig.prototype, "referenceId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_pipe_1.Expose)(),
|
|
36
|
+
(0, class_pipe_1.IsOptional)(),
|
|
37
|
+
(0, class_pipe_1.IsString)(),
|
|
38
|
+
(0, class_pipe_1.IsArray)(),
|
|
39
|
+
(0, database_1.Column)({
|
|
40
|
+
type: 'jsonb',
|
|
41
|
+
default: '[]'
|
|
42
|
+
}),
|
|
43
|
+
__metadata("design:type", Array)
|
|
44
|
+
], TranslationConfig.prototype, "keys", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_pipe_1.Expose)(),
|
|
47
|
+
(0, class_pipe_1.IsOptional)(),
|
|
48
|
+
(0, class_pipe_1.IsString)(),
|
|
49
|
+
(0, class_pipe_1.IsArray)(),
|
|
50
|
+
(0, database_1.Column)({
|
|
51
|
+
type: 'jsonb',
|
|
52
|
+
default: '[]'
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], TranslationConfig.prototype, "locales", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_pipe_1.Expose)(),
|
|
58
|
+
(0, class_pipe_1.IsOptional)(),
|
|
59
|
+
(0, class_pipe_1.IsIn)(common_1.Locale),
|
|
60
|
+
(0, database_1.Column)({ type: 'varchar' }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], TranslationConfig.prototype, "default", void 0);
|
|
63
|
+
exports.TranslationConfig = TranslationConfig = __decorate([
|
|
64
|
+
(0, database_1.Entity)()
|
|
65
|
+
], TranslationConfig);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Locale, Dictionary } from "@rockster/common";
|
|
2
|
+
import { ITranslationValues } from "../interfaces/translation-values";
|
|
3
|
+
import { ITranslationConfig } from "../interfaces/translation-config";
|
|
4
|
+
export declare class TranslationValues implements ITranslationValues {
|
|
5
|
+
translationConfigId: string;
|
|
6
|
+
id: string;
|
|
7
|
+
locale: Locale;
|
|
8
|
+
values: Dictionary<string>;
|
|
9
|
+
translationConfig?: ITranslationConfig;
|
|
10
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TranslationValues = void 0;
|
|
13
|
+
const common_1 = require("@rockster/common");
|
|
14
|
+
const translation_config_entity_1 = require("./translation-config.entity");
|
|
15
|
+
const database_1 = require("../../database");
|
|
16
|
+
const class_pipe_1 = require("@rockster/class-pipe");
|
|
17
|
+
let TranslationValues = class TranslationValues {
|
|
18
|
+
};
|
|
19
|
+
exports.TranslationValues = TranslationValues;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_pipe_1.Expose)(),
|
|
22
|
+
(0, class_pipe_1.IsRequired)(),
|
|
23
|
+
(0, class_pipe_1.IsString)(),
|
|
24
|
+
(0, database_1.Relation)(() => translation_config_entity_1.TranslationConfig),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], TranslationValues.prototype, "translationConfigId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_pipe_1.Expose)(),
|
|
29
|
+
(0, class_pipe_1.IsString)(),
|
|
30
|
+
(0, class_pipe_1.IsOptional)(),
|
|
31
|
+
(0, database_1.IdGenerated)('nanoid'),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], TranslationValues.prototype, "id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_pipe_1.Expose)(),
|
|
36
|
+
(0, class_pipe_1.IsRequired)(),
|
|
37
|
+
(0, class_pipe_1.IsIn)(Object.values(common_1.Locale)),
|
|
38
|
+
(0, database_1.Column)({ type: 'varchar' }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], TranslationValues.prototype, "locale", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_pipe_1.Expose)({ ignoreType: true }),
|
|
43
|
+
(0, class_pipe_1.IsRequired)(),
|
|
44
|
+
(0, class_pipe_1.IsObject)(),
|
|
45
|
+
(0, database_1.Column)({
|
|
46
|
+
type: 'jsonb',
|
|
47
|
+
default: '{}'
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], TranslationValues.prototype, "values", void 0);
|
|
51
|
+
exports.TranslationValues = TranslationValues = __decorate([
|
|
52
|
+
(0, database_1.Entity)()
|
|
53
|
+
], TranslationValues);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkCanUse: () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkCanUse = void 0;
|
|
4
|
+
const env_1 = require("../env");
|
|
5
|
+
const checkCanUse = () => {
|
|
6
|
+
if (!env_1.env.activate) {
|
|
7
|
+
throw new Error('Translations disabled');
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
exports.checkCanUse = checkCanUse;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TranslationConfig } from "../entities/translation-config.entity";
|
|
2
|
+
import { ITranslationConfig } from "../interfaces/translation-config";
|
|
3
|
+
export declare const createTranslationConfig: (config: Omit<ITranslationConfig, "id">) => Promise<Omit<ITranslationConfig, "id"> & TranslationConfig>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTranslationConfig = void 0;
|
|
4
|
+
const use_repository_1 = require("../../database/functions/use-repository");
|
|
5
|
+
const translation_config_entity_1 = require("../entities/translation-config.entity");
|
|
6
|
+
const check_can_use_1 = require("./check-can-use");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const transaction_context_1 = require("../../database/contexts/transaction-context");
|
|
9
|
+
const createTranslationConfig = async (config) => {
|
|
10
|
+
(0, check_can_use_1.checkCanUse)();
|
|
11
|
+
const transactionContext = transaction_context_1.transactionContextStore.getStore();
|
|
12
|
+
const entityManager = transactionContext?.entityManager;
|
|
13
|
+
const repository = entityManager
|
|
14
|
+
? entityManager.getRepository(translation_config_entity_1.TranslationConfig)
|
|
15
|
+
: (0, use_repository_1.useRepository)(translation_config_entity_1.TranslationConfig);
|
|
16
|
+
(0, __1.generateEntityId)(repository.target, config);
|
|
17
|
+
return repository.save(config);
|
|
18
|
+
};
|
|
19
|
+
exports.createTranslationConfig = createTranslationConfig;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TranslationValues } from '../entities/translation-values.entity';
|
|
2
|
+
import { ITranslationValues } from '../interfaces/translation-values';
|
|
3
|
+
export declare const createTranslationValues: (values: Omit<ITranslationValues, "id">) => Promise<Omit<ITranslationValues, "id"> & TranslationValues>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTranslationValues = void 0;
|
|
7
|
+
const transaction_context_1 = require("../../database/contexts/transaction-context");
|
|
8
|
+
const generate_id_1 = __importDefault(require("../../database/functions/generate-id"));
|
|
9
|
+
const use_repository_1 = require("../../database/functions/use-repository");
|
|
10
|
+
const translation_values_entity_1 = require("../entities/translation-values.entity");
|
|
11
|
+
const check_can_use_1 = require("./check-can-use");
|
|
12
|
+
const createTranslationValues = async (values) => {
|
|
13
|
+
(0, check_can_use_1.checkCanUse)();
|
|
14
|
+
const transactionContext = transaction_context_1.transactionContextStore.getStore();
|
|
15
|
+
const entityManager = transactionContext?.entityManager;
|
|
16
|
+
const repository = entityManager
|
|
17
|
+
? entityManager.getRepository(translation_values_entity_1.TranslationValues)
|
|
18
|
+
: (0, use_repository_1.useRepository)(translation_values_entity_1.TranslationValues);
|
|
19
|
+
(0, generate_id_1.default)(repository.target, values);
|
|
20
|
+
return repository.save(values);
|
|
21
|
+
};
|
|
22
|
+
exports.createTranslationValues = createTranslationValues;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EntityManager, FindOneOptions } from "typeorm";
|
|
2
|
+
import { TranslationConfig } from "../entities/translation-config.entity";
|
|
3
|
+
export declare const getTranslationConfig: (options: FindOneOptions<TranslationConfig>, entityManager: EntityManager) => Promise<TranslationConfig>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTranslationConfig = void 0;
|
|
4
|
+
const use_repository_1 = require("../../database/functions/use-repository");
|
|
5
|
+
const translation_config_entity_1 = require("../entities/translation-config.entity");
|
|
6
|
+
const check_can_use_1 = require("./check-can-use");
|
|
7
|
+
const getTranslationConfig = async (options, entityManager) => {
|
|
8
|
+
(0, check_can_use_1.checkCanUse)();
|
|
9
|
+
const repository = entityManager
|
|
10
|
+
? entityManager.getRepository(translation_config_entity_1.TranslationConfig)
|
|
11
|
+
: (0, use_repository_1.useRepository)(translation_config_entity_1.TranslationConfig);
|
|
12
|
+
return repository.findOne(options);
|
|
13
|
+
};
|
|
14
|
+
exports.getTranslationConfig = getTranslationConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dictionary, Locale } from "@rockster/common";
|
|
2
|
+
import { ITranslationConfig } from "./translation-config";
|
|
3
|
+
export interface ITranslationValues {
|
|
4
|
+
id: string;
|
|
5
|
+
translationConfigId: string;
|
|
6
|
+
locale: Locale;
|
|
7
|
+
values: Dictionary<string>;
|
|
8
|
+
translationConfig?: ITranslationConfig;
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateTranslationTables1723760669185 = void 0;
|
|
4
|
+
const database_1 = require("../../database");
|
|
5
|
+
class CreateTranslationTables1723760669185 {
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await (0, database_1.executeIfNotExistsTable)('translation_config', queryRunner, async () => {
|
|
8
|
+
await queryRunner.query(`
|
|
9
|
+
create table translation_config
|
|
10
|
+
(
|
|
11
|
+
id varchar not null
|
|
12
|
+
constraint PK_8427c3ffc46a55b0a81aadcc94e primary key,
|
|
13
|
+
reference_id varchar not null,
|
|
14
|
+
keys jsonb default '[]'::jsonb not null,
|
|
15
|
+
locales jsonb default '[]'::jsonb not null,
|
|
16
|
+
"default" varchar not null
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
create unique index idx_unique_reference_id
|
|
20
|
+
on translation_config (reference_id);
|
|
21
|
+
`);
|
|
22
|
+
});
|
|
23
|
+
await (0, database_1.executeIfNotExistsTable)('translation_values', queryRunner, async () => {
|
|
24
|
+
await queryRunner.query(`
|
|
25
|
+
create table translation_values
|
|
26
|
+
(
|
|
27
|
+
translation_config_id varchar not null
|
|
28
|
+
constraint FK_0b56598e8fbae363ccf05f6199a
|
|
29
|
+
references translation_config,
|
|
30
|
+
id varchar not null
|
|
31
|
+
constraint PK_c7f4573ffed80531e93aab5cc55 primary key,
|
|
32
|
+
locale varchar not null,
|
|
33
|
+
values jsonb default '{}'::jsonb not null
|
|
34
|
+
);
|
|
35
|
+
`);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async down(queryRunner) {
|
|
39
|
+
await queryRunner.query(`drop table if exists translation_values;`);
|
|
40
|
+
await queryRunner.query(`drop table if exists translation_config;`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.CreateTranslationTables1723760669185 = CreateTranslationTables1723760669185;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetValuesRequest = void 0;
|
|
13
|
+
const class_pipe_1 = require("@rockster/class-pipe");
|
|
14
|
+
const common_1 = require("@rockster/common");
|
|
15
|
+
class GetValuesRequest {
|
|
16
|
+
}
|
|
17
|
+
exports.GetValuesRequest = GetValuesRequest;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_pipe_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], GetValuesRequest.prototype, "referenceId", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_pipe_1.IsIn)(Object.values(common_1.Locale)),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], GetValuesRequest.prototype, "locale", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetValuesResponse = void 0;
|
|
13
|
+
const class_pipe_1 = require("@rockster/class-pipe");
|
|
14
|
+
class GetValuesResponse {
|
|
15
|
+
}
|
|
16
|
+
exports.GetValuesResponse = GetValuesResponse;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_pipe_1.Expose)({ ignoreType: true }),
|
|
19
|
+
__metadata("design:type", Object)
|
|
20
|
+
], GetValuesResponse.prototype, "values", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TranslationConfigQuery: (options?: import("../..").QueryActionOptions) => (target: any, propertyKey: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TranslationConfigQuery = void 0;
|
|
4
|
+
const create_query_1 = require("../../query/functions/create-query");
|
|
5
|
+
const translation_config_entity_1 = require("../entities/translation-config.entity");
|
|
6
|
+
exports.TranslationConfigQuery = (0, create_query_1.createQuery)({
|
|
7
|
+
alias: 'translationConfig',
|
|
8
|
+
target: () => translation_config_entity_1.TranslationConfig
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TranslationValuesQuery: (options?: import("../..").QueryActionOptions) => (target: any, propertyKey: string) => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TranslationValuesQuery = void 0;
|
|
4
|
+
const create_query_1 = require("../../query/functions/create-query");
|
|
5
|
+
const translation_config_entity_1 = require("../entities/translation-config.entity");
|
|
6
|
+
const translation_values_entity_1 = require("../entities/translation-values.entity");
|
|
7
|
+
exports.TranslationValuesQuery = (0, create_query_1.createQuery)({
|
|
8
|
+
alias: 'translationValues',
|
|
9
|
+
target: () => translation_values_entity_1.TranslationValues,
|
|
10
|
+
paths: {
|
|
11
|
+
translationConfig: (0, create_query_1.directPath)({
|
|
12
|
+
alias: 'translationConfig',
|
|
13
|
+
target: () => translation_config_entity_1.TranslationConfig
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPostContent } from '../../command/interfaces';
|
|
2
|
+
import { TranslationConfig } from '../entities/translation-config.entity';
|
|
3
|
+
import { IQueryContent } from '../../query/interfaces';
|
|
4
|
+
import { GetValuesRequest } from '../models/get-values.request';
|
|
5
|
+
import { GetValuesResponse } from '../models/get-values.response';
|
|
6
|
+
import { TranslationsService } from '../services/translations.service';
|
|
7
|
+
import { ITranslationValues } from '../interfaces/translation-values';
|
|
8
|
+
export declare class TranslationRequest {
|
|
9
|
+
protected readonly translationsService: TranslationsService;
|
|
10
|
+
constructor(translationsService: TranslationsService);
|
|
11
|
+
postConfig(content: IPostContent<TranslationConfig>): Promise<TranslationConfig>;
|
|
12
|
+
postValues(content: IPostContent<ITranslationValues>): Promise<ITranslationValues>;
|
|
13
|
+
queryConfig(content: IQueryContent<TranslationConfig>): Promise<import("../../query/interfaces").Query<TranslationConfig>>;
|
|
14
|
+
queryValues(content: IQueryContent<TranslationConfig>): Promise<import("../../query/interfaces").Query<TranslationConfig>>;
|
|
15
|
+
getValues(content: GetValuesRequest): Promise<GetValuesResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.TranslationRequest = void 0;
|
|
16
|
+
const translation_config_entity_1 = require("../entities/translation-config.entity");
|
|
17
|
+
const execute_post_1 = require("../../command/functions/execute-post");
|
|
18
|
+
const translation_config_query_1 = require("../queries/translation-config.query");
|
|
19
|
+
const decorators_1 = require("../../query/decorators");
|
|
20
|
+
const translation_values_query_1 = require("../queries/translation-values.query");
|
|
21
|
+
const execute_query_1 = require("../../query/functions/execute-query");
|
|
22
|
+
const get_values_request_1 = require("../models/get-values.request");
|
|
23
|
+
const get_values_response_1 = require("../models/get-values.response");
|
|
24
|
+
const translations_service_1 = require("../services/translations.service");
|
|
25
|
+
const translation_values_entity_1 = require("../entities/translation-values.entity");
|
|
26
|
+
const decorators_2 = require("../../command/decorators");
|
|
27
|
+
const controllers_1 = require("../../controllers");
|
|
28
|
+
let TranslationRequest = class TranslationRequest {
|
|
29
|
+
constructor(translationsService) {
|
|
30
|
+
this.translationsService = translationsService;
|
|
31
|
+
}
|
|
32
|
+
async postConfig(content) {
|
|
33
|
+
return (0, execute_post_1.executePost)(content);
|
|
34
|
+
}
|
|
35
|
+
async postValues(content) {
|
|
36
|
+
return (0, execute_post_1.executePost)(content);
|
|
37
|
+
}
|
|
38
|
+
async queryConfig(content) {
|
|
39
|
+
return (0, execute_query_1.executeQuery)({ content: content });
|
|
40
|
+
}
|
|
41
|
+
async queryValues(content) {
|
|
42
|
+
return (0, execute_query_1.executeQuery)({ content: content });
|
|
43
|
+
}
|
|
44
|
+
async getValues(content) {
|
|
45
|
+
const values = await this
|
|
46
|
+
.translationsService
|
|
47
|
+
.getValues(content.referenceId, content.locale);
|
|
48
|
+
return {
|
|
49
|
+
values: values
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.TranslationRequest = TranslationRequest;
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, decorators_2.PostAction)({
|
|
56
|
+
type: () => translation_config_entity_1.TranslationConfig
|
|
57
|
+
}),
|
|
58
|
+
__param(0, (0, decorators_2.PostContent)()),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", [Object]),
|
|
61
|
+
__metadata("design:returntype", Promise)
|
|
62
|
+
], TranslationRequest.prototype, "postConfig", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, decorators_2.PostAction)({
|
|
65
|
+
type: () => translation_values_entity_1.TranslationValues
|
|
66
|
+
}),
|
|
67
|
+
__param(0, (0, decorators_2.PostContent)()),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [Object]),
|
|
70
|
+
__metadata("design:returntype", Promise)
|
|
71
|
+
], TranslationRequest.prototype, "postValues", null);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, translation_config_query_1.TranslationConfigQuery)(),
|
|
74
|
+
__param(0, (0, decorators_1.QueryContent)()),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [Object]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], TranslationRequest.prototype, "queryConfig", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, translation_values_query_1.TranslationValuesQuery)(),
|
|
81
|
+
__param(0, (0, decorators_1.QueryContent)()),
|
|
82
|
+
__metadata("design:type", Function),
|
|
83
|
+
__metadata("design:paramtypes", [Object]),
|
|
84
|
+
__metadata("design:returntype", Promise)
|
|
85
|
+
], TranslationRequest.prototype, "queryValues", null);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, controllers_1.Action)({
|
|
88
|
+
response: () => get_values_response_1.GetValuesResponse,
|
|
89
|
+
public: true
|
|
90
|
+
}),
|
|
91
|
+
__param(0, (0, controllers_1.ActionContent)()),
|
|
92
|
+
__metadata("design:type", Function),
|
|
93
|
+
__metadata("design:paramtypes", [get_values_request_1.GetValuesRequest]),
|
|
94
|
+
__metadata("design:returntype", Promise)
|
|
95
|
+
], TranslationRequest.prototype, "getValues", null);
|
|
96
|
+
exports.TranslationRequest = TranslationRequest = __decorate([
|
|
97
|
+
(0, controllers_1.Controller)(),
|
|
98
|
+
__metadata("design:paramtypes", [translations_service_1.TranslationsService])
|
|
99
|
+
], TranslationRequest);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Locale } from "@rockster/common";
|
|
2
|
+
import { TranslationValues } from "../entities/translation-values.entity";
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
import { CacheInstance } from "../../cache";
|
|
5
|
+
export declare class TranslationsService {
|
|
6
|
+
protected repository: Repository<TranslationValues>;
|
|
7
|
+
protected cache: CacheInstance;
|
|
8
|
+
getValues(referenceId: string, locale: Locale): Promise<{
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TranslationsService = void 0;
|
|
13
|
+
const class_injector_1 = require("@rockster/class-injector");
|
|
14
|
+
const translation_values_entity_1 = require("../entities/translation-values.entity");
|
|
15
|
+
const translation_config_entity_1 = require("../entities/translation-config.entity");
|
|
16
|
+
const database_1 = require("../../database");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const cache_1 = require("../../cache");
|
|
19
|
+
let TranslationsService = class TranslationsService {
|
|
20
|
+
async getValues(referenceId, locale) {
|
|
21
|
+
const values = await this
|
|
22
|
+
.repository
|
|
23
|
+
.createQueryBuilder('translationValues')
|
|
24
|
+
.leftJoinAndMapOne('translationValues.translationConfig', translation_config_entity_1.TranslationConfig, 'translationConfig', `translationValues.translation_config_id = translationConfig.id`)
|
|
25
|
+
.where(`
|
|
26
|
+
(translationConfig.reference_id = '${referenceId}'
|
|
27
|
+
AND translationValues.locale = '${locale}')
|
|
28
|
+
OR translationValues.locale = translationConfig.default
|
|
29
|
+
`)
|
|
30
|
+
.getMany();
|
|
31
|
+
const _default = values
|
|
32
|
+
.find((value) => {
|
|
33
|
+
return value.translationConfig?.default === value.locale;
|
|
34
|
+
}) || { values: {} };
|
|
35
|
+
const _requested = values
|
|
36
|
+
.find((value) => {
|
|
37
|
+
return value.locale === locale;
|
|
38
|
+
}) || { values: {} };
|
|
39
|
+
return {
|
|
40
|
+
..._default.values,
|
|
41
|
+
..._requested.values
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.TranslationsService = TranslationsService;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, database_1.InjectRepository)(() => translation_values_entity_1.TranslationValues),
|
|
48
|
+
__metadata("design:type", typeorm_1.Repository)
|
|
49
|
+
], TranslationsService.prototype, "repository", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, cache_1.InjectCache)(),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], TranslationsService.prototype, "cache", void 0);
|
|
54
|
+
exports.TranslationsService = TranslationsService = __decorate([
|
|
55
|
+
(0, class_injector_1.Injectable)()
|
|
56
|
+
], TranslationsService);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TranslationsService } from "./translations.service";
|
|
2
|
+
import { CacheClient } from "../../cache";
|
|
3
|
+
import { Dictionary, Locale } from "@rockster/common";
|
|
4
|
+
import { TranslatorHandle } from "../interfaces/translator-handle";
|
|
5
|
+
export declare class TranslatorService {
|
|
6
|
+
protected translationsService: TranslationsService;
|
|
7
|
+
protected cache: CacheClient;
|
|
8
|
+
constructor(translationsService: TranslationsService);
|
|
9
|
+
useValues(referenceId: string, locale: Locale): Promise<TranslatorHandle>;
|
|
10
|
+
protected getHandle(values: Dictionary<string>): TranslatorHandle;
|
|
11
|
+
}
|