oak-domain 6.0.0 → 6.1.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 +5 -1
- package/es/actions/action.d.ts +1 -1
- package/es/base-app-domain/EntityDict.d.ts +27 -0
- package/es/base-app-domain/LocalizedContent/Schema.d.ts +19 -0
- package/es/base-app-domain/LocalizedContent/Schema.js +1 -0
- package/es/base-app-domain/LocalizedContent/Storage.d.ts +3 -0
- package/es/base-app-domain/LocalizedContent/Storage.js +75 -0
- package/es/base-app-domain/LocalizedContent/Style.d.ts +3 -0
- package/es/base-app-domain/LocalizedContent/Style.js +12 -0
- package/es/base-app-domain/LocalizedContent/_baseSchema.d.ts +58 -0
- package/es/base-app-domain/Storage.js +2 -0
- package/es/base-app-domain/StyleDict.js +2 -0
- package/es/compiler/customChecks/i18n.js +4 -1
- package/es/compiler/customChecks/runner.d.ts +1 -1
- package/es/compiler/customChecks/runner.js +1 -1
- package/es/compiler/customChecks/types.d.ts +2 -1
- package/es/compiler/dependencyBuilder.d.ts +11 -2
- package/es/compiler/dependencyBuilder.js +188 -199
- package/es/compiler/entityDescEnum.d.ts +5 -0
- package/es/compiler/entityDescEnum.js +443 -0
- package/es/compiler/entitySource.d.ts +28 -0
- package/es/compiler/entitySource.js +521 -0
- package/es/compiler/localeBuilder.d.ts +7 -2
- package/es/compiler/localeBuilder.js +52 -56
- package/es/compiler/routerBuilder.d.ts +32 -3
- package/es/compiler/routerBuilder.js +157 -45
- package/es/compiler/schemaBuilder.d.ts +12 -2
- package/es/compiler/schemaBuilder.js +653 -148
- package/es/compiler/tscBuilder.d.ts +20 -2
- package/es/compiler/tscBuilder.js +231 -45
- package/es/context/BackendRuntimeContext.d.ts +6 -4
- package/es/context/BackendRuntimeContext.js +9 -1
- package/es/context/ContextComposer.d.ts +93 -0
- package/es/context/ContextComposer.js +353 -0
- package/es/context/SerializedData.d.ts +2 -1
- package/es/data/i18n.d.ts +1 -1
- package/es/data/i18n.js +1 -86
- package/es/data/i18n.json +86 -0
- package/es/entities/ActionAuth.d.ts +3 -3
- package/es/entities/I18n.d.ts +2 -2
- package/es/entities/LocalizedContent.d.ts +22 -0
- package/es/entities/LocalizedContent.js +101 -0
- package/es/entities/Log.d.ts +3 -3
- package/es/entities/Modi.d.ts +2 -2
- package/es/entities/ModiEntity.d.ts +3 -3
- package/es/entities/Oper.d.ts +5 -5
- package/es/entities/OperEntity.d.ts +3 -3
- package/es/entities/Path.d.ts +2 -2
- package/es/entities/Relation.d.ts +2 -2
- package/es/entities/RelationAuth.d.ts +3 -3
- package/es/entities/User.d.ts +4 -4
- package/es/entities/UserEntityClaim.d.ts +6 -6
- package/es/entities/UserEntityGrant.d.ts +2 -2
- package/es/entities/UserRelation.d.ts +4 -4
- package/es/store/AsyncRowStore.d.ts +2 -2
- package/es/store/AsyncRowStore.js +2 -2
- package/es/store/CascadeStore.d.ts +5 -3
- package/es/store/CascadeStore.js +56 -24
- package/es/store/IntrinsicCheckers.d.ts +1 -1
- package/es/store/IntrinsicCheckers.js +2 -2
- package/es/store/IntrinsicLogics.d.ts +1 -1
- package/es/store/RelationAuth.js +3 -3
- package/es/store/SyncRowStore.d.ts +1 -1
- package/es/store/SyncRowStore.js +1 -1
- package/es/store/TriggerExecutor.d.ts +6 -4
- package/es/store/TriggerExecutor.js +16 -4
- package/es/store/checker.d.ts +2 -2
- package/es/store/checker.js +45 -9
- package/es/store/filter.d.ts +3 -3
- package/es/store/filter.js +4 -4
- package/es/store/modi.d.ts +5 -5
- package/es/store/modi.js +4 -4
- package/es/store/projection.d.ts +1 -1
- package/es/store/relation.js +1 -1
- package/es/store/triggers.d.ts +4 -4
- package/es/store/triggers.js +2 -2
- package/es/timers/oper.d.ts +3 -3
- package/es/timers/oper.js +1 -1
- package/es/timers/vaccum.d.ts +3 -3
- package/es/types/Action.d.ts +1 -1
- package/es/types/AppLoader.d.ts +1 -1
- package/es/types/Aspect.d.ts +1 -1
- package/es/types/Auth.d.ts +2 -2
- package/es/types/Configuration.d.ts +7 -6
- package/es/types/Connector.d.ts +47 -1
- package/es/types/DataType.d.ts +2 -2
- package/es/types/Demand.d.ts +40 -6
- package/es/types/Endpoint.d.ts +17 -1
- package/es/types/Entity.d.ts +21 -4
- package/es/types/Entity.js +23 -0
- package/es/types/EntityDesc.d.ts +9 -8
- package/es/types/Environment.d.ts +17 -0
- package/es/types/Exception.d.ts +1 -1
- package/es/types/Exception.js +1 -1
- package/es/types/Expression.d.ts +13 -2
- package/es/types/Expression.js +36 -1
- package/es/types/Locale.d.ts +14 -1
- package/es/types/Locale.js +13 -1
- package/es/types/OakPackage.d.ts +29 -0
- package/es/types/OakPackage.js +30 -0
- package/es/types/Port.d.ts +1 -1
- package/es/types/RowStore.d.ts +9 -7
- package/es/types/Storage.d.ts +11 -3
- package/es/types/Storage.js +12 -1
- package/es/types/Style.d.ts +2 -2
- package/es/types/Sync.d.ts +3 -3
- package/es/types/Timer.d.ts +14 -2
- package/es/types/Trigger.d.ts +1 -1
- package/es/types/Watcher.d.ts +1 -1
- package/es/types/index.d.ts +1 -0
- package/es/types/index.js +1 -0
- package/es/utils/SimpleConnector.d.ts +30 -4
- package/es/utils/SimpleConnector.js +294 -21
- package/es/utils/concurrent.js +1 -1
- package/es/utils/decimal.d.ts +26 -0
- package/es/utils/decimal.js +87 -0
- package/es/utils/fetch/index.d.ts +1 -0
- package/es/utils/fetch/index.js +3 -0
- package/es/utils/fetch/index.mp.d.ts +3 -0
- package/es/utils/fetch/index.mp.js +280 -0
- package/es/utils/fetch/index.native.d.ts +1 -0
- package/es/utils/fetch/index.native.js +3 -0
- package/es/utils/fetch/index.web.d.ts +1 -0
- package/es/utils/fetch/index.web.js +3 -0
- package/es/utils/fetch/shared.d.ts +6 -0
- package/es/utils/fetch/shared.js +23 -0
- package/es/utils/localizedContent.d.ts +11 -0
- package/es/utils/localizedContent.js +346 -0
- package/es/utils/lodash.d.ts +1 -35
- package/es/utils/lodash.js +1 -52
- package/es/utils/module/combine.common.d.ts +3 -3
- package/es/utils/module/combine.common.js +2 -2
- package/es/utils/module/combine.dev.d.ts +2 -2
- package/es/utils/module/combine.dev.js +2 -2
- package/es/utils/module/combine.prod.d.ts +1 -1
- package/es/utils/module/combine.server.d.ts +2 -2
- package/es/utils/module/combine.server.js +2 -2
- package/es/utils/money.d.ts +2 -2
- package/es/utils/money.js +2 -2
- package/es/utils/operationResult.js +1 -1
- package/es/utils/projection.d.ts +3 -3
- package/es/utils/projection.js +1 -1
- package/es/utils/relationPath.d.ts +1 -1
- package/es/utils/relationPath.js +1 -1
- package/es/utils/row.d.ts +3 -3
- package/es/utils/row.js +2 -2
- package/es/utils/sseEndpoint.d.ts +41 -0
- package/es/utils/sseEndpoint.js +151 -0
- package/es/utils/toolkit.d.ts +28 -0
- package/es/utils/toolkit.js +220 -0
- package/es/utils/url/index.d.ts +1 -3
- package/es/utils/url/index.js +1 -1
- package/es/utils/url/index.mp.d.ts +16 -3
- package/es/utils/url/index.mp.js +2 -2
- package/es/utils/url/index.native.d.ts +13 -1
- package/es/utils/url/index.native.js +3 -1
- package/es/utils/url/index.web.d.ts +13 -1
- package/es/utils/url/index.web.js +3 -1
- package/es/utils/url/lightweight.d.ts +65 -0
- package/es/utils/url/lightweight.js +530 -0
- package/es/utils/url/urlObject.d.ts +16 -0
- package/es/utils/validate/id.d.ts +5 -0
- package/es/utils/validate/id.js +28 -0
- package/es/utils/validate/index.d.ts +4 -0
- package/es/utils/validate/index.js +4 -0
- package/es/utils/validate/mobile.d.ts +6 -0
- package/es/utils/validate/mobile.js +49 -0
- package/es/utils/validate/nationality.d.ts +14 -0
- package/es/utils/validate/nationality.data.d.ts +9 -0
- package/es/utils/validate/nationality.data.js +257 -0
- package/es/utils/validate/nationality.js +64 -0
- package/es/utils/validate/passport.d.ts +3 -0
- package/es/utils/validate/passport.js +19 -0
- package/es/utils/validator.d.ts +10 -8
- package/es/utils/validator.js +24 -40
- package/lib/actions/action.d.ts +1 -1
- package/lib/base-app-domain/EntityDict.d.ts +27 -0
- package/lib/base-app-domain/LocalizedContent/Schema.d.ts +19 -0
- package/lib/base-app-domain/LocalizedContent/Schema.js +4 -0
- package/lib/base-app-domain/LocalizedContent/Storage.d.ts +3 -0
- package/lib/base-app-domain/LocalizedContent/Storage.js +78 -0
- package/lib/base-app-domain/LocalizedContent/Style.d.ts +3 -0
- package/lib/base-app-domain/LocalizedContent/Style.js +15 -0
- package/lib/base-app-domain/LocalizedContent/_baseSchema.d.ts +58 -0
- package/lib/base-app-domain/Storage.js +26 -24
- package/lib/base-app-domain/StyleDict.js +10 -8
- package/lib/compiler/customChecks/i18n.js +5 -2
- package/lib/compiler/customChecks/runner.d.ts +1 -1
- package/lib/compiler/customChecks/types.d.ts +2 -1
- package/lib/compiler/dependencyBuilder.d.ts +11 -2
- package/lib/compiler/dependencyBuilder.js +237 -243
- package/lib/compiler/entityDescEnum.d.ts +5 -0
- package/lib/compiler/entityDescEnum.js +450 -0
- package/lib/compiler/entitySource.d.ts +28 -0
- package/lib/compiler/entitySource.js +529 -0
- package/lib/compiler/localeBuilder.d.ts +7 -2
- package/lib/compiler/localeBuilder.js +52 -56
- package/lib/compiler/routerBuilder.d.ts +32 -3
- package/lib/compiler/routerBuilder.js +160 -48
- package/lib/compiler/schemaBuilder.d.ts +12 -2
- package/lib/compiler/schemaBuilder.js +855 -350
- package/lib/compiler/tscBuilder.d.ts +20 -2
- package/lib/compiler/tscBuilder.js +217 -37
- package/lib/context/BackendRuntimeContext.d.ts +6 -4
- package/lib/context/BackendRuntimeContext.js +10 -3
- package/lib/context/ContextComposer.d.ts +93 -0
- package/lib/context/ContextComposer.js +361 -0
- package/lib/context/SerializedData.d.ts +2 -1
- package/lib/data/i18n.d.ts +1 -1
- package/lib/data/i18n.js +1 -86
- package/lib/data/i18n.json +86 -0
- package/lib/entities/ActionAuth.d.ts +3 -3
- package/lib/entities/I18n.d.ts +2 -2
- package/lib/entities/LocalizedContent.d.ts +22 -0
- package/lib/entities/LocalizedContent.js +104 -0
- package/lib/entities/Log.d.ts +3 -3
- package/lib/entities/Modi.d.ts +2 -2
- package/lib/entities/ModiEntity.d.ts +3 -3
- package/lib/entities/Oper.d.ts +5 -5
- package/lib/entities/OperEntity.d.ts +3 -3
- package/lib/entities/Path.d.ts +2 -2
- package/lib/entities/Relation.d.ts +2 -2
- package/lib/entities/RelationAuth.d.ts +3 -3
- package/lib/entities/User.d.ts +4 -4
- package/lib/entities/UserEntityClaim.d.ts +6 -6
- package/lib/entities/UserEntityGrant.d.ts +2 -2
- package/lib/entities/UserRelation.d.ts +4 -4
- package/lib/store/AsyncRowStore.d.ts +2 -2
- package/lib/store/AsyncRowStore.js +6 -7
- package/lib/store/CascadeStore.d.ts +5 -3
- package/lib/store/CascadeStore.js +101 -70
- package/lib/store/IntrinsicCheckers.d.ts +1 -1
- package/lib/store/IntrinsicCheckers.js +12 -13
- package/lib/store/IntrinsicLogics.d.ts +1 -1
- package/lib/store/RelationAuth.js +42 -43
- package/lib/store/SyncRowStore.d.ts +1 -1
- package/lib/store/SyncRowStore.js +4 -5
- package/lib/store/TriggerExecutor.d.ts +6 -4
- package/lib/store/TriggerExecutor.js +39 -28
- package/lib/store/checker.d.ts +2 -2
- package/lib/store/checker.js +55 -20
- package/lib/store/filter.d.ts +3 -3
- package/lib/store/filter.js +47 -48
- package/lib/store/modi.d.ts +5 -5
- package/lib/store/modi.js +5 -6
- package/lib/store/projection.d.ts +1 -1
- package/lib/store/relation.js +4 -5
- package/lib/store/triggers.d.ts +4 -4
- package/lib/store/triggers.js +13 -14
- package/lib/timers/oper.d.ts +3 -3
- package/lib/timers/vaccum.d.ts +3 -3
- package/lib/types/Action.d.ts +1 -1
- package/lib/types/AppLoader.d.ts +1 -1
- package/lib/types/Aspect.d.ts +1 -1
- package/lib/types/Auth.d.ts +2 -2
- package/lib/types/Configuration.d.ts +7 -6
- package/lib/types/Connector.d.ts +47 -1
- package/lib/types/DataType.d.ts +2 -2
- package/lib/types/Demand.d.ts +40 -6
- package/lib/types/Endpoint.d.ts +17 -1
- package/lib/types/Entity.d.ts +21 -4
- package/lib/types/Entity.js +27 -0
- package/lib/types/EntityDesc.d.ts +9 -8
- package/lib/types/Environment.d.ts +17 -0
- package/lib/types/Exception.d.ts +1 -1
- package/lib/types/Exception.js +2 -2
- package/lib/types/Expression.d.ts +13 -2
- package/lib/types/Expression.js +40 -5
- package/lib/types/Locale.d.ts +14 -1
- package/lib/types/Locale.js +14 -0
- package/lib/types/OakPackage.d.ts +29 -0
- package/lib/types/OakPackage.js +36 -0
- package/lib/types/Port.d.ts +1 -1
- package/lib/types/RowStore.d.ts +9 -7
- package/lib/types/Storage.d.ts +11 -3
- package/lib/types/Storage.js +13 -0
- package/lib/types/Style.d.ts +2 -2
- package/lib/types/Sync.d.ts +3 -3
- package/lib/types/Timer.d.ts +14 -2
- package/lib/types/Trigger.d.ts +1 -1
- package/lib/types/Watcher.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/utils/SimpleConnector.d.ts +30 -4
- package/lib/utils/SimpleConnector.js +297 -24
- package/lib/utils/concurrent.js +4 -5
- package/lib/utils/decimal.d.ts +26 -0
- package/lib/utils/decimal.js +112 -0
- package/lib/utils/fetch/index.d.ts +1 -0
- package/lib/utils/fetch/index.js +6 -0
- package/lib/utils/fetch/index.mp.d.ts +3 -0
- package/lib/utils/fetch/index.mp.js +285 -0
- package/lib/utils/fetch/index.native.d.ts +1 -0
- package/lib/utils/fetch/index.native.js +6 -0
- package/lib/utils/fetch/index.web.d.ts +1 -0
- package/lib/utils/fetch/index.web.js +6 -0
- package/lib/utils/fetch/shared.d.ts +6 -0
- package/lib/utils/fetch/shared.js +28 -0
- package/lib/utils/localizedContent.d.ts +11 -0
- package/lib/utils/localizedContent.js +352 -0
- package/lib/utils/lodash.d.ts +1 -35
- package/lib/utils/lodash.js +1 -76
- package/lib/utils/module/combine.common.d.ts +3 -3
- package/lib/utils/module/combine.common.js +6 -7
- package/lib/utils/module/combine.dev.d.ts +2 -2
- package/lib/utils/module/combine.dev.js +19 -19
- package/lib/utils/module/combine.prod.d.ts +1 -1
- package/lib/utils/module/combine.server.d.ts +2 -2
- package/lib/utils/module/combine.server.js +19 -19
- package/lib/utils/money.d.ts +2 -2
- package/lib/utils/money.js +2 -2
- package/lib/utils/operationResult.js +4 -4
- package/lib/utils/projection.d.ts +3 -3
- package/lib/utils/relationPath.d.ts +1 -1
- package/lib/utils/relationPath.js +10 -11
- package/lib/utils/row.d.ts +3 -3
- package/lib/utils/row.js +4 -5
- package/lib/utils/sseEndpoint.d.ts +41 -0
- package/lib/utils/sseEndpoint.js +156 -0
- package/lib/utils/toolkit.d.ts +28 -0
- package/lib/utils/toolkit.js +253 -0
- package/lib/utils/url/index.d.ts +1 -3
- package/lib/utils/url/index.js +3 -1
- package/lib/utils/url/index.mp.d.ts +16 -3
- package/lib/utils/url/index.mp.js +6 -4
- package/lib/utils/url/index.native.d.ts +13 -1
- package/lib/utils/url/index.native.js +5 -1
- package/lib/utils/url/index.web.d.ts +13 -1
- package/lib/utils/url/index.web.js +5 -1
- package/lib/utils/url/lightweight.d.ts +65 -0
- package/lib/utils/url/lightweight.js +535 -0
- package/lib/utils/url/urlObject.d.ts +16 -0
- package/lib/utils/url/urlObject.js +2 -0
- package/lib/utils/url/whatwg-url/lib/URL-impl.d.ts +8 -15
- package/lib/utils/url/whatwg-url/lib/infra.js +5 -4
- package/lib/utils/url/whatwg-url/lib/urlencoded.d.ts +3 -1
- package/lib/utils/url/whatwg-url/lib/utils.d.ts +1 -1
- package/lib/utils/validate/id.d.ts +5 -0
- package/lib/utils/validate/id.js +35 -0
- package/lib/utils/validate/index.d.ts +4 -0
- package/lib/utils/validate/index.js +7 -0
- package/lib/utils/validate/mobile.d.ts +6 -0
- package/lib/utils/validate/mobile.js +57 -0
- package/lib/utils/validate/nationality.d.ts +14 -0
- package/lib/utils/validate/nationality.data.d.ts +9 -0
- package/lib/utils/validate/nationality.data.js +260 -0
- package/lib/utils/validate/nationality.js +76 -0
- package/lib/utils/validate/passport.d.ts +3 -0
- package/lib/utils/validate/passport.js +24 -0
- package/lib/utils/validator.d.ts +10 -8
- package/lib/utils/validator.js +38 -42
- package/package.json +19 -9
- package/es/utils/url/whatwg-url/index.d.ts +0 -3
- package/es/utils/url/whatwg-url/index.js +0 -12
- package/es/utils/url/whatwg-url/lib/URL-impl.d.ts +0 -27
- package/es/utils/url/whatwg-url/lib/URL-impl.js +0 -172
- package/es/utils/url/whatwg-url/lib/URL.js +0 -295
- package/es/utils/url/whatwg-url/lib/URLSearchParams-impl.d.ts +0 -19
- package/es/utils/url/whatwg-url/lib/URLSearchParams-impl.js +0 -123
- package/es/utils/url/whatwg-url/lib/URLSearchParams.js +0 -423
- package/es/utils/url/whatwg-url/lib/infra.d.ts +0 -12
- package/es/utils/url/whatwg-url/lib/infra.js +0 -19
- package/es/utils/url/whatwg-url/lib/url-state-machine.d.ts +0 -24
- package/es/utils/url/whatwg-url/lib/url-state-machine.js +0 -1228
- package/es/utils/url/whatwg-url/lib/urlencoded.d.ts +0 -14
- package/es/utils/url/whatwg-url/lib/urlencoded.js +0 -160
- package/es/utils/url/whatwg-url/lib/utils.d.ts +0 -37
- package/es/utils/url/whatwg-url/lib/utils.js +0 -99
- package/lib/store/diffSchema.d.ts +0 -1
- package/lib/utils/url/whatwg-url/index.d.ts +0 -3
- package/lib/utils/url/whatwg-url/index.js +0 -16
- package/lib/utils/url/whatwg-url/lib/URL-impl.js +0 -175
- package/lib/utils/url/whatwg-url/lib/URL.d.ts +0 -1
- package/lib/utils/url/whatwg-url/lib/URL.js +0 -298
- package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.d.ts +0 -19
- package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.js +0 -126
- package/lib/utils/url/whatwg-url/lib/URLSearchParams.d.ts +0 -1
- package/lib/utils/url/whatwg-url/lib/URLSearchParams.js +0 -426
- package/lib/utils/url/whatwg-url/lib/infra.d.ts +0 -12
- package/lib/utils/url/whatwg-url/lib/url-state-machine.d.ts +0 -24
- package/lib/utils/url/whatwg-url/lib/url-state-machine.js +0 -1238
- package/lib/utils/url/whatwg-url/lib/urlencoded.js +0 -162
- package/lib/utils/url/whatwg-url/lib/utils.js +0 -101
- package/src/entities/ActionAuth.ts +0 -50
- package/src/entities/I18n.ts +0 -53
- package/src/entities/Log.ts +0 -62
- package/src/entities/Modi.ts +0 -107
- package/src/entities/ModiEntity.ts +0 -35
- package/src/entities/Oper.ts +0 -115
- package/src/entities/OperEntity.ts +0 -36
- package/src/entities/Path.ts +0 -56
- package/src/entities/Relation.ts +0 -53
- package/src/entities/RelationAuth.ts +0 -53
- package/src/entities/User.ts +0 -85
- package/src/entities/UserEntityClaim.ts +0 -41
- package/src/entities/UserEntityGrant.ts +0 -33
- package/src/entities/UserRelation.ts +0 -60
- /package/es/{utils/url/whatwg-url/lib/URL.d.ts → base-app-domain/LocalizedContent/_baseSchema.js} +0 -0
- /package/es/utils/url/{whatwg-url/lib/URLSearchParams.d.ts → urlObject.js} +0 -0
- /package/lib/{store/diffSchema.js → base-app-domain/LocalizedContent/_baseSchema.js} +0 -0
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = combineModuleServer;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const combine_common_1 = tslib_1.__importDefault(require("./combine.common"));
|
|
6
|
-
const
|
|
7
|
-
const assert_1 =
|
|
6
|
+
const toolkit_1 = require("../../utils/toolkit");
|
|
7
|
+
const assert_1 = require("../assert");
|
|
8
8
|
function combineModuleServer(...modules) {
|
|
9
9
|
const { checkers, common } = (0, combine_common_1.default)(...modules);
|
|
10
10
|
const others = modules.map((module) => ({
|
|
@@ -18,33 +18,33 @@ function combineModuleServer(...modules) {
|
|
|
18
18
|
data: require(`${module}/lib/data`).default,
|
|
19
19
|
})).reduce((prev, current, index) => {
|
|
20
20
|
const check = (module, name) => {
|
|
21
|
-
(0, assert_1.
|
|
22
|
-
(0, assert_1.
|
|
23
|
-
(0, assert_1.
|
|
24
|
-
(0, assert_1.
|
|
25
|
-
(0, assert_1.
|
|
26
|
-
(0, assert_1.
|
|
27
|
-
(0, assert_1.
|
|
28
|
-
(0, assert_1.
|
|
21
|
+
(0, assert_1.assert)(typeof module.aspectDict === 'object', `${name}模块中的aspectDict不是对象`);
|
|
22
|
+
(0, assert_1.assert)(typeof module.data === 'object', `${name}模块中的data不是对象`);
|
|
23
|
+
(0, assert_1.assert)(module.exportations instanceof Array, `${name}模块中的exportations不是数组`);
|
|
24
|
+
(0, assert_1.assert)(module.importations instanceof Array, `${name}模块中的importations不是数组`);
|
|
25
|
+
(0, assert_1.assert)(module.watchers instanceof Array, `${name}模块中的watchers不是数组`);
|
|
26
|
+
(0, assert_1.assert)(module.timers instanceof Array, `${name}模块中的timers不是数组`);
|
|
27
|
+
(0, assert_1.assert)(module.triggers instanceof Array, `${name}模块中的triggers不是数组`);
|
|
28
|
+
(0, assert_1.assert)(module.startRoutines instanceof Array, `${name}模块中的startRoutines不是数组`);
|
|
29
29
|
};
|
|
30
30
|
if (index === 1) {
|
|
31
31
|
check(prev, modules[0]);
|
|
32
32
|
}
|
|
33
33
|
check(current, modules[index]);
|
|
34
34
|
// aspectDict中不应当有同名对象
|
|
35
|
-
const its = (0,
|
|
35
|
+
const its = (0, toolkit_1.intersection)(Object.keys(prev.aspectDict), Object.keys(current.aspectDict));
|
|
36
36
|
if (its.length > 0) {
|
|
37
37
|
throw new Error(`模块${modules[index]}的aspectDict中,存在和其它模块同步的aspect【${its.join(',')}】,请正确处理`);
|
|
38
38
|
}
|
|
39
39
|
return {
|
|
40
|
-
aspectDict: (0,
|
|
41
|
-
data: (0,
|
|
42
|
-
importations: (0,
|
|
43
|
-
exportations: (0,
|
|
44
|
-
watchers: (0,
|
|
45
|
-
timers: (0,
|
|
46
|
-
startRoutines: (0,
|
|
47
|
-
triggers: (0,
|
|
40
|
+
aspectDict: (0, toolkit_1.mergeConcatArray)(prev.aspectDict, current.aspectDict),
|
|
41
|
+
data: (0, toolkit_1.mergeConcatArray)(prev.data, current.data),
|
|
42
|
+
importations: (0, toolkit_1.mergeConcatArray)(prev.importations, current.importations),
|
|
43
|
+
exportations: (0, toolkit_1.mergeConcatArray)(prev.exportations, current.exportations),
|
|
44
|
+
watchers: (0, toolkit_1.mergeConcatArray)(prev.watchers, current.watchers),
|
|
45
|
+
timers: (0, toolkit_1.merge)(prev.timers, current.timers),
|
|
46
|
+
startRoutines: (0, toolkit_1.merge)(prev.startRoutines, current.startRoutines),
|
|
47
|
+
triggers: (0, toolkit_1.merge)(prev.triggers, current.triggers),
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
return {
|
package/lib/utils/money.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const ToCent: (float: number) => number;
|
|
2
|
-
declare const ToYuan: (int: number) => number;
|
|
2
|
+
declare const ToYuan: (int: number | string) => number;
|
|
3
3
|
declare const StringToCent: (value: string, allowNegative?: true) => number | undefined;
|
|
4
|
-
declare const CentToString: (value: number, fixed?: number) => string | undefined;
|
|
4
|
+
declare const CentToString: (value: number | string, fixed?: number) => string | undefined;
|
|
5
5
|
declare const ThousandCont: (value: number | string, decimalPlaces?: number) => string;
|
|
6
6
|
export { ToCent, ToYuan, StringToCent, CentToString, ThousandCont };
|
package/lib/utils/money.js
CHANGED
|
@@ -6,7 +6,7 @@ const ToCent = (float) => {
|
|
|
6
6
|
};
|
|
7
7
|
exports.ToCent = ToCent;
|
|
8
8
|
const ToYuan = (int) => {
|
|
9
|
-
return Math.round(int) / 100;
|
|
9
|
+
return Math.round(Number(int)) / 100;
|
|
10
10
|
};
|
|
11
11
|
exports.ToYuan = ToYuan;
|
|
12
12
|
const StringToCent = (value, allowNegative) => {
|
|
@@ -17,7 +17,7 @@ const StringToCent = (value, allowNegative) => {
|
|
|
17
17
|
};
|
|
18
18
|
exports.StringToCent = StringToCent;
|
|
19
19
|
const CentToString = (value, fixed) => {
|
|
20
|
-
if (typeof value === 'number') {
|
|
20
|
+
if (typeof value === 'number' || typeof value === 'string') {
|
|
21
21
|
return ToYuan(value).toFixed(fixed);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mergeOperationResult = mergeOperationResult;
|
|
4
|
-
const
|
|
4
|
+
const toolkit_1 = require("../utils/toolkit");
|
|
5
5
|
function mergeOperationResult(result, toBeMerged) {
|
|
6
6
|
for (const entity in toBeMerged) {
|
|
7
7
|
for (const action in toBeMerged[entity]) {
|
|
8
|
-
const value = (0,
|
|
8
|
+
const value = (0, toolkit_1.get)(result, `${entity}.${action}`);
|
|
9
9
|
if (typeof value === 'number') {
|
|
10
|
-
(0,
|
|
10
|
+
(0, toolkit_1.set)(result, `${entity}.${action}`, value + toBeMerged[entity][action]);
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
(0,
|
|
13
|
+
(0, toolkit_1.set)(result, `${entity}.${action}`, toBeMerged[entity][action]);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EntityDict } from
|
|
2
|
-
import { EntityDict as BaseEntityDict } from
|
|
3
|
-
import { StorageSchema } from
|
|
1
|
+
import { EntityDict } from "../types/Entity";
|
|
2
|
+
import { EntityDict as BaseEntityDict } from "../base-app-domain";
|
|
3
|
+
import { StorageSchema } from "../types/Storage";
|
|
4
4
|
export declare function makeProjection<ED extends BaseEntityDict & EntityDict, T extends keyof ED>(entity: T, schema: StorageSchema<ED>): ED[T]["Projection"];
|
|
5
5
|
export declare function traverseProjection<ED extends BaseEntityDict & EntityDict, T extends keyof ED>(entity: T, schema: StorageSchema<ED>, projection: ED[T]['Projection'], callback: <T2 extends keyof ED>(entity2: T2, projection2: ED[T2]['Projection']) => void): void;
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.destructRelationPath = destructRelationPath;
|
|
4
4
|
exports.destructDirectUserPath = destructDirectUserPath;
|
|
5
5
|
exports.destructDirectPath = destructDirectPath;
|
|
6
|
-
const
|
|
7
|
-
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
|
+
const assert_1 = require("./assert");
|
|
8
7
|
const relation_1 = require("../store/relation");
|
|
9
8
|
/**
|
|
10
9
|
* 根据entity的相对path,以及定义的userRelationFilter,找到根结点对象上相应的userRelations
|
|
@@ -15,7 +14,7 @@ const relation_1 = require("../store/relation");
|
|
|
15
14
|
* @param recursive
|
|
16
15
|
*/
|
|
17
16
|
function destructRelationPath(schema, entity, path, relationFilter, recursive) {
|
|
18
|
-
(0, assert_1.
|
|
17
|
+
(0, assert_1.assert)(!recursive, 'recursive的情况还没处理,等跑出来再说, by Xc');
|
|
19
18
|
if (path === '') {
|
|
20
19
|
return {
|
|
21
20
|
projection: {
|
|
@@ -91,7 +90,7 @@ function destructRelationPath(schema, entity, path, relationFilter, recursive) {
|
|
|
91
90
|
};
|
|
92
91
|
}
|
|
93
92
|
else {
|
|
94
|
-
(0, assert_1.
|
|
93
|
+
(0, assert_1.assert)(rel instanceof Array);
|
|
95
94
|
const [e2] = rel;
|
|
96
95
|
const { projection, getData } = makeIter(e2, idx + 1);
|
|
97
96
|
return {
|
|
@@ -140,7 +139,7 @@ function destructDirectUserPath(schema, entity, path) {
|
|
|
140
139
|
* @returns
|
|
141
140
|
*/
|
|
142
141
|
function destructDirectPath(schema, entity, path) {
|
|
143
|
-
(0, assert_1.
|
|
142
|
+
(0, assert_1.assert)(path, '直接对象的路径最终要指向user对象,不可能为空');
|
|
144
143
|
const paths = path.split('.');
|
|
145
144
|
const makeIter = (e, idx) => {
|
|
146
145
|
const attr = paths[idx];
|
|
@@ -161,7 +160,7 @@ function destructDirectPath(schema, entity, path) {
|
|
|
161
160
|
data: d,
|
|
162
161
|
}];
|
|
163
162
|
}
|
|
164
|
-
(0, assert_1.
|
|
163
|
+
(0, assert_1.assert)(p === attr);
|
|
165
164
|
return [{
|
|
166
165
|
entity: attr,
|
|
167
166
|
data: {
|
|
@@ -186,7 +185,7 @@ function destructDirectPath(schema, entity, path) {
|
|
|
186
185
|
data: d,
|
|
187
186
|
}];
|
|
188
187
|
}
|
|
189
|
-
(0, assert_1.
|
|
188
|
+
(0, assert_1.assert)(p === attr);
|
|
190
189
|
return [{
|
|
191
190
|
entity: rel,
|
|
192
191
|
data: {
|
|
@@ -214,7 +213,7 @@ function destructDirectPath(schema, entity, path) {
|
|
|
214
213
|
}];
|
|
215
214
|
}
|
|
216
215
|
const ps = p.split('.');
|
|
217
|
-
(0, assert_1.
|
|
216
|
+
(0, assert_1.assert)(ps[0] === attr);
|
|
218
217
|
return d[attr] && getData(d[attr], ps.slice(1).join('.'));
|
|
219
218
|
}
|
|
220
219
|
},
|
|
@@ -236,14 +235,14 @@ function destructDirectPath(schema, entity, path) {
|
|
|
236
235
|
}];
|
|
237
236
|
}
|
|
238
237
|
const ps = p.split('.');
|
|
239
|
-
(0, assert_1.
|
|
238
|
+
(0, assert_1.assert)(ps[0] === attr);
|
|
240
239
|
return d[attr] && getData(d[attr], ps.slice(1).join('.'));
|
|
241
240
|
}
|
|
242
241
|
},
|
|
243
242
|
};
|
|
244
243
|
}
|
|
245
244
|
else {
|
|
246
|
-
(0, assert_1.
|
|
245
|
+
(0, assert_1.assert)(rel instanceof Array);
|
|
247
246
|
const [e2, fk] = rel;
|
|
248
247
|
const { projection, getData } = makeIter(e2, idx + 1);
|
|
249
248
|
return {
|
|
@@ -262,7 +261,7 @@ function destructDirectPath(schema, entity, path) {
|
|
|
262
261
|
}];
|
|
263
262
|
}
|
|
264
263
|
const ps = p.split('.');
|
|
265
|
-
(0, assert_1.
|
|
264
|
+
(0, assert_1.assert)(ps[0] === attr);
|
|
266
265
|
return d[attr] && d[attr].map(ele => getData(ele, ps.slice(1).join('.'))).flat().filter(ele => !!ele);
|
|
267
266
|
}
|
|
268
267
|
};
|
package/lib/utils/row.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityDict } from
|
|
2
|
-
import { EntityDict as BaseEntityDict } from
|
|
3
|
-
import { StorageSchema } from
|
|
1
|
+
import { EntityDict } from "../types/Entity";
|
|
2
|
+
import { EntityDict as BaseEntityDict } from "../base-app-domain";
|
|
3
|
+
import { StorageSchema } from "../types";
|
|
4
4
|
/**
|
|
5
5
|
* 比较两行是否完全相等
|
|
6
6
|
* @param schema
|
package/lib/utils/row.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compareRow = compareRow;
|
|
4
4
|
exports.compareRows = compareRows;
|
|
5
|
-
const
|
|
6
|
-
const lodash_1 = require("./lodash");
|
|
5
|
+
const toolkit_1 = require("./toolkit");
|
|
7
6
|
const relation_1 = require("../store/relation");
|
|
8
|
-
const assert_1 =
|
|
7
|
+
const assert_1 = require("./assert");
|
|
9
8
|
/**
|
|
10
9
|
* 比较两行是否完全相等
|
|
11
10
|
* @param schema
|
|
@@ -17,7 +16,7 @@ const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
|
17
16
|
function compareRow(schema, entity, row1, row2) {
|
|
18
17
|
const attrs1 = Object.keys(row1 || {}).filter(ele => !ele.startsWith('$$'));
|
|
19
18
|
const attrs2 = Object.keys(row2 || {}).filter(ele => !ele.startsWith('$$'));
|
|
20
|
-
if ((0,
|
|
19
|
+
if ((0, toolkit_1.difference)(attrs1, attrs2).length > 0) {
|
|
21
20
|
return false;
|
|
22
21
|
}
|
|
23
22
|
for (const attr of attrs1) {
|
|
@@ -41,7 +40,7 @@ function compareRow(schema, entity, row1, row2) {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
44
|
-
(0, assert_1.
|
|
43
|
+
(0, assert_1.assert)(rel instanceof Array);
|
|
45
44
|
// 如果两组对象一样但顺序不一样怎么办?暂时应该不用考虑这种情况,因为只有前台runningTree使用(by Xc)
|
|
46
45
|
if (!compareRows(schema, rel[0], row1[attr], row2[attr])) {
|
|
47
46
|
return false;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage } from 'http';
|
|
2
|
+
import { PassThrough } from 'stream';
|
|
3
|
+
import type { AsyncContext } from '../store/AsyncRowStore';
|
|
4
|
+
import type { EntityDict } from '../types/Entity';
|
|
5
|
+
import type { EntityDict as BaseEntityDict } from '../base-app-domain';
|
|
6
|
+
import type { FreeEndpoint } from '../types/Endpoint';
|
|
7
|
+
import { OakException } from '../types/Exception';
|
|
8
|
+
export type SSEEndpointServerEvent<T> = {
|
|
9
|
+
event?: string;
|
|
10
|
+
data: T;
|
|
11
|
+
id?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class SSEEndpointResponse<T = any> {
|
|
14
|
+
private stream;
|
|
15
|
+
private closed;
|
|
16
|
+
private done;
|
|
17
|
+
private doneCallbacks;
|
|
18
|
+
get body(): PassThrough;
|
|
19
|
+
onDone(callback: () => void | Promise<void>): () => boolean;
|
|
20
|
+
write(event: SSEEndpointServerEvent<T> | T): void;
|
|
21
|
+
runDoneCallbacks(): Promise<void>;
|
|
22
|
+
close(): Promise<void>;
|
|
23
|
+
end(): void;
|
|
24
|
+
error(error: any): void;
|
|
25
|
+
writeException(exception: OakException<any>): void;
|
|
26
|
+
private formatEvent;
|
|
27
|
+
private isEventObject;
|
|
28
|
+
}
|
|
29
|
+
export type MakeSSEEndpointOptions<ED extends EntityDict & BaseEntityDict, BackCxt extends AsyncContext<ED>, Params> = {
|
|
30
|
+
name: string;
|
|
31
|
+
params?: string[];
|
|
32
|
+
fn: (input: {
|
|
33
|
+
context: BackCxt;
|
|
34
|
+
params: Record<string, string>;
|
|
35
|
+
headers: IncomingHttpHeaders;
|
|
36
|
+
req: IncomingMessage;
|
|
37
|
+
body: Params;
|
|
38
|
+
response: SSEEndpointResponse;
|
|
39
|
+
}) => Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
export declare function makeSSEEndpoint<ED extends EntityDict & BaseEntityDict, BackCxt extends AsyncContext<ED>, Params = any>(options: MakeSSEEndpointOptions<ED, BackCxt, Params>): FreeEndpoint<ED, BackCxt>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SSEEndpointResponse = void 0;
|
|
4
|
+
exports.makeSSEEndpoint = makeSSEEndpoint;
|
|
5
|
+
const stream_1 = require("stream");
|
|
6
|
+
const Exception_1 = require("../types/Exception");
|
|
7
|
+
class SSEEndpointResponse {
|
|
8
|
+
stream = new stream_1.PassThrough();
|
|
9
|
+
closed = false;
|
|
10
|
+
done = false;
|
|
11
|
+
doneCallbacks = new Set();
|
|
12
|
+
get body() {
|
|
13
|
+
return this.stream;
|
|
14
|
+
}
|
|
15
|
+
onDone(callback) {
|
|
16
|
+
this.doneCallbacks.add(callback);
|
|
17
|
+
return () => this.doneCallbacks.delete(callback);
|
|
18
|
+
}
|
|
19
|
+
write(event) {
|
|
20
|
+
if (this.closed) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const packet = this.formatEvent(event);
|
|
24
|
+
this.stream.write(packet);
|
|
25
|
+
}
|
|
26
|
+
async runDoneCallbacks() {
|
|
27
|
+
if (this.done) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.done = true;
|
|
31
|
+
for (const callback of this.doneCallbacks) {
|
|
32
|
+
await callback();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async close() {
|
|
36
|
+
try {
|
|
37
|
+
await this.runDoneCallbacks();
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
this.end();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
end() {
|
|
44
|
+
if (this.closed) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.closed = true;
|
|
48
|
+
this.stream.end();
|
|
49
|
+
}
|
|
50
|
+
error(error) {
|
|
51
|
+
this.writeException((0, Exception_1.isOakException)(error) ? error : makeGeneralException(error));
|
|
52
|
+
}
|
|
53
|
+
writeException(exception) {
|
|
54
|
+
this.write({
|
|
55
|
+
event: 'error',
|
|
56
|
+
data: {
|
|
57
|
+
exception: exception.toString(),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
formatEvent(event) {
|
|
62
|
+
const normalized = this.isEventObject(event)
|
|
63
|
+
? event
|
|
64
|
+
: { event: 'message', data: event };
|
|
65
|
+
const lines = [];
|
|
66
|
+
if (normalized.id) {
|
|
67
|
+
lines.push(`id: ${normalized.id}`);
|
|
68
|
+
}
|
|
69
|
+
lines.push(`event: ${normalized.event || 'message'}`);
|
|
70
|
+
const data = JSON.stringify(normalized.data);
|
|
71
|
+
data.split(/\r?\n/).forEach((line) => lines.push(`data: ${line}`));
|
|
72
|
+
return `${lines.join('\n')}\n\n`;
|
|
73
|
+
}
|
|
74
|
+
isEventObject(event) {
|
|
75
|
+
return !!event
|
|
76
|
+
&& typeof event === 'object'
|
|
77
|
+
&& (Object.prototype.hasOwnProperty.call(event, 'event')
|
|
78
|
+
|| Object.prototype.hasOwnProperty.call(event, 'id'))
|
|
79
|
+
&& Object.prototype.hasOwnProperty.call(event, 'data');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.SSEEndpointResponse = SSEEndpointResponse;
|
|
83
|
+
function makeGeneralException(err) {
|
|
84
|
+
return new Exception_1.OakException(err instanceof Error ? err.message : String(err), 'oak-domain', err instanceof Error ? { name: err.name } : undefined);
|
|
85
|
+
}
|
|
86
|
+
async function deduceSSEException(err, context) {
|
|
87
|
+
if ((0, Exception_1.isOakException)(err)) {
|
|
88
|
+
return err;
|
|
89
|
+
}
|
|
90
|
+
if (context && err instanceof Error) {
|
|
91
|
+
try {
|
|
92
|
+
const exception = await context.tryDeduceException(err);
|
|
93
|
+
if (exception) {
|
|
94
|
+
return exception;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (deduceErr) {
|
|
98
|
+
return makeGeneralException(deduceErr);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return makeGeneralException(err);
|
|
102
|
+
}
|
|
103
|
+
function makeSSEEndpoint(options) {
|
|
104
|
+
return {
|
|
105
|
+
name: options.name,
|
|
106
|
+
params: options.params,
|
|
107
|
+
method: 'post',
|
|
108
|
+
type: 'free',
|
|
109
|
+
protocol: 'sse',
|
|
110
|
+
useConnector: true,
|
|
111
|
+
fn: async (buildContext, params, headers, req, body) => {
|
|
112
|
+
const response = new SSEEndpointResponse();
|
|
113
|
+
let context;
|
|
114
|
+
Promise.resolve().then(async () => {
|
|
115
|
+
try {
|
|
116
|
+
context = await buildContext();
|
|
117
|
+
await options.fn({
|
|
118
|
+
context,
|
|
119
|
+
params,
|
|
120
|
+
headers,
|
|
121
|
+
req,
|
|
122
|
+
body,
|
|
123
|
+
response,
|
|
124
|
+
});
|
|
125
|
+
await response.runDoneCallbacks();
|
|
126
|
+
await context.commit();
|
|
127
|
+
response.end();
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
const exception = await deduceSSEException(err, context);
|
|
131
|
+
response.writeException(exception);
|
|
132
|
+
if (context) {
|
|
133
|
+
try {
|
|
134
|
+
await context.rollback();
|
|
135
|
+
}
|
|
136
|
+
catch (rollbackErr) {
|
|
137
|
+
console.error(`SSE endpoint「${options.name}」rollback failed`, rollbackErr);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
response.end();
|
|
141
|
+
}
|
|
142
|
+
}).catch((err) => {
|
|
143
|
+
response.error(err);
|
|
144
|
+
response.end();
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
data: response.body,
|
|
148
|
+
headers: {
|
|
149
|
+
'Content-Type': 'text/event-stream; charset=utf-8',
|
|
150
|
+
'Cache-Control': 'no-cache, no-transform',
|
|
151
|
+
Connection: 'keep-alive',
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cloneDeep, flatten, identity, isEqual, uniq, upperFirst, debounce } from 'es-toolkit';
|
|
2
|
+
type PathSegment = string | number | symbol;
|
|
3
|
+
type PropertyPath = string | number | symbol | PathSegment[];
|
|
4
|
+
declare function assign<T extends object, U>(object: T, source: U): T & U;
|
|
5
|
+
declare function keys(object: object | null | undefined): string[];
|
|
6
|
+
declare function get<T = any, D = undefined>(object: unknown, path: PropertyPath, defaultValue?: D): T | D;
|
|
7
|
+
declare function result<T = any, D = undefined>(object: unknown, path: PropertyPath, defaultValue?: D): T | D;
|
|
8
|
+
declare function set<T extends object>(object: T, path: PropertyPath, value: unknown): T;
|
|
9
|
+
declare function unset(object: unknown, path: PropertyPath): boolean;
|
|
10
|
+
declare function pull<T>(array: T[], ...values: T[]): T[];
|
|
11
|
+
declare function pullAll<T>(array: T[], values: T[]): T[];
|
|
12
|
+
declare function first<T>(array?: ReadonlyArray<T> | null): T | undefined;
|
|
13
|
+
declare function difference<T>(array: T[], values: T[]): T[];
|
|
14
|
+
declare function differenceBy<T>(array: T[], values: T[], iteratee?: ((value: T) => PropertyKey) | PropertyPath): T[];
|
|
15
|
+
declare function intersection<T>(...arrays: T[][]): T[];
|
|
16
|
+
declare function intersectionBy<T>(array: T[], values: T[], iteratee?: ((value: T) => PropertyKey) | PropertyPath): T[];
|
|
17
|
+
declare function union<T>(...arrays: T[][]): T[];
|
|
18
|
+
declare function unionBy<T>(array: T[], values: T[], iteratee?: ((value: T) => PropertyKey) | PropertyPath): T[];
|
|
19
|
+
declare function uniqBy<T>(array: T[], iteratee?: ((value: T) => PropertyKey) | PropertyPath): T[];
|
|
20
|
+
declare function groupBy(array: ReadonlyArray<any> | null | undefined, iteratee?: ((value: any) => PropertyKey) | PropertyPath): Record<string, any[]>;
|
|
21
|
+
declare function pick<T extends object>(object: T, ...paths: Array<PropertyPath | PropertyPath[]>): any;
|
|
22
|
+
declare function omit<T extends object>(object: T, ...paths: Array<PropertyPath | PropertyPath[]>): any;
|
|
23
|
+
declare function merge<T extends Record<PropertyKey, any>>(object: T, ...sources: any[]): T;
|
|
24
|
+
declare function mergeWith<T extends Record<PropertyKey, any>>(object: T, source: any, customizer: (objValue: any, srcValue: any) => any): any;
|
|
25
|
+
declare function mergeConcatArray(object: any, source: any): any;
|
|
26
|
+
declare function mergeConcatMany<T>(array: Array<T>): T | undefined;
|
|
27
|
+
declare function isInteger(value: unknown): value is number;
|
|
28
|
+
export { assign, cloneDeep, difference, differenceBy, first, flatten, get, groupBy, identity, intersection, intersectionBy, isEqual, isInteger, keys, merge, mergeConcatArray, mergeConcatMany, mergeWith, omit, pick, pull, pullAll, result, set, union, unionBy, uniq, uniqBy, unset, upperFirst, debounce, };
|