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
package/server/rscWorkerHost.ts
CHANGED
|
@@ -98,9 +98,7 @@ export class RscWorker {
|
|
|
98
98
|
|
|
99
99
|
#status: WorkerStatus = "starting";
|
|
100
100
|
#killed = false;
|
|
101
|
-
|
|
102
|
-
// here and flushed on the next `ready`. Each closure re-checks `#pending` so
|
|
103
|
-
// cancelled streams don't forward a stale request to the new worker.
|
|
101
|
+
|
|
104
102
|
#queuedSends: Array<() => void> = [];
|
|
105
103
|
#restartAttempts = 0;
|
|
106
104
|
#restartCount = 0;
|
|
@@ -140,9 +138,7 @@ export class RscWorker {
|
|
|
140
138
|
|
|
141
139
|
render(req: Request): ReadableStream<Uint8Array> {
|
|
142
140
|
const requestId = crypto.randomUUID();
|
|
143
|
-
|
|
144
|
-
// own `requestStorage` scope. Without this, server components running in
|
|
145
|
-
// the worker cannot read cookies/auth headers of the incoming request.
|
|
141
|
+
|
|
146
142
|
const headers: Array<[string, string]> = [];
|
|
147
143
|
req.headers.forEach((value, key) => {
|
|
148
144
|
headers.push([key, value]);
|
|
@@ -156,10 +152,7 @@ export class RscWorker {
|
|
|
156
152
|
onError: (msg) => controller.error(new Error(msg)),
|
|
157
153
|
});
|
|
158
154
|
const send = () => {
|
|
159
|
-
|
|
160
|
-
// again between queueing and flushing — both cases drop silently
|
|
161
|
-
// (the pending entry is already gone / will be handled by the exit
|
|
162
|
-
// path).
|
|
155
|
+
|
|
163
156
|
if (!this.#pending.has(requestId)) return;
|
|
164
157
|
try {
|
|
165
158
|
this.#proc.send({ type: "render", requestId, url: req.url, method: req.method, headers });
|
|
@@ -312,8 +305,6 @@ export class RscWorker {
|
|
|
312
305
|
try {
|
|
313
306
|
this.#proc.send({ type: "updateCssAssets", cssAssets });
|
|
314
307
|
} catch {
|
|
315
|
-
// If the worker died mid-send we'll pick up the new value on the next
|
|
316
|
-
// `hello` after restart; nothing to do here.
|
|
317
308
|
}
|
|
318
309
|
}
|
|
319
310
|
|
|
@@ -329,15 +320,10 @@ export class RscWorker {
|
|
|
329
320
|
this.#cssAssets = input.cssAssets ?? this.#cssAssets;
|
|
330
321
|
this.#pagesBundleBuildId = input.buildId;
|
|
331
322
|
if (input.pagesBundlePath) this.#pagesBundlePath = input.pagesBundlePath;
|
|
332
|
-
|
|
333
|
-
// `#clientManifest` / `#cssAssets` / `#pagesBundlePath` via the `init` reply
|
|
334
|
-
// to its first `hello`, so callers don't need to wait on an explicit
|
|
335
|
-
// `reloaded` ack.
|
|
323
|
+
|
|
336
324
|
if (this.#status !== "ready") return Promise.resolve();
|
|
337
325
|
return new Promise<void>((resolve, reject) => {
|
|
338
|
-
|
|
339
|
-
// build strictly implies the earlier one completed from the caller's
|
|
340
|
-
// perspective.
|
|
326
|
+
|
|
341
327
|
if (this.#pendingReload) this.#pendingReload.resolve();
|
|
342
328
|
this.#pendingReload = { resolve, reject, targetBuildId: input.buildId };
|
|
343
329
|
try {
|
|
@@ -386,10 +372,7 @@ export class RscWorker {
|
|
|
386
372
|
if (proc !== this.#proc) return;
|
|
387
373
|
switch (message.type) {
|
|
388
374
|
case "hello":
|
|
389
|
-
|
|
390
|
-
// recovery transparent: after a respawn the new worker's first act is
|
|
391
|
-
// to ask for config, and it receives the latest manifest the host has
|
|
392
|
-
// accumulated via `reload(...)`.
|
|
375
|
+
|
|
393
376
|
this.#proc.send({
|
|
394
377
|
type: "init",
|
|
395
378
|
clientManifest: this.#clientManifest,
|
|
@@ -434,8 +417,7 @@ export class RscWorker {
|
|
|
434
417
|
return;
|
|
435
418
|
case "error":
|
|
436
419
|
if (message.requestId === "__init__") {
|
|
437
|
-
|
|
438
|
-
// subsequent restarts swallow them and let exponential backoff retry.
|
|
420
|
+
|
|
439
421
|
if (!this.#readyResolved) this.#rejectReady(new Error(String(message.message)));
|
|
440
422
|
else this.#logger.error(`[rsc] worker init error on restart: ${message.message}`);
|
|
441
423
|
return;
|
|
@@ -509,9 +491,7 @@ export class RscWorker {
|
|
|
509
491
|
}
|
|
510
492
|
|
|
511
493
|
#handleExit(proc: Bun.Subprocess<"ignore", "inherit", "inherit">, code: number | null): void {
|
|
512
|
-
|
|
513
|
-
// old subprocess was slow to cleanup; ignore them so we don't
|
|
514
|
-
// double-schedule a restart.
|
|
494
|
+
|
|
515
495
|
if (proc !== this.#proc) return;
|
|
516
496
|
|
|
517
497
|
const err = new Error(`rsc worker exited with code ${code}`);
|
|
@@ -521,8 +501,7 @@ export class RscWorker {
|
|
|
521
501
|
this.#pendingReload.reject(err);
|
|
522
502
|
this.#pendingReload = null;
|
|
523
503
|
}
|
|
524
|
-
|
|
525
|
-
// their streams and will see the `onError` above.
|
|
504
|
+
|
|
526
505
|
this.#queuedSends = [];
|
|
527
506
|
|
|
528
507
|
if (this.#killed) {
|
|
@@ -539,7 +518,7 @@ export class RscWorker {
|
|
|
539
518
|
this.#status = "stopped";
|
|
540
519
|
const msg = `[rsc] worker failed ${attempt} restarts; giving up. SSR will return errors until the server restarts.`;
|
|
541
520
|
this.#logger.error(msg);
|
|
542
|
-
|
|
521
|
+
|
|
543
522
|
this.#rejectReady(new Error(msg));
|
|
544
523
|
return;
|
|
545
524
|
}
|
|
@@ -609,10 +588,9 @@ export class RscWorker {
|
|
|
609
588
|
const raw = fs.readFileSync(filePath, "utf8").trim();
|
|
610
589
|
if (!raw || raw === "max") continue;
|
|
611
590
|
const parsed = Number.parseInt(raw, 10);
|
|
612
|
-
|
|
591
|
+
|
|
613
592
|
if (Number.isFinite(parsed) && parsed > 0 && parsed < 1024 ** 5) return parsed;
|
|
614
593
|
} catch {
|
|
615
|
-
// cgroup files are best-effort; explicit env thresholds still work.
|
|
616
594
|
}
|
|
617
595
|
}
|
|
618
596
|
return null;
|
|
@@ -12,11 +12,6 @@ export class SsrFromRscRenderer {
|
|
|
12
12
|
ssrChunkCacheHitCount: 0,
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
// Inline bootstrap that runs as a classic script BEFORE any <script type="module">.
|
|
16
|
-
// - Installs the webpack runtime shims that react-server-dom-webpack/client.browser
|
|
17
|
-
// needs at module initialization time.
|
|
18
|
-
// - Creates a tiny queue so <script>self.__RSC_PUSH__(...)</script> tags
|
|
19
|
-
// emitted after the HTML shell can be buffered until rscClient picks them up.
|
|
20
15
|
static readonly #clientBootstrap = `(function(){
|
|
21
16
|
var registry = new Map();
|
|
22
17
|
function load(id) {
|
|
@@ -58,8 +53,7 @@ export class SsrFromRscRenderer {
|
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
async render(input: SsrFromRscInput): Promise<ReadableStream<Uint8Array>> {
|
|
61
|
-
|
|
62
|
-
// other is relayed to the client as inline <script> tags for hydration.
|
|
56
|
+
|
|
63
57
|
const [rscForSsr, rscForClient] = input.rscStream.tee();
|
|
64
58
|
|
|
65
59
|
const ssrNodeStream = Readable.fromWeb(rscForSsr as never);
|
|
@@ -103,19 +97,6 @@ export class SsrFromRscRenderer {
|
|
|
103
97
|
if (g.__rsc_ssr_shims_installed__) return;
|
|
104
98
|
g.__rsc_ssr_shims_installed__ = true;
|
|
105
99
|
|
|
106
|
-
// SSR-side webpack runtime shims. We use dynamic `import()` rather than
|
|
107
|
-
// `require()` because client component chunks may transitively use
|
|
108
|
-
// top-level await, which Bun's `require()` refuses to load.
|
|
109
|
-
//
|
|
110
|
-
// `chunks`/`id` entries in the ssrManifest are absolute filesystem paths
|
|
111
|
-
// to server-importable client chunks. These may differ from the browser
|
|
112
|
-
// chunks referenced by the Flight client manifest because the browser build
|
|
113
|
-
// can rely on import maps while this SSR pass is loaded directly by Bun.
|
|
114
|
-
// HMR cache-busting is filename-based: each rebuild emits a new
|
|
115
|
-
// content-hashed chunk filename, which means a new import
|
|
116
|
-
// specifier, which bypasses Bun's module cache naturally. The
|
|
117
|
-
// `?v=<digits>` stripping below is defensive for any caller that still
|
|
118
|
-
// appends a version query to keep the pre-existing registry keys stable.
|
|
119
100
|
const registry = new Map<string, Record<string, unknown>>();
|
|
120
101
|
g.__webpack_chunk_load__ = async (chunkId: string) => {
|
|
121
102
|
if (registry.has(chunkId)) {
|
|
@@ -206,8 +187,7 @@ export class SsrFromRscRenderer {
|
|
|
206
187
|
if (tail) controller.enqueue(encoder.encode(tail));
|
|
207
188
|
return;
|
|
208
189
|
}
|
|
209
|
-
|
|
210
|
-
// verbatim so we don't swallow the document.
|
|
190
|
+
|
|
211
191
|
const tail = decoder.decode();
|
|
212
192
|
const rest = withHtmlTheme(buffered + tail);
|
|
213
193
|
if (rest) controller.enqueue(encoder.encode(rest));
|
|
@@ -220,20 +200,10 @@ export class SsrFromRscRenderer {
|
|
|
220
200
|
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
221
201
|
}
|
|
222
202
|
|
|
223
|
-
// React-server-dom-webpack/server emits a Flight hint of the form
|
|
224
|
-
// `:HL["<href>","stylesheet"]\n` for every `<link rel="stylesheet">` in the
|
|
225
|
-
// server tree. That string is forwarded verbatim to the browser which then
|
|
226
|
-
// calls `ReactDOM.preload(href, "stylesheet")`, creating an invalid
|
|
227
|
-
// `<link rel="preload" as="stylesheet">` (valid preload `as` is `"style"`).
|
|
228
|
-
// The SSR-side Fizz dispatcher happens to tolerate this, but Chromium logs
|
|
229
|
-
// `<link rel=preload> must have a valid "as" value`. Rewrite the hint for
|
|
230
|
-
// the browser-bound stream to use the spec-correct `"style"`; the SSR-bound
|
|
231
|
-
// tee is left untouched so we don't alter React's server behavior.
|
|
232
203
|
static #sanitizeFlightForClient(stream: ReadableStream<Uint8Array>): ReadableStream<Uint8Array> {
|
|
233
204
|
const decoder = new TextDecoder();
|
|
234
205
|
const encoder = new TextEncoder();
|
|
235
|
-
|
|
236
|
-
// left alone; only the `as` slot is rewritten.
|
|
206
|
+
|
|
237
207
|
const hlStylesheetRe = /(:HL\["[^"\\]*(?:\\.[^"\\]*)*",)"stylesheet"(\])/g;
|
|
238
208
|
|
|
239
209
|
return stream.pipeThrough(
|
|
@@ -283,8 +253,6 @@ export class SsrFromRscRenderer {
|
|
|
283
253
|
reader.releaseLock();
|
|
284
254
|
}
|
|
285
255
|
|
|
286
|
-
// Inline RSC scripts must not be interleaved with arbitrary HTML bytes:
|
|
287
|
-
// Fizz may split inside SVG path data or attributes, corrupting markup.
|
|
288
256
|
const rscReader = rscClientStream.getReader();
|
|
289
257
|
try {
|
|
290
258
|
while (true) {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// use. The upstream package ships runtime code only; no types are published.
|
|
3
|
-
// We only declare the surface our SSR/RSC pipeline actually touches.
|
|
4
|
-
//
|
|
5
|
-
// This file is intentionally a top-level ambient declaration (no `import`/
|
|
6
|
-
// `export` at file scope) so that TypeScript registers the module names below
|
|
7
|
-
// globally.
|
|
1
|
+
|
|
8
2
|
|
|
9
3
|
declare module "react-server-dom-webpack/server.node" {
|
|
10
4
|
export interface ClientReferenceManifestEntry {
|
package/server/vendor/react.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// the JS module (CJS) which does expose these named properties.
|
|
4
|
-
//
|
|
5
|
-
// We enumerate exports explicitly because Bun's `export * from "<cjs>"` only
|
|
6
|
-
// emits an internal `__reExport` object and never generates top-level ESM
|
|
7
|
-
// named bindings — so downstream chunks that `import { useState } from
|
|
8
|
-
// "react"` would silently get `undefined`. See the importmap dedup story
|
|
9
|
-
// in `vendorSpecifiers.ts` for the rationale behind these entries.
|
|
1
|
+
|
|
2
|
+
|
|
10
3
|
import * as m from "react";
|
|
11
4
|
|
|
12
5
|
export default m;
|
package/server/webRouter.ts
CHANGED
|
@@ -437,12 +437,11 @@ export class WebRouter {
|
|
|
437
437
|
const fwdProto = req.headers.get("x-forwarded-proto")?.split(",")[0]?.trim();
|
|
438
438
|
const fwdHost = req.headers.get("x-forwarded-host")?.split(",")[0]?.trim();
|
|
439
439
|
const hostFallback = fwdHost ?? req.headers.get("host");
|
|
440
|
-
const protoFallback = fwdProto ?? parsed.protocol.slice(0, -1);
|
|
440
|
+
const protoFallback = fwdProto ?? parsed.protocol.slice(0, -1);
|
|
441
441
|
if (hostFallback && protoFallback) {
|
|
442
442
|
try {
|
|
443
443
|
return new URL(`${protoFallback}://${hostFallback}`).origin;
|
|
444
444
|
} catch {
|
|
445
|
-
/* fallthrough */
|
|
446
445
|
}
|
|
447
446
|
}
|
|
448
447
|
return parsed.origin;
|
|
@@ -462,7 +461,7 @@ export class WebRouter {
|
|
|
462
461
|
static #isTrustedRscTarget(clientOrigin: string, targetUrl: URL): boolean {
|
|
463
462
|
try {
|
|
464
463
|
if (targetUrl.origin === clientOrigin) return true;
|
|
465
|
-
|
|
464
|
+
|
|
466
465
|
return targetUrl.hostname === new URL(clientOrigin).hostname;
|
|
467
466
|
} catch {
|
|
468
467
|
return false;
|
package/service/adapt.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface Adaptor {
|
|
|
10
10
|
|
|
11
11
|
export type AdaptorCls<
|
|
12
12
|
Methods = any,
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
InjectMap extends Record<string, InjectInfo> = {},
|
|
15
15
|
> = Cls<
|
|
16
16
|
Methods & ExtractInjectInfoObject<InjectMap> & Adaptor,
|
|
@@ -22,7 +22,6 @@ export function adapt<Name extends string>(name: Name): AdaptorCls;
|
|
|
22
22
|
export function adapt<Name extends string, Injection extends InjectBuilder<"use" | "env" | "memory" | "plug">>(
|
|
23
23
|
name: Name,
|
|
24
24
|
injectBuilder: Injection,
|
|
25
|
-
// biome-ignore lint/complexity/noBannedTypes: `{}` preserves adaptor method inference for generated class types.
|
|
26
25
|
): AdaptorCls<{}, ReturnType<Injection>>;
|
|
27
26
|
|
|
28
27
|
export function adapt(name: string, injectBuilder?: InjectBuilder) {
|
|
@@ -32,10 +31,8 @@ export function adapt(name: string, injectBuilder?: InjectBuilder) {
|
|
|
32
31
|
static readonly [INJECT_META] = injectInfoMap;
|
|
33
32
|
static readonly refName = name;
|
|
34
33
|
async onInit() {
|
|
35
|
-
//
|
|
36
34
|
}
|
|
37
35
|
async onDestroy() {
|
|
38
|
-
//
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
return Adaptor;
|
|
@@ -44,7 +41,6 @@ export function adapt(name: string, injectBuilder?: InjectBuilder) {
|
|
|
44
41
|
export function dangerouslyAdapt<Name extends string, Injection extends InjectBuilder>(
|
|
45
42
|
name: Name,
|
|
46
43
|
injectBuilder: Injection,
|
|
47
|
-
// biome-ignore lint/complexity/noBannedTypes: `{}` preserves adaptor method inference for generated class types.
|
|
48
44
|
): AdaptorCls<{}, ReturnType<Injection>>;
|
|
49
45
|
export function dangerouslyAdapt(name: string, injectBuilder?: InjectBuilder) {
|
|
50
46
|
return adapt(name, injectBuilder as InjectBuilder<"use" | "env" | "memory" | "plug">);
|
|
@@ -35,8 +35,7 @@ export class RedisCache
|
|
|
35
35
|
operationMode,
|
|
36
36
|
repoName,
|
|
37
37
|
redis = {
|
|
38
|
-
|
|
39
|
-
// password, // TODO: Implement username and password
|
|
38
|
+
|
|
40
39
|
sshOptions: {
|
|
41
40
|
host: `${appName}-${environment}.${serveDomain}`,
|
|
42
41
|
port: 32767,
|
|
@@ -300,7 +300,7 @@ const jsonPath = (path: string) =>
|
|
|
300
300
|
.map((part) => part.replaceAll('"', '\\"'))
|
|
301
301
|
.join(".")}`;
|
|
302
302
|
const encodeSqlValue = (value: unknown) => encodeDocumentValue(value);
|
|
303
|
-
|
|
303
|
+
|
|
304
304
|
const decodeDateValue = (value: unknown) => {
|
|
305
305
|
if (value === null || value === undefined) return value;
|
|
306
306
|
if (typeof value === "number") return dayjs(value);
|
|
@@ -1128,7 +1128,7 @@ export class SqliteDocumentStore {
|
|
|
1128
1128
|
private prepareReadStmt(sql: string) {
|
|
1129
1129
|
const cached = this.#readStmtCache.get(sql);
|
|
1130
1130
|
if (cached) return cached;
|
|
1131
|
-
|
|
1131
|
+
|
|
1132
1132
|
if (this.#readStmtCache.size >= 128) {
|
|
1133
1133
|
const oldest = this.#readStmtCache.keys().next().value;
|
|
1134
1134
|
if (oldest) this.#readStmtCache.delete(oldest);
|
|
@@ -67,8 +67,7 @@ export const encodeSolidValue = (value: unknown): { type: SolidValueType; value:
|
|
|
67
67
|
if (Buffer.isBuffer(value)) return { type: "buffer", value };
|
|
68
68
|
if (typeof value === "number") return { type: "number", value: String(value) };
|
|
69
69
|
if (typeof value === "string") return { type: "string", value };
|
|
70
|
-
|
|
71
|
-
// structured values (e.g. refresh sessions) through the SQLite-backed cache.
|
|
70
|
+
|
|
72
71
|
return { type: "json", value: JSON.stringify(value ?? null) };
|
|
73
72
|
};
|
|
74
73
|
|
|
@@ -63,7 +63,7 @@ export class WebSocketRedisAdaptor
|
|
|
63
63
|
#heartbeatInterval: Timer | null = null;
|
|
64
64
|
|
|
65
65
|
override async onInit() {
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
this.publisher.on("connect", () => {
|
|
68
68
|
this.#publisherReady = true;
|
|
69
69
|
this.logger.verbose("Publisher connected");
|
|
@@ -77,7 +77,6 @@ export class WebSocketRedisAdaptor
|
|
|
77
77
|
this.logger.warn(`Publisher error: ${err.message}`);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
// Subscriber lifecycle
|
|
81
80
|
this.subscriber.on("error", (err: Error) => {
|
|
82
81
|
this.logger.warn(`Subscriber error: ${err.message}`);
|
|
83
82
|
});
|
|
@@ -85,7 +84,6 @@ export class WebSocketRedisAdaptor
|
|
|
85
84
|
await this.publisher.connect();
|
|
86
85
|
await this.subscriber.connect();
|
|
87
86
|
|
|
88
|
-
// Subscribe to broadcast channel
|
|
89
87
|
await this.subscriber.subscribe(BROADCAST_CHANNEL, (err?: Error | null) => {
|
|
90
88
|
if (err) this.logger.warn(`Subscribe error: ${err.message}`);
|
|
91
89
|
});
|
|
@@ -107,8 +105,6 @@ export class WebSocketRedisAdaptor
|
|
|
107
105
|
}
|
|
108
106
|
});
|
|
109
107
|
|
|
110
|
-
// Server heartbeat — expire server key every 60s, refresh every 30s
|
|
111
|
-
// If a pod crashes without graceful shutdown, its keys expire after 60s
|
|
112
108
|
await this.redis.set(`${WEBSOCKET_PREFIX}server:${this.serverId}`, Date.now().toString(), "EX", 60);
|
|
113
109
|
this.#heartbeatInterval = setInterval(async () => {
|
|
114
110
|
try {
|
|
@@ -123,13 +119,12 @@ export class WebSocketRedisAdaptor
|
|
|
123
119
|
}
|
|
124
120
|
|
|
125
121
|
override async onDestroy() {
|
|
126
|
-
|
|
122
|
+
|
|
127
123
|
if (this.#heartbeatInterval) {
|
|
128
124
|
clearInterval(this.#heartbeatInterval);
|
|
129
125
|
this.#heartbeatInterval = null;
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
// Clean up all sockets registered to this server
|
|
133
128
|
await this.#cleanupServer();
|
|
134
129
|
|
|
135
130
|
if (this.subscriber) {
|
|
@@ -147,8 +142,6 @@ export class WebSocketRedisAdaptor
|
|
|
147
142
|
this.logger.verbose("WebSocket Redis adaptor destroyed");
|
|
148
143
|
}
|
|
149
144
|
|
|
150
|
-
// ── Pub/Sub ──
|
|
151
|
-
|
|
152
145
|
publish(roomId: string, data: unknown): void {
|
|
153
146
|
const endpointKey = this.#getEndpointKey(roomId);
|
|
154
147
|
const endpointInfo = endpointKey ? this.#endpointMap.get(endpointKey) : null;
|
|
@@ -187,8 +180,6 @@ export class WebSocketRedisAdaptor
|
|
|
187
180
|
return idx >= 0 ? roomId.substring(0, idx) : roomId;
|
|
188
181
|
}
|
|
189
182
|
|
|
190
|
-
// ── Room membership ──
|
|
191
|
-
|
|
192
183
|
async joinRoom(ws: Bun.ServerWebSocket<unknown>, room: string): Promise<void> {
|
|
193
184
|
const socketId = this.#getSocketId(ws);
|
|
194
185
|
const pipeline = this.redis.multi();
|
|
@@ -218,7 +209,6 @@ export class WebSocketRedisAdaptor
|
|
|
218
209
|
await pipeline.exec();
|
|
219
210
|
}
|
|
220
211
|
|
|
221
|
-
// ── Socket registration ──
|
|
222
212
|
#getSocketId(ws: Bun.ServerWebSocket<unknown>): string {
|
|
223
213
|
const data = ws.data as WsSocketData;
|
|
224
214
|
if (!data.socketId) data.socketId = `${this.serverId}-${Bun.randomUUIDv7()}`;
|
|
@@ -241,8 +231,6 @@ export class WebSocketRedisAdaptor
|
|
|
241
231
|
await this.leaveAllRooms(ws);
|
|
242
232
|
}
|
|
243
233
|
|
|
244
|
-
// ── Internal helpers ──
|
|
245
|
-
|
|
246
234
|
#packMessage(origin: string, roomId: string, payload: Buffer): Buffer {
|
|
247
235
|
const originBuf = Buffer.from(origin, "utf-8");
|
|
248
236
|
const roomIdBuf = Buffer.from(roomId, "utf-8");
|
|
@@ -306,7 +294,7 @@ export class WebSocketRedisAdaptor
|
|
|
306
294
|
const sockets = await this.redis.smembers(`${WEBSOCKET_PREFIX}server:${this.serverId}:sockets`);
|
|
307
295
|
const pipeline = this.redis.multi();
|
|
308
296
|
for (const socketId of sockets) {
|
|
309
|
-
|
|
297
|
+
|
|
310
298
|
const rooms = await this.redis.smembers(`${WEBSOCKET_PREFIX}socket:${socketId}:rooms`);
|
|
311
299
|
for (const room of rooms) {
|
|
312
300
|
pipeline.srem(`${WEBSOCKET_PREFIX}room:${room}`, socketId);
|
package/service/serve.ts
CHANGED
|
@@ -38,7 +38,7 @@ const avoidKeys = new Set([
|
|
|
38
38
|
|
|
39
39
|
export interface Service {
|
|
40
40
|
readonly logger: Logger;
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
onInit(): Promise<void>;
|
|
43
43
|
_libsOnInit(): Promise<void>;
|
|
44
44
|
onDestroy(): Promise<void>;
|
|
@@ -47,9 +47,9 @@ export interface Service {
|
|
|
47
47
|
|
|
48
48
|
export type ServiceCls<
|
|
49
49
|
RefName extends string = string,
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
Methods = {},
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
InjectMap extends { [key: string]: InjectInfo } = {},
|
|
54
54
|
> = Cls<
|
|
55
55
|
Methods & ExtractInjectInfoObject<InjectMap> & Service,
|
|
@@ -65,14 +65,12 @@ export function serve<RefName extends string, Injection extends InjectBuilder>(
|
|
|
65
65
|
refName: RefName,
|
|
66
66
|
injectBuilder: Injection,
|
|
67
67
|
...extendSrvs: Cls[]
|
|
68
|
-
// biome-ignore lint/complexity/noBannedTypes: `{}` preserves plain service method inference.
|
|
69
68
|
): ServiceCls<RefName, {}, ReturnType<Injection>>;
|
|
70
69
|
export function serve<RefName extends string, Injection extends InjectBuilder>(
|
|
71
70
|
refName: RefName,
|
|
72
71
|
option: ServiceOptions,
|
|
73
72
|
injectBuilder: Injection,
|
|
74
73
|
...extendSrvs: Cls[]
|
|
75
|
-
// biome-ignore lint/complexity/noBannedTypes: `{}` preserves plain service method inference.
|
|
76
74
|
): ServiceCls<RefName, {}, ReturnType<Injection>>;
|
|
77
75
|
export function serve<
|
|
78
76
|
T extends string,
|
|
@@ -155,10 +153,8 @@ export function serve(
|
|
|
155
153
|
static [INJECT_META] = {};
|
|
156
154
|
readonly logger = new Logger(this.constructor.name);
|
|
157
155
|
async onInit() {
|
|
158
|
-
//
|
|
159
156
|
}
|
|
160
157
|
async onDestroy() {
|
|
161
|
-
//
|
|
162
158
|
}
|
|
163
159
|
};
|
|
164
160
|
applyMixins(srvRef, extSrvs, avoidKeys);
|
package/signal/base.signal.ts
CHANGED
package/signal/endpointInfo.ts
CHANGED
|
@@ -324,9 +324,6 @@ export class EndpointInfo<
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
// TODO: signal type 에 따라 기본 internal arg들 배정해주기
|
|
328
|
-
// TODO: pubsub은 exec 없어도 되게하기
|
|
329
|
-
// TODO: exec 없으면 타입에러 뜨게하기
|
|
330
327
|
export type BuildEndpoint<SrvModule extends ServiceModel = ServiceModel> = {
|
|
331
328
|
query: <Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
332
329
|
returnRef: Returns,
|
|
@@ -357,10 +354,6 @@ export type EndpointBuilder<SrvModule extends ServiceModel = ServiceModel> = (bu
|
|
|
357
354
|
[key: string]: EndpointInfo;
|
|
358
355
|
};
|
|
359
356
|
|
|
360
|
-
// --- Accessors ---
|
|
361
|
-
// Named projections for EndpointInfo's 10 generics. Use these instead of
|
|
362
|
-
// re-inferring the whole shape so that parameter-order refactors only need
|
|
363
|
-
// to be reflected in one place.
|
|
364
357
|
export type EndpInfoReqType<E> =
|
|
365
358
|
E extends EndpointInfo<infer T, any, any, any, any, any, any, any, any, any> ? T : never;
|
|
366
359
|
export type EndpInfoSrvs<E> = E extends EndpointInfo<any, infer S, any, any, any, any, any, any, any, any> ? S : never;
|
package/signal/intercept.ts
CHANGED
package/signal/middleware.ts
CHANGED
|
@@ -63,7 +63,6 @@ export class Cache extends middleware("cache") {
|
|
|
63
63
|
}
|
|
64
64
|
traceCache(false);
|
|
65
65
|
|
|
66
|
-
// Execute - middleware는 makeResponse 이전에 실행됨
|
|
67
66
|
const result = await next();
|
|
68
67
|
|
|
69
68
|
context.adaptor.logger.debug(`Caching result type ${context.key}: ${typeof result} / ${Array.isArray(result)}`);
|
|
@@ -102,7 +101,7 @@ export class Retry extends middleware("retry") {
|
|
|
102
101
|
console.warn(`[${context.key}] Retry ${attempt + 1}/${maxRetries}:`, lastError.message);
|
|
103
102
|
|
|
104
103
|
if (attempt < maxRetries - 1) {
|
|
105
|
-
|
|
104
|
+
|
|
106
105
|
await new Promise((resolve) => setTimeout(resolve, 2 ** attempt * 100));
|
|
107
106
|
}
|
|
108
107
|
}
|
package/signal/serverSignal.ts
CHANGED
|
@@ -85,20 +85,6 @@ type ServerSignalClsStatics = {
|
|
|
85
85
|
readonly [INTERNAL_META]: { [key: string]: InternalInfo };
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
// type ServerSignalClsStatics<EnpCls, IntCls> = EnpCls extends {
|
|
89
|
-
// refName: infer RefName;
|
|
90
|
-
// [ENDPOINT_META]: infer EndpointInfoObj;
|
|
91
|
-
// }
|
|
92
|
-
// ? IntCls extends { [ENDPOINT_META]: infer InternalInfoObj }
|
|
93
|
-
// ? {
|
|
94
|
-
// readonly refName: RefName;
|
|
95
|
-
// readonly [ENDPOINT_META]: EndpointInfoObj;
|
|
96
|
-
// readonly [ENDPOINT_META]: InternalInfoObj;
|
|
97
|
-
// readonly [INJECT_META]: { queue: QueueAdaptor };
|
|
98
|
-
// }
|
|
99
|
-
// : never
|
|
100
|
-
// : never;
|
|
101
|
-
|
|
102
88
|
export type ServerSignalCls<EnpCls = any, IntCls = any> = AdaptorCls<
|
|
103
89
|
EndpointServerSignalMethods<EnpCls> & InternalServerSignalMethods<IntCls> & ServerSignal
|
|
104
90
|
> &
|
|
@@ -111,7 +97,7 @@ export const serverSignal = <EnpCls, IntCls>(
|
|
|
111
97
|
): ServerSignalCls<EnpCls, IntCls> => {
|
|
112
98
|
const refName = (endpointRef as unknown as EndpointCls).refName.slice(0, -8);
|
|
113
99
|
return class ServerSignal extends adapt(`${refName}Signal`, ({ plug }) => ({
|
|
114
|
-
|
|
100
|
+
|
|
115
101
|
queue: plug(QueueAdaptorRole),
|
|
116
102
|
})) {
|
|
117
103
|
static readonly [ENDPOINT_META] = Object.fromEntries(
|
package/signal/signalContext.ts
CHANGED
|
@@ -360,7 +360,7 @@ export class HttpExecutionContext<Appended = unknown> {
|
|
|
360
360
|
async getArgs(endpointInfo: EndpointInfo): Promise<unknown[]> {
|
|
361
361
|
if (endpointInfo.args.length === 0) return [];
|
|
362
362
|
this.params = this.req.params;
|
|
363
|
-
|
|
363
|
+
|
|
364
364
|
const hasBodyArgs = endpointInfo.args.some((arg) => arg.type === "body");
|
|
365
365
|
const hasUploadArgs = hasBodyArgs && endpointInfo.args.some((arg) => arg.type === "body" && arg.argRef === Upload);
|
|
366
366
|
if (endpointInfo.type === "mutation" && hasBodyArgs && this.req.body) {
|
package/signal/signalRegistry.ts
CHANGED
|
@@ -56,11 +56,6 @@ export class ServiceSignal<
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// TODO: add scalar signal for resolve field
|
|
60
|
-
// export interface ScalarSignal {
|
|
61
|
-
// internal: InternalCls;
|
|
62
|
-
// }
|
|
63
|
-
|
|
64
59
|
/** Registry for database and service signals used by routing and fetch serialization. */
|
|
65
60
|
export class SignalRegistry {
|
|
66
61
|
static readonly #database = new Map<string, DatabaseSignal<InternalCls, EndpointCls, SliceCls, ServerSignalCls>>();
|
package/signal/sliceInfo.ts
CHANGED
|
@@ -202,9 +202,6 @@ export const buildSlice =
|
|
|
202
202
|
signalOption,
|
|
203
203
|
);
|
|
204
204
|
|
|
205
|
-
// --- Accessors ---
|
|
206
|
-
// Named projections for SliceInfo's 11 generics. Use these to avoid repeating
|
|
207
|
-
// 11-slot `extends SliceInfo<any, any, ..., infer X, any, any>` patterns.
|
|
208
205
|
export type SliceInfoRefName<S> =
|
|
209
206
|
S extends SliceInfo<infer R, any, any, any, any, any, any, any, any, any, any> ? R : never;
|
|
210
207
|
export type SliceInfoInput<S> =
|