akanjs 2.2.4 → 2.2.5
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,329 @@
|
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
import type { Client as LibsqlClient } from "@libsql/client";
|
|
3
|
+
import { type BaseEnv, type PromiseOrObject } from "akanjs/base";
|
|
4
|
+
import { type ConstantModel } from "akanjs/constant";
|
|
5
|
+
import { type DatabaseModel, type DocumentQuery, type DocumentSchema, type DocumentUpdate, type DocumentUpdateOptions, type SchemaOf } from "akanjs/document";
|
|
6
|
+
import type { Sql } from "postgres";
|
|
7
|
+
export interface SqliteDatabaseConfig {
|
|
8
|
+
filePath?: string;
|
|
9
|
+
journalMode?: "WAL" | "DELETE" | "TRUNCATE" | "PERSIST" | "MEMORY" | "OFF";
|
|
10
|
+
busyTimeoutMs?: number;
|
|
11
|
+
synchronous?: "OFF" | "NORMAL" | "FULL" | "EXTRA";
|
|
12
|
+
foreignKeys?: boolean;
|
|
13
|
+
cacheSize?: number;
|
|
14
|
+
tempStore?: "DEFAULT" | "FILE" | "MEMORY";
|
|
15
|
+
}
|
|
16
|
+
export interface LibsqlDatabaseConfig {
|
|
17
|
+
url?: string;
|
|
18
|
+
authToken?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PostgresDatabaseConfig {
|
|
21
|
+
url?: string;
|
|
22
|
+
host?: string;
|
|
23
|
+
port?: number;
|
|
24
|
+
database?: string;
|
|
25
|
+
user?: string;
|
|
26
|
+
password?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DatabaseConfig {
|
|
29
|
+
driver?: "sqlite" | "libsql" | "postgres";
|
|
30
|
+
sqlite?: SqliteDatabaseConfig;
|
|
31
|
+
libsql?: LibsqlDatabaseConfig;
|
|
32
|
+
postgres?: PostgresDatabaseConfig;
|
|
33
|
+
}
|
|
34
|
+
export interface DocumentStore {
|
|
35
|
+
ensure(): Promise<void>;
|
|
36
|
+
create(data: DocumentRecord): Promise<any>;
|
|
37
|
+
clone(data: DocumentRecord & {
|
|
38
|
+
id: string;
|
|
39
|
+
}): Promise<any>;
|
|
40
|
+
update(id: string, patch: DocumentRecord): Promise<any>;
|
|
41
|
+
remove(id: string): Promise<any>;
|
|
42
|
+
updateOneByQuery(query: DocumentQuery, update: DocumentUpdate, options?: DocumentUpdateOptions): Promise<{
|
|
43
|
+
acknowledged: boolean;
|
|
44
|
+
matchedCount: number;
|
|
45
|
+
modifiedCount: number;
|
|
46
|
+
upsertedId: string | null;
|
|
47
|
+
}>;
|
|
48
|
+
updateManyByQuery(query: DocumentQuery, update: DocumentUpdate): Promise<{
|
|
49
|
+
acknowledged: boolean;
|
|
50
|
+
matchedCount: number;
|
|
51
|
+
modifiedCount: number;
|
|
52
|
+
}>;
|
|
53
|
+
deleteManyByQuery(query: DocumentQuery): Promise<{
|
|
54
|
+
acknowledged: boolean;
|
|
55
|
+
matchedCount: number;
|
|
56
|
+
modifiedCount: number;
|
|
57
|
+
}>;
|
|
58
|
+
bulkWrite(operations: {
|
|
59
|
+
updateOne: {
|
|
60
|
+
filter: DocumentQuery;
|
|
61
|
+
update: DocumentUpdate;
|
|
62
|
+
upsert?: boolean;
|
|
63
|
+
};
|
|
64
|
+
}[]): Promise<{
|
|
65
|
+
acknowledged: boolean;
|
|
66
|
+
matchedCount: number;
|
|
67
|
+
modifiedCount: number;
|
|
68
|
+
upsertedId: string | null;
|
|
69
|
+
}>;
|
|
70
|
+
find(query?: DocumentQuery, options?: FindManyOptions): Promise<any[]>;
|
|
71
|
+
findIds(query?: DocumentQuery, options?: {
|
|
72
|
+
sort?: SortOption;
|
|
73
|
+
skip?: number | null;
|
|
74
|
+
limit?: number | null;
|
|
75
|
+
sample?: number;
|
|
76
|
+
}): Promise<string[]>;
|
|
77
|
+
findOne(query?: DocumentQuery, options?: FindOneOptions): Promise<any | null>;
|
|
78
|
+
findId(query?: DocumentQuery, options?: {
|
|
79
|
+
sort?: SortOption;
|
|
80
|
+
skip?: number | null;
|
|
81
|
+
sample?: boolean;
|
|
82
|
+
}): Promise<string | null>;
|
|
83
|
+
pickOne(query?: DocumentQuery, options?: FindOneOptions): Promise<any>;
|
|
84
|
+
pickById(id: string): Promise<any>;
|
|
85
|
+
exists(query?: DocumentQuery): Promise<string | null>;
|
|
86
|
+
count(query?: DocumentQuery): Promise<number>;
|
|
87
|
+
insight(query?: DocumentQuery): Promise<any>;
|
|
88
|
+
hydrate(data: DocumentRecord, originalData?: DocumentRecord): any;
|
|
89
|
+
}
|
|
90
|
+
export interface SqlResultRows<Row = Record<string, unknown>> {
|
|
91
|
+
rows: Row[];
|
|
92
|
+
}
|
|
93
|
+
export interface AkanSqlStatement {
|
|
94
|
+
run(...params: unknown[]): Promise<unknown>;
|
|
95
|
+
get<Row = Record<string, unknown>>(...params: unknown[]): Promise<Row | null>;
|
|
96
|
+
all<Row = Record<string, unknown>>(...params: unknown[]): Promise<Row[]>;
|
|
97
|
+
}
|
|
98
|
+
export interface AkanSqlClient {
|
|
99
|
+
execute(sql: string, params?: unknown[] | Record<string, unknown>): Promise<unknown>;
|
|
100
|
+
prepare(sql: string): AkanSqlStatement;
|
|
101
|
+
close(): Promise<void>;
|
|
102
|
+
}
|
|
103
|
+
export interface DatabaseAdaptor {
|
|
104
|
+
getConnection(): AkanSqlClient;
|
|
105
|
+
getStore(constant: ConstantModel, database: DatabaseModel, schema: DocumentSchema): DocumentStore;
|
|
106
|
+
transaction<T>(fn: () => PromiseOrObject<T>): Promise<T>;
|
|
107
|
+
}
|
|
108
|
+
interface SqliteEnv extends BaseEnv {
|
|
109
|
+
workspaceRoot?: string;
|
|
110
|
+
database?: DatabaseConfig;
|
|
111
|
+
}
|
|
112
|
+
type DocumentRecord = Record<string, unknown>;
|
|
113
|
+
type FieldMap = Record<string, {
|
|
114
|
+
getProps: () => Record<string, unknown>;
|
|
115
|
+
[key: string]: unknown;
|
|
116
|
+
}>;
|
|
117
|
+
type SortOption = Record<string, 1 | -1> | null | undefined;
|
|
118
|
+
type ProjectionOption = Partial<Record<string, boolean>> | null | undefined;
|
|
119
|
+
type FindManyOptions = {
|
|
120
|
+
sort?: SortOption;
|
|
121
|
+
skip?: number | null;
|
|
122
|
+
limit?: number | null;
|
|
123
|
+
sample?: number;
|
|
124
|
+
select?: ProjectionOption;
|
|
125
|
+
};
|
|
126
|
+
type FindOneOptions = {
|
|
127
|
+
sort?: SortOption;
|
|
128
|
+
skip?: number | null;
|
|
129
|
+
sample?: boolean;
|
|
130
|
+
select?: ProjectionOption;
|
|
131
|
+
};
|
|
132
|
+
interface DocumentDatabaseOwner {
|
|
133
|
+
getConnection(): AkanSqlClient;
|
|
134
|
+
getMeta(key: string): Promise<string | undefined> | string | undefined;
|
|
135
|
+
setMeta(key: string, value: string): Promise<void>;
|
|
136
|
+
afterCommit(fn: () => PromiseOrObject<void>): Promise<void>;
|
|
137
|
+
}
|
|
138
|
+
declare class BunSqliteClient implements AkanSqlClient {
|
|
139
|
+
readonly db: Database;
|
|
140
|
+
constructor(db: Database);
|
|
141
|
+
execute(sql: string, params?: unknown[] | Record<string, unknown>): Promise<import("bun:sqlite").Changes>;
|
|
142
|
+
prepare(sql: string): AkanSqlStatement;
|
|
143
|
+
close(): Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
declare class LibsqlAkanClient implements AkanSqlClient {
|
|
146
|
+
readonly client: LibsqlClient;
|
|
147
|
+
constructor(client: LibsqlClient);
|
|
148
|
+
execute(sql: string, params?: unknown[] | Record<string, unknown>): Promise<import("@libsql/client").ResultSet>;
|
|
149
|
+
prepare(sql: string): AkanSqlStatement;
|
|
150
|
+
close(): Promise<void>;
|
|
151
|
+
}
|
|
152
|
+
declare class PostgresAkanClient implements AkanSqlClient {
|
|
153
|
+
readonly client: Sql;
|
|
154
|
+
constructor(client: Sql);
|
|
155
|
+
execute(sql: string, params?: unknown[] | Record<string, unknown>): Promise<import("postgres").RowList<(import("postgres").Row & Iterable<import("postgres").Row>)[]>>;
|
|
156
|
+
prepare(sql: string): AkanSqlStatement;
|
|
157
|
+
close(): Promise<void>;
|
|
158
|
+
}
|
|
159
|
+
declare class QueryCompiler {
|
|
160
|
+
private readonly fields;
|
|
161
|
+
constructor(fields: FieldMap);
|
|
162
|
+
compile(query?: DocumentQuery): {
|
|
163
|
+
where: string;
|
|
164
|
+
params: unknown[];
|
|
165
|
+
};
|
|
166
|
+
orderBy(sort?: Record<string, 1 | -1>): string;
|
|
167
|
+
fieldExpr(path: string): string;
|
|
168
|
+
private compileNode;
|
|
169
|
+
private compileField;
|
|
170
|
+
private compileArrayHas;
|
|
171
|
+
private assertPath;
|
|
172
|
+
private isQueryNode;
|
|
173
|
+
}
|
|
174
|
+
export declare class SqliteDocumentStore {
|
|
175
|
+
#private;
|
|
176
|
+
private readonly owner;
|
|
177
|
+
readonly constant: ConstantModel;
|
|
178
|
+
readonly database: DatabaseModel;
|
|
179
|
+
readonly schema: DocumentSchema;
|
|
180
|
+
readonly table: string;
|
|
181
|
+
readonly compiler: QueryCompiler;
|
|
182
|
+
constructor(owner: DocumentDatabaseOwner, constant: ConstantModel, database: DatabaseModel, schema: DocumentSchema);
|
|
183
|
+
ensure(): Promise<void>;
|
|
184
|
+
create(data: DocumentRecord): Promise<any>;
|
|
185
|
+
clone(data: DocumentRecord & {
|
|
186
|
+
id: string;
|
|
187
|
+
}): Promise<any>;
|
|
188
|
+
update(id: string, patch: DocumentRecord): Promise<any>;
|
|
189
|
+
remove(id: string): Promise<any>;
|
|
190
|
+
updateOneByQuery(query: DocumentQuery, update: DocumentUpdate, options?: DocumentUpdateOptions): Promise<{
|
|
191
|
+
acknowledged: boolean;
|
|
192
|
+
matchedCount: number;
|
|
193
|
+
modifiedCount: number;
|
|
194
|
+
upsertedId: any;
|
|
195
|
+
}>;
|
|
196
|
+
updateManyByQuery(query: DocumentQuery, update: DocumentUpdate): Promise<{
|
|
197
|
+
acknowledged: boolean;
|
|
198
|
+
matchedCount: number;
|
|
199
|
+
modifiedCount: number;
|
|
200
|
+
}>;
|
|
201
|
+
deleteManyByQuery(query: DocumentQuery): Promise<{
|
|
202
|
+
acknowledged: boolean;
|
|
203
|
+
matchedCount: number;
|
|
204
|
+
modifiedCount: number;
|
|
205
|
+
}>;
|
|
206
|
+
bulkWrite(operations: {
|
|
207
|
+
updateOne: {
|
|
208
|
+
filter: DocumentQuery;
|
|
209
|
+
update: DocumentUpdate;
|
|
210
|
+
upsert?: boolean;
|
|
211
|
+
};
|
|
212
|
+
}[]): Promise<{
|
|
213
|
+
acknowledged: boolean;
|
|
214
|
+
matchedCount: number;
|
|
215
|
+
modifiedCount: number;
|
|
216
|
+
upsertedId: string | null;
|
|
217
|
+
}>;
|
|
218
|
+
find(query?: DocumentQuery, options?: FindManyOptions): Promise<any[]>;
|
|
219
|
+
findIds(query?: DocumentQuery, options?: {
|
|
220
|
+
sort?: SortOption;
|
|
221
|
+
skip?: number | null;
|
|
222
|
+
limit?: number | null;
|
|
223
|
+
sample?: number;
|
|
224
|
+
}): Promise<string[]>;
|
|
225
|
+
findOne(query?: DocumentQuery, options?: FindOneOptions): Promise<any>;
|
|
226
|
+
findId(query?: DocumentQuery, options?: {
|
|
227
|
+
sort?: SortOption;
|
|
228
|
+
skip?: number | null;
|
|
229
|
+
sample?: boolean;
|
|
230
|
+
}): Promise<string | null>;
|
|
231
|
+
pickOne(query?: DocumentQuery, options?: FindOneOptions): Promise<any>;
|
|
232
|
+
pickById(id: string): Promise<any>;
|
|
233
|
+
exists(query?: DocumentQuery): Promise<string | null>;
|
|
234
|
+
count(query?: DocumentQuery): Promise<number>;
|
|
235
|
+
insight(query?: DocumentQuery): Promise<DocumentRecord>;
|
|
236
|
+
search(searchText: string | undefined | null, options?: {
|
|
237
|
+
skip?: number | null;
|
|
238
|
+
limit?: number | null;
|
|
239
|
+
sort?: SortOption;
|
|
240
|
+
}): Promise<{
|
|
241
|
+
docs: any[];
|
|
242
|
+
count: number;
|
|
243
|
+
}>;
|
|
244
|
+
private safeQuery;
|
|
245
|
+
private prepareDocument;
|
|
246
|
+
private extractInsertBase;
|
|
247
|
+
private applyDocumentUpdate;
|
|
248
|
+
private toRow;
|
|
249
|
+
private fromRow;
|
|
250
|
+
private normalizeProjection;
|
|
251
|
+
private projectionSql;
|
|
252
|
+
private projectionAlias;
|
|
253
|
+
private fromProjectedRow;
|
|
254
|
+
private parseProjectedValue;
|
|
255
|
+
private decodeDocumentPayload;
|
|
256
|
+
private decodeFieldValue;
|
|
257
|
+
private decodeMapValue;
|
|
258
|
+
private decodeNestedValue;
|
|
259
|
+
private normalizeWriteValue;
|
|
260
|
+
private fillScalarDefaults;
|
|
261
|
+
hydrate(data: DocumentRecord, originalData?: DocumentRecord): any;
|
|
262
|
+
private runHooks;
|
|
263
|
+
private insertStmt;
|
|
264
|
+
private prepareReadStmt;
|
|
265
|
+
private assertValidRefName;
|
|
266
|
+
}
|
|
267
|
+
declare const SqliteDatabase_base: import("..").AdaptorCls<{}, {
|
|
268
|
+
config: import("..").InjectInfo<"env", {
|
|
269
|
+
filePath: string;
|
|
270
|
+
journalMode: "WAL" | "DELETE" | "TRUNCATE" | "PERSIST" | "MEMORY" | "OFF";
|
|
271
|
+
busyTimeoutMs: number;
|
|
272
|
+
synchronous: "OFF" | "NORMAL" | "FULL" | "EXTRA";
|
|
273
|
+
foreignKeys: boolean;
|
|
274
|
+
cacheSize?: number;
|
|
275
|
+
tempStore?: "DEFAULT" | "FILE" | "MEMORY";
|
|
276
|
+
}, SqliteEnv, never>;
|
|
277
|
+
}>;
|
|
278
|
+
export declare class SqliteDatabase extends SqliteDatabase_base implements DatabaseAdaptor {
|
|
279
|
+
#private;
|
|
280
|
+
onInit(): Promise<void>;
|
|
281
|
+
onDestroy(): Promise<void>;
|
|
282
|
+
getConnection(): BunSqliteClient;
|
|
283
|
+
getStore(constant: ConstantModel, database: DatabaseModel, schema: SchemaOf): SqliteDocumentStore;
|
|
284
|
+
getMeta(key: string): string | undefined;
|
|
285
|
+
setMeta(key: string, value: string): Promise<void>;
|
|
286
|
+
transaction<T>(fn: () => PromiseOrObject<T>): Promise<T>;
|
|
287
|
+
afterCommit(fn: () => PromiseOrObject<void>): Promise<void>;
|
|
288
|
+
checkpoint(mode?: "PASSIVE" | "FULL" | "RESTART" | "TRUNCATE"): void;
|
|
289
|
+
vacuum(): void;
|
|
290
|
+
}
|
|
291
|
+
declare const LibsqlDatabase_base: import("..").AdaptorCls<{}, {
|
|
292
|
+
config: import("..").InjectInfo<"env", {
|
|
293
|
+
url: string;
|
|
294
|
+
authToken: string | undefined;
|
|
295
|
+
}, SqliteEnv, never>;
|
|
296
|
+
}>;
|
|
297
|
+
export declare class LibsqlDatabase extends LibsqlDatabase_base implements DatabaseAdaptor {
|
|
298
|
+
#private;
|
|
299
|
+
onInit(): Promise<void>;
|
|
300
|
+
onDestroy(): Promise<void>;
|
|
301
|
+
getConnection(): LibsqlAkanClient;
|
|
302
|
+
getStore(constant: ConstantModel, database: DatabaseModel, schema: SchemaOf): SqliteDocumentStore;
|
|
303
|
+
getMeta(key: string): Promise<string | undefined>;
|
|
304
|
+
setMeta(key: string, value: string): Promise<void>;
|
|
305
|
+
transaction<T>(fn: () => PromiseOrObject<T>): Promise<T>;
|
|
306
|
+
afterCommit(fn: () => PromiseOrObject<void>): Promise<void>;
|
|
307
|
+
}
|
|
308
|
+
declare const PostgresDatabase_base: import("..").AdaptorCls<{}, {
|
|
309
|
+
config: import("..").InjectInfo<"env", {
|
|
310
|
+
url: string | undefined;
|
|
311
|
+
host: string;
|
|
312
|
+
port: number;
|
|
313
|
+
database: string;
|
|
314
|
+
user: string;
|
|
315
|
+
password: string;
|
|
316
|
+
}, SqliteEnv, never>;
|
|
317
|
+
}>;
|
|
318
|
+
export declare class PostgresDatabase extends PostgresDatabase_base implements DatabaseAdaptor {
|
|
319
|
+
#private;
|
|
320
|
+
onInit(): Promise<void>;
|
|
321
|
+
onDestroy(): Promise<void>;
|
|
322
|
+
getConnection(): PostgresAkanClient;
|
|
323
|
+
getStore(constant: ConstantModel, database: DatabaseModel, schema: SchemaOf): SqliteDocumentStore;
|
|
324
|
+
getMeta(key: string): Promise<string | undefined>;
|
|
325
|
+
setMeta(key: string, value: string): Promise<void>;
|
|
326
|
+
transaction<T>(fn: () => PromiseOrObject<T>): Promise<T>;
|
|
327
|
+
afterCommit(fn: () => PromiseOrObject<void>): Promise<void>;
|
|
328
|
+
}
|
|
329
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./cache.adaptor";
|
|
2
|
+
export * from "./compress.adaptor";
|
|
3
|
+
export * from "./database.adaptor";
|
|
4
|
+
export * from "./logging.adaptor";
|
|
5
|
+
export * from "./queue.adaptor";
|
|
6
|
+
export * from "./role.adaptor";
|
|
7
|
+
export * from "./schedule.adaptor";
|
|
8
|
+
export * from "./solidCache.adaptor";
|
|
9
|
+
export * from "./solidPubsub.adaptor";
|
|
10
|
+
export * from "./solidQueue.adaptor";
|
|
11
|
+
export * from "./solidSqlite.d.ts";
|
|
12
|
+
export * from "./storage.adaptor";
|
|
13
|
+
export * from "./websocket.adaptor";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface LoggingAdaptor {
|
|
2
|
+
trace(name: string, msg: string, context?: string): void;
|
|
3
|
+
verbose(name: string, msg: string, context?: string): void;
|
|
4
|
+
debug(name: string, msg: string, context?: string): void;
|
|
5
|
+
log(name: string, msg: string, context?: string): void;
|
|
6
|
+
info(name: string, msg: string, context?: string): void;
|
|
7
|
+
warn(name: string, msg: string, context?: string): void;
|
|
8
|
+
error(name: string, msg: string, context?: string): void;
|
|
9
|
+
}
|
|
10
|
+
declare const ConsoleLogger_base: import("..").AdaptorCls<{}, {}>;
|
|
11
|
+
export declare class ConsoleLogger extends ConsoleLogger_base implements LoggingAdaptor {
|
|
12
|
+
trace(name: string, msg: string, context?: string): void;
|
|
13
|
+
verbose(name: string, msg: string, context?: string): void;
|
|
14
|
+
debug(name: string, msg: string, context?: string): void;
|
|
15
|
+
log(name: string, msg: string, context?: string): void;
|
|
16
|
+
info(name: string, msg: string, context?: string): void;
|
|
17
|
+
warn(name: string, msg: string, context?: string): void;
|
|
18
|
+
error(name: string, msg: string, context?: string): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BaseEnv } from "akanjs/base";
|
|
2
|
+
import type { AkanJob, AkanJobOptions, AkanWorker } from "../ipcTypes.d.ts";
|
|
3
|
+
type QueueLike = {
|
|
4
|
+
add(name: string, args: unknown[], options?: AkanJobOptions): Promise<unknown>;
|
|
5
|
+
};
|
|
6
|
+
type WorkerLike = AkanWorker;
|
|
7
|
+
export interface QueueAdaptor {
|
|
8
|
+
registerProcessWorker(key: string, handler: (job: AkanJob) => Promise<void>): AkanWorker;
|
|
9
|
+
registerProcessQueue(key: string, args: unknown[], jobOptions?: AkanJobOptions): Promise<AkanJob>;
|
|
10
|
+
}
|
|
11
|
+
declare const BullQueue_base: import("..").AdaptorCls<{}, {
|
|
12
|
+
redis: import("..").InjectInfo<"plug", import("ioredis").default, never, never>;
|
|
13
|
+
prefix: import("..").InjectInfo<"env", string, BaseEnv, never>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare class BullQueue extends BullQueue_base implements QueueAdaptor {
|
|
16
|
+
#private;
|
|
17
|
+
onInit(): Promise<void>;
|
|
18
|
+
getQueue(): QueueLike;
|
|
19
|
+
registerProcessWorker(key: string, handler: (job: AkanJob) => Promise<void>): WorkerLike;
|
|
20
|
+
registerProcessQueue(key: string, args: unknown[], jobOptions?: AkanJobOptions): Promise<AkanJob>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AdaptorCls } from "../adapt.d.ts";
|
|
2
|
+
import type { CacheAdaptor } from "./cache.adaptor";
|
|
3
|
+
import type { CompressAdaptor } from "./compress.adaptor";
|
|
4
|
+
import type { DatabaseAdaptor } from "./database.adaptor";
|
|
5
|
+
import type { LoggingAdaptor } from "./logging.adaptor";
|
|
6
|
+
import type { QueueAdaptor } from "./queue.adaptor";
|
|
7
|
+
import type { ScheduleAdaptor } from "./schedule.adaptor";
|
|
8
|
+
import type { StorageAdaptor } from "./storage.adaptor";
|
|
9
|
+
import type { WebsocketAdaptor } from "./websocket.adaptor";
|
|
10
|
+
export declare const DatabaseAdaptorRole: AdaptorCls<DatabaseAdaptor>;
|
|
11
|
+
export declare const CacheAdaptorRole: AdaptorCls<CacheAdaptor>;
|
|
12
|
+
export declare const StorageAdaptorRole: AdaptorCls<StorageAdaptor>;
|
|
13
|
+
export declare const QueueAdaptorRole: AdaptorCls<QueueAdaptor>;
|
|
14
|
+
export declare const ScheduleAdaptorRole: AdaptorCls<ScheduleAdaptor>;
|
|
15
|
+
export declare const LoggingAdaptorRole: AdaptorCls<LoggingAdaptor>;
|
|
16
|
+
export declare const WebsocketAdaptorRole: AdaptorCls<WebsocketAdaptor>;
|
|
17
|
+
export declare const CompressAdaptorRole: AdaptorCls<CompressAdaptor>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Cron } from "croner";
|
|
2
|
+
export interface ScheduleAdaptor {
|
|
3
|
+
getCron(key: string): Cron | undefined;
|
|
4
|
+
registerCron(key: string, cronStr: string, callback: () => Promise<void>, option?: {
|
|
5
|
+
lock?: boolean;
|
|
6
|
+
}): Cron;
|
|
7
|
+
unregisterCron(key: string): void;
|
|
8
|
+
getInterval(key: string): NodeJS.Timeout | undefined;
|
|
9
|
+
registerInterval(key: string, scheduleTime: number, callback: () => Promise<void>, option?: {
|
|
10
|
+
lock?: boolean;
|
|
11
|
+
}): NodeJS.Timeout;
|
|
12
|
+
unregisterInterval(key: string): void;
|
|
13
|
+
getTimeout(key: string): NodeJS.Timeout | undefined;
|
|
14
|
+
registerTimeout(key: string, timeout: number, callback: () => Promise<void>, option?: {
|
|
15
|
+
lock?: boolean;
|
|
16
|
+
}): NodeJS.Timeout;
|
|
17
|
+
unregisterTimeout(key: string): void;
|
|
18
|
+
getInit(key: string): (() => Promise<void>) | undefined;
|
|
19
|
+
registerInit(key: string, callback: () => Promise<void>): void;
|
|
20
|
+
unregisterInit(key: string): void;
|
|
21
|
+
_runInit(): Promise<void>;
|
|
22
|
+
getDestroy(key: string): (() => Promise<void>) | undefined;
|
|
23
|
+
registerDestroy(key: string, callback: () => Promise<void>): void;
|
|
24
|
+
unregisterDestroy(key: string): void;
|
|
25
|
+
_runDestroy(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
declare const Scheduler_base: import("..").AdaptorCls<{}, {
|
|
28
|
+
cache: import("..").InjectInfo<"plug", import("./cache.adaptor").CacheAdaptor, never, never>;
|
|
29
|
+
}>;
|
|
30
|
+
export declare class Scheduler extends Scheduler_base implements ScheduleAdaptor {
|
|
31
|
+
readonly lockMap: Map<string, boolean>;
|
|
32
|
+
readonly cronMap: Map<string, Cron<undefined>>;
|
|
33
|
+
readonly intervalMap: Map<string, NodeJS.Timeout>;
|
|
34
|
+
readonly timeoutMap: Map<string, NodeJS.Timeout>;
|
|
35
|
+
readonly initMap: Map<string, () => Promise<void>>;
|
|
36
|
+
readonly destroyMap: Map<string, () => Promise<void>>;
|
|
37
|
+
getCron(key: string): Cron<undefined> | undefined;
|
|
38
|
+
registerCron(key: string, cronStr: string, callback: () => Promise<void>, { lock }?: {
|
|
39
|
+
lock?: boolean;
|
|
40
|
+
}): Cron<undefined>;
|
|
41
|
+
unregisterCron(key: string): void;
|
|
42
|
+
getInterval(key: string): NodeJS.Timeout | undefined;
|
|
43
|
+
registerInterval(key: string, scheduleTime: number, callback: () => Promise<void>, { lock }?: {
|
|
44
|
+
lock?: boolean;
|
|
45
|
+
}): NodeJS.Timeout;
|
|
46
|
+
unregisterInterval(key: string): void;
|
|
47
|
+
getTimeout(key: string): NodeJS.Timeout | undefined;
|
|
48
|
+
registerTimeout(key: string, scheduleTime: number, callback: () => Promise<void>): NodeJS.Timeout;
|
|
49
|
+
unregisterTimeout(key: string): void;
|
|
50
|
+
getInit(key: string): (() => Promise<void>) | undefined;
|
|
51
|
+
registerInit(key: string, callback: () => Promise<void>): void;
|
|
52
|
+
unregisterInit(key: string): void;
|
|
53
|
+
_runInit(): Promise<void>;
|
|
54
|
+
getDestroy(key: string): (() => Promise<void>) | undefined;
|
|
55
|
+
registerDestroy(key: string, callback: () => Promise<void>): void;
|
|
56
|
+
unregisterDestroy(key: string): void;
|
|
57
|
+
_runDestroy(): Promise<void>;
|
|
58
|
+
onDestroy(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Dayjs } from "akanjs/base";
|
|
2
|
+
import type { CacheAdaptor } from "./cache.adaptor";
|
|
3
|
+
import { type SolidConfig, type SolidEnv } from "./solidSqlite.d.ts";
|
|
4
|
+
declare const SolidCache_base: import("..").AdaptorCls<{}, {
|
|
5
|
+
config: import("..").InjectInfo<"env", Required<SolidConfig>, SolidEnv, never>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare class SolidCache extends SolidCache_base implements CacheAdaptor {
|
|
8
|
+
#private;
|
|
9
|
+
onInit(): Promise<void>;
|
|
10
|
+
onDestroy(): Promise<void>;
|
|
11
|
+
set(topic: string, key: string, value: string | number | Buffer, option?: {
|
|
12
|
+
expireAt?: Dayjs;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
get<T extends string | number | Buffer>(topic: string, key: string): Promise<T | undefined>;
|
|
15
|
+
delete(topic: string, key: string): Promise<void>;
|
|
16
|
+
hset(topic: string, key: string, subKey: string, value: string | number | Buffer, option?: {
|
|
17
|
+
expireAt?: Dayjs;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
hget<T extends string | number | Buffer>(topic: string, key: string, subKey: string): Promise<T | undefined>;
|
|
20
|
+
hdelete(topic: string, key: string, subKey: string): Promise<void>;
|
|
21
|
+
hkeys(topic: string, key: string): Promise<string[]>;
|
|
22
|
+
hentries<T extends string | number | Buffer>(topic: string, key: string): Promise<[string, T][]>;
|
|
23
|
+
hclear(topic: string, key: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseEnv, Cls } from "akanjs/base";
|
|
2
|
+
import type { WebsocketAdaptor, WsRedisEventHandler } from "./websocket.adaptor";
|
|
3
|
+
declare const SolidPubSub_base: import("..").AdaptorCls<{}, {
|
|
4
|
+
serverId: import("..").InjectInfo<"env", string, BaseEnv, never>;
|
|
5
|
+
}>;
|
|
6
|
+
export declare class SolidPubSub extends SolidPubSub_base implements WebsocketAdaptor {
|
|
7
|
+
#private;
|
|
8
|
+
onInit(): Promise<void>;
|
|
9
|
+
onDestroy(): Promise<void>;
|
|
10
|
+
publish(roomId: string, data: unknown): void;
|
|
11
|
+
setEventHandler(handler: WsRedisEventHandler): void;
|
|
12
|
+
clearEventHandler(): void;
|
|
13
|
+
registerEndpoint(key: string, returnRef: Cls, arrDepth: number): void;
|
|
14
|
+
joinRoom(ws: Bun.ServerWebSocket<unknown>, room: string): Promise<void>;
|
|
15
|
+
leaveRoom(ws: Bun.ServerWebSocket<unknown>, room: string): Promise<void>;
|
|
16
|
+
leaveAllRooms(ws: Bun.ServerWebSocket<unknown>): Promise<void>;
|
|
17
|
+
registerSocket(ws: Bun.ServerWebSocket<unknown>): Promise<void>;
|
|
18
|
+
unregisterSocket(ws: Bun.ServerWebSocket<unknown>): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type AkanJob, type AkanJobOptions, type AkanWorker } from "../ipcTypes.d.ts";
|
|
2
|
+
import type { QueueAdaptor } from "./queue.adaptor";
|
|
3
|
+
import { type SolidConfig, type SolidEnv } from "./solidSqlite.d.ts";
|
|
4
|
+
declare const SolidQueue_base: import("..").AdaptorCls<{}, {
|
|
5
|
+
config: import("..").InjectInfo<"env", Required<SolidConfig>, SolidEnv, never>;
|
|
6
|
+
queueName: import("..").InjectInfo<"env", string, SolidEnv, never>;
|
|
7
|
+
workerId: import("..").InjectInfo<"env", string, SolidEnv, never>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare class SolidQueue extends SolidQueue_base implements QueueAdaptor {
|
|
10
|
+
#private;
|
|
11
|
+
onInit(): Promise<void>;
|
|
12
|
+
onDestroy(): Promise<void>;
|
|
13
|
+
registerProcessWorker(key: string, handler: (job: AkanJob) => Promise<void>): AkanWorker;
|
|
14
|
+
registerProcessQueue(key: string, args: unknown[], jobOptions?: AkanJobOptions): Promise<AkanJob>;
|
|
15
|
+
wake(name?: string): void;
|
|
16
|
+
claimJob(name: string): AkanJob | null;
|
|
17
|
+
runJob(job: AkanJob, handler: (job: AkanJob) => Promise<void>): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
import type { BaseEnv, Dayjs } from "akanjs/base";
|
|
3
|
+
export interface SolidConfig {
|
|
4
|
+
filePath?: string;
|
|
5
|
+
journalMode?: "WAL" | "DELETE" | "TRUNCATE" | "PERSIST" | "MEMORY" | "OFF";
|
|
6
|
+
busyTimeoutMs?: number;
|
|
7
|
+
synchronous?: "OFF" | "NORMAL" | "FULL" | "EXTRA";
|
|
8
|
+
cleanupIntervalMs?: number;
|
|
9
|
+
queuePollIntervalMs?: number;
|
|
10
|
+
queueLeaseMs?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SolidEnv extends BaseEnv {
|
|
13
|
+
workspaceRoot?: string;
|
|
14
|
+
solid?: SolidConfig;
|
|
15
|
+
}
|
|
16
|
+
export type SolidValueType = "string" | "number" | "buffer" | "json";
|
|
17
|
+
export declare const getSolidConfig: (env: SolidEnv) => Required<SolidConfig>;
|
|
18
|
+
export declare const openSolidDatabase: (config: Required<SolidConfig>) => Promise<Database>;
|
|
19
|
+
export declare const encodeSolidValue: (value: unknown) => {
|
|
20
|
+
type: SolidValueType;
|
|
21
|
+
value: string | Buffer;
|
|
22
|
+
};
|
|
23
|
+
export declare const decodeSolidValue: <T>(type: SolidValueType, value: string | Buffer | null) => T | undefined;
|
|
24
|
+
export declare const toEpochMs: (value?: Dayjs | number | null) => number | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ResolveDefaultSqliteFileOptions {
|
|
2
|
+
appName: string;
|
|
3
|
+
fileName: string;
|
|
4
|
+
isProduction: boolean;
|
|
5
|
+
operationMode?: string;
|
|
6
|
+
workspaceRoot?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const resolveDefaultSqliteFile: ({ appName, fileName, isProduction, operationMode, workspaceRoot, }: ResolveDefaultSqliteFileOptions) => string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { BaseEnv } from "akanjs/base";
|
|
2
|
+
export interface DownloadRequest {
|
|
3
|
+
path: string;
|
|
4
|
+
localPath: string;
|
|
5
|
+
renamePath?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LocalFilePath {
|
|
8
|
+
localPath: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UploadRequest {
|
|
11
|
+
path: string;
|
|
12
|
+
localPath: string;
|
|
13
|
+
meta?: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
};
|
|
16
|
+
rename?: string;
|
|
17
|
+
host?: string;
|
|
18
|
+
access?: "public" | "private";
|
|
19
|
+
}
|
|
20
|
+
export interface CopyRequest {
|
|
21
|
+
bucket: string;
|
|
22
|
+
copyPath: string;
|
|
23
|
+
pastePath: string;
|
|
24
|
+
filename: string;
|
|
25
|
+
host?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface UploadFromStreamRequest {
|
|
28
|
+
path: string;
|
|
29
|
+
body: ReadableStream;
|
|
30
|
+
mimetype: string;
|
|
31
|
+
root?: string;
|
|
32
|
+
access?: "public" | "private";
|
|
33
|
+
updateProgress: (progress: {
|
|
34
|
+
loaded?: number;
|
|
35
|
+
total?: number;
|
|
36
|
+
part?: number;
|
|
37
|
+
}) => void;
|
|
38
|
+
uploadSuccess: (url: string) => void;
|
|
39
|
+
}
|
|
40
|
+
export interface UploadProgress {
|
|
41
|
+
loaded?: number;
|
|
42
|
+
total?: number;
|
|
43
|
+
part?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface StorageAdaptor {
|
|
46
|
+
readData(path: string): Promise<ReadableStream>;
|
|
47
|
+
readDataAsJson<T>(path: string): Promise<T>;
|
|
48
|
+
getDataList(prefix?: string): Promise<string[]>;
|
|
49
|
+
uploadDataFromLocal(request: UploadRequest): Promise<string>;
|
|
50
|
+
uploadDataFromStream(request: UploadFromStreamRequest): void;
|
|
51
|
+
saveData(request: DownloadRequest): Promise<LocalFilePath>;
|
|
52
|
+
copyData(request: CopyRequest): Promise<string>;
|
|
53
|
+
deleteData(url: string): Promise<boolean>;
|
|
54
|
+
deleteDataByPath(path: string): Promise<boolean>;
|
|
55
|
+
}
|
|
56
|
+
export interface BlobStorageOptions extends BaseEnv {
|
|
57
|
+
blobStorage?: {
|
|
58
|
+
baseDir?: string;
|
|
59
|
+
privateBaseDir?: string;
|
|
60
|
+
urlPrefix?: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
declare const BlobStorage_base: import("..").AdaptorCls<{}, {
|
|
64
|
+
root: import("..").InjectInfo<"env", string, BlobStorageOptions, never>;
|
|
65
|
+
privateRoot: import("..").InjectInfo<"env", string, BlobStorageOptions, never>;
|
|
66
|
+
urlPrefix: import("..").InjectInfo<"env", string | undefined, BlobStorageOptions, never>;
|
|
67
|
+
}>;
|
|
68
|
+
export declare class BlobStorage extends BlobStorage_base implements StorageAdaptor {
|
|
69
|
+
#private;
|
|
70
|
+
readData(path: string): Promise<ReadableStream>;
|
|
71
|
+
readDataAsJson<T>(path: string): Promise<T>;
|
|
72
|
+
getDataList(prefix?: string): Promise<string[]>;
|
|
73
|
+
uploadDataFromLocal({ path, localPath, meta, access }: UploadRequest): Promise<string>;
|
|
74
|
+
uploadDataFromStream({ path, body, mimetype, updateProgress, uploadSuccess, access, }: UploadFromStreamRequest): Promise<void>;
|
|
75
|
+
saveData({ path, localPath, renamePath }: DownloadRequest): Promise<LocalFilePath>;
|
|
76
|
+
copyData({ copyPath, pastePath, host }: CopyRequest): Promise<string>;
|
|
77
|
+
deleteDataByPath(path: string): Promise<boolean>;
|
|
78
|
+
deleteData(url: string): Promise<boolean>;
|
|
79
|
+
}
|
|
80
|
+
export {};
|