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
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const buffer_1 = require("buffer");
|
|
4
|
-
const infra_1 = require("./infra");
|
|
5
|
-
function strictlySplitByteSequence(buf, cp) {
|
|
6
|
-
const list = [];
|
|
7
|
-
let last = 0;
|
|
8
|
-
let i = buf.indexOf(cp);
|
|
9
|
-
while (i >= 0) {
|
|
10
|
-
list.push(buf.slice(last, i));
|
|
11
|
-
last = i + 1;
|
|
12
|
-
i = buf.indexOf(cp, last);
|
|
13
|
-
}
|
|
14
|
-
if (last !== buf.length) {
|
|
15
|
-
list.push(buf.slice(last));
|
|
16
|
-
}
|
|
17
|
-
return list;
|
|
18
|
-
}
|
|
19
|
-
function replaceByteInByteSequence(buf, from, to) {
|
|
20
|
-
let i = buf.indexOf(from);
|
|
21
|
-
while (i >= 0) {
|
|
22
|
-
buf[i] = to;
|
|
23
|
-
i = buf.indexOf(from, i + 1);
|
|
24
|
-
}
|
|
25
|
-
return buf;
|
|
26
|
-
}
|
|
27
|
-
function percentEncode(c) {
|
|
28
|
-
let hex = c.toString(16).toUpperCase();
|
|
29
|
-
if (hex.length === 1) {
|
|
30
|
-
hex = '0' + hex;
|
|
31
|
-
}
|
|
32
|
-
return '%' + hex;
|
|
33
|
-
}
|
|
34
|
-
function percentDecode(input) {
|
|
35
|
-
const output = buffer_1.Buffer.alloc(input.byteLength);
|
|
36
|
-
let ptr = 0;
|
|
37
|
-
for (let i = 0; i < input.length; ++i) {
|
|
38
|
-
if (input[i] !== 37 ||
|
|
39
|
-
!(0, infra_1.isASCIIHex)(input[i + 1]) ||
|
|
40
|
-
!(0, infra_1.isASCIIHex)(input[i + 2])) {
|
|
41
|
-
output[ptr++] = input[i];
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
output[ptr++] = parseInt(input.slice(i + 1, i + 3).toString(), 16);
|
|
45
|
-
i += 2;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return output.slice(0, ptr);
|
|
49
|
-
}
|
|
50
|
-
function parseUrlencoded2(input) {
|
|
51
|
-
const sequences = strictlySplitByteSequence(input, 38);
|
|
52
|
-
const output = [];
|
|
53
|
-
for (const bytes of sequences) {
|
|
54
|
-
if (bytes.length === 0) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
let name;
|
|
58
|
-
let value;
|
|
59
|
-
const indexOfEqual = bytes.indexOf(61);
|
|
60
|
-
if (indexOfEqual >= 0) {
|
|
61
|
-
name = bytes.slice(0, indexOfEqual);
|
|
62
|
-
value = bytes.slice(indexOfEqual + 1);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
name = bytes;
|
|
66
|
-
value = buffer_1.Buffer.alloc(0);
|
|
67
|
-
}
|
|
68
|
-
name = replaceByteInByteSequence(buffer_1.Buffer.from(name), 43, 32);
|
|
69
|
-
value = replaceByteInByteSequence(buffer_1.Buffer.from(value), 43, 32);
|
|
70
|
-
output.push([
|
|
71
|
-
percentDecode(name).toString(),
|
|
72
|
-
percentDecode(value).toString(),
|
|
73
|
-
]);
|
|
74
|
-
}
|
|
75
|
-
return output;
|
|
76
|
-
}
|
|
77
|
-
function serializeUrlencodedByte(input) {
|
|
78
|
-
let output = '';
|
|
79
|
-
for (const byte of input) {
|
|
80
|
-
if (byte === 32) {
|
|
81
|
-
output += '+';
|
|
82
|
-
}
|
|
83
|
-
else if (byte === 42 ||
|
|
84
|
-
byte === 45 ||
|
|
85
|
-
byte === 46 ||
|
|
86
|
-
(byte >= 48 && byte <= 57) ||
|
|
87
|
-
(byte >= 65 && byte <= 90) ||
|
|
88
|
-
byte === 95 ||
|
|
89
|
-
(byte >= 97 && byte <= 122)) {
|
|
90
|
-
output += String.fromCodePoint(byte);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
output += percentEncode(byte);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return output;
|
|
97
|
-
}
|
|
98
|
-
function serializeUrlencoded(tuples, encodingOverride = undefined) {
|
|
99
|
-
let encoding = 'utf-8';
|
|
100
|
-
if (encodingOverride !== undefined) {
|
|
101
|
-
encoding = encodingOverride;
|
|
102
|
-
}
|
|
103
|
-
let output = '';
|
|
104
|
-
for (const [i, tuple] of tuples.entries()) {
|
|
105
|
-
// TODO: handle encoding override
|
|
106
|
-
const name = serializeUrlencodedByte(buffer_1.Buffer.from(tuple[0]));
|
|
107
|
-
let value = tuple[1];
|
|
108
|
-
if (tuple.length > 2 && tuple[2] !== undefined) {
|
|
109
|
-
if (tuple[2] === 'hidden' && name === '_charset_') {
|
|
110
|
-
value = encoding;
|
|
111
|
-
}
|
|
112
|
-
else if (tuple[2] === 'file') {
|
|
113
|
-
// value is a File object
|
|
114
|
-
value = value.name;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
value = serializeUrlencodedByte(buffer_1.Buffer.from(value));
|
|
118
|
-
if (i !== 0) {
|
|
119
|
-
output += '&';
|
|
120
|
-
}
|
|
121
|
-
output += `${name}=${value}`;
|
|
122
|
-
}
|
|
123
|
-
return output;
|
|
124
|
-
}
|
|
125
|
-
function parseUrlencoded(input) {
|
|
126
|
-
return parseUrlencoded2(buffer_1.Buffer.from(input));
|
|
127
|
-
}
|
|
128
|
-
function ucs2decode(string) {
|
|
129
|
-
const output = [];
|
|
130
|
-
let counter = 0;
|
|
131
|
-
const length = string.length;
|
|
132
|
-
while (counter < length) {
|
|
133
|
-
const value = string.charCodeAt(counter++);
|
|
134
|
-
if (value >= 0xd800 && value <= 0xdbff && counter < length) {
|
|
135
|
-
// It's a high surrogate, and there is a next character.
|
|
136
|
-
const extra = string.charCodeAt(counter++);
|
|
137
|
-
if ((extra & 0xfc00) == 0xdc00) {
|
|
138
|
-
// Low surrogate.
|
|
139
|
-
output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// It's an unmatched surrogate; only append this code unit, in case the
|
|
143
|
-
// next code unit is the high surrogate of a surrogate pair.
|
|
144
|
-
output.push(value);
|
|
145
|
-
counter--;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
output.push(value);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return output;
|
|
153
|
-
}
|
|
154
|
-
exports.default = {
|
|
155
|
-
percentEncode,
|
|
156
|
-
percentDecode,
|
|
157
|
-
// application/x-www-form-urlencoded string parser
|
|
158
|
-
parseUrlencoded,
|
|
159
|
-
// application/x-www-form-urlencoded serializer
|
|
160
|
-
serializeUrlencoded,
|
|
161
|
-
ucs2decode,
|
|
162
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// Returns "Type(value) is Object" in ES terminology.
|
|
4
|
-
function isObject(value) {
|
|
5
|
-
return typeof value === "object" && value !== null || typeof value === "function";
|
|
6
|
-
}
|
|
7
|
-
function hasOwn(obj, prop) {
|
|
8
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
9
|
-
}
|
|
10
|
-
const wrapperSymbol = Symbol("wrapper");
|
|
11
|
-
const implSymbol = Symbol("impl");
|
|
12
|
-
const sameObjectCaches = Symbol("SameObject caches");
|
|
13
|
-
const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry");
|
|
14
|
-
function getSameObject(wrapper, prop, creator) {
|
|
15
|
-
if (!wrapper[sameObjectCaches]) {
|
|
16
|
-
wrapper[sameObjectCaches] = Object.create(null);
|
|
17
|
-
}
|
|
18
|
-
if (prop in wrapper[sameObjectCaches]) {
|
|
19
|
-
return wrapper[sameObjectCaches][prop];
|
|
20
|
-
}
|
|
21
|
-
wrapper[sameObjectCaches][prop] = creator();
|
|
22
|
-
return wrapper[sameObjectCaches][prop];
|
|
23
|
-
}
|
|
24
|
-
function wrapperForImpl(impl) {
|
|
25
|
-
return impl ? impl[wrapperSymbol] : null;
|
|
26
|
-
}
|
|
27
|
-
function implForWrapper(wrapper) {
|
|
28
|
-
return wrapper ? wrapper[implSymbol] : null;
|
|
29
|
-
}
|
|
30
|
-
function tryWrapperForImpl(impl) {
|
|
31
|
-
const wrapper = wrapperForImpl(impl);
|
|
32
|
-
return wrapper ? wrapper : impl;
|
|
33
|
-
}
|
|
34
|
-
function tryImplForWrapper(wrapper) {
|
|
35
|
-
const impl = implForWrapper(wrapper);
|
|
36
|
-
return impl ? impl : wrapper;
|
|
37
|
-
}
|
|
38
|
-
const iterInternalSymbol = Symbol("internal");
|
|
39
|
-
const IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
|
|
40
|
-
function isArrayIndexPropName(P) {
|
|
41
|
-
if (typeof P !== 'string') {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
const i = P >>> 0;
|
|
45
|
-
if (i === Math.pow(2, 32) - 1) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
const s = `${i}`;
|
|
49
|
-
if (P !== s) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
const byteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
|
|
55
|
-
function isArrayBuffer(value) {
|
|
56
|
-
try {
|
|
57
|
-
byteLengthGetter.call(value);
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
const supportsPropertyIndex = Symbol("supports property index");
|
|
65
|
-
const supportedPropertyIndices = Symbol("supported property indices");
|
|
66
|
-
const supportsPropertyName = Symbol("supports property name");
|
|
67
|
-
const supportedPropertyNames = Symbol("supported property names");
|
|
68
|
-
const indexedGet = Symbol("indexed property get");
|
|
69
|
-
const indexedSetNew = Symbol("indexed property set new");
|
|
70
|
-
const indexedSetExisting = Symbol("indexed property set existing");
|
|
71
|
-
const namedGet = Symbol("named property get");
|
|
72
|
-
const namedSetNew = Symbol("named property set new");
|
|
73
|
-
const namedSetExisting = Symbol("named property set existing");
|
|
74
|
-
const namedDelete = Symbol("named property delete");
|
|
75
|
-
exports.default = {
|
|
76
|
-
isObject,
|
|
77
|
-
hasOwn,
|
|
78
|
-
wrapperSymbol,
|
|
79
|
-
implSymbol,
|
|
80
|
-
getSameObject,
|
|
81
|
-
ctorRegistrySymbol,
|
|
82
|
-
wrapperForImpl,
|
|
83
|
-
implForWrapper,
|
|
84
|
-
tryWrapperForImpl,
|
|
85
|
-
tryImplForWrapper,
|
|
86
|
-
iterInternalSymbol,
|
|
87
|
-
IteratorPrototype,
|
|
88
|
-
isArrayBuffer,
|
|
89
|
-
isArrayIndexPropName,
|
|
90
|
-
supportsPropertyIndex,
|
|
91
|
-
supportedPropertyIndices,
|
|
92
|
-
supportsPropertyName,
|
|
93
|
-
supportedPropertyNames,
|
|
94
|
-
indexedGet,
|
|
95
|
-
indexedSetNew,
|
|
96
|
-
indexedSetExisting,
|
|
97
|
-
namedGet,
|
|
98
|
-
namedSetNew,
|
|
99
|
-
namedSetExisting,
|
|
100
|
-
namedDelete
|
|
101
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { EntityShape } from '../types/Entity';
|
|
2
|
-
import { Schema as Relation } from './Relation';
|
|
3
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
4
|
-
import { Schema as Path } from './Path';
|
|
5
|
-
|
|
6
|
-
type Actions = string[];
|
|
7
|
-
|
|
8
|
-
export interface Schema extends EntityShape {
|
|
9
|
-
relation?: Relation;
|
|
10
|
-
path: Path;
|
|
11
|
-
deActions: Actions;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const entityDesc: EntityDesc<Schema> = {
|
|
15
|
-
locales: {
|
|
16
|
-
zh_CN: {
|
|
17
|
-
name: '用户授权',
|
|
18
|
-
attr: {
|
|
19
|
-
relation: '关系',
|
|
20
|
-
path: '路径',
|
|
21
|
-
deActions: '目标对象动作',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
en_US: {
|
|
26
|
-
name: 'Action authorization',
|
|
27
|
-
attr: {
|
|
28
|
-
relation: 'Relation',
|
|
29
|
-
path: 'Path',
|
|
30
|
-
deActions: 'Target actions',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
indexes: [
|
|
35
|
-
{
|
|
36
|
-
name: 'index_relation_path',
|
|
37
|
-
attributes: [
|
|
38
|
-
{
|
|
39
|
-
name: 'relation',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'path',
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
config: {
|
|
46
|
-
unique: true,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
};
|
package/src/entities/I18n.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { String } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
4
|
-
|
|
5
|
-
export interface Schema extends EntityShape {
|
|
6
|
-
module: String<64>;
|
|
7
|
-
position: String<188>;
|
|
8
|
-
namespace: String<256>;
|
|
9
|
-
language: String<32>;
|
|
10
|
-
data: Object;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const entityDesc: EntityDesc<Schema> = {
|
|
14
|
-
locales: {
|
|
15
|
-
zh_CN: {
|
|
16
|
-
name: 'i18n',
|
|
17
|
-
attr: {
|
|
18
|
-
module: '模块',
|
|
19
|
-
position: '文件位置',
|
|
20
|
-
namespace: '命名空间',
|
|
21
|
-
language: '语言',
|
|
22
|
-
data: '数据'
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
en_US: {
|
|
27
|
-
name: 'I18n',
|
|
28
|
-
attr: {
|
|
29
|
-
module: 'Module',
|
|
30
|
-
position: 'Position',
|
|
31
|
-
namespace: 'Namespace',
|
|
32
|
-
language: 'Language',
|
|
33
|
-
data: 'Data',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
indexes: [
|
|
38
|
-
{
|
|
39
|
-
name: 'namespace_language',
|
|
40
|
-
attributes: [
|
|
41
|
-
{
|
|
42
|
-
name: 'namespace',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'language',
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
config: {
|
|
49
|
-
unique: true,
|
|
50
|
-
},
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
};
|
package/src/entities/Log.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ActionDef } from '../types/Action';
|
|
2
|
-
import { String, Int, Datetime, Image, Boolean, Text } from '../types/DataType';
|
|
3
|
-
import { EntityShape } from '../types/Entity';
|
|
4
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
-
|
|
6
|
-
export interface Schema extends EntityShape {
|
|
7
|
-
entity: String<32>; // 关联的目标对象
|
|
8
|
-
entityId: String<64>; // 关联的目标对象id
|
|
9
|
-
iState: 'normal' | 'rollbacked';
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type IAction = 'undo' | 'redo';
|
|
13
|
-
export type Action = IAction;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const entityDesc: EntityDesc<Schema, Action> = {
|
|
17
|
-
locales: {
|
|
18
|
-
zh_CN: {
|
|
19
|
-
name: '日志',
|
|
20
|
-
attr: {
|
|
21
|
-
entity: '关联对象',
|
|
22
|
-
entityId: '关联对象ID',
|
|
23
|
-
iState: '状态'
|
|
24
|
-
},
|
|
25
|
-
action: {
|
|
26
|
-
undo: '回滚',
|
|
27
|
-
redo: '重做',
|
|
28
|
-
},
|
|
29
|
-
v: {
|
|
30
|
-
iState: {
|
|
31
|
-
normal: '正常的',
|
|
32
|
-
rollbacked: '已回滚',
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
en_US: {
|
|
38
|
-
name: 'Log',
|
|
39
|
-
attr: {
|
|
40
|
-
entity: 'Entity',
|
|
41
|
-
entityId: 'Entity ID',
|
|
42
|
-
iState: 'Status',
|
|
43
|
-
},
|
|
44
|
-
action: {
|
|
45
|
-
undo: 'Undo',
|
|
46
|
-
redo: 'Redo',
|
|
47
|
-
},
|
|
48
|
-
v: {
|
|
49
|
-
iState: {
|
|
50
|
-
normal: 'Normal',
|
|
51
|
-
rollbacked: 'Rolled back',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
style: {
|
|
57
|
-
icon: {
|
|
58
|
-
undo: '',
|
|
59
|
-
redo: '',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
};
|
package/src/entities/Modi.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { ActionDef } from '../types/Action';
|
|
2
|
-
import { String } from '../types/DataType';
|
|
3
|
-
import { EntityShape } from '../types/Entity';
|
|
4
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
-
|
|
6
|
-
export interface Schema extends EntityShape {
|
|
7
|
-
targetEntity: String<32>; // 要操作的目标对象
|
|
8
|
-
entity: String<32>; // 关联的目标对象
|
|
9
|
-
entityId: String<64>; // 关联的目标对象id
|
|
10
|
-
action: String<24>;
|
|
11
|
-
data: Object;
|
|
12
|
-
filter?: Object;
|
|
13
|
-
extra?: Object;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
type IState = 'active' | 'applied' | 'abandoned';
|
|
17
|
-
type IAction = 'apply' | 'abandon';
|
|
18
|
-
|
|
19
|
-
const IActionDef: ActionDef<IAction, IState> = {
|
|
20
|
-
stm: {
|
|
21
|
-
apply: ['active', 'applied'],
|
|
22
|
-
abandon: ['active', 'abandoned'],
|
|
23
|
-
},
|
|
24
|
-
is: 'active',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
type Action = IAction;
|
|
28
|
-
|
|
29
|
-
const entityDesc: EntityDesc<Schema, Action, '', {
|
|
30
|
-
iState: IState,
|
|
31
|
-
}> = {
|
|
32
|
-
locales: {
|
|
33
|
-
zh_CN: {
|
|
34
|
-
name: '更新',
|
|
35
|
-
attr: {
|
|
36
|
-
targetEntity: '目标对象',
|
|
37
|
-
entity: '关联对象',
|
|
38
|
-
entityId: '关联对象Id',
|
|
39
|
-
action: '动作',
|
|
40
|
-
data: '数据',
|
|
41
|
-
filter: '条件',
|
|
42
|
-
extra: '其它',
|
|
43
|
-
iState: '状态',
|
|
44
|
-
},
|
|
45
|
-
action: {
|
|
46
|
-
abandon: '放弃',
|
|
47
|
-
apply: '应用',
|
|
48
|
-
},
|
|
49
|
-
v: {
|
|
50
|
-
iState: {
|
|
51
|
-
active: '活跃的',
|
|
52
|
-
abandoned: '放弃的',
|
|
53
|
-
applied: '应用的',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
en_US: {
|
|
59
|
-
name: 'Modi',
|
|
60
|
-
attr: {
|
|
61
|
-
targetEntity: 'Target entity',
|
|
62
|
-
entity: 'Entity',
|
|
63
|
-
entityId: 'Entity ID',
|
|
64
|
-
action: 'Action',
|
|
65
|
-
data: 'Data',
|
|
66
|
-
filter: 'Filter',
|
|
67
|
-
extra: 'Extra',
|
|
68
|
-
iState: 'Status',
|
|
69
|
-
},
|
|
70
|
-
action: {
|
|
71
|
-
abandon: 'Abandon',
|
|
72
|
-
apply: 'Apply',
|
|
73
|
-
},
|
|
74
|
-
v: {
|
|
75
|
-
iState: {
|
|
76
|
-
active: 'Active',
|
|
77
|
-
abandoned: 'Abandoned',
|
|
78
|
-
applied: 'Applied',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
indexes: [
|
|
84
|
-
{
|
|
85
|
-
name: 'index_state',
|
|
86
|
-
attributes: [
|
|
87
|
-
{
|
|
88
|
-
name: 'iState',
|
|
89
|
-
direction: 'ASC',
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
style: {
|
|
95
|
-
icon: {
|
|
96
|
-
apply: '',
|
|
97
|
-
abandon: '',
|
|
98
|
-
},
|
|
99
|
-
color: {
|
|
100
|
-
iState: {
|
|
101
|
-
active: '#0000FF',
|
|
102
|
-
applied: '#008000',
|
|
103
|
-
abandoned: '#A9A9A9',
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { String } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { Schema as Modi } from './Modi';
|
|
4
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
-
|
|
6
|
-
export interface Schema extends EntityShape {
|
|
7
|
-
modi: Modi,
|
|
8
|
-
entity: String<32>;
|
|
9
|
-
entityId: String<64>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const entityDesc: EntityDesc<Schema> = {
|
|
13
|
-
locales: {
|
|
14
|
-
zh_CN: {
|
|
15
|
-
name: '更新对象连接',
|
|
16
|
-
attr: {
|
|
17
|
-
modi: '更新',
|
|
18
|
-
entity: '关联对象',
|
|
19
|
-
entityId: '关联对象id',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
en_US: {
|
|
24
|
-
name: 'Modi entity',
|
|
25
|
-
attr: {
|
|
26
|
-
modi: 'Modi',
|
|
27
|
-
entity: 'Entity',
|
|
28
|
-
entityId: 'Entity ID',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
configuration: {
|
|
33
|
-
actionType: 'appendOnly',
|
|
34
|
-
}
|
|
35
|
-
};
|
package/src/entities/Oper.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { String, Int, Datetime, Image, Boolean, Text } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { Schema as User } from './User';
|
|
4
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
-
import { Schema as Log } from './Log';
|
|
6
|
-
import { ActionDef } from '../types/Action';
|
|
7
|
-
|
|
8
|
-
export interface Schema extends EntityShape {
|
|
9
|
-
action: String<24>;
|
|
10
|
-
data: Object;
|
|
11
|
-
filter?: Object;
|
|
12
|
-
extra?: Object;
|
|
13
|
-
operator?: User;
|
|
14
|
-
targetEntity: String<32>;
|
|
15
|
-
bornAt?: Datetime;
|
|
16
|
-
log?: Log;
|
|
17
|
-
undoData?: Object;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export type IState = 'normal' | 'rollbacked';
|
|
22
|
-
export type State = IState;
|
|
23
|
-
export type IAction = 'undo' | 'redo';
|
|
24
|
-
export type Action = IAction;
|
|
25
|
-
export const IActionDef: ActionDef<IAction, IState> = {
|
|
26
|
-
stm: {
|
|
27
|
-
undo: ['normal', 'rollbacked'],
|
|
28
|
-
redo: ['rollbacked', 'normal'],
|
|
29
|
-
},
|
|
30
|
-
is: 'normal',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const entityDesc: EntityDesc<Schema, Action, '', {
|
|
34
|
-
iState: IState,
|
|
35
|
-
}> = {
|
|
36
|
-
locales: {
|
|
37
|
-
zh_CN: {
|
|
38
|
-
name: '操作',
|
|
39
|
-
attr: {
|
|
40
|
-
action: '动作',
|
|
41
|
-
data: '数据',
|
|
42
|
-
filter: '选择条件',
|
|
43
|
-
extra: '其它',
|
|
44
|
-
operator: '操作者',
|
|
45
|
-
targetEntity: '关联对象',
|
|
46
|
-
bornAt: '诞生时间',
|
|
47
|
-
log: '关联日志',
|
|
48
|
-
undoData: '回滚数据',
|
|
49
|
-
iState: '状态',
|
|
50
|
-
},
|
|
51
|
-
action: {
|
|
52
|
-
undo: '回滚',
|
|
53
|
-
redo: '重做',
|
|
54
|
-
},
|
|
55
|
-
v: {
|
|
56
|
-
iState: {
|
|
57
|
-
normal: '正常的',
|
|
58
|
-
rollbacked: '已回滚',
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
en_US: {
|
|
64
|
-
name: 'Operation',
|
|
65
|
-
attr: {
|
|
66
|
-
action: 'Action',
|
|
67
|
-
data: 'Data',
|
|
68
|
-
filter: 'Filter',
|
|
69
|
-
extra: 'Extra',
|
|
70
|
-
operator: 'Operator',
|
|
71
|
-
targetEntity: 'Target entity',
|
|
72
|
-
bornAt: 'Born at',
|
|
73
|
-
log: 'Log',
|
|
74
|
-
undoData: 'Undo data',
|
|
75
|
-
iState: 'Status',
|
|
76
|
-
},
|
|
77
|
-
action: {
|
|
78
|
-
undo: 'Undo',
|
|
79
|
-
redo: 'Redo',
|
|
80
|
-
},
|
|
81
|
-
v: {
|
|
82
|
-
iState: {
|
|
83
|
-
normal: 'Normal',
|
|
84
|
-
rollbacked: 'Rolled back',
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
style: {
|
|
90
|
-
icon: {
|
|
91
|
-
undo: '',
|
|
92
|
-
redo: '',
|
|
93
|
-
},
|
|
94
|
-
color: {
|
|
95
|
-
iState: {
|
|
96
|
-
normal: '#229954',
|
|
97
|
-
rollbacked: '#2C3E50',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
indexes: [
|
|
102
|
-
{
|
|
103
|
-
name: 'index_bornAt_operatorId',
|
|
104
|
-
attributes: [
|
|
105
|
-
{
|
|
106
|
-
name: 'bornAt',
|
|
107
|
-
direction: 'DESC',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'operator',
|
|
111
|
-
},
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
};
|