@voxgig/sdkgen-langpack 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/.sdk/model/target/dart.aon +63 -0
- package/.sdk/model/target/haskell.aon +72 -0
- package/.sdk/model/target/lean.aon +91 -0
- package/.sdk/src/cmp/dart/Config_dart.ts +248 -0
- package/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
- package/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
- package/.sdk/src/cmp/dart/EntityTypes_dart.ts +207 -0
- package/.sdk/src/cmp/dart/Entity_dart.ts +87 -0
- package/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
- package/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
- package/.sdk/src/cmp/dart/Main_dart.ts +178 -0
- package/.sdk/src/cmp/dart/Package_dart.ts +82 -0
- package/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +177 -0
- package/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +238 -0
- package/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +53 -0
- package/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +152 -0
- package/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +59 -0
- package/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +65 -0
- package/.sdk/src/cmp/dart/ReadmeModel_dart.ts +151 -0
- package/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +63 -0
- package/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +225 -0
- package/.sdk/src/cmp/dart/ReadmeRef_dart.ts +397 -0
- package/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +24 -0
- package/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +106 -0
- package/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +78 -0
- package/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
- package/.sdk/src/cmp/dart/TestDirect_dart.ts +516 -0
- package/.sdk/src/cmp/dart/TestEntity_dart.ts +628 -0
- package/.sdk/src/cmp/dart/Test_dart.ts +138 -0
- package/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/Config.fragment.dart +70 -0
- package/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
- package/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +29 -0
- package/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +28 -0
- package/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +302 -0
- package/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
- package/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +108 -0
- package/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/Main.fragment.dart +339 -0
- package/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +26 -0
- package/.sdk/src/cmp/dart/tsconfig.json +15 -0
- package/.sdk/src/cmp/dart/utility_dart.ts +155 -0
- package/.sdk/src/cmp/haskell/Config_haskell.ts +98 -0
- package/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
- package/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
- package/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
- package/.sdk/src/cmp/haskell/Package_haskell.ts +60 -0
- package/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +186 -0
- package/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +135 -0
- package/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +48 -0
- package/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +168 -0
- package/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +51 -0
- package/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +67 -0
- package/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +162 -0
- package/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +74 -0
- package/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +241 -0
- package/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +408 -0
- package/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +31 -0
- package/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +104 -0
- package/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +80 -0
- package/.sdk/src/cmp/haskell/Test_haskell.ts +297 -0
- package/.sdk/src/cmp/haskell/tsconfig.json +15 -0
- package/.sdk/src/cmp/haskell/utility_haskell.ts +166 -0
- package/.sdk/src/cmp/lean/Config_lean.ts +93 -0
- package/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
- package/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
- package/.sdk/src/cmp/lean/Main_lean.ts +120 -0
- package/.sdk/src/cmp/lean/Package_lean.ts +93 -0
- package/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
- package/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
- package/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +39 -0
- package/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
- package/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
- package/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
- package/.sdk/src/cmp/lean/ReadmeRef_lean.ts +40 -0
- package/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
- package/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
- package/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +19 -0
- package/.sdk/src/cmp/lean/Test_lean.ts +261 -0
- package/.sdk/src/cmp/lean/utility_lean.ts +129 -0
- package/.sdk/tm/dart/LICENSE +22 -0
- package/.sdk/tm/dart/Makefile +50 -0
- package/.sdk/tm/dart/lib/Context.dart +150 -0
- package/.sdk/tm/dart/lib/Control.dart +15 -0
- package/.sdk/tm/dart/lib/Operation.dart +31 -0
- package/.sdk/tm/dart/lib/Point.dart +51 -0
- package/.sdk/tm/dart/lib/Response.dart +32 -0
- package/.sdk/tm/dart/lib/Result.dart +39 -0
- package/.sdk/tm/dart/lib/Spec.dart +49 -0
- package/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
- package/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
- package/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
- package/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +446 -0
- package/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
- package/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
- package/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
- package/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
- package/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +240 -0
- package/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
- package/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
- package/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
- package/.sdk/tm/dart/lib/feature/secrets/SecretsFeature.dart +649 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/capability.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/catalog.dart +46 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/config.dart +297 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/depend.dart +198 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/env.dart +144 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/export.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/graph.dart +160 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/host.dart +1067 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/order.dart +172 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/plugin.dart +23 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/point.dart +117 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/ref.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/resolve.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/types.dart +201 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/version.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/aws.dart +285 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/azuresecrets.dart +178 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/boru.dart +145 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/crypto.dart +194 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/doppler.dart +101 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/gcpsecrets.dart +143 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/hashicorp.dart +190 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/httpjson.dart +363 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/infisical.dart +149 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/onepassword.dart +146 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/secretspec.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/sigv4.dart +237 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/addr.dart +138 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/json.dart +276 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/provider.dart +31 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/providers.dart +243 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/sekreto.dart +730 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/spec.dart +200 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/support.dart +217 -0
- package/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
- package/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
- package/.sdk/tm/dart/lib/feature/test/TestFeature.dart +328 -0
- package/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
- package/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
- package/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
- package/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
- package/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/FetcherUtility.dart +104 -0
- package/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +162 -0
- package/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
- package/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +71 -0
- package/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
- package/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +233 -0
- package/.sdk/tm/dart/lib/utility/MakePointUtility.dart +130 -0
- package/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +66 -0
- package/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +59 -0
- package/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
- package/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +77 -0
- package/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
- package/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
- package/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
- package/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
- package/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +30 -0
- package/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
- package/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
- package/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
- package/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
- package/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
- package/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
- package/.sdk/tm/dart/lib/utility/Utility.dart +239 -0
- package/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2462 -0
- package/.sdk/tm/dart/src/feature/README.md +3 -0
- package/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/secrets/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/dart/test/custom_test.dart +65 -0
- package/.sdk/tm/dart/test/exists_test.dart +12 -0
- package/.sdk/tm/dart/test/feature/harness.dart +347 -0
- package/.sdk/tm/dart/test/feature/secrets/secrets_test.dart +1107 -0
- package/.sdk/tm/dart/test/feature_test.dart +1193 -0
- package/.sdk/tm/dart/test/harness.dart +153 -0
- package/.sdk/tm/dart/test/netsim_test.dart +48 -0
- package/.sdk/tm/dart/test/omni.dart +520 -0
- package/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/.sdk/tm/dart/test/pipeline_test.dart +608 -0
- package/.sdk/tm/dart/test/primary_test.dart +476 -0
- package/.sdk/tm/dart/test/sdk-test-control.json +19 -0
- package/.sdk/tm/dart/test/struct_test.dart +468 -0
- package/.sdk/tm/dart/test/utility.dart +198 -0
- package/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/.sdk/tm/haskell/LICENSE +21 -0
- package/.sdk/tm/haskell/Makefile +22 -0
- package/.sdk/tm/haskell/VERSION +1 -0
- package/.sdk/tm/haskell/src/SdkFeatures.hs +1440 -0
- package/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
- package/.sdk/tm/haskell/src/SdkJson.hs +111 -0
- package/.sdk/tm/haskell/src/SdkRuntime.hs +1279 -0
- package/.sdk/tm/haskell/src/SdkTypes.hs +195 -0
- package/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
- package/.sdk/tm/haskell/src/Vregex.hs +237 -0
- package/.sdk/tm/haskell/src/feature/README.md +5 -0
- package/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/haskell/test/Harness.hs +281 -0
- package/.sdk/tm/haskell/test/OmniResolver.hs +252 -0
- package/.sdk/tm/haskell/test/Runner.hs +49 -0
- package/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
- package/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
- package/.sdk/tm/haskell/test/TFeature.hs +794 -0
- package/.sdk/tm/haskell/test/TNetsim.hs +50 -0
- package/.sdk/tm/haskell/test/TPipeline.hs +334 -0
- package/.sdk/tm/haskell/test/TPrimaryCorpus.hs +263 -0
- package/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
- package/.sdk/tm/haskell/test/Testutil.hs +59 -0
- package/.sdk/tm/haskell/test/vendor/omni/Omni.hs +1147 -0
- package/.sdk/tm/lean/LICENSE +21 -0
- package/.sdk/tm/lean/Makefile +32 -0
- package/.sdk/tm/lean/VERSION +1 -0
- package/.sdk/tm/lean/src/SdkFeature.lean +171 -0
- package/.sdk/tm/lean/src/SdkFeatures.lean +787 -0
- package/.sdk/tm/lean/src/SdkJson.lean +134 -0
- package/.sdk/tm/lean/src/SdkRuntime.lean +374 -0
- package/.sdk/tm/lean/src/SdkUtility.lean +809 -0
- package/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
- package/.sdk/tm/lean/src/Vregex.lean +412 -0
- package/.sdk/tm/lean/src/feature/README.md +5 -0
- package/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/.sdk/tm/lean/test/StructCorpus.lean +368 -0
- package/.sdk/tm/lean/test/TFeature.lean +281 -0
- package/.sdk/tm/lean/test/TPrimaryUtility.lean +227 -0
- package/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/package.json +78 -0
- package/sdkgen-package.json +22 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
nom,
|
|
4
|
+
} from '@voxgig/apidef'
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
ModelEntity
|
|
8
|
+
} from '@voxgig/apidef'
|
|
9
|
+
|
|
10
|
+
import { cmp, each, snakify, Folder, File, Content, entityCollection,
|
|
11
|
+
targetFeatures, TestControl } from '@voxgig/sdkgen'
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { TestDirect } from './TestDirect_dart'
|
|
15
|
+
import { TestEntity } from './TestEntity_dart'
|
|
16
|
+
import { ReadmeExamplesTest } from './ReadmeExamplesTest_dart'
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const Test = cmp(function Test(props: any) {
|
|
20
|
+
const { model } = props.ctx$
|
|
21
|
+
const { target } = props
|
|
22
|
+
|
|
23
|
+
const entity = each(entityCollection(model))
|
|
24
|
+
.filter((e: any) => false !== e.active)
|
|
25
|
+
|
|
26
|
+
// GATED SUITES. test/main.dart is a HAND-LISTED suite entry - dart has no
|
|
27
|
+
// `go test ./...` or pytest discovery - so a feature whose tests ship in
|
|
28
|
+
// its own trimmable folder has to be registered here or it is dead
|
|
29
|
+
// weight. Both halves matter, and they fail in opposite directions:
|
|
30
|
+
// register unconditionally and a project without the feature imports a
|
|
31
|
+
// file that is not there (a compile error); forget to register and the
|
|
32
|
+
// suite ships, never runs, and the lane stays green while nothing is
|
|
33
|
+
// checked. The feature list is tag-gated, so a target with no vendored
|
|
34
|
+
// sekreto never reaches this.
|
|
35
|
+
const feature = targetFeatures(model, target)
|
|
36
|
+
const secrets = null != feature.secrets
|
|
37
|
+
|
|
38
|
+
Folder({ name: 'test' }, () => {
|
|
39
|
+
|
|
40
|
+
// Write-once: a project's edited control file survives regeneration.
|
|
41
|
+
TestControl({ target, dir: 'test' })
|
|
42
|
+
|
|
43
|
+
// Suite entry: registers every static suite plus the generated
|
|
44
|
+
// per-entity suites, then runs them (Makefile: dart run test/main.dart).
|
|
45
|
+
File({ name: 'main.' + target.ext }, () => {
|
|
46
|
+
|
|
47
|
+
Content(`// ${model.const.Name} SDK test suite entry. GENERATED — do not edit.
|
|
48
|
+
|
|
49
|
+
import 'dart:io';
|
|
50
|
+
|
|
51
|
+
import 'harness.dart' as harness;
|
|
52
|
+
|
|
53
|
+
import 'exists_test.dart' as exists_test;
|
|
54
|
+
import 'omni_smoke_test.dart' as omni_smoke_test;
|
|
55
|
+
import 'struct_test.dart' as struct_test;
|
|
56
|
+
import 'primary_test.dart' as primary_test;
|
|
57
|
+
import 'pipeline_test.dart' as pipeline_test;
|
|
58
|
+
import 'feature_test.dart' as feature_test;
|
|
59
|
+
import 'netsim_test.dart' as netsim_test;
|
|
60
|
+
import 'custom_test.dart' as custom_test;
|
|
61
|
+
import 'readme_examples_test.dart' as readme_examples_test;
|
|
62
|
+
`)
|
|
63
|
+
|
|
64
|
+
if (secrets) {
|
|
65
|
+
Content(`import 'feature/secrets/secrets_test.dart' as secrets_test;
|
|
66
|
+
`)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
each(entity, (ent: ModelEntity) => {
|
|
70
|
+
const alias = snakify(ent.name)
|
|
71
|
+
Content(`import 'entity/${ent.name}/${nom(ent, 'Name')}Entity_test.dart' as ${alias}_entity_test;
|
|
72
|
+
`)
|
|
73
|
+
if (hasDirect(ent)) {
|
|
74
|
+
Content(`import 'entity/${ent.name}/${nom(ent, 'Name')}Direct_test.dart' as ${alias}_direct_test;
|
|
75
|
+
`)
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
Content(`
|
|
80
|
+
Future<void> main() async {
|
|
81
|
+
exists_test.tests();
|
|
82
|
+
omni_smoke_test.tests();
|
|
83
|
+
struct_test.tests();
|
|
84
|
+
primary_test.tests();
|
|
85
|
+
pipeline_test.tests();
|
|
86
|
+
feature_test.tests();
|
|
87
|
+
netsim_test.tests();
|
|
88
|
+
custom_test.tests();
|
|
89
|
+
readme_examples_test.tests();
|
|
90
|
+
`)
|
|
91
|
+
|
|
92
|
+
if (secrets) {
|
|
93
|
+
Content(` secrets_test.tests();
|
|
94
|
+
`)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
each(entity, (ent: ModelEntity) => {
|
|
98
|
+
const alias = snakify(ent.name)
|
|
99
|
+
Content(` ${alias}_entity_test.tests();
|
|
100
|
+
`)
|
|
101
|
+
if (hasDirect(ent)) {
|
|
102
|
+
Content(` ${alias}_direct_test.tests();
|
|
103
|
+
`)
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
Content(`
|
|
108
|
+
final failed = await harness.runAll();
|
|
109
|
+
if (0 < failed) {
|
|
110
|
+
exitCode = 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`)
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
// Documentation dart-examples presence & completeness gate.
|
|
117
|
+
ReadmeExamplesTest({ target })
|
|
118
|
+
|
|
119
|
+
Folder({ name: 'entity' }, () => {
|
|
120
|
+
each(entity, (ent: ModelEntity) => {
|
|
121
|
+
TestEntity({ target, entity: ent })
|
|
122
|
+
TestDirect({ target, entity: ent })
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
// A Direct test file is generated only when the entity has load or list.
|
|
130
|
+
function hasDirect(entity: any): boolean {
|
|
131
|
+
const opnames = Object.keys(entity.op || {})
|
|
132
|
+
return opnames.includes('load') || opnames.includes('list')
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
Test
|
|
138
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import 'dart:convert';
|
|
2
|
+
|
|
3
|
+
import 'feature/base/BaseFeature.dart';
|
|
4
|
+
// #ImportFeatures
|
|
5
|
+
// #ImportPlugins
|
|
6
|
+
|
|
7
|
+
// ignore: non_constant_identifier_names
|
|
8
|
+
final Map<String, BaseFeature Function()> FEATURE_CLASS = {
|
|
9
|
+
// #FeatureClasses
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Per-feature plugin DEFINITIONS (voxgig/plugin `Definition` values), from
|
|
13
|
+
// the model's active plugin groups. A feature that takes a `plugins` option
|
|
14
|
+
// (secrets over sekreto) reads its own entry; a feature with no plugins has
|
|
15
|
+
// none. The named `show` imports above make each definition statically
|
|
16
|
+
// reachable, so an SDK carries exactly the plugin libraries its model
|
|
17
|
+
// selects - the same leanness the old side-effect registry bought, without
|
|
18
|
+
// a registry.
|
|
19
|
+
//
|
|
20
|
+
// Emitted UNCONDITIONALLY, empty when no group is active: SecretsFeature
|
|
21
|
+
// imports this name, and the feature source can be present in a tree whose
|
|
22
|
+
// model selects no plugin group at all. An emission conditional on the map
|
|
23
|
+
// having entries would make that tree fail `dart analyze`.
|
|
24
|
+
//
|
|
25
|
+
// ignore: non_constant_identifier_names
|
|
26
|
+
final Map<String, List<dynamic>> FEATURE_PLUGINS = <String, List<dynamic>>{
|
|
27
|
+
// #FeaturePlugins
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// THE API MODEL, EMBEDDED AS DATA (sdkgen rung L1).
|
|
31
|
+
//
|
|
32
|
+
// The literal form of this file declares the whole model as nested map
|
|
33
|
+
// literals. For a large API that is megabytes of source the Dart analyzer and
|
|
34
|
+
// compiler must parse and type every node of, on every build, and that the VM
|
|
35
|
+
// must build entry by entry on every load.
|
|
36
|
+
//
|
|
37
|
+
// As a single string constant it is one token, and `jsonDecode` builds the map
|
|
38
|
+
// far faster than the equivalent literal.
|
|
39
|
+
//
|
|
40
|
+
// Emitted only above a size threshold, or when `main.kit.config.repr` pins it:
|
|
41
|
+
// for a small model the literal is smaller, loads no slower, and is far easier
|
|
42
|
+
// to read when debugging.
|
|
43
|
+
const String _CONFIG_DATA = 'CONFIGJSON';
|
|
44
|
+
|
|
45
|
+
class Config {
|
|
46
|
+
// ONE decode per constructed Config, and each instance owns the maps it
|
|
47
|
+
// decoded. The literal representation builds fresh maps in every field
|
|
48
|
+
// initialiser, so a caller that constructs a second Config and mutates it
|
|
49
|
+
// does not touch the first - and `Config` is exported by Main.fragment.dart,
|
|
50
|
+
// so callers really can construct one.
|
|
51
|
+
//
|
|
52
|
+
// Sharing a single top-level parsed map would have been cheaper and was the
|
|
53
|
+
// first attempt; it made `Config().options['x'] = 1` mutate the `config`
|
|
54
|
+
// singleton every SDK client reads. Decoding per instance costs about what
|
|
55
|
+
// building the literal per instance cost, and the rung's win is untouched:
|
|
56
|
+
// L1 is about what the COMPILER has to walk, not what happens at load.
|
|
57
|
+
Config() : this._(jsonDecode(_CONFIG_DATA) as Map<String, dynamic>);
|
|
58
|
+
|
|
59
|
+
Config._(Map<String, dynamic> data)
|
|
60
|
+
: main = data['main'] as Map<String, dynamic>,
|
|
61
|
+
feature = data['feature'] as Map<String, dynamic>,
|
|
62
|
+
options = data['options'] as Map<String, dynamic>,
|
|
63
|
+
entity = data['entity'] as Map<String, dynamic>;
|
|
64
|
+
|
|
65
|
+
BaseFeature makeFeature(String fn) {
|
|
66
|
+
final fc = FEATURE_CLASS[fn];
|
|
67
|
+
if (null == fc) {
|
|
68
|
+
// TODO: errors etc
|
|
69
|
+
throw StateError('Unknown feature: ' + fn);
|
|
70
|
+
}
|
|
71
|
+
return fc();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// False for a feature added at runtime via options.extend (station's
|
|
75
|
+
// adopt path) - the constructor uses this to skip makeFeature for names
|
|
76
|
+
// no generated class backs.
|
|
77
|
+
bool hasFeature(String fn) => null != FEATURE_CLASS[fn];
|
|
78
|
+
|
|
79
|
+
// The same fields the literal declares - same names, same types, same
|
|
80
|
+
// finalness - so callers cannot tell which representation they were given.
|
|
81
|
+
final Map<String, dynamic> main;
|
|
82
|
+
|
|
83
|
+
final Map<String, dynamic> feature;
|
|
84
|
+
|
|
85
|
+
final Map<String, dynamic> options;
|
|
86
|
+
|
|
87
|
+
final Map<String, dynamic> entity;
|
|
88
|
+
|
|
89
|
+
// The pipeline context carries the config as a plain map.
|
|
90
|
+
Map<String, dynamic> toMap() => <String, dynamic>{
|
|
91
|
+
'main': main,
|
|
92
|
+
'feature': feature,
|
|
93
|
+
'options': options,
|
|
94
|
+
'entity': entity,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
final config = Config();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import 'feature/base/BaseFeature.dart';
|
|
2
|
+
// #ImportFeatures
|
|
3
|
+
// #ImportPlugins
|
|
4
|
+
|
|
5
|
+
// ignore: non_constant_identifier_names
|
|
6
|
+
final Map<String, BaseFeature Function()> FEATURE_CLASS = {
|
|
7
|
+
// #FeatureClasses
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// Per-feature plugin DEFINITIONS (voxgig/plugin `Definition` values), from
|
|
11
|
+
// the model's active plugin groups. A feature that takes a `plugins` option
|
|
12
|
+
// (secrets over sekreto) reads its own entry; a feature with no plugins has
|
|
13
|
+
// none. The named `show` imports above make each definition statically
|
|
14
|
+
// reachable, so an SDK carries exactly the plugin libraries its model
|
|
15
|
+
// selects - the same leanness the old side-effect registry bought, without
|
|
16
|
+
// a registry.
|
|
17
|
+
//
|
|
18
|
+
// Emitted UNCONDITIONALLY, empty when no group is active: SecretsFeature
|
|
19
|
+
// imports this name, and the feature source can be present in a tree whose
|
|
20
|
+
// model selects no plugin group at all. An emission conditional on the map
|
|
21
|
+
// having entries would make that tree fail `dart analyze`.
|
|
22
|
+
//
|
|
23
|
+
// ignore: non_constant_identifier_names
|
|
24
|
+
final Map<String, List<dynamic>> FEATURE_PLUGINS = <String, List<dynamic>>{
|
|
25
|
+
// #FeaturePlugins
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
class Config {
|
|
29
|
+
BaseFeature makeFeature(String fn) {
|
|
30
|
+
final fc = FEATURE_CLASS[fn];
|
|
31
|
+
if (null == fc) {
|
|
32
|
+
// TODO: errors etc
|
|
33
|
+
throw StateError('Unknown feature: ' + fn);
|
|
34
|
+
}
|
|
35
|
+
return fc();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// False for a feature added at runtime via options.extend (station's
|
|
39
|
+
// adopt path) - the constructor uses this to skip makeFeature for names
|
|
40
|
+
// no generated class backs.
|
|
41
|
+
bool hasFeature(String fn) => null != FEATURE_CLASS[fn];
|
|
42
|
+
|
|
43
|
+
final Map<String, dynamic> main = <String, dynamic>{
|
|
44
|
+
'name': 'ProjectName',
|
|
45
|
+
// #MainMeta
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
final Map<String, dynamic> feature = <String, dynamic>{
|
|
49
|
+
// #FeatureConfigs
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Rendered whole from the canonical config definition rather than assembled
|
|
53
|
+
// slot by slot. Assembling it here meant `options.server` - the OpenAPI
|
|
54
|
+
// server-variable defaults - was simply absent from this branch, so a
|
|
55
|
+
// templated server URL produced a different config either side of the
|
|
56
|
+
// threshold.
|
|
57
|
+
final Map<String, dynamic> options = 'OPTIONSMAP';
|
|
58
|
+
|
|
59
|
+
final Map<String, dynamic> entity = 'ENTITYMAP';
|
|
60
|
+
|
|
61
|
+
// The pipeline context carries the config as a plain map.
|
|
62
|
+
Map<String, dynamic> toMap() => <String, dynamic>{
|
|
63
|
+
'main': main,
|
|
64
|
+
'feature': feature,
|
|
65
|
+
'options': options,
|
|
66
|
+
'entity': entity,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
final config = Config();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// ignore_for_file: unused_import, unused_local_variable, non_constant_identifier_names
|
|
2
|
+
|
|
3
|
+
import 'dart:convert';
|
|
4
|
+
|
|
5
|
+
import '../../harness.dart';
|
|
6
|
+
import '../../utility.dart';
|
|
7
|
+
|
|
8
|
+
import '../../../lib/ProjectNameSDK.dart';
|
|
9
|
+
|
|
10
|
+
void tests() {
|
|
11
|
+
describe('EntityNameDirect', () {
|
|
12
|
+
test('direct-exists', (t) async {
|
|
13
|
+
final sdk = ProjectNameSDK({
|
|
14
|
+
'system': {
|
|
15
|
+
'fetch': (dynamic url, dynamic init) async => <String, dynamic>{}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
ok(null != sdk);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// <[SLOT:direct]>
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// <[SLOT:directSetup]>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
// ignore_for_file: non_constant_identifier_names
|
|
3
|
+
|
|
4
|
+
// #OpImports
|
|
5
|
+
import '../ProjectNameEntityBase.dart';
|
|
6
|
+
|
|
7
|
+
// #TypeImports
|
|
8
|
+
|
|
9
|
+
class EntyClass extends ProjectNameEntityBase {
|
|
10
|
+
EntyClass(dynamic client, dynamic entopts) : super(client, entopts) {
|
|
11
|
+
name = 'entityname';
|
|
12
|
+
name_ = 'entityname';
|
|
13
|
+
Name = 'EntityName';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
EntyClass make() {
|
|
17
|
+
return EntyClass(client, entopts());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// #LoadOp
|
|
21
|
+
|
|
22
|
+
// #ListOp
|
|
23
|
+
|
|
24
|
+
// #CreateOp
|
|
25
|
+
|
|
26
|
+
// #UpdateOp
|
|
27
|
+
|
|
28
|
+
// #RemoveOp
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ignore_for_file: unused_import, unused_local_variable, non_constant_identifier_names
|
|
2
|
+
|
|
3
|
+
import 'dart:convert';
|
|
4
|
+
import 'dart:io';
|
|
5
|
+
|
|
6
|
+
import '../../harness.dart';
|
|
7
|
+
import '../../utility.dart';
|
|
8
|
+
|
|
9
|
+
import '../../../lib/ProjectNameSDK.dart';
|
|
10
|
+
import '../../../lib/utility/voxgig_struct.dart' as vs;
|
|
11
|
+
|
|
12
|
+
void tests() {
|
|
13
|
+
describe('EntityNameEntity', () {
|
|
14
|
+
test('instance', (t) async {
|
|
15
|
+
final testsdk = ProjectNameSDK.test();
|
|
16
|
+
final ent = testsdk.EntityName();
|
|
17
|
+
ok(null != ent);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// <[SLOT:stream]>
|
|
21
|
+
|
|
22
|
+
test('basic', (t) async {
|
|
23
|
+
// <[SLOT:basic]>
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// <[SLOT:basicSetup]>
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
|
|
2
|
+
// ignore_for_file: non_constant_identifier_names
|
|
3
|
+
|
|
4
|
+
import 'dart:async';
|
|
5
|
+
|
|
6
|
+
import 'utility/ErrUtility.dart';
|
|
7
|
+
|
|
8
|
+
// Base class for generated entities. `dataVal`/`matchVal` hold accreted
|
|
9
|
+
// partial state (they start {} and fill in as ops resolve); the full typed
|
|
10
|
+
// data models are documented in ProjectNameTypes.dart.
|
|
11
|
+
class ProjectNameEntityBase {
|
|
12
|
+
String name = '';
|
|
13
|
+
String name_ = '';
|
|
14
|
+
String Name = '';
|
|
15
|
+
|
|
16
|
+
dynamic client;
|
|
17
|
+
dynamic utility;
|
|
18
|
+
dynamic entoptsMap;
|
|
19
|
+
dynamic dataVal = {};
|
|
20
|
+
dynamic matchVal = {};
|
|
21
|
+
dynamic entctx;
|
|
22
|
+
|
|
23
|
+
ProjectNameEntityBase(dynamic client_, dynamic entopts_) {
|
|
24
|
+
final entopts = entopts_ ?? {};
|
|
25
|
+
if (entopts is Map) {
|
|
26
|
+
entopts['active'] = false != entopts['active'];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
client = client_;
|
|
30
|
+
entoptsMap = entopts;
|
|
31
|
+
utility = client_.utility();
|
|
32
|
+
dataVal = {};
|
|
33
|
+
matchVal = {};
|
|
34
|
+
|
|
35
|
+
final makeContext = utility.makeContext;
|
|
36
|
+
|
|
37
|
+
entctx = makeContext({
|
|
38
|
+
'entity': this,
|
|
39
|
+
'entopts': entopts,
|
|
40
|
+
}, client_.rootctx);
|
|
41
|
+
|
|
42
|
+
final featureHook = utility.featureHook;
|
|
43
|
+
featureHook(entctx, 'PostConstructEntity');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Every operation resolves to the entity; `remove` additionally marks
|
|
47
|
+
// it. The instance KEEPS the data it held — a caller can still read what
|
|
48
|
+
// was deleted — but it is no longer a live record. See AGENTS.md.
|
|
49
|
+
bool _deleted = false;
|
|
50
|
+
|
|
51
|
+
void markDeleted() {
|
|
52
|
+
_deleted = true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
bool deleted() => _deleted;
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
dynamic entopts() {
|
|
59
|
+
return utility.struct.merge([{}, entoptsMap]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
dynamic data([dynamic d]) {
|
|
63
|
+
final struct = utility.struct;
|
|
64
|
+
final featureHook = utility.featureHook;
|
|
65
|
+
|
|
66
|
+
if (null != d) {
|
|
67
|
+
dataVal = struct.clone(d);
|
|
68
|
+
featureHook(entctx, 'SetData');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
featureHook(entctx, 'GetData');
|
|
72
|
+
final out = struct.clone(dataVal);
|
|
73
|
+
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
dynamic match([dynamic m]) {
|
|
78
|
+
final struct = utility.struct;
|
|
79
|
+
final featureHook = utility.featureHook;
|
|
80
|
+
|
|
81
|
+
if (null != m) {
|
|
82
|
+
matchVal = struct.clone(m);
|
|
83
|
+
featureHook(entctx, 'SetMatch');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
featureHook(entctx, 'GetMatch');
|
|
87
|
+
final out = struct.clone(matchVal);
|
|
88
|
+
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Streaming operation. Runs `action` through the full pipeline and returns
|
|
93
|
+
// a Stream over the result items, so the `streaming` feature's incremental
|
|
94
|
+
// output is reachable from a generated entity (a normal op call
|
|
95
|
+
// materialises the whole result). `callopts` parameterises the call:
|
|
96
|
+
// - inbound (download): yields items/chunks from the streaming feature
|
|
97
|
+
// when active, else falls back to the materialised items;
|
|
98
|
+
// - outbound (upload): an async-iterable/Stream `body` is attached to the
|
|
99
|
+
// request so the transport can stream a request payload;
|
|
100
|
+
// - `ctrl` (pipeline control) and `signal` (cancellation) are honoured.
|
|
101
|
+
Stream<dynamic> stream(String action,
|
|
102
|
+
[dynamic args, dynamic callopts]) async* {
|
|
103
|
+
final utility = this.utility;
|
|
104
|
+
|
|
105
|
+
final makeContext = utility.makeContext;
|
|
106
|
+
final done = utility.done;
|
|
107
|
+
final featureHook = utility.featureHook;
|
|
108
|
+
final makePoint = utility.makePoint;
|
|
109
|
+
final makeSpec = utility.makeSpec;
|
|
110
|
+
final makeRequest = utility.makeRequest;
|
|
111
|
+
final makeResponse = utility.makeResponse;
|
|
112
|
+
final makeResult = utility.makeResult;
|
|
113
|
+
|
|
114
|
+
callopts = callopts ?? {};
|
|
115
|
+
final signal = callopts is Map ? callopts['signal'] : null;
|
|
116
|
+
|
|
117
|
+
final ctrl = <String, dynamic>{};
|
|
118
|
+
if (callopts is Map && callopts['ctrl'] is Map) {
|
|
119
|
+
(callopts['ctrl'] as Map).forEach((k, v) => ctrl[k.toString()] = v);
|
|
120
|
+
}
|
|
121
|
+
ctrl['stream'] = callopts;
|
|
122
|
+
|
|
123
|
+
final ctxmap = <String, dynamic>{
|
|
124
|
+
'opname': action,
|
|
125
|
+
'ctrl': ctrl,
|
|
126
|
+
'match': matchVal,
|
|
127
|
+
'data': dataVal,
|
|
128
|
+
};
|
|
129
|
+
if (args is Map) {
|
|
130
|
+
args.forEach((k, v) => ctxmap[k.toString()] = v);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
final ctx = makeContext(ctxmap, entctx);
|
|
134
|
+
|
|
135
|
+
// Outbound: expose the caller's async-iterable/Stream payload so the
|
|
136
|
+
// request builder / transport can stream it as the request body.
|
|
137
|
+
final body = callopts is Map ? callopts['body'] : null;
|
|
138
|
+
if (null != body) {
|
|
139
|
+
final rd = ctx.reqdata is Map
|
|
140
|
+
? Map<String, dynamic>.from(ctx.reqdata)
|
|
141
|
+
: <String, dynamic>{};
|
|
142
|
+
rd[r'body$'] = body;
|
|
143
|
+
ctx.reqdata = rd;
|
|
144
|
+
ctrl['stream_out'] = body;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
dynamic fres;
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
fres = featureHook(ctx, 'PrePoint');
|
|
151
|
+
if (fres is Future) {
|
|
152
|
+
await fres;
|
|
153
|
+
}
|
|
154
|
+
ctx.out['point'] = makePoint(ctx);
|
|
155
|
+
if (iserr(ctx.out['point'])) {
|
|
156
|
+
throw ctx.out['point'];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
fres = featureHook(ctx, 'PreSpec');
|
|
160
|
+
if (fres is Future) {
|
|
161
|
+
await fres;
|
|
162
|
+
}
|
|
163
|
+
ctx.out['spec'] = makeSpec(ctx);
|
|
164
|
+
if (iserr(ctx.out['spec'])) {
|
|
165
|
+
throw ctx.out['spec'];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
fres = featureHook(ctx, 'PreRequest');
|
|
169
|
+
if (fres is Future) {
|
|
170
|
+
await fres;
|
|
171
|
+
}
|
|
172
|
+
ctx.out['request'] = await makeRequest(ctx);
|
|
173
|
+
if (iserr(ctx.out['request'])) {
|
|
174
|
+
throw ctx.out['request'];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
fres = featureHook(ctx, 'PreResponse');
|
|
178
|
+
if (fres is Future) {
|
|
179
|
+
await fres;
|
|
180
|
+
}
|
|
181
|
+
ctx.out['response'] = await makeResponse(ctx);
|
|
182
|
+
if (iserr(ctx.out['response'])) {
|
|
183
|
+
throw ctx.out['response'];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
fres = featureHook(ctx, 'PreResult');
|
|
187
|
+
if (fres is Future) {
|
|
188
|
+
await fres;
|
|
189
|
+
}
|
|
190
|
+
ctx.out['result'] = makeResult(ctx);
|
|
191
|
+
if (iserr(ctx.out['result'])) {
|
|
192
|
+
throw ctx.out['result'];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
fres = featureHook(ctx, 'PreDone');
|
|
196
|
+
if (fres is Future) {
|
|
197
|
+
await fres;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
final result = ctx.result;
|
|
201
|
+
|
|
202
|
+
// Inbound: prefer the streaming feature's incremental Stream; else fall
|
|
203
|
+
// back to the materialised items so `stream` always yields.
|
|
204
|
+
if (null != result && result.stream is Function) {
|
|
205
|
+
await for (final item in result.stream()) {
|
|
206
|
+
if (_streamAborted(signal)) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
yield item;
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
final data = done(ctx);
|
|
213
|
+
final items = data is List ? data : (null == data ? [] : [data]);
|
|
214
|
+
for (final item in items) {
|
|
215
|
+
if (_streamAborted(signal)) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
yield item;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
} catch (err) {
|
|
222
|
+
final uerr = unexpected(ctx, err);
|
|
223
|
+
if (null != uerr) {
|
|
224
|
+
throw uerr;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
bool _streamAborted(dynamic signal) {
|
|
230
|
+
if (null == signal) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
if (signal is Map) {
|
|
234
|
+
return true == signal['aborted'];
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
return true == (signal as dynamic).aborted;
|
|
238
|
+
} catch (_e) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
Map<String, dynamic> toJSON() {
|
|
244
|
+
final struct = utility.struct;
|
|
245
|
+
final out = <String, dynamic>{};
|
|
246
|
+
final d = struct.getdef(dataVal, {});
|
|
247
|
+
if (d is Map) {
|
|
248
|
+
d.forEach((k, v) => out[k.toString()] = v);
|
|
249
|
+
}
|
|
250
|
+
// The marker is NAMESPACED. It used to be `entity$` — a short, generic
|
|
251
|
+
// name, and the `$`-suffix convention is not unique to sdkgen. Seneca uses
|
|
252
|
+
// `entity$` on its own entities to hold the canon, so an SDK record fed
|
|
253
|
+
// into `entize` silently overwrote it and produced entities claiming a
|
|
254
|
+
// canon that does not exist: no error, just wrong entities.
|
|
255
|
+
out[r'voxgig$entity'] = Name;
|
|
256
|
+
return out;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@override
|
|
260
|
+
String toString() {
|
|
261
|
+
return Name + ' ' + utility.struct.jsonify(dataVal);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
dynamic unexpected(dynamic ctx, dynamic err) {
|
|
265
|
+
final clean = utility.clean;
|
|
266
|
+
final struct = utility.struct;
|
|
267
|
+
final delprop = struct.delprop;
|
|
268
|
+
|
|
269
|
+
final ctrl = ctx.ctrl;
|
|
270
|
+
|
|
271
|
+
ctrl['err'] = err;
|
|
272
|
+
|
|
273
|
+
if (null != ctrl['explain']) {
|
|
274
|
+
ctx.ctrl['explain'] = clean(ctx, ctx.ctrl['explain']);
|
|
275
|
+
delprop(ctx.ctrl['explain']['result'], 'err');
|
|
276
|
+
|
|
277
|
+
if (null != ctx.result && null != ctx.result.err) {
|
|
278
|
+
ctrl['explain']['err'] = clean(ctx, {
|
|
279
|
+
'code': errcode(ctx.result.err),
|
|
280
|
+
'message': errmsg(ctx.result.err),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
final cleanerr = clean(ctx, {
|
|
285
|
+
'code': errcode(err),
|
|
286
|
+
'message': errmsg(err),
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
if (null == ctrl['explain']['err']) {
|
|
290
|
+
ctrl['explain']['err'] = cleanerr;
|
|
291
|
+
} else if (ctrl['explain']['err']['message'] != cleanerr['message']) {
|
|
292
|
+
ctrl['explain']['unexpected'] = cleanerr;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (false == ctrl['throw']) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return err;
|
|
301
|
+
}
|
|
302
|
+
}
|