akanjs 2.2.4 → 2.2.6
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/CHANGELOG.md +9 -0
- package/base/base.ts +1 -1
- package/base/primitiveRegistry.ts +6 -10
- package/base/types.ts +1 -4
- package/capacitor.base.config.ts +1 -1
- package/client/capacitor.ts +1 -1
- package/client/cookie.ts +2 -4
- package/client/createFont.ts +2 -2
- package/client/csrTypes.ts +2 -8
- package/client/makePageProto.tsx +4 -10
- package/client/router.ts +3 -8
- package/client/translator.ts +4 -12
- package/common/Logger.ts +1 -4
- package/common/formatNumber.ts +2 -5
- package/common/hmrPhase.ts +1 -1
- package/common/isValidDate.ts +0 -3
- package/constant/fieldInfo.ts +3 -3
- package/constant/purify.ts +1 -2
- package/constant/types.ts +0 -4
- package/constant/via.ts +6 -12
- package/document/databaseRegistry.ts +0 -8
- package/document/into.ts +0 -1
- package/fetch/client/fetchClient.ts +1 -6
- package/fetch/client/httpClient.ts +1 -2
- package/fetch/fetchType/appliedReturn.type.ts +0 -1
- package/fetch/fetchType/endpointFetch.type.ts +0 -3
- package/fetch/fetchType/sliceFetch.type.ts +0 -8
- package/fetch/requestStorage.ts +2 -10
- package/package.json +67 -24
- package/server/akanApp.ts +2 -5
- package/server/akanLib.ts +0 -1
- package/server/akanServer.ts +3 -4
- package/server/artifact/builderRpc.ts +2 -2
- package/server/artifact/ipcTypes.ts +0 -4
- package/server/decorators.ts +1 -1
- package/server/di/diLifecycle.ts +3 -6
- package/server/hmr/clientScript.ts +2 -20
- package/server/hmr/devHmrController.ts +0 -4
- package/server/processMetricsCollector.ts +1 -1
- package/server/resolver/database.resolver.ts +2 -2
- package/server/resolver/resolver.contract.fixture.ts +0 -1
- package/server/resolver/signal.resolver.ts +2 -10
- package/server/routing/apiRouter.ts +2 -4
- package/server/rscClient.tsx +1 -7
- package/server/rscWorkerHost.ts +11 -33
- package/server/ssrFromRscRenderer.tsx +3 -35
- package/server/types/react-server-dom-webpack.d.ts +1 -7
- package/server/vendor/react-dom-client.ts +1 -1
- package/server/vendor/react-dom.ts +2 -3
- package/server/vendor/react-jsx-dev-runtime.ts +1 -1
- package/server/vendor/react-jsx-runtime.ts +1 -1
- package/server/vendor/react-refresh-runtime.ts +2 -2
- package/server/vendor/react-server-dom-webpack-client-browser.ts +1 -1
- package/server/vendor/react.ts +2 -9
- package/server/vendor/scheduler.ts +2 -3
- package/server/webRouter.ts +2 -3
- package/service/adapt.ts +1 -5
- package/service/predefinedAdaptor/cache.adaptor.ts +1 -2
- package/service/predefinedAdaptor/database.adaptor.ts +2 -2
- package/service/predefinedAdaptor/solidSqlite.ts +1 -2
- package/service/predefinedAdaptor/websocket.adaptor.ts +3 -15
- package/service/serve.ts +3 -7
- package/signal/base.signal.ts +0 -1
- package/signal/endpointInfo.ts +0 -7
- package/signal/intercept.ts +0 -2
- package/signal/middleware.ts +1 -2
- package/signal/serverSignal.ts +1 -15
- package/signal/signalContext.ts +1 -1
- package/signal/signalRegistry.ts +0 -5
- package/signal/sliceInfo.ts +0 -3
- package/signal/trace.ts +0 -11
- package/signal/types.ts +2 -11
- package/store/action.ts +3 -5
- package/store/stateBuilder.ts +0 -2
- package/store/stateInfo.ts +1 -2
- package/store/types.ts +1 -1
- package/test/playwright.config.base.ts +5 -28
- package/test/playwright.pageAgent.ts +1 -1
- package/test/sampleOf.ts +1 -1
- package/test/testServer.ts +1 -1
- package/types/base/base.d.ts +53 -0
- package/types/base/baseEnv.d.ts +68 -0
- package/types/base/index.d.ts +6 -0
- package/types/base/primitiveRegistry.d.ts +134 -0
- package/types/base/symbols.d.ts +11 -0
- package/types/base/types.d.ts +68 -0
- package/types/base/utils.d.ts +4 -0
- package/types/base.d.ts +1 -0
- package/types/capacitor.base.config.d.ts +3 -0
- package/types/client/capacitor.d.ts +233 -0
- package/types/client/clientRuntime.d.ts +63 -0
- package/types/client/cookie.d.ts +33 -0
- package/types/client/createFont.d.ts +6 -0
- package/types/client/csrTypes.d.ts +262 -0
- package/types/client/decorators.d.ts +7 -0
- package/types/client/device.d.ts +41 -0
- package/types/client/fetch.d.ts +1 -0
- package/types/client/index.d.ts +14 -0
- package/types/client/locale.d.ts +5 -0
- package/types/client/makePageProto.d.ts +17002 -0
- package/types/client/router.d.ts +66 -0
- package/types/client/rscNavigation.d.ts +19 -0
- package/types/client/storage.d.ts +5 -0
- package/types/client/translator.d.ts +18 -0
- package/types/client/types.d.ts +145 -0
- package/types/client/useClient.d.ts +1 -0
- package/types/client.d.ts +1 -0
- package/types/common/Logger.d.ts +41 -0
- package/types/common/applyMixins.d.ts +3 -0
- package/types/common/capitalize.d.ts +2 -0
- package/types/common/deepObjectify.d.ts +4 -0
- package/types/common/fileUpload.d.ts +28 -0
- package/types/common/formatNumber.d.ts +1 -0
- package/types/common/formatPhone.d.ts +2 -0
- package/types/common/getAllPropertyDescriptors.d.ts +5 -0
- package/types/common/hmrPhase.d.ts +6 -0
- package/types/common/httpClient.d.ts +20 -0
- package/types/common/index.d.ts +29 -0
- package/types/common/isDayjs.d.ts +2 -0
- package/types/common/isEmail.d.ts +2 -0
- package/types/common/isPhoneNumber.d.ts +2 -0
- package/types/common/isQueryEqual.d.ts +1 -0
- package/types/common/isValidDate.d.ts +2 -0
- package/types/common/jwtDecode.d.ts +2 -0
- package/types/common/localeConfig.d.ts +11 -0
- package/types/common/lowerlize.d.ts +2 -0
- package/types/common/mergeVersion.d.ts +10 -0
- package/types/common/objectify.d.ts +1 -0
- package/types/common/pathGet.d.ts +1 -0
- package/types/common/pathSet.d.ts +3 -0
- package/types/common/randomPick.d.ts +1 -0
- package/types/common/randomPicks.d.ts +1 -0
- package/types/common/routeConvention.d.ts +35 -0
- package/types/common/sleep.d.ts +2 -0
- package/types/common/splitVersion.d.ts +11 -0
- package/types/common/subRoute.d.ts +7 -0
- package/types/common/types.d.ts +14 -0
- package/types/common.d.ts +1 -0
- package/types/constant/constantRegistry.d.ts +89 -0
- package/types/constant/crystalize.d.ts +4 -0
- package/types/constant/deserialize.d.ts +7 -0
- package/types/constant/fieldInfo.d.ts +153 -0
- package/types/constant/getDefault.d.ts +3 -0
- package/types/constant/immerify.d.ts +2 -0
- package/types/constant/index.d.ts +10 -0
- package/types/constant/purify.d.ts +12 -0
- package/types/constant/serialize.d.ts +11 -0
- package/types/constant/types.d.ts +77 -0
- package/types/constant/via.d.ts +52 -0
- package/types/constant.d.ts +1 -0
- package/types/dictionary/base.dictionary.d.ts +1 -0
- package/types/dictionary/dictInfo.d.ts +206 -0
- package/types/dictionary/dictionary.d.ts +11 -0
- package/types/dictionary/index.d.ts +4 -0
- package/types/dictionary/locale.d.ts +128 -0
- package/types/dictionary/trans.d.ts +82 -0
- package/types/dictionary.d.ts +1 -0
- package/types/document/by.d.ts +20 -0
- package/types/document/dataLoader.d.ts +36 -0
- package/types/document/database.d.ts +96 -0
- package/types/document/databaseRegistry.d.ts +36 -0
- package/types/document/documentQuery.d.ts +105 -0
- package/types/document/documentSchema.d.ts +33 -0
- package/types/document/filterMeta.d.ts +84 -0
- package/types/document/index.d.ts +11 -0
- package/types/document/into.d.ts +65 -0
- package/types/document/loaderInfo.d.ts +35 -0
- package/types/document/schema.d.ts +5 -0
- package/types/document/types.d.ts +36 -0
- package/types/document.d.ts +1 -0
- package/types/fetch/client/fetchClient.d.ts +78 -0
- package/types/fetch/client/httpClient.d.ts +39 -0
- package/types/fetch/client/index.d.ts +3 -0
- package/types/fetch/client/wsClient.d.ts +37 -0
- package/types/fetch/client.d.ts +1 -0
- package/types/fetch/fetchType/appliedReturn.type.d.ts +67 -0
- package/types/fetch/fetchType/buildFetch.type.d.ts +11 -0
- package/types/fetch/fetchType/clientSignal.type.d.ts +16 -0
- package/types/fetch/fetchType/endpointFetch.type.d.ts +29 -0
- package/types/fetch/fetchType/index.d.ts +5 -0
- package/types/fetch/fetchType/sliceFetch.type.d.ts +76 -0
- package/types/fetch/fetchType.d.ts +1 -0
- package/types/fetch/index.d.ts +4 -0
- package/types/fetch/requestStorage.d.ts +29 -0
- package/types/fetch/serializer/fetch.serializer.d.ts +14 -0
- package/types/fetch/serializer/index.d.ts +1 -0
- package/types/fetch/serializer.d.ts +1 -0
- package/types/fetch/types.d.ts +19 -0
- package/types/fetch.d.ts +1 -0
- package/types/index.d.ts +213 -0
- package/types/server/akanApp.d.ts +17 -0
- package/types/server/akanAppHeaders.d.ts +1 -0
- package/types/server/akanLib.d.ts +33 -0
- package/types/server/akanOption.d.ts +15 -0
- package/types/server/akanServer.d.ts +47 -0
- package/types/server/artifact/builderRpc.d.ts +42 -0
- package/types/server/artifact/index.d.ts +6 -0
- package/types/server/artifact/ipcTypes.d.ts +73 -0
- package/types/server/artifact/manifestTypes.d.ts +16 -0
- package/types/server/artifact/routeClientCache.d.ts +45 -0
- package/types/server/artifact/routeSeedIndexStore.d.ts +43 -0
- package/types/server/artifact/routesManifestStore.d.ts +16 -0
- package/types/server/artifact.d.ts +1 -0
- package/types/server/decorators.d.ts +6 -0
- package/types/server/di/diLifecycle.d.ts +45 -0
- package/types/server/di/index.d.ts +4 -0
- package/types/server/di/predefinedAdaptor.d.ts +33 -0
- package/types/server/di/resolveAdaptorHierarchy.d.ts +21 -0
- package/types/server/di/resolveHierarchy.d.ts +11 -0
- package/types/server/di/resolveServiceHierarchy.d.ts +13 -0
- package/types/server/di/utils.d.ts +14 -0
- package/types/server/di.d.ts +1 -0
- package/types/server/hmr/changeBatch.d.ts +13 -0
- package/types/server/hmr/clientScript.d.ts +1 -0
- package/types/server/hmr/devHmrController.d.ts +24 -0
- package/types/server/hmr/index.d.ts +4 -0
- package/types/server/hmr/wsHub.d.ts +45 -0
- package/types/server/hmr.d.ts +1 -0
- package/types/server/imageOptimizer.d.ts +12 -0
- package/types/server/imageOptimizerError.d.ts +4 -0
- package/types/server/index.d.ts +14 -0
- package/types/server/lifecycle/shutdownManager.d.ts +13 -0
- package/types/server/logging/rotatingLogWriter.d.ts +20 -0
- package/types/server/processMetricsCollector.d.ts +10 -0
- package/types/server/proxy/akanResponse.d.ts +7 -0
- package/types/server/proxy/bunRequestFields.d.ts +1 -0
- package/types/server/proxy/hostBasePathWebProxy.d.ts +6 -0
- package/types/server/proxy/index.d.ts +6 -0
- package/types/server/proxy/localeWebProxy.d.ts +5 -0
- package/types/server/proxy/types.d.ts +37 -0
- package/types/server/proxy/webProxyRunner.d.ts +7 -0
- package/types/server/proxy.d.ts +1 -0
- package/types/server/resolver/database.resolver.d.ts +6 -0
- package/types/server/resolver/index.d.ts +3 -0
- package/types/server/resolver/service.resolver.d.ts +7 -0
- package/types/server/resolver/signal.resolver.d.ts +29 -0
- package/types/server/resolver.d.ts +1 -0
- package/types/server/robots.d.ts +1 -0
- package/types/server/routeElementComposer.d.ts +41 -0
- package/types/server/routeTreeBuilder.d.ts +28 -0
- package/types/server/routing/apiRouter.d.ts +61 -0
- package/types/server/rscClient.d.ts +15 -0
- package/types/server/rscWorker.d.ts +3 -0
- package/types/server/rscWorkerHost.d.ts +83 -0
- package/types/server/sitemap.d.ts +13 -0
- package/types/server/ssrFromRscRenderer.d.ts +6 -0
- package/types/server/ssrTypes.d.ts +47 -0
- package/types/server/systemPages.d.ts +27 -0
- package/types/server/types/react-server-dom-webpack.d.ts +91 -0
- package/types/server/types.d.ts +67 -0
- package/types/server/vendor/akanjs-base.d.ts +1 -0
- package/types/server/vendor/akanjs-common.d.ts +1 -0
- package/types/server/vendor/akanjs-constant.d.ts +1 -0
- package/types/server/vendor/akanjs-store.d.ts +1 -0
- package/types/server/vendor/react-dom-client.d.ts +3 -0
- package/types/server/vendor/react-dom.d.ts +3 -0
- package/types/server/vendor/react-jsx-dev-runtime.d.ts +3 -0
- package/types/server/vendor/react-jsx-runtime.d.ts +3 -0
- package/types/server/vendor/react-refresh-runtime.d.ts +3 -0
- package/types/server/vendor/react-server-dom-webpack-client-browser.d.ts +3 -0
- package/types/server/vendor/react.d.ts +11 -0
- package/types/server/vendor/scheduler.d.ts +3 -0
- package/types/server/webRouter.d.ts +44 -0
- package/types/server.d.ts +1 -0
- package/types/service/adapt.d.ts +15 -0
- package/types/service/base.service.d.ts +18 -0
- package/types/service/index.d.ts +10 -0
- package/types/service/injectInfo.d.ts +102 -0
- package/types/service/ipcTypes.d.ts +194 -0
- package/types/service/predefinedAdaptor/cache.adaptor.d.ts +46 -0
- package/types/service/predefinedAdaptor/compress.adaptor.d.ts +22 -0
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +329 -0
- package/types/service/predefinedAdaptor/index.d.ts +13 -0
- package/types/service/predefinedAdaptor/logging.adaptor.d.ts +20 -0
- package/types/service/predefinedAdaptor/queue.adaptor.d.ts +22 -0
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +17 -0
- package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +60 -0
- package/types/service/predefinedAdaptor/solidCache.adaptor.d.ts +25 -0
- package/types/service/predefinedAdaptor/solidPubsub.adaptor.d.ts +20 -0
- package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +19 -0
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +24 -0
- package/types/service/predefinedAdaptor/sqlitePath.d.ts +9 -0
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +80 -0
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +49 -0
- package/types/service/predefinedAdaptor.d.ts +1 -0
- package/types/service/serve.d.ts +31 -0
- package/types/service/serviceModule.d.ts +50 -0
- package/types/service/serviceRegistry.d.ts +9 -0
- package/types/service/types.d.ts +55 -0
- package/types/service.d.ts +1 -0
- package/types/signal/base.signal.d.ts +41 -0
- package/types/signal/endpoint.d.ts +28 -0
- package/types/signal/endpointInfo.d.ts +77 -0
- package/types/signal/exception.d.ts +54786 -0
- package/types/signal/guard.d.ts +10 -0
- package/types/signal/guards.d.ts +10 -0
- package/types/signal/index.d.ts +19 -0
- package/types/signal/intercept.d.ts +17 -0
- package/types/signal/internal.d.ts +18 -0
- package/types/signal/internalArg.d.ts +31 -0
- package/types/signal/internalInfo.d.ts +45 -0
- package/types/signal/middleware.d.ts +51 -0
- package/types/signal/serializer/fetch.serializer.d.ts +14 -0
- package/types/signal/serializer/index.d.ts +1 -0
- package/types/signal/serializer.d.ts +1 -0
- package/types/signal/serverSignal.d.ts +36 -0
- package/types/signal/signalContext.d.ts +96 -0
- package/types/signal/signalRegistry.d.ts +49 -0
- package/types/signal/slice.d.ts +42 -0
- package/types/signal/sliceInfo.d.ts +51 -0
- package/types/signal/trace.d.ts +97 -0
- package/types/signal/types.d.ts +142 -0
- package/types/signal.d.ts +1 -0
- package/types/store/action.d.ts +145 -0
- package/types/store/baseSt.d.ts +412 -0
- package/types/store/hooks.d.ts +1 -0
- package/types/store/index.d.ts +8 -0
- package/types/store/rootStore.d.ts +22 -0
- package/types/store/state.d.ts +91 -0
- package/types/store/stateBuilder.d.ts +141 -0
- package/types/store/stateInfo.d.ts +23 -0
- package/types/store/store.d.ts +36 -0
- package/types/store/storeInstance.d.ts +38 -0
- package/types/store/storeRegistry.d.ts +13 -0
- package/types/store/types.d.ts +42 -0
- package/types/store/withSelector.d.ts +42 -0
- package/types/store.d.ts +1 -0
- package/types/test/index.d.ts +4 -0
- package/types/test/playwright.config.base.d.ts +9 -0
- package/types/test/playwright.pageAgent.d.ts +12 -0
- package/types/test/sample.d.ts +15 -0
- package/types/test/sampleOf.d.ts +5 -0
- package/types/test/signalTest.preload.d.ts +1 -0
- package/types/test/signalTestRuntime.d.ts +29 -0
- package/types/test/testServer.d.ts +26 -0
- package/types/test.d.ts +1 -0
- package/types/ui/BottomSheet.d.ts +13 -0
- package/types/ui/Button.d.ts +11 -0
- package/types/ui/ClientSide.d.ts +8 -0
- package/types/ui/Clipboard.d.ts +7 -0
- package/types/ui/Constant/Doc.d.ts +29 -0
- package/types/ui/Constant/Mermaid.d.ts +8 -0
- package/types/ui/Constant/index.d.ts +6 -0
- package/types/ui/Constant/schemaDoc.d.ts +84 -0
- package/types/ui/Constant.d.ts +1 -0
- package/types/ui/Copy.d.ts +10 -0
- package/types/ui/CsrImage.d.ts +18 -0
- package/types/ui/Data/CardList.d.ts +36 -0
- package/types/ui/Data/Dashboard.d.ts +11 -0
- package/types/ui/Data/Insight.d.ts +9 -0
- package/types/ui/Data/Item.d.ts +75 -0
- package/types/ui/Data/ListContainer.d.ts +49 -0
- package/types/ui/Data/Pagination.d.ts +9 -0
- package/types/ui/Data/QueryMaker.d.ts +8 -0
- package/types/ui/Data/TableList.d.ts +26 -0
- package/types/ui/Data/index.d.ts +9 -0
- package/types/ui/Data/index_.d.ts +8 -0
- package/types/ui/Data.d.ts +1 -0
- package/types/ui/DatePicker.d.ts +36 -0
- package/types/ui/Dialog/Action.d.ts +5 -0
- package/types/ui/Dialog/Close.d.ts +6 -0
- package/types/ui/Dialog/Content.d.ts +6 -0
- package/types/ui/Dialog/Modal.d.ts +9 -0
- package/types/ui/Dialog/Provider.d.ts +11 -0
- package/types/ui/Dialog/Title.d.ts +5 -0
- package/types/ui/Dialog/Trigger.d.ts +6 -0
- package/types/ui/Dialog/context.d.ts +10 -0
- package/types/ui/Dialog/index.d.ts +9 -0
- package/types/ui/Dialog.d.ts +1 -0
- package/types/ui/DragAction.d.ts +24 -0
- package/types/ui/DraggableList.d.ts +31 -0
- package/types/ui/Dropdown.d.ts +14 -0
- package/types/ui/Empty.d.ts +12 -0
- package/types/ui/Field.d.ts +411 -0
- package/types/ui/FontFace.d.ts +6 -0
- package/types/ui/Image.d.ts +49 -0
- package/types/ui/InfiniteScroll.d.ts +10 -0
- package/types/ui/Input.d.ts +95 -0
- package/types/ui/KeyboardAvoiding.d.ts +8 -0
- package/types/ui/Layout/BottomAction.d.ts +6 -0
- package/types/ui/Layout/BottomInset.d.ts +7 -0
- package/types/ui/Layout/BottomTab.d.ts +14 -0
- package/types/ui/Layout/Header.d.ts +8 -0
- package/types/ui/Layout/LeftSider.d.ts +9 -0
- package/types/ui/Layout/Navbar.d.ts +11 -0
- package/types/ui/Layout/RightSider.d.ts +10 -0
- package/types/ui/Layout/Sider.d.ts +7 -0
- package/types/ui/Layout/Template.d.ts +7 -0
- package/types/ui/Layout/TopLeftAction.d.ts +6 -0
- package/types/ui/Layout/Unit.d.ts +9 -0
- package/types/ui/Layout/View.d.ts +8 -0
- package/types/ui/Layout/Zone.d.ts +6 -0
- package/types/ui/Layout/index.d.ts +14 -0
- package/types/ui/Layout.d.ts +1 -0
- package/types/ui/Link/Back.d.ts +7 -0
- package/types/ui/Link/Close.d.ts +7 -0
- package/types/ui/Link/CsrLink.d.ts +2 -0
- package/types/ui/Link/Lang.d.ts +8 -0
- package/types/ui/Link/SsrLink.d.ts +2 -0
- package/types/ui/Link/index.d.ts +10 -0
- package/types/ui/Link/types.d.ts +42 -0
- package/types/ui/Link.d.ts +1 -0
- package/types/ui/Load/Edit.d.ts +4 -0
- package/types/ui/Load/Edit_Client.d.ts +27 -0
- package/types/ui/Load/Page.d.ts +15 -0
- package/types/ui/Load/PageCSR.d.ts +3 -0
- package/types/ui/Load/Pagination.d.ts +8 -0
- package/types/ui/Load/Units.d.ts +30 -0
- package/types/ui/Load/View.d.ts +22 -0
- package/types/ui/Load/index.d.ts +8 -0
- package/types/ui/Load/index_.d.ts +3 -0
- package/types/ui/Load.d.ts +1 -0
- package/types/ui/Loading/Area.d.ts +1 -0
- package/types/ui/Loading/Button.d.ts +7 -0
- package/types/ui/Loading/Input.d.ts +7 -0
- package/types/ui/Loading/ProgressBar.d.ts +6 -0
- package/types/ui/Loading/Skeleton.d.ts +7 -0
- package/types/ui/Loading/Spin.d.ts +7 -0
- package/types/ui/Loading/index.d.ts +8 -0
- package/types/ui/Loading.d.ts +1 -0
- package/types/ui/Menu.d.ts +26 -0
- package/types/ui/Modal.d.ts +19 -0
- package/types/ui/Model/AdminPanel.d.ts +31 -0
- package/types/ui/Model/Edit.d.ts +16 -0
- package/types/ui/Model/EditModal.d.ts +52 -0
- package/types/ui/Model/EditWrapper.d.ts +13 -0
- package/types/ui/Model/LoadInit.d.ts +10 -0
- package/types/ui/Model/New.d.ts +16 -0
- package/types/ui/Model/NewWrapper.d.ts +13 -0
- package/types/ui/Model/NewWrapper_Client.d.ts +13 -0
- package/types/ui/Model/Remove.d.ts +13 -0
- package/types/ui/Model/RemoveWrapper.d.ts +12 -0
- package/types/ui/Model/SureToRemove.d.ts +11 -0
- package/types/ui/Model/View.d.ts +19 -0
- package/types/ui/Model/ViewEditModal.d.ts +12 -0
- package/types/ui/Model/ViewModal.d.ts +14 -0
- package/types/ui/Model/ViewWrapper.d.ts +12 -0
- package/types/ui/Model/index.d.ts +16 -0
- package/types/ui/Model/index_.d.ts +14 -0
- package/types/ui/Model.d.ts +1 -0
- package/types/ui/More.d.ts +12 -0
- package/types/ui/ObjectId.d.ts +5 -0
- package/types/ui/Pagination.d.ts +20 -0
- package/types/ui/Popconfirm.d.ts +28 -0
- package/types/ui/Portal.d.ts +6 -0
- package/types/ui/Radio.d.ts +19 -0
- package/types/ui/RecentTime.d.ts +12 -0
- package/types/ui/Refresh.d.ts +7 -0
- package/types/ui/ScreenNavigator.d.ts +18 -0
- package/types/ui/Select.d.ts +43 -0
- package/types/ui/Signal/Arg.d.ts +78 -0
- package/types/ui/Signal/Doc.d.ts +33 -0
- package/types/ui/Signal/Listener.d.ts +9 -0
- package/types/ui/Signal/Message.d.ts +23 -0
- package/types/ui/Signal/Object.d.ts +20 -0
- package/types/ui/Signal/PubSub.d.ts +24 -0
- package/types/ui/Signal/Request.d.ts +8 -0
- package/types/ui/Signal/Response.d.ts +14 -0
- package/types/ui/Signal/RestApi.d.ts +40 -0
- package/types/ui/Signal/WebSocket.d.ts +11 -0
- package/types/ui/Signal/index.d.ts +18 -0
- package/types/ui/Signal/makeExample.d.ts +4 -0
- package/types/ui/Signal/style.d.ts +15 -0
- package/types/ui/Signal.d.ts +1 -0
- package/types/ui/System/CSR.d.ts +32 -0
- package/types/ui/System/Client.d.ts +47 -0
- package/types/ui/System/Common.d.ts +47 -0
- package/types/ui/System/DevModeToggle.d.ts +1 -0
- package/types/ui/System/Gtag.d.ts +4 -0
- package/types/ui/System/Messages.d.ts +1 -0
- package/types/ui/System/Reconnect.d.ts +1 -0
- package/types/ui/System/Root.d.ts +6 -0
- package/types/ui/System/SSR.d.ts +24 -0
- package/types/ui/System/SelectLanguage.d.ts +5 -0
- package/types/ui/System/ThemeToggle.d.ts +4 -0
- package/types/ui/System/index.d.ts +12 -0
- package/types/ui/System.d.ts +1 -0
- package/types/ui/Tab/Menu.d.ts +12 -0
- package/types/ui/Tab/Menus.d.ts +6 -0
- package/types/ui/Tab/Panel.d.ts +8 -0
- package/types/ui/Tab/Provider.d.ts +10 -0
- package/types/ui/Tab/context.d.ts +9 -0
- package/types/ui/Tab/index.d.ts +7 -0
- package/types/ui/Tab.d.ts +1 -0
- package/types/ui/Table.d.ts +41 -0
- package/types/ui/ToggleSelect.d.ts +33 -0
- package/types/ui/Unauthorized.d.ts +9 -0
- package/types/ui/animated.d.ts +5 -0
- package/types/ui/fontCss.d.ts +11 -0
- package/types/ui/index.d.ts +44 -0
- package/types/ui.d.ts +1 -0
- package/types/webkit/bootCsr.d.ts +16 -0
- package/types/webkit/createRobotPage.d.ts +15 -0
- package/types/webkit/createSitemapPage.d.ts +4 -0
- package/types/webkit/index.d.ts +17 -0
- package/types/webkit/lazy.d.ts +11 -0
- package/types/webkit/types.d.ts +7 -0
- package/types/webkit/useCamera.d.ts +19 -0
- package/types/webkit/useCodepush.d.ts +16 -0
- package/types/webkit/useContact.d.ts +11 -0
- package/types/webkit/useCsrValues.d.ts +30 -0
- package/types/webkit/useDebounce.d.ts +2 -0
- package/types/webkit/useFetch.d.ts +18 -0
- package/types/webkit/useGeoLocation.d.ts +8 -0
- package/types/webkit/useHistory.d.ts +23 -0
- package/types/webkit/useInterval.d.ts +2 -0
- package/types/webkit/useLocation.d.ts +8 -0
- package/types/webkit/usePurchase.d.ts +19 -0
- package/types/webkit/usePushNoti.d.ts +7 -0
- package/types/webkit/useThrottle.d.ts +2 -0
- package/types/webkit.d.ts +1 -0
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Clipboard.tsx +1 -1
- package/ui/CsrImage.tsx +3 -14
- package/ui/Data/ListContainer.tsx +1 -1
- package/ui/Data/Pagination.tsx +1 -1
- package/ui/Data/QueryMaker.tsx +0 -339
- package/ui/Data/index.ts +0 -1
- package/ui/DatePicker.tsx +1 -95
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/DraggableList.tsx +5 -5
- package/ui/Field.tsx +2 -3
- package/ui/Image.tsx +2 -3
- package/ui/InfiniteScroll.tsx +0 -1
- package/ui/Input.tsx +1 -8
- package/ui/Layout/BottomTab.tsx +2 -2
- package/ui/Link/SsrLink.tsx +1 -2
- package/ui/Load/Page.tsx +1 -1
- package/ui/Load/PageCSR.tsx +0 -1
- package/ui/Load/Units.tsx +1 -2
- package/ui/Load/View.tsx +1 -2
- package/ui/Menu.tsx +5 -8
- package/ui/Model/EditModal.tsx +2 -5
- package/ui/Popconfirm.tsx +2 -4
- package/ui/ScreenNavigator.tsx +2 -3
- package/ui/Signal/Message.tsx +2 -3
- package/ui/Signal/PubSub.tsx +0 -2
- package/ui/Signal/Response.tsx +1 -1
- package/ui/Signal/WebSocket.tsx +2 -11
- package/ui/System/Client.tsx +7 -41
- package/ui/System/Gtag.tsx +2 -5
- package/ui/System/Messages.tsx +2 -2
- package/ui/System/Reconnect.tsx +5 -6
- package/ui/System/Root.tsx +0 -1
- package/ui/System/SSR.tsx +1 -7
- package/ui/ToggleSelect.tsx +3 -8
- package/ui/Unauthorized.tsx +1 -1
- package/webkit/bootCsr.tsx +3 -6
- package/webkit/lazy.tsx +1 -8
- package/webkit/useCamera.tsx +0 -1
- package/webkit/useCodepush.tsx +4 -9
- package/webkit/useContact.tsx +0 -1
- package/webkit/useCsrValues.ts +6 -10
- package/webkit/useDebounce.ts +2 -2
- package/webkit/usePurchase.tsx +5 -9
- package/webkit/usePushNoti.tsx +0 -1
- package/base/base.test.ts +0 -135
- package/base/baseEnv.test.ts +0 -146
- package/base/primitiveRegistry.test.ts +0 -127
- package/base/symbols.test.ts +0 -29
- package/base/utils.test.ts +0 -30
- package/build.ts +0 -318
- package/capacitor.base.config.test.ts +0 -83
- package/client/client.auth-storage.test.ts +0 -210
- package/client/client.decorators.test.ts +0 -74
- package/client/client.device.test.ts +0 -181
- package/client/client.page.test.tsx +0 -175
- package/client/client.pure.test.ts +0 -146
- package/client/client.router.test.ts +0 -290
- package/common/Logger.test.ts +0 -45
- package/common/formatAndValidation.test.ts +0 -61
- package/common/httpClient.test.ts +0 -91
- package/common/objectPath.test.ts +0 -108
- package/common/routeConvention.test.ts +0 -132
- package/common/runtimeConfig.test.ts +0 -84
- package/constant/constant.test.ts +0 -374
- package/dictionary/dictionary.test.ts +0 -352
- package/document/document.test.ts +0 -698
- package/fetch/fetch.test.ts +0 -838
- package/server/akanApp.test.ts +0 -130
- package/server/akanServer.test.ts +0 -157
- package/server/artifact/routeClientCache.test.ts +0 -265
- package/server/artifact/routeSeedIndex.test.ts +0 -56
- package/server/artifact/routesManifest.test.ts +0 -64
- package/server/di/diLifecycle.contract.test.ts +0 -168
- package/server/logging/rotatingLogWriter.test.ts +0 -119
- package/server/processMetrics.test.ts +0 -24
- package/server/proxy/webProxyRunner.test.ts +0 -66
- package/server/resolver/resolver.contract.test.ts +0 -594
- package/server/robots.test.ts +0 -16
- package/server/routeTree.test.tsx +0 -198
- package/server/routing/apiRouter.test.ts +0 -136
- package/server/sitemap.test.ts +0 -61
- package/server/systemPages.test.tsx +0 -93
- package/server/webRouter.test.ts +0 -49
- package/service/predefinedAdaptor/compress.adaptor.test.ts +0 -184
- package/service/predefinedAdaptor/solidCache.adaptor.test.ts +0 -107
- package/service/predefinedAdaptor/solidSqlite.test.ts +0 -457
- package/service/service.test.ts +0 -732
- package/signal/signal.test.ts +0 -892
- package/store/stateBuilder.test.ts +0 -168
- package/store/store.test.ts +0 -427
- package/tsconfig.json +0 -5
- package/ui/Constant/schemaDoc.test.ts +0 -113
- package/ui/InfiniteScroll.test.tsx +0 -155
- package/ui/System/Common.test.ts +0 -37
- package/webkit/bootCsr.test.tsx +0 -153
- package/webkit/native.test.tsx +0 -341
- package/webkit/webkit.test.tsx +0 -531
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Cls } from "akanjs/base";
|
|
2
|
+
import type { SignalContext } from "./signalContext.d.ts";
|
|
3
|
+
export interface Guard {
|
|
4
|
+
canPass(context: SignalContext): boolean;
|
|
5
|
+
}
|
|
6
|
+
export type GuardCls<Name extends string = string> = Cls<Guard, {
|
|
7
|
+
readonly name: Name;
|
|
8
|
+
}>;
|
|
9
|
+
/** Creates a named guard base class for signal access checks. */
|
|
10
|
+
export declare const guard: <T extends string>(name: T) => GuardCls<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Guard } from "./guard.d.ts";
|
|
2
|
+
import type { SignalContext } from "./signalContext.d.ts";
|
|
3
|
+
export declare class Public implements Guard {
|
|
4
|
+
static name: string;
|
|
5
|
+
canPass(context: SignalContext): boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class None implements Guard {
|
|
8
|
+
static name: string;
|
|
9
|
+
canPass(context: SignalContext): boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./base.signal";
|
|
2
|
+
export * from "./endpoint.d.ts";
|
|
3
|
+
export * from "./endpointInfo.d.ts";
|
|
4
|
+
export * from "./exception.d.ts";
|
|
5
|
+
export * from "./guard.d.ts";
|
|
6
|
+
export * from "./guards.d.ts";
|
|
7
|
+
export * from "./intercept.d.ts";
|
|
8
|
+
export * from "./internal.d.ts";
|
|
9
|
+
export * from "./internalArg.d.ts";
|
|
10
|
+
export * from "./internalInfo.d.ts";
|
|
11
|
+
export * from "./middleware.d.ts";
|
|
12
|
+
export * from "./serializer.d.ts";
|
|
13
|
+
export * from "./serverSignal.d.ts";
|
|
14
|
+
export * from "./signalContext.d.ts";
|
|
15
|
+
export * from "./signalRegistry.d.ts";
|
|
16
|
+
export * from "./slice.d.ts";
|
|
17
|
+
export * from "./sliceInfo.d.ts";
|
|
18
|
+
export * from "./trace.d.ts";
|
|
19
|
+
export * from "./types.d.ts";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Cls, INJECT_META } from "akanjs/base";
|
|
2
|
+
import { Logger } from "akanjs/common";
|
|
3
|
+
import { type ExtractInjectInfoObject, type InjectBuilder, type InjectInfo } from "akanjs/service";
|
|
4
|
+
import type { SignalContext } from "./signalContext.d.ts";
|
|
5
|
+
export type InterceptorCls<Methods = {}, InjectMap extends {
|
|
6
|
+
[key: string]: InjectInfo;
|
|
7
|
+
} = {}> = Cls<Methods & ExtractInjectInfoObject<InjectMap> & {
|
|
8
|
+
readonly logger: Logger;
|
|
9
|
+
onInit(): Promise<void>;
|
|
10
|
+
onDestroy(): Promise<void>;
|
|
11
|
+
intercept(context: SignalContext): AsyncGenerator<unknown> | Promise<unknown>;
|
|
12
|
+
}, {
|
|
13
|
+
readonly [INJECT_META]: InjectMap;
|
|
14
|
+
readonly refName: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function intercept<Name extends string>(name: Name): InterceptorCls;
|
|
17
|
+
export declare function intercept<Name extends string, Injection extends InjectBuilder<"use" | "env" | "memory">>(refName: Name, injectBuilder: Injection): InterceptorCls<{}, ReturnType<Injection>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { INTERNAL_META, type MergeAllKeyOfObjects } from "akanjs/base";
|
|
2
|
+
import { type Adaptor, type AdaptorCls, type QueueAdaptor, type ScheduleAdaptor, type ServiceModel } from "akanjs/service";
|
|
3
|
+
import { type BuildInternal, type InternalBuilder, type InternalInfo } from "./internalInfo.d.ts";
|
|
4
|
+
export interface Internal extends Adaptor {
|
|
5
|
+
schedule: ScheduleAdaptor;
|
|
6
|
+
queue: QueueAdaptor;
|
|
7
|
+
}
|
|
8
|
+
export type InternalCls<SrvModule extends ServiceModel = ServiceModel, InternalInfoMap extends {
|
|
9
|
+
[key: string]: InternalInfo;
|
|
10
|
+
} = {
|
|
11
|
+
[key: string]: InternalInfo;
|
|
12
|
+
}> = AdaptorCls & {
|
|
13
|
+
refName: SrvModule["srv"]["refName"];
|
|
14
|
+
srv: SrvModule;
|
|
15
|
+
[INTERNAL_META]: InternalInfoMap;
|
|
16
|
+
};
|
|
17
|
+
/** Builds an internal adaptor for schedules, queues, processes, and server-only jobs. */
|
|
18
|
+
export declare function internal<SrvModule extends ServiceModel, InternalInfoMap extends ReturnType<InternalBuilder<SrvModule>>, LibInternals extends InternalCls[]>(srv: SrvModule, internalBuilder: (builder: BuildInternal<SrvModule>) => InternalInfoMap, ...libInternals: LibInternals): InternalCls<SrvModule, MergeAllKeyOfObjects<LibInternals, typeof INTERNAL_META> & InternalInfoMap>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Cls, PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import type { SignalContext } from "./signalContext.d.ts";
|
|
3
|
+
export interface InternalArg<ArgType = unknown> {
|
|
4
|
+
getArg: (context: SignalContext) => PromiseOrObject<ArgType | null>;
|
|
5
|
+
}
|
|
6
|
+
export type InternalArgCls<ArgType = unknown> = Cls<InternalArg<ArgType>>;
|
|
7
|
+
/** Injects the current Bun request into an endpoint/internal handler. */
|
|
8
|
+
export declare class Req implements InternalArg {
|
|
9
|
+
getArg(context: SignalContext): Bun.BunRequest;
|
|
10
|
+
}
|
|
11
|
+
/** Injects the current mutable response context into an endpoint/internal handler. */
|
|
12
|
+
export declare class Res implements InternalArg {
|
|
13
|
+
getArg(context: SignalContext): {
|
|
14
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
15
|
+
prototype: Response;
|
|
16
|
+
error(): Response;
|
|
17
|
+
json(data: any, init?: ResponseInit): Response;
|
|
18
|
+
redirect(url: string | URL, status?: number): Response;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Injects websocket state and subscription hooks into message/pubsub handlers. */
|
|
22
|
+
export declare class Ws implements InternalArg {
|
|
23
|
+
onDisconnect?: () => void;
|
|
24
|
+
onUnsubscribe?: () => void;
|
|
25
|
+
getArg(context: SignalContext): {
|
|
26
|
+
ws: Bun.ServerWebSocket<unknown>;
|
|
27
|
+
subscribe: boolean;
|
|
28
|
+
on: (event: "disconnect" | "unsubscribe", handler: () => void) => void;
|
|
29
|
+
off: (event: "disconnect" | "unsubscribe", handler: () => void) => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Any, type FIELD_META, type PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import type { ConstantCls, ConstantField, ConstantFieldTypeInput, DocumentModel, FieldObject, FieldToValue, PlainTypeToFieldType } from "akanjs/constant";
|
|
3
|
+
import type { AkanJob, ServiceModel } from "akanjs/service";
|
|
4
|
+
import { type ArgInfo, type InternalArgInfo, type ReturnInfo } from "./endpointInfo.d.ts";
|
|
5
|
+
import type { InternalArgCls } from "./internalArg.d.ts";
|
|
6
|
+
import type { SignalOption } from "./types.d.ts";
|
|
7
|
+
type InternalType = "resolveField" | "interval" | "cron" | "timeout" | "init" | "destroy" | "process";
|
|
8
|
+
interface InternalArgProps<Nullable extends boolean = false> {
|
|
9
|
+
nullable?: Nullable;
|
|
10
|
+
}
|
|
11
|
+
export declare class InternalInfo<ReqType extends InternalType = InternalType, Srvs extends {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
} = {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}, Args extends any[] = any, InternalArgs extends any[] = any, DefaultArgs extends any[] = any, Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, ServerReturns = any, Nullable extends boolean = boolean> {
|
|
16
|
+
readonly type: ReqType;
|
|
17
|
+
readonly args: ArgInfo<InternalArgProps<boolean>>[];
|
|
18
|
+
readonly internalArgs: InternalArgInfo<boolean>[];
|
|
19
|
+
readonly defaultArgs: string[];
|
|
20
|
+
readonly returns: ReturnInfo<Returns, Nullable>;
|
|
21
|
+
readonly signalOption: SignalOption<Returns, Nullable>;
|
|
22
|
+
execFn: ((...args: [...Args, ...DefaultArgs, ...InternalArgs]) => ServerReturns) | null;
|
|
23
|
+
constructor(type: ReqType, returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>);
|
|
24
|
+
msg<ExplicitType, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>, Nullable extends boolean = false, _FieldToValue = FieldToValue<Arg>>(name: string, arg: Arg, option?: InternalArgProps<Nullable>): InternalInfo<ReqType, Srvs, [...Args, arg: _FieldToValue | (Nullable extends true ? undefined : never)], InternalArgs, DefaultArgs, Returns, ServerReturns, Nullable>;
|
|
25
|
+
with<ArgType, Optional extends boolean = false>(argRef: InternalArgCls<ArgType>, option?: InternalArgProps<Optional>): InternalInfo<ReqType, Srvs, Args, [...InternalArgs, arg: NonNullable<ArgType> | (Optional extends true ? null : ReqType extends "resolveField" ? null : never)], DefaultArgs, Returns, ServerReturns, Nullable>;
|
|
26
|
+
exec<ExecReturn extends ReqType extends "process" | "resolveField" ? PromiseOrObject<DocumentModel<FieldToValue<Returns>> | (Nullable extends true ? null : never)> : PromiseOrObject<void>>(execFn: (this: Srvs, ...args: [...Args, ...DefaultArgs, ...InternalArgs]) => ExecReturn): InternalInfo<ReqType, Srvs, Args, InternalArgs, DefaultArgs, Returns, ExecReturn, Nullable>;
|
|
27
|
+
}
|
|
28
|
+
export type BuildInternal<SrvModule extends ServiceModel, ParentDoc = SrvModule["db"]["_Doc"]> = {
|
|
29
|
+
resolveField: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: Pick<SignalOption<Returns, Nullable>, "nullable">) => InternalInfo<"resolveField", SrvModule["srvMap"], [], [], [ParentDoc], Returns, never, Nullable>;
|
|
30
|
+
interval: <Nullable extends boolean = false>(scheduleTime: number, signalOption?: SignalOption<typeof Any, Nullable>) => InternalInfo<"interval", SrvModule["srvMap"], [], [], [], typeof Any, never, Nullable>;
|
|
31
|
+
cron: <Nullable extends boolean = false>(scheduleCron: string, signalOption?: SignalOption<typeof Any, Nullable>) => InternalInfo<"cron", SrvModule["srvMap"], [], [], [], typeof Any, never, Nullable>;
|
|
32
|
+
timeout: <Nullable extends boolean = false>(timeout: number, signalOption?: SignalOption<typeof Any, Nullable>) => InternalInfo<"timeout", SrvModule["srvMap"], [], [], [], typeof Any, never, Nullable>;
|
|
33
|
+
initialize: <Nullable extends boolean = false>(signalOption?: SignalOption<typeof Any, Nullable>) => InternalInfo<"init", SrvModule["srvMap"], [], [], [], typeof Any, never, Nullable>;
|
|
34
|
+
destroy: <Nullable extends boolean = false>(signalOption?: SignalOption<typeof Any, Nullable>) => InternalInfo<"destroy", SrvModule["srvMap"], [], [], [], typeof Any, never, Nullable>;
|
|
35
|
+
process: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>) => InternalInfo<"process", SrvModule["srvMap"], [], [], [AkanJob], Returns, never, Nullable>;
|
|
36
|
+
};
|
|
37
|
+
export type InternalBuilder<SrvModule extends ServiceModel, _FullCls extends ConstantCls = SrvModule["cnst"]["full"], _FieldObj extends FieldObject = _FullCls[typeof FIELD_META], _ResolveFieldObj extends FieldObject = {
|
|
38
|
+
[K in keyof _FieldObj as _FieldObj[K] extends ConstantField<"resolve", any, any, any, any, any> ? K : never]: _FieldObj[K];
|
|
39
|
+
}> = (builder: BuildInternal<SrvModule>) => SrvModule["cnst"] extends never ? {
|
|
40
|
+
[key: string]: InternalInfo<Exclude<InternalType, "resolveField">>;
|
|
41
|
+
} : {
|
|
42
|
+
[K in keyof _ResolveFieldObj]: _ResolveFieldObj[K] extends ConstantField<"resolve", infer Value, any, any, infer Nullable> ? InternalInfo<"resolveField", any, any, any, any, NonNullable<Value>, Nullable> : InternalInfo<Exclude<InternalType, "resolveField">>;
|
|
43
|
+
};
|
|
44
|
+
export declare const buildInternal: BuildInternal<any, any>;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { BaseEnv, Cls, PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import type { SignalContext } from "./signalContext.d.ts";
|
|
3
|
+
export interface Middleware<Env extends BaseEnv = BaseEnv> {
|
|
4
|
+
use(env: Env): PromiseOrObject<(context: SignalContext, next: () => Promise<unknown>) => PromiseOrObject<unknown>>;
|
|
5
|
+
}
|
|
6
|
+
export type MiddlewareCls = Cls<Middleware, {
|
|
7
|
+
readonly refName: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const middleware: (refName: string) => {
|
|
10
|
+
new (): {
|
|
11
|
+
use(env: BaseEnv): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
12
|
+
};
|
|
13
|
+
refName: string;
|
|
14
|
+
};
|
|
15
|
+
declare const Logging_base: {
|
|
16
|
+
new (): {
|
|
17
|
+
use(env: BaseEnv): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
18
|
+
};
|
|
19
|
+
refName: string;
|
|
20
|
+
};
|
|
21
|
+
export declare class Logging extends Logging_base {
|
|
22
|
+
use(): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
23
|
+
}
|
|
24
|
+
declare const Cache_base: {
|
|
25
|
+
new (): {
|
|
26
|
+
use(env: BaseEnv): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
27
|
+
};
|
|
28
|
+
refName: string;
|
|
29
|
+
};
|
|
30
|
+
export declare class Cache extends Cache_base {
|
|
31
|
+
use(): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<any>>;
|
|
32
|
+
}
|
|
33
|
+
declare const Timeout_base: {
|
|
34
|
+
new (): {
|
|
35
|
+
use(env: BaseEnv): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
36
|
+
};
|
|
37
|
+
refName: string;
|
|
38
|
+
};
|
|
39
|
+
export declare class Timeout extends Timeout_base {
|
|
40
|
+
use(): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
41
|
+
}
|
|
42
|
+
declare const Retry_base: {
|
|
43
|
+
new (): {
|
|
44
|
+
use(env: BaseEnv): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
45
|
+
};
|
|
46
|
+
refName: string;
|
|
47
|
+
};
|
|
48
|
+
export declare class Retry extends Retry_base {
|
|
49
|
+
use(): Promise<(context: SignalContext, next: () => Promise<unknown>) => Promise<unknown>>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Logger } from "akanjs/common";
|
|
2
|
+
import type { LiveRegistry } from "akanjs/service";
|
|
3
|
+
import type { EndpointCls, SerializedSignal, SliceCls } from "akanjs/signal";
|
|
4
|
+
export declare class FetchSerializer {
|
|
5
|
+
#private;
|
|
6
|
+
static logger: Logger;
|
|
7
|
+
static serializeDatabaseSignal(sliceCls: SliceCls, endpointCls: EndpointCls): SerializedSignal;
|
|
8
|
+
static serializeServiceSignal(endpointCls: EndpointCls): SerializedSignal;
|
|
9
|
+
static serializeRegistry({ endpointCls, sliceCls }: LiveRegistry): {
|
|
10
|
+
signal: {
|
|
11
|
+
[key: string]: SerializedSignal;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./fetch.serializer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./serializer/index.d.ts";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ENDPOINT_META, INJECT_META, INTERNAL_META } from "akanjs/base";
|
|
2
|
+
import type { DocumentModel } from "akanjs/constant";
|
|
3
|
+
import { type Adaptor, type AdaptorCls, type AkanJob, type AkanJobOptions, type QueueAdaptor } from "akanjs/service";
|
|
4
|
+
import type { ServerWebSocket } from "bun";
|
|
5
|
+
import type { EndpointInfo } from "./endpointInfo.d.ts";
|
|
6
|
+
import type { InternalInfo } from "./internalInfo.d.ts";
|
|
7
|
+
export interface ServerSignal extends Adaptor {
|
|
8
|
+
readonly websocket: ServerWebSocket;
|
|
9
|
+
readonly queue: QueueAdaptor;
|
|
10
|
+
}
|
|
11
|
+
type EndpointServerSignalMethods<EnpCls> = EnpCls extends {
|
|
12
|
+
[ENDPOINT_META]: infer EndpointInfoObj;
|
|
13
|
+
} ? {
|
|
14
|
+
[K in keyof EndpointInfoObj as EndpointInfoObj[K] extends EndpointInfo<"pubsub", any, any, any, any, any, any, any, any> ? K : never]: EndpointInfoObj[K] extends EndpointInfo<any, any, any, any, any, infer ServerArgs, any, infer ClientReturns, any, any> ? (...args: [...ServerArgs, data: DocumentModel<ClientReturns>]) => void : never;
|
|
15
|
+
} : never;
|
|
16
|
+
type InternalServerSignalMethods<IntCls> = IntCls extends {
|
|
17
|
+
[INTERNAL_META]: infer InternalInfoObj;
|
|
18
|
+
} ? {
|
|
19
|
+
[K in keyof InternalInfoObj as InternalInfoObj[K] extends InternalInfo<"process", any, any, any, any, any, any, any> ? K : never]: InternalInfoObj[K] extends InternalInfo<any, any, infer ServerArgs, any, any, any, infer ServerReturns> ? (...args: [...args: ServerArgs, jobOptions?: AkanJobOptions]) => Promise<AkanJob<any, ServerReturns>> : never;
|
|
20
|
+
} : never;
|
|
21
|
+
type ServerSignalClsStatics = {
|
|
22
|
+
readonly refName: string;
|
|
23
|
+
readonly [INJECT_META]: {
|
|
24
|
+
queue: QueueAdaptor;
|
|
25
|
+
};
|
|
26
|
+
readonly [ENDPOINT_META]: {
|
|
27
|
+
[key: string]: EndpointInfo;
|
|
28
|
+
};
|
|
29
|
+
readonly [INTERNAL_META]: {
|
|
30
|
+
[key: string]: InternalInfo;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type ServerSignalCls<EnpCls = any, IntCls = any> = AdaptorCls<EndpointServerSignalMethods<EnpCls> & InternalServerSignalMethods<IntCls> & ServerSignal> & ServerSignalClsStatics;
|
|
34
|
+
/** Composes endpoint and internal classes into a server-side signal class. */
|
|
35
|
+
export declare const serverSignal: <EnpCls, IntCls>(endpointRef: EnpCls, internalRef: IntCls) => ServerSignalCls<EnpCls, IntCls>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type BaseEnv, type PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import { type ConstantFieldTypeInput } from "akanjs/constant";
|
|
3
|
+
import type { Adaptor, AdaptorCls, DatabaseService, InjectRegistry, LiveRegistry } from "akanjs/service";
|
|
4
|
+
import type { Internal, InternalInfo, MiddlewareCls } from ".";
|
|
5
|
+
import type { EndpointInfo } from "./endpointInfo.d.ts";
|
|
6
|
+
import { SignalTrace } from "./trace.d.ts";
|
|
7
|
+
export type SignalTransportType = "http" | "websocket";
|
|
8
|
+
interface WebSocketRequest {
|
|
9
|
+
ws: Bun.ServerWebSocket<unknown>;
|
|
10
|
+
data: unknown[];
|
|
11
|
+
eventType: WebSocketEventType;
|
|
12
|
+
}
|
|
13
|
+
type RuntimeRecord = Record<string, unknown>;
|
|
14
|
+
export declare class SignalContext<Ctx extends HttpExecutionContext | WebSocketExecutionContext = HttpExecutionContext | WebSocketExecutionContext, Env extends BaseEnv = BaseEnv> {
|
|
15
|
+
#private;
|
|
16
|
+
key: string;
|
|
17
|
+
transport: SignalTransportType;
|
|
18
|
+
ctx: Ctx;
|
|
19
|
+
endpointInfo: EndpointInfo;
|
|
20
|
+
adaptor: Adaptor;
|
|
21
|
+
args: unknown[];
|
|
22
|
+
internalArgs: unknown[];
|
|
23
|
+
trace: SignalTrace | null;
|
|
24
|
+
constructor(key: string, reqOrWsReq: Bun.BunRequest | WebSocketRequest, { endpointInfo, adaptor, registry, env, live, middleware, }: {
|
|
25
|
+
endpointInfo: EndpointInfo;
|
|
26
|
+
adaptor: Adaptor;
|
|
27
|
+
registry: InjectRegistry;
|
|
28
|
+
env: Env;
|
|
29
|
+
live: LiveRegistry;
|
|
30
|
+
middleware: Map<string, MiddlewareCls>;
|
|
31
|
+
});
|
|
32
|
+
getAdaptor<T extends Adaptor>(adaptorCls: AdaptorCls<T>): T;
|
|
33
|
+
init(): Promise<this>;
|
|
34
|
+
exec(): Promise<Response | undefined>;
|
|
35
|
+
static try(endpoint: Adaptor, endpointInfo: EndpointInfo, key: string, fn: () => Promise<Response | undefined>): Promise<Response | undefined>;
|
|
36
|
+
static resolveReturn(value: unknown, { signalContext, returnRef, arrDepth, registry, live, }: {
|
|
37
|
+
signalContext: SignalContext | null;
|
|
38
|
+
returnRef: ConstantFieldTypeInput;
|
|
39
|
+
arrDepth: number;
|
|
40
|
+
registry: InjectRegistry;
|
|
41
|
+
live: LiveRegistry;
|
|
42
|
+
}): Promise<unknown>;
|
|
43
|
+
static loadNested(value: unknown, service: DatabaseService, { arrDepth, nullable }: {
|
|
44
|
+
arrDepth: number;
|
|
45
|
+
nullable: boolean;
|
|
46
|
+
}): Promise<unknown>;
|
|
47
|
+
getHttpContext<Appended = unknown>(): HttpExecutionContext<Appended>;
|
|
48
|
+
getWebSocketContext<Appended = unknown>(): WebSocketExecutionContext<Appended>;
|
|
49
|
+
getRoomId(key: string): string;
|
|
50
|
+
getEnv(): Env;
|
|
51
|
+
}
|
|
52
|
+
export declare class HttpExecutionContext<Appended = unknown> {
|
|
53
|
+
#private;
|
|
54
|
+
req: Bun.BunRequest & Appended;
|
|
55
|
+
res: {
|
|
56
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
57
|
+
prototype: Response;
|
|
58
|
+
error(): Response;
|
|
59
|
+
json(data: any, init?: ResponseInit): Response;
|
|
60
|
+
redirect(url: string | URL, status?: number): Response;
|
|
61
|
+
};
|
|
62
|
+
params: RuntimeRecord;
|
|
63
|
+
searchParams: RuntimeRecord;
|
|
64
|
+
body: RuntimeRecord;
|
|
65
|
+
constructor(req: Bun.BunRequest);
|
|
66
|
+
get url(): URL;
|
|
67
|
+
getArgs(endpointInfo: EndpointInfo): Promise<unknown[]>;
|
|
68
|
+
makeResponse(result: unknown, endpointInfo: EndpointInfo): Response;
|
|
69
|
+
}
|
|
70
|
+
export type WebSocketEventType = "open" | "subscribe" | "unsubscribe" | "message" | "close";
|
|
71
|
+
export declare class WebSocketExecutionContext<Appended = unknown> {
|
|
72
|
+
ws: Bun.ServerWebSocket<Appended>;
|
|
73
|
+
data: unknown[];
|
|
74
|
+
roomId: string;
|
|
75
|
+
eventType: WebSocketEventType;
|
|
76
|
+
onDisconnect: Set<() => PromiseOrObject<void>>;
|
|
77
|
+
onUnsubscribe: Set<() => PromiseOrObject<void>>;
|
|
78
|
+
constructor(wsReq: WebSocketRequest);
|
|
79
|
+
getArgs(endpointInfo: EndpointInfo): Promise<unknown[]>;
|
|
80
|
+
makeResponse(result: unknown, endpointInfo: EndpointInfo): Response;
|
|
81
|
+
on(event: "disconnect" | "unsubscribe", handler: () => void): void;
|
|
82
|
+
off(event: "disconnect" | "unsubscribe", handler: () => void): void;
|
|
83
|
+
}
|
|
84
|
+
export declare class ResolveFieldContext {
|
|
85
|
+
signalContext: SignalContext | null;
|
|
86
|
+
internalInfo: InternalInfo<"resolveField">;
|
|
87
|
+
internal: Internal;
|
|
88
|
+
parent: unknown;
|
|
89
|
+
constructor(parent: unknown, { signalContext, internalInfo, internal, }: {
|
|
90
|
+
signalContext: SignalContext | null;
|
|
91
|
+
internalInfo: InternalInfo<"resolveField">;
|
|
92
|
+
internal: Internal;
|
|
93
|
+
});
|
|
94
|
+
exec(): Promise<any>;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EndpointCls } from "./endpoint.d.ts";
|
|
2
|
+
import type { InternalCls } from "./internal.d.ts";
|
|
3
|
+
import type { ServerSignalCls } from "./serverSignal.d.ts";
|
|
4
|
+
import type { SliceCls } from "./slice.d.ts";
|
|
5
|
+
import type { SerializedSignal } from "./types.d.ts";
|
|
6
|
+
type SignalBaseRef<SigCls> = SigCls extends {
|
|
7
|
+
srv: {
|
|
8
|
+
srv: {
|
|
9
|
+
refName: infer RefName;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
} ? RefName : never;
|
|
13
|
+
type SignalWithBase<RefName extends string, SigCls> = SignalBaseRef<SigCls> extends RefName ? SigCls : never;
|
|
14
|
+
export declare class DatabaseSignal<IntlCls extends InternalCls = InternalCls, EndpCls extends EndpointCls = EndpointCls, SlceCls extends SliceCls = SliceCls, SrvrCls extends ServerSignalCls = ServerSignalCls> {
|
|
15
|
+
internal: IntlCls;
|
|
16
|
+
endpoint: EndpCls;
|
|
17
|
+
slice: SlceCls;
|
|
18
|
+
server: SrvrCls;
|
|
19
|
+
serializedSignal: SerializedSignal;
|
|
20
|
+
constructor(internal: IntlCls, endpoint: EndpCls, slice: SlceCls, server: SrvrCls);
|
|
21
|
+
}
|
|
22
|
+
export declare class ServiceSignal<IntlCls extends InternalCls = InternalCls, EndpCls extends EndpointCls = EndpointCls, SrvrCls extends ServerSignalCls = ServerSignalCls> {
|
|
23
|
+
internal: IntlCls;
|
|
24
|
+
endpoint: EndpCls;
|
|
25
|
+
server: SrvrCls;
|
|
26
|
+
serializedSignal: SerializedSignal;
|
|
27
|
+
constructor(internal: IntlCls, endpoint: EndpCls, server: SrvrCls);
|
|
28
|
+
}
|
|
29
|
+
/** Registry for database and service signals used by routing and fetch serialization. */
|
|
30
|
+
export declare class SignalRegistry {
|
|
31
|
+
#private;
|
|
32
|
+
static registerDatabase<RefName extends string, IntlCls extends InternalCls, EndpCls extends EndpointCls, SlceCls extends SliceCls, SrvrCls extends ServerSignalCls>(refName: RefName, internal: SignalWithBase<RefName, IntlCls>, endpoint: SignalWithBase<RefName, EndpCls>, slice: SignalWithBase<RefName, SlceCls>, server: SrvrCls): DatabaseSignal<IntlCls, EndpCls, SlceCls, SrvrCls>;
|
|
33
|
+
static getDatabase(refName: string): DatabaseSignal<InternalCls, EndpointCls<import("../service.d.ts").ServiceModel<import("../service.d.ts").ServiceCls, any, any, {
|
|
34
|
+
[x: `${Uncapitalize<string>}Service`]: import("../service.d.ts").ExtractInjectInfoObject<{}> & import("../service.d.ts").Service;
|
|
35
|
+
}>, {
|
|
36
|
+
[key: string]: import("./endpointInfo.d.ts").EndpointInfo<import("./endpointInfo.d.ts").EndpointType, {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}, any, any, any, any, import("../constant.d.ts").ConstantFieldTypeInput, never, never, boolean>;
|
|
39
|
+
}>, SliceCls, ServerSignalCls> | undefined;
|
|
40
|
+
static registerService<RefName extends string, IntlCls extends InternalCls, EndpCls extends EndpointCls, SrvrCls extends ServerSignalCls>(refName: RefName, internal: SignalWithBase<RefName, IntlCls>, endpoint: SignalWithBase<RefName, EndpCls>, server: SrvrCls): ServiceSignal<IntlCls, EndpCls, SrvrCls>;
|
|
41
|
+
static getService(refName: string): ServiceSignal<InternalCls, EndpointCls<import("../service.d.ts").ServiceModel<import("../service.d.ts").ServiceCls, any, any, {
|
|
42
|
+
[x: `${Uncapitalize<string>}Service`]: import("../service.d.ts").ExtractInjectInfoObject<{}> & import("../service.d.ts").Service;
|
|
43
|
+
}>, {
|
|
44
|
+
[key: string]: import("./endpointInfo.d.ts").EndpointInfo<import("./endpointInfo.d.ts").EndpointType, {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}, any, any, any, any, import("../constant.d.ts").ConstantFieldTypeInput, never, never, boolean>;
|
|
47
|
+
}>, ServerSignalCls> | undefined;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Assign, type Cls, type MergeAllKeyOfObjects, SLICE_META } from "akanjs/base";
|
|
2
|
+
import type { DocumentModel, QueryOf } from "akanjs/constant";
|
|
3
|
+
import type { FilterInstance } from "akanjs/document";
|
|
4
|
+
import { type Adaptor, type AdaptorCls, type ServiceModel } from "akanjs/service";
|
|
5
|
+
import type { Guard, GuardCls } from "./guard.d.ts";
|
|
6
|
+
import { type SliceBuilder, type SliceInfo } from "./sliceInfo.d.ts";
|
|
7
|
+
export interface Slice extends Adaptor {
|
|
8
|
+
}
|
|
9
|
+
export type SliceCls<SrvModule extends ServiceModel = ServiceModel, SliceInfoObj extends {
|
|
10
|
+
[key: string]: SliceInfo;
|
|
11
|
+
} = {
|
|
12
|
+
[key: string]: SliceInfo;
|
|
13
|
+
}> = AdaptorCls & {
|
|
14
|
+
baseName: SrvModule["srv"]["refName"];
|
|
15
|
+
srv: SrvModule;
|
|
16
|
+
[SLICE_META]: SliceInfoObj;
|
|
17
|
+
getGuards: GuardCls[];
|
|
18
|
+
cruGuards: GuardCls[];
|
|
19
|
+
};
|
|
20
|
+
interface RootSliceOption {
|
|
21
|
+
guards?: {
|
|
22
|
+
root?: Cls<Guard> | Cls<Guard>[];
|
|
23
|
+
get?: Cls<Guard> | Cls<Guard>[];
|
|
24
|
+
cru?: Cls<Guard> | Cls<Guard>[];
|
|
25
|
+
};
|
|
26
|
+
prefix?: string;
|
|
27
|
+
}
|
|
28
|
+
type ExtendSliceInfoObj<SrvModule extends ServiceModel, LibSlices extends SliceCls[], _Input = NonNullable<SrvModule["cnst"]>["_Input"], _Full = NonNullable<SrvModule["cnst"]>["_Full"], _Light = NonNullable<SrvModule["cnst"]>["_Light"], _Insight = NonNullable<SrvModule["cnst"]>["_Insight"], _Filter extends FilterInstance = any, _Merged = MergeAllKeyOfObjects<LibSlices, typeof SLICE_META>> = {
|
|
29
|
+
[K in keyof _Merged]: _Merged[K] extends SliceInfo<any, any, any, any, any, any, infer Srvs, infer ArgNames, infer Args, infer InternalArgs, infer ServerArgs> ? SliceInfo<SrvModule["srv"]["refName"], _Input, _Full, _Light, _Insight, _Filter, Srvs, ArgNames, Args, InternalArgs, ServerArgs> : never;
|
|
30
|
+
};
|
|
31
|
+
/** Builds database-backed slice APIs for list, insight, init, view, edit, create, update, and remove flows. */
|
|
32
|
+
export declare function slice<SrvModule extends ServiceModel, BuildSlice extends SliceBuilder<SrvModule>, LibSlices extends SliceCls[], _Input = NonNullable<SrvModule["cnst"]>["_Input"], _Full = NonNullable<SrvModule["cnst"]>["_Full"], _Light = NonNullable<SrvModule["cnst"]>["_Light"], _Insight = NonNullable<SrvModule["cnst"]>["_Insight"], _Filter extends FilterInstance = NonNullable<SrvModule["db"]>["_Filter"], _Query = QueryOf<DocumentModel<_Full>>>(srv: SrvModule, option: RootSliceOption, sliceBuilder: BuildSlice, ...libSlices: LibSlices): SliceCls<SrvModule, Assign<ReturnType<BuildSlice>, LibSlices extends [] ? {
|
|
33
|
+
[""]: SliceInfo<SrvModule["srv"]["refName"], _Input, _Full, _Light, _Insight, _Filter, SrvModule["srvMap"], [
|
|
34
|
+
"query"
|
|
35
|
+
], [
|
|
36
|
+
_Query
|
|
37
|
+
], [
|
|
38
|
+
], [
|
|
39
|
+
_Query
|
|
40
|
+
]>;
|
|
41
|
+
} : ExtendSliceInfoObj<SrvModule, LibSlices>>>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Cls, PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import type { BaseInsight, BaseObject, ConstantFieldTypeInput, DocumentModel, FieldToValue, ParamFieldType, PlainTypeToFieldType, PurifiedModel, QueryOf } from "akanjs/constant";
|
|
3
|
+
import type { ExtractSort, FilterCls, FilterInstance } from "akanjs/document";
|
|
4
|
+
import type { ServiceModel } from "akanjs/service";
|
|
5
|
+
import { type ArgInfo, type EndpointArgProps, type InternalArgInfo, type InternalArgProps } from "./endpointInfo.d.ts";
|
|
6
|
+
import type { InternalArgCls } from "./internalArg.d.ts";
|
|
7
|
+
import type { SignalOption } from "./types.d.ts";
|
|
8
|
+
export declare class SliceInfo<RefName extends string = string, Input = any, Full = any, Light = any, Insight = any, Filter extends FilterInstance = any, Srvs extends {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
} = {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}, ArgNames extends string[] = any, Args extends any[] = any, InternalArgs extends any[] = any, ServerArgs extends any[] = any> {
|
|
13
|
+
readonly refName: RefName;
|
|
14
|
+
readonly input: Cls<Input>;
|
|
15
|
+
readonly full: Cls<Full>;
|
|
16
|
+
readonly light: Cls<Light>;
|
|
17
|
+
readonly insight: Cls<Insight>;
|
|
18
|
+
readonly filter: FilterCls<Filter>;
|
|
19
|
+
readonly argNames: ArgNames;
|
|
20
|
+
readonly args: ArgInfo<EndpointArgProps<boolean>>[];
|
|
21
|
+
readonly internalArgs: InternalArgInfo<boolean>[];
|
|
22
|
+
readonly signalOption: SignalOption;
|
|
23
|
+
execFn: ((...args: [...ServerArgs, ...InternalArgs]) => QueryOf<DocumentModel<Full>>) | null;
|
|
24
|
+
constructor(refName: RefName, input: Cls<Input>, full: Cls<Full>, light: Cls<Light>, insight: Cls<Insight>, filter: FilterCls<Filter>, signalOption?: SignalOption);
|
|
25
|
+
param<ArgName extends string, Arg extends ParamFieldType, _ClientArg = FieldToValue<Arg>, _ServerArg = DocumentModel<_ClientArg>>(name: ArgName, arg: Arg, option?: Omit<EndpointArgProps, "nullable">): SliceInfo<RefName, Input, Full, Light, Insight, Filter, Srvs, [...ArgNames, ArgName], [...Args, arg: _ClientArg], InternalArgs, [...ServerArgs, arg: _ServerArg]>;
|
|
26
|
+
body<ArgName extends string, ExplicitType = unknown, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>, Optional extends boolean = false, _ArgType = unknown extends ExplicitType ? FieldToValue<Arg> : ExplicitType, _ClientArg = PurifiedModel<_ArgType>, _ServerArg = DocumentModel<_ArgType>>(name: ArgName, arg: Arg, option?: EndpointArgProps<Optional>): SliceInfo<RefName, Input, Full, Light, Insight, Filter, Srvs, [...ArgNames, ArgName], Optional extends true ? [...Args, arg?: _ClientArg | null] : [...Args, arg: _ClientArg], InternalArgs, [...ServerArgs, arg: _ServerArg | (Optional extends true ? undefined : never)]>;
|
|
27
|
+
search<ArgName extends string, ExplicitType = unknown, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>, _ArgType = unknown extends ExplicitType ? FieldToValue<Arg> : ExplicitType, _ClientArg = PurifiedModel<_ArgType>, _ServerArg = DocumentModel<_ArgType>>(name: ArgName, arg: Arg, option?: Omit<EndpointArgProps, "nullable">): SliceInfo<RefName, Input, Full, Light, Insight, Filter, Srvs, [...ArgNames, ArgName], [...Args, arg?: _ClientArg | null], InternalArgs, [...ServerArgs, arg: _ServerArg | undefined]>;
|
|
28
|
+
with<ArgType, Optional extends boolean = false>(argRef: InternalArgCls<ArgType>, option?: InternalArgProps<Optional>): SliceInfo<RefName, Input, Full, Light, Insight, Filter, Srvs, ArgNames, Args, [...InternalArgs, arg: NonNullable<ArgType> | (Optional extends true ? null : never)], ServerArgs>;
|
|
29
|
+
exec(query: (this: {
|
|
30
|
+
[K in keyof Srvs as K extends string ? Uncapitalize<K> : never]: Srvs[K];
|
|
31
|
+
}, ...args: [...ServerArgs, ...InternalArgs]) => PromiseOrObject<QueryOf<DocumentModel<Full>>>): this;
|
|
32
|
+
}
|
|
33
|
+
export declare const buildSlice: <T extends string, Input extends Cls<any>, Full extends BaseObject, Light extends BaseObject, Insight extends BaseInsight, Filter extends FilterInstance, SrvModule extends ServiceModel>(refName: T, input: Cls<Input>, full: Cls<Full>, light: Cls<Light>, insight: Cls<Insight>, filter: FilterCls<Filter>) => (signalOption?: SignalOption) => SliceInfo<T, Input, Full, Light, Insight, Filter, SrvModule["srvMap"], [], [], [], []>;
|
|
34
|
+
export type SliceInfoRefName<S> = S extends SliceInfo<infer R, any, any, any, any, any, any, any, any, any, any> ? R : never;
|
|
35
|
+
export type SliceInfoInput<S> = S extends SliceInfo<any, infer I, any, any, any, any, any, any, any, any, any> ? I : never;
|
|
36
|
+
export type SliceInfoFull<S> = S extends SliceInfo<any, any, infer F, any, any, any, any, any, any, any, any> ? F : never;
|
|
37
|
+
export type SliceInfoLight<S> = S extends SliceInfo<any, any, any, infer L, any, any, any, any, any, any, any> ? L : never;
|
|
38
|
+
export type SliceInfoInsight<S> = S extends SliceInfo<any, any, any, any, infer I, any, any, any, any, any, any> ? I : never;
|
|
39
|
+
export type SliceInfoFilter<S> = S extends SliceInfo<any, any, any, any, any, infer F, any, any, any, any, any> ? F : never;
|
|
40
|
+
export type SliceInfoSrvs<S> = S extends SliceInfo<any, any, any, any, any, any, infer S2, any, any, any, any> ? S2 : never;
|
|
41
|
+
export type SliceInfoArgNames<S> = S extends SliceInfo<any, any, any, any, any, any, any, infer N, any, any, any> ? N : never;
|
|
42
|
+
export type SliceInfoArgs<S> = S extends SliceInfo<any, any, any, any, any, any, any, any, infer A, any, any> ? A : never;
|
|
43
|
+
export type SliceInfoInternalArgs<S> = S extends SliceInfo<any, any, any, any, any, any, any, any, any, infer I, any> ? I : never;
|
|
44
|
+
export type SliceInfoServerArgs<S> = S extends SliceInfo<any, any, any, any, any, any, any, any, any, any, infer S2> ? S2 : never;
|
|
45
|
+
export type SliceBuilder<SrvModule extends ServiceModel, _Input = NonNullable<SrvModule["cnst"]>["_Input"], _Full = NonNullable<SrvModule["cnst"]>["_Full"], _Light = NonNullable<SrvModule["cnst"]>["_Light"], _Insight = NonNullable<SrvModule["cnst"]>["_Insight"], _Filter extends FilterInstance = NonNullable<SrvModule["db"]>["_Filter"], _Sort = ExtractSort<_Filter>> = (init: (signalOption?: SignalOption) => SliceInfo<SrvModule["srv"]["refName"], _Input, _Full, _Light, _Insight, _Filter, SrvModule["srvMap"], [
|
|
46
|
+
], [
|
|
47
|
+
], [
|
|
48
|
+
], [
|
|
49
|
+
]>) => {
|
|
50
|
+
[key: string]: SliceInfo<SrvModule["srv"]["refName"], _Input, _Full, _Light, _Insight, _Filter, SrvModule["srvMap"]>;
|
|
51
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Whether request tracing is enabled. Cached after first read. */
|
|
2
|
+
export declare const isTraceEnabled: () => boolean;
|
|
3
|
+
/** Override the trace flag at runtime (tests / harness control). */
|
|
4
|
+
export declare const setTraceEnabled: (enabled: boolean) => void;
|
|
5
|
+
export interface SpanRecord {
|
|
6
|
+
name: string;
|
|
7
|
+
durationMs: number;
|
|
8
|
+
}
|
|
9
|
+
/** Per-request trace context. Threaded via {@link AsyncLocalStorage}. */
|
|
10
|
+
export declare class SignalTrace {
|
|
11
|
+
#private;
|
|
12
|
+
readonly traceId: string;
|
|
13
|
+
readonly endpointKey: string;
|
|
14
|
+
readonly endpointType: string;
|
|
15
|
+
readonly startedAt: number;
|
|
16
|
+
readonly spans: SpanRecord[];
|
|
17
|
+
dbQueryCount: number;
|
|
18
|
+
dbQueryMs: number;
|
|
19
|
+
cacheHits: number;
|
|
20
|
+
cacheMisses: number;
|
|
21
|
+
dataLoaderBatchCount: number;
|
|
22
|
+
dataLoaderKeyCount: number;
|
|
23
|
+
constructor(endpointKey: string, endpointType: string);
|
|
24
|
+
recordSpan(name: string, durationMs: number): void;
|
|
25
|
+
countDbQuery(durationMs: number): void;
|
|
26
|
+
countCache(hit: boolean): void;
|
|
27
|
+
countDataLoaderBatch(keyCount: number): void;
|
|
28
|
+
finalize(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const getCurrentTrace: () => SignalTrace | undefined;
|
|
31
|
+
/** Run `fn` with `trace` as the ambient request trace. */
|
|
32
|
+
export declare const runWithTrace: <T>(trace: SignalTrace, fn: () => T) => T;
|
|
33
|
+
/**
|
|
34
|
+
* Time an async stage under the current trace. When tracing is off (or no trace is
|
|
35
|
+
* active) this is a thin passthrough with no measurement overhead.
|
|
36
|
+
*/
|
|
37
|
+
export declare const traceSpan: <T>(name: string, fn: () => Promise<T>) => Promise<T>;
|
|
38
|
+
/** Record a DB query duration against the current trace (no-op when untraced). */
|
|
39
|
+
export declare const traceDbQuery: (durationMs: number) => void;
|
|
40
|
+
/** Record a cache hit/miss against the current trace (no-op when untraced). */
|
|
41
|
+
export declare const traceCache: (hit: boolean) => void;
|
|
42
|
+
/** Record a DataLoader batch against the current trace (no-op when untraced). */
|
|
43
|
+
export declare const traceDataLoaderBatch: (keyCount: number) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Process-wide aggregator. Keeps rolling per-endpoint, per-span statistics with a
|
|
46
|
+
* bounded sample ring per span so percentiles stay representative of steady state
|
|
47
|
+
* without unbounded memory growth.
|
|
48
|
+
*/
|
|
49
|
+
declare class TraceAggregator {
|
|
50
|
+
#private;
|
|
51
|
+
ingest(trace: SignalTrace): void;
|
|
52
|
+
reset(): void;
|
|
53
|
+
/** Summarized snapshot suitable for JSON exposure on the metrics endpoint. */
|
|
54
|
+
snapshot(): {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
endpoints: {
|
|
57
|
+
endpoint: string;
|
|
58
|
+
requests: number;
|
|
59
|
+
avgDbQueriesPerRequest: number;
|
|
60
|
+
avgDbQueryMsPerRequest: number;
|
|
61
|
+
cacheHitRatio: number | null;
|
|
62
|
+
avgDataLoaderBatchSize: number | null;
|
|
63
|
+
spans: {
|
|
64
|
+
name: string;
|
|
65
|
+
count: number;
|
|
66
|
+
meanMs: number;
|
|
67
|
+
p50Ms: number;
|
|
68
|
+
p95Ms: number;
|
|
69
|
+
p99Ms: number;
|
|
70
|
+
maxMs: number;
|
|
71
|
+
}[];
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export declare const traceAggregator: TraceAggregator;
|
|
76
|
+
/** Snapshot of all aggregated trace stats. Safe to call when tracing is disabled. */
|
|
77
|
+
export declare const getTraceSnapshot: () => {
|
|
78
|
+
enabled: boolean;
|
|
79
|
+
endpoints: {
|
|
80
|
+
endpoint: string;
|
|
81
|
+
requests: number;
|
|
82
|
+
avgDbQueriesPerRequest: number;
|
|
83
|
+
avgDbQueryMsPerRequest: number;
|
|
84
|
+
cacheHitRatio: number | null;
|
|
85
|
+
avgDataLoaderBatchSize: number | null;
|
|
86
|
+
spans: {
|
|
87
|
+
name: string;
|
|
88
|
+
count: number;
|
|
89
|
+
meanMs: number;
|
|
90
|
+
p50Ms: number;
|
|
91
|
+
p95Ms: number;
|
|
92
|
+
p99Ms: number;
|
|
93
|
+
maxMs: number;
|
|
94
|
+
}[];
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
export {};
|