akanjs 3.0.2 → 3.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/base/baseEnv.ts +0 -4
- package/base/primitiveRegistry.ts +2 -2
- package/client/cookie.ts +5 -1
- package/client/csrLocation.ts +122 -0
- package/client/csrTypes.ts +32 -4
- package/client/device.ts +2 -1
- package/client/frameConfig.ts +78 -7
- package/client/index.ts +3 -0
- package/client/makePageProto.tsx +3 -2
- package/client/native/external-view.ts +1 -0
- package/client/route/RootLayoutDefinition.ts +7 -1
- package/client/route/RouteHead.ts +108 -0
- package/client/route/index.ts +1 -0
- package/client/router.ts +36 -23
- package/client/rscNavigation.ts +8 -2
- package/client/viewportMeta.ts +60 -0
- package/client/webManifest.ts +18 -0
- package/common/Logger.ts +7 -2
- package/common/PipelineNames.ts +31 -0
- package/common/PipelinePattern.ts +70 -0
- package/common/PipelinePlanSchema.ts +490 -0
- package/common/backoff.ts +14 -0
- package/common/index.ts +39 -0
- package/common/pipelinePlan.ts +259 -0
- package/common/routeConvention.ts +1 -0
- package/common/types.ts +17 -0
- package/constant/constantRegistry.ts +26 -6
- package/dictionary/base.dictionary.ts +8 -0
- package/dictionary/trans.ts +9 -1
- package/document/into.ts +5 -0
- package/fetch/client/fetchClient.ts +135 -31
- package/fetch/client/httpClient.ts +45 -0
- package/fetch/client/wsClient.ts +125 -16
- package/fetch/fetchType/buildFetch.type.ts +1 -0
- package/index.ts +243 -10
- package/package.json +1 -5
- package/server/akanApp.ts +5 -2
- package/server/akanServer.ts +44 -8
- package/server/artifact/builderRpc.ts +8 -3
- package/server/artifact/ipcTypes.ts +5 -2
- package/server/di/diLifecycle.ts +39 -3
- package/server/di/utils.ts +28 -1
- package/server/ed25519Key.ts +48 -0
- package/server/index.ts +1 -0
- package/server/machine/index.ts +2 -0
- package/server/machine/machineAccount.ts +27 -0
- package/server/machine/machineToken.ts +151 -0
- package/server/mcp/McpApps.ts +256 -0
- package/server/mcp/McpDispatcher.ts +31 -7
- package/server/mcp/McpRouter.ts +209 -46
- package/server/ops/opsToken.ts +3 -10
- package/server/resolver/database.resolver.ts +3 -0
- package/server/resolver/signal.resolver.ts +40 -3
- package/server/routeElementComposer.tsx +78 -2
- package/server/routeState.ts +6 -0
- package/server/routeTreeBuilder.ts +26 -9
- package/server/routing/apiRouter.ts +6 -3
- package/server/routing/roomReplay.ts +88 -0
- package/server/rscClient.tsx +53 -8
- package/server/rscWorker.tsx +141 -27
- package/server/rscWorkerHost.ts +18 -5
- package/server/sitemap.ts +14 -0
- package/server/ssrFromRscRenderer.tsx +12 -6
- package/server/ssrTypes.ts +3 -1
- package/server/systemPageDocument.tsx +38 -30
- package/server/types.tsx +2 -0
- package/server/webRouter.ts +74 -5
- package/service/injectInfo.ts +9 -1
- package/service/ipcTypes.ts +2 -1
- package/service/predefinedAdaptor/database.adaptor.ts +1 -146
- package/service/predefinedAdaptor/queue.adaptor.ts +44 -6
- package/service/predefinedAdaptor/queueBackoff.ts +12 -0
- package/service/predefinedAdaptor/solidQueue.adaptor.ts +17 -13
- package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +44 -2
- package/service/predefinedAdaptor/sql/dialect/postgres.ts +3 -0
- package/service/predefinedAdaptor/sql/dialect/sqlite.ts +5 -2
- package/service/predefinedAdaptor/sql/search/fts5.ts +1 -1
- package/service/predefinedAdaptor/sql/types.ts +8 -6
- package/service/predefinedAdaptor/sql/values.ts +0 -23
- package/service/serve.ts +5 -1
- package/signal/agent.signal.ts +1 -1
- package/signal/base.signal.ts +2 -2
- package/signal/endpointIdempotency.ts +53 -0
- package/signal/internalArg.ts +14 -0
- package/signal/mcp/McpDocument.ts +38 -1
- package/signal/mcp/mcpProtocol.ts +18 -0
- package/signal/signalContext.ts +58 -30
- package/signal/signalRegistry.ts +14 -4
- package/signal/types.ts +18 -3
- package/store/agent/StoreSurfaceSource.ts +1 -1
- package/store/agentic/StToolBuilder.ts +3 -0
- package/test/conformance.ts +9 -33
- package/types/base/baseEnv.d.ts +0 -4
- package/types/base/primitiveRegistry.d.ts +1 -1
- package/types/client/csrLocation.d.ts +32 -0
- package/types/client/csrTypes.d.ts +40 -4
- package/types/client/frameConfig.d.ts +14 -2
- package/types/client/index.d.ts +3 -0
- package/types/client/native/external-view.d.ts +1 -0
- package/types/client/route/RootLayoutDefinition.d.ts +2 -1
- package/types/client/route/RouteHead.d.ts +13 -0
- package/types/client/route/index.d.ts +1 -0
- package/types/client/router.d.ts +6 -0
- package/types/client/rscNavigation.d.ts +4 -0
- package/types/client/viewportMeta.d.ts +18 -0
- package/types/client/webManifest.d.ts +4 -0
- package/types/common/PipelineNames.d.ts +6 -0
- package/types/common/PipelinePattern.d.ts +14 -0
- package/types/common/PipelinePlanSchema.d.ts +9 -0
- package/types/common/backoff.d.ts +10 -0
- package/types/common/index.d.ts +5 -0
- package/types/common/pipelinePlan.d.ts +224 -0
- package/types/common/types.d.ts +16 -0
- package/types/constant/constantRegistry.d.ts +5 -2
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +8 -8
- package/types/document/into.d.ts +9 -0
- package/types/fetch/client/fetchClient.d.ts +31 -4
- package/types/fetch/client/httpClient.d.ts +8 -0
- package/types/fetch/client/wsClient.d.ts +26 -2
- package/types/fetch/fetchType/buildFetch.type.d.ts +1 -0
- package/types/index.d.ts +230 -9
- package/types/server/akanServer.d.ts +16 -1
- package/types/server/artifact/builderRpc.d.ts +7 -2
- package/types/server/artifact/ipcTypes.d.ts +5 -1
- package/types/server/di/utils.d.ts +1 -0
- package/types/server/ed25519Key.d.ts +13 -0
- package/types/server/index.d.ts +1 -0
- package/types/server/machine/index.d.ts +2 -0
- package/types/server/machine/machineAccount.d.ts +5 -0
- package/types/server/machine/machineToken.d.ts +29 -0
- package/types/server/machine.d.ts +1 -0
- package/types/server/mcp/McpApps.d.ts +50 -0
- package/types/server/mcp/McpDispatcher.d.ts +4 -1
- package/types/server/mcp/McpRouter.d.ts +4 -0
- package/types/server/resolver/signal.resolver.d.ts +2 -1
- package/types/server/routeElementComposer.d.ts +24 -4
- package/types/server/routeState.d.ts +4 -1
- package/types/server/routing/roomReplay.d.ts +24 -0
- package/types/server/rscWorkerHost.d.ts +5 -2
- package/types/server/sitemap.d.ts +2 -0
- package/types/server/ssrFromRscRenderer.d.ts +3 -3
- package/types/server/ssrTypes.d.ts +4 -1
- package/types/server/systemPageDocument.d.ts +2 -0
- package/types/server/types.d.ts +4 -1
- package/types/server/webRouter.d.ts +3 -1
- package/types/service/ipcTypes.d.ts +2 -0
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +1 -24
- package/types/service/predefinedAdaptor/queue.adaptor.d.ts +10 -3
- package/types/service/predefinedAdaptor/queueBackoff.d.ts +4 -0
- package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +3 -3
- package/types/service/predefinedAdaptor/sql/SqlDocumentStore.d.ts +6 -1
- package/types/service/predefinedAdaptor/sql/dialect/postgres.d.ts +1 -0
- package/types/service/predefinedAdaptor/sql/dialect/sqlite.d.ts +1 -0
- package/types/service/predefinedAdaptor/sql/search/fts5.d.ts +1 -1
- package/types/service/predefinedAdaptor/sql/types.d.ts +9 -5
- package/types/service/predefinedAdaptor/sql/values.d.ts +0 -3
- package/types/service/serve.d.ts +3 -0
- package/types/signal/endpointIdempotency.d.ts +7 -0
- package/types/signal/internalArg.d.ts +10 -0
- package/types/signal/mcp/McpDocument.d.ts +8 -0
- package/types/signal/mcp/mcpProtocol.d.ts +17 -0
- package/types/signal/signalContext.d.ts +5 -3
- package/types/signal/signalRegistry.d.ts +4 -4
- package/types/signal/types.d.ts +21 -1
- package/types/store/agentic/StToolBuilder.d.ts +2 -0
- package/types/test/conformance.d.ts +7 -10
- package/types/ui/Agent/Chat.d.ts +5 -1
- package/types/ui/Agent/EmbedApproval.d.ts +1 -0
- package/types/ui/Agent/index.d.ts +3 -0
- package/types/ui/Agent/useKeyboardFrame.d.ts +2 -0
- package/types/ui/Agent/useScreenActions.d.ts +18 -0
- package/types/ui/BottomSheet.d.ts +1 -0
- package/types/ui/Constant/Doc.d.ts +11 -17
- package/types/ui/Constant/index.d.ts +7 -2
- package/types/ui/Constant/schemaDoc.d.ts +11 -0
- package/types/ui/Dialog/Modal.d.ts +6 -1
- package/types/ui/Dialog/index.d.ts +1 -1
- package/types/ui/Dialog/modalSurface.d.ts +12 -0
- package/types/ui/Layout/BottomTab.d.ts +11 -2
- package/types/ui/Layout/FrameSlotFallback.d.ts +9 -0
- package/types/ui/Layout/Navbar.d.ts +4 -1
- package/types/ui/Layout/TopInset.d.ts +1 -1
- package/types/ui/Layout/index.d.ts +3 -3
- package/types/ui/Link/Action.d.ts +5 -1
- package/types/ui/Link/Anchor.d.ts +5 -3
- package/types/ui/Link/activePath.d.ts +13 -0
- package/types/ui/Link/index.d.ts +1 -1
- package/types/ui/Modal.d.ts +6 -1
- package/types/ui/Model/EditModal.d.ts +6 -1
- package/types/ui/Model/New.d.ts +6 -1
- package/types/ui/Model/ViewEditModal.d.ts +6 -1
- package/types/ui/Model/ViewModal.d.ts +6 -1
- package/types/ui/Model/newFormOrigin.d.ts +7 -0
- package/types/ui/Portal.d.ts +3 -1
- package/types/ui/Reference/origin.d.ts +12 -0
- package/types/ui/Signal/Doc.d.ts +23 -18
- package/types/ui/Signal/Listener.d.ts +2 -6
- package/types/ui/Signal/Object.d.ts +6 -10
- package/types/ui/Signal/Response.d.ts +3 -6
- package/types/ui/Signal/RestApi.d.ts +11 -15
- package/types/ui/Signal/WebSocket.d.ts +11 -21
- package/types/ui/Signal/endpointEntries.d.ts +8 -0
- package/types/ui/Signal/index.d.ts +35 -12
- package/types/ui/Signal/signalText.d.ts +178 -0
- package/types/ui/System/CSR.d.ts +2 -2
- package/types/ui/System/Client.d.ts +4 -3
- package/types/ui/System/Common.d.ts +27 -6
- package/types/ui/System/SSR.d.ts +6 -6
- package/types/ui/Tooltip.d.ts +4 -2
- package/types/ui/index.d.ts +2 -1
- package/types/ui/overlayLayer.d.ts +6 -0
- package/types/ui/overlayPosition.d.ts +17 -0
- package/types/vendor/@akanjs/native/packages/cli/src/api.d.ts +14 -3
- package/types/vendor/@akanjs/native/packages/cli/src/commands/update.d.ts +1 -1
- package/types/vendor/@akanjs/native/packages/cli/src/config.d.ts +30 -5
- package/types/vendor/@akanjs/native/packages/cli/src/lib/compat.d.ts +8 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/desktop-server.d.ts +5 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/distribution.d.ts +22 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +4 -0
- package/types/vendor/@akanjs/native/packages/cli/src/lib/publish.d.ts +16 -10
- package/types/vendor/@akanjs/native/packages/cli/src/lib/updates.d.ts +51 -7
- package/types/vendor/@akanjs/native/packages/cli/src/lib/vectors.d.ts +1 -1
- package/types/vendor/@akanjs/native/packages/cli/src/platforms/windows-installer.d.ts +7 -0
- package/types/vendor/@akanjs/native/packages/cli/src/platforms/windows.d.ts +5 -0
- package/types/vendor/@akanjs/native/packages/core/src/kernel.d.ts +36 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/plugin.d.ts +2 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/server.d.ts +11 -0
- package/types/vendor/@akanjs/native/plugins/external-view/src/desktop.d.ts +17 -0
- package/types/vendor/@akanjs/native/plugins/external-view/src/index.d.ts +132 -0
- package/types/vendor/@akanjs/native/plugins/external-view/src.d.ts +1 -0
- package/types/vendor/@akanjs/native/plugins/updates/src/index.d.ts +8 -0
- package/types/vendor/@akanjs/native/plugins/window/src/desktop.d.ts +4 -1
- package/types/vendor/@akanjs/native/plugins/window/src/index.d.ts +49 -0
- package/types/vendor/use-agentic/types.d.ts +2 -0
- package/types/webkit/CsrStack.d.ts +1 -1
- package/types/webkit/McpAppAgent.d.ts +14 -0
- package/types/webkit/McpAppApprovals.d.ts +8 -0
- package/types/webkit/McpAppBridge.d.ts +101 -0
- package/types/webkit/McpAppView.d.ts +21 -0
- package/types/webkit/index.d.ts +1 -0
- package/types/webkit/useLocation.d.ts +1 -1
- package/types/webkit/useVisualViewportFrame.d.ts +13 -0
- package/ui/Agent/Chat.tsx +29 -10
- package/ui/Agent/Composer.tsx +2 -1
- package/ui/Agent/EmbedApproval.tsx +17 -0
- package/ui/Agent/RichInput.tsx +1 -1
- package/ui/Agent/index.ts +2 -0
- package/ui/Agent/useKeyboardFrame.ts +10 -0
- package/ui/Agent/useScreenActions.ts +45 -0
- package/ui/BottomSheet.tsx +82 -53
- package/ui/Constant/Doc.tsx +113 -60
- package/ui/Constant/index.ts +2 -2
- package/ui/Constant/schemaDoc.ts +86 -26
- package/ui/Dialog/LegacyModal.tsx +53 -52
- package/ui/Dialog/Modal.tsx +93 -49
- package/ui/Dialog/modalSurface.ts +61 -0
- package/ui/DragAction.tsx +1 -1
- package/ui/DraggableList.tsx +1 -1
- package/ui/Dropdown.tsx +4 -6
- package/ui/KeyboardAvoiding.tsx +1 -1
- package/ui/Layout/BottomInset.tsx +20 -14
- package/ui/Layout/BottomTab.tsx +42 -16
- package/ui/Layout/FrameSlotFallback.tsx +59 -0
- package/ui/Layout/Navbar.tsx +37 -11
- package/ui/Layout/Sider.tsx +1 -1
- package/ui/Layout/TopInset.tsx +15 -14
- package/ui/Link/Action.tsx +15 -5
- package/ui/Link/Anchor.tsx +25 -13
- package/ui/Link/activePath.ts +25 -0
- package/ui/Link/index.tsx +1 -1
- package/ui/Load/Pagination.tsx +1 -1
- package/ui/Load/Units.tsx +1 -1
- package/ui/Loading/ProgressBar.tsx +1 -1
- package/ui/Modal.tsx +9 -0
- package/ui/Model/EditModal.tsx +16 -1
- package/ui/Model/New.tsx +25 -2
- package/ui/Model/NewWrapper_Client.tsx +2 -0
- package/ui/Model/ViewEditModal.tsx +9 -0
- package/ui/Model/ViewModal.tsx +16 -1
- package/ui/Model/newFormOrigin.ts +45 -0
- package/ui/Popconfirm.tsx +5 -7
- package/ui/Portal.tsx +4 -7
- package/ui/Reference/origin.ts +31 -0
- package/ui/ScreenNavigator.tsx +1 -1
- package/ui/Select.tsx +2 -7
- package/ui/Signal/Arg.tsx +2 -2
- package/ui/Signal/Doc.tsx +125 -63
- package/ui/Signal/Endpoint.tsx +11 -10
- package/ui/Signal/Listener.tsx +7 -10
- package/ui/Signal/Object.tsx +7 -14
- package/ui/Signal/Response.tsx +24 -24
- package/ui/Signal/RestApi.tsx +63 -52
- package/ui/Signal/WebSocket.tsx +65 -72
- package/ui/Signal/endpointEntries.ts +25 -0
- package/ui/Signal/index.ts +23 -6
- package/ui/Signal/signalText.ts +59 -0
- package/ui/System/CSR.tsx +34 -8
- package/ui/System/Client.tsx +36 -5
- package/ui/System/Common.tsx +76 -32
- package/ui/System/SSR.tsx +73 -31
- package/ui/Toast.tsx +1 -1
- package/ui/Tooltip.tsx +84 -30
- package/ui/index.ts +11 -1
- package/ui/overlayLayer.ts +25 -2
- package/ui/overlayPosition.ts +90 -0
- package/ui/recipe/inputRecipe.ts +8 -1
- package/ui/styles.css +152 -0
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeActivity.kt +22 -2
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeKernel.kt +37 -0
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeUpdateReports.kt +169 -0
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeUpdates.kt +110 -38
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeVectors.kt +20 -0
- package/vendor/@akanjs/native/native/desktop/Cargo.lock +16 -16
- package/vendor/@akanjs/native/native/desktop/src/external.rs +651 -0
- package/vendor/@akanjs/native/native/desktop/src/json.rs +23 -0
- package/vendor/@akanjs/native/native/desktop/src/lib.rs +228 -5
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeApp.swift +2 -1
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeKernel.swift +47 -1
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeUpdateReports.swift +145 -0
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeUpdates.swift +112 -43
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeVectors.swift +18 -0
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeViewController.swift +24 -2
- package/vendor/@akanjs/native/packages/cli/src/api.ts +22 -6
- package/vendor/@akanjs/native/packages/cli/src/commands/build.ts +24 -8
- package/vendor/@akanjs/native/packages/cli/src/commands/update.ts +11 -9
- package/vendor/@akanjs/native/packages/cli/src/config.ts +35 -7
- package/vendor/@akanjs/native/packages/cli/src/lib/compat.ts +2 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/configkeys.ts +6 -4
- package/vendor/@akanjs/native/packages/cli/src/lib/desktop-server.ts +11 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/distribution.ts +73 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +15 -3
- package/vendor/@akanjs/native/packages/cli/src/lib/publish.ts +70 -23
- package/vendor/@akanjs/native/packages/cli/src/lib/updates.ts +159 -23
- package/vendor/@akanjs/native/packages/cli/src/lib/vectors.ts +2 -0
- package/vendor/@akanjs/native/packages/cli/src/platforms/android.ts +9 -4
- package/vendor/@akanjs/native/packages/cli/src/platforms/desktop-update.ts +1 -1
- package/vendor/@akanjs/native/packages/cli/src/platforms/desktop.ts +4 -2
- package/vendor/@akanjs/native/packages/cli/src/platforms/ios.ts +9 -4
- package/vendor/@akanjs/native/packages/cli/src/platforms/windows-installer.ts +25 -11
- package/vendor/@akanjs/native/packages/cli/src/platforms/windows.ts +14 -3
- package/vendor/@akanjs/native/packages/core/src/kernel.ts +49 -0
- package/vendor/@akanjs/native/packages/core/vectors/updates.json +31 -0
- package/vendor/@akanjs/native/packages/desktop/src/main.ts +3 -0
- package/vendor/@akanjs/native/packages/desktop/src/plugin.ts +2 -0
- package/vendor/@akanjs/native/packages/desktop/src/server.ts +70 -6
- package/vendor/@akanjs/native/plugins/external-view/native-plugin.json +23 -0
- package/vendor/@akanjs/native/plugins/external-view/src/desktop.ts +321 -0
- package/vendor/@akanjs/native/plugins/external-view/src/index.ts +106 -0
- package/vendor/@akanjs/native/plugins/updates/android/UpdatesPlugin.kt +133 -41
- package/vendor/@akanjs/native/plugins/updates/ios/UpdatesPlugin.swift +101 -36
- package/vendor/@akanjs/native/plugins/updates/native-plugin.json +4 -2
- package/vendor/@akanjs/native/plugins/updates/src/desktop.ts +15 -1
- package/vendor/@akanjs/native/plugins/updates/src/index.ts +7 -1
- package/vendor/@akanjs/native/plugins/window/native-plugin.json +4 -0
- package/vendor/@akanjs/native/plugins/window/src/desktop.ts +68 -1
- package/vendor/@akanjs/native/plugins/window/src/index.ts +47 -0
- package/vendor/use-agentic/ToolRunner.ts +8 -1
- package/vendor/use-agentic/types.ts +2 -0
- package/webkit/CsrRouteTable.ts +1 -0
- package/webkit/CsrStack.ts +9 -2
- package/webkit/McpAppAgent.ts +138 -0
- package/webkit/McpAppApprovals.ts +56 -0
- package/webkit/McpAppBridge.ts +291 -0
- package/webkit/McpAppView.ts +258 -0
- package/webkit/bootCsr.tsx +54 -5
- package/webkit/index.ts +1 -0
- package/webkit/useCsrValues.ts +16 -10
- package/webkit/useFrameRuntime.ts +10 -1
- package/webkit/useLocation.ts +4 -3
- package/webkit/useVisualViewportFrame.tsx +52 -0
- package/service/predefinedAdaptor/sql/driver/libsql.ts +0 -45
- package/types/service/predefinedAdaptor/sql/driver/libsql.d.ts +0 -20
- package/types/ui/Agent/useKeyboardInset.d.ts +0 -1
- package/types/ui/ServerPortal.d.ts +0 -15
- package/ui/Agent/useKeyboardInset.ts +0 -19
- package/ui/ServerPortal.tsx +0 -49
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export const pipelinePlanVersion = 1;
|
|
4
|
+
|
|
5
|
+
/** Fixed vocabulary so a non-developer UI can label, order and translate progress without reading stage names. */
|
|
6
|
+
export const pipelineMilestones = ["prepare", "build", "verify", "package", "deploy", "finish"] as const;
|
|
7
|
+
export type PipelineMilestone = (typeof pipelineMilestones)[number];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* What started the build, in akasys's terms: a webhook push, the redeploy button, a project's first build, a rebuild of
|
|
11
|
+
* a finished build, and `manual` for an admin build-and-deploy or a studio publish (also the local CLI's default).
|
|
12
|
+
*/
|
|
13
|
+
export const pipelineTriggers = ["push", "redeploy", "initial", "rebuild", "manual"] as const;
|
|
14
|
+
export type PipelineTrigger = (typeof pipelineTriggers)[number];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The executor's own operations, declared per app. Within one app each appears at most once, in this order, and
|
|
18
|
+
* `docker` needs a `build` before it: the image is made from this run's `akan build` output. An action whose app's
|
|
19
|
+
* previous action in the run was skipped or did not succeed is skipped, never run. `deploy` is the only way any part
|
|
20
|
+
* of a plan reaches the master host, and its phase runs the apps one at a time. `ota` packs an over-the-air update of
|
|
21
|
+
* the app's native web bundle per target and platform (`akan pack-update`) for the executor to sign and publish; it
|
|
22
|
+
* makes its own CSR build, so it needs no `build` before it.
|
|
23
|
+
*/
|
|
24
|
+
export const pipelineActions = {
|
|
25
|
+
build: { version: 1, milestone: "build", name: "Build" },
|
|
26
|
+
docker: { version: 1, milestone: "package", name: "Docker" },
|
|
27
|
+
deploy: { version: 1, milestone: "deploy", name: "Deploy" },
|
|
28
|
+
ota: { version: 1, milestone: "deploy", name: "OTA" },
|
|
29
|
+
} as const satisfies Record<string, { version: number; milestone: PipelineMilestone; name: string }>;
|
|
30
|
+
export type PipelineActionName = keyof typeof pipelineActions;
|
|
31
|
+
export const pipelineActionNames = [
|
|
32
|
+
"build",
|
|
33
|
+
"docker",
|
|
34
|
+
"deploy",
|
|
35
|
+
"ota",
|
|
36
|
+
] as const satisfies readonly PipelineActionName[];
|
|
37
|
+
|
|
38
|
+
/** The phones an `ota` action packs for; a desktop app updates itself whole, outside a pipeline. */
|
|
39
|
+
export const pipelineOtaPlatforms = ["ios", "android"] as const;
|
|
40
|
+
export type PipelineOtaPlatform = (typeof pipelineOtaPlatforms)[number];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Where a phase came from. Workspace `before`/`after` stages become a phase each; app stages fill the slots around the
|
|
44
|
+
* three action phases, the k-th custom stage of every app in a slot sharing one phase (`after-build`, `after-build-2`…).
|
|
45
|
+
*/
|
|
46
|
+
export const pipelinePlanSlots = [
|
|
47
|
+
"before",
|
|
48
|
+
"before-build",
|
|
49
|
+
"build",
|
|
50
|
+
"after-build",
|
|
51
|
+
"docker",
|
|
52
|
+
"after-docker",
|
|
53
|
+
"deploy",
|
|
54
|
+
"after-deploy",
|
|
55
|
+
"ota",
|
|
56
|
+
"after-ota",
|
|
57
|
+
"after",
|
|
58
|
+
] as const;
|
|
59
|
+
export type PipelinePlanSlot = (typeof pipelinePlanSlots)[number];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Set by the executor on every `sh` step (AKAN_CI_APP from the stage's `app`), never by a plan. AKAN_CI_RESULT's
|
|
63
|
+
* values are the executor's.
|
|
64
|
+
*/
|
|
65
|
+
export const pipelineRuntimeEnv = [
|
|
66
|
+
"CI",
|
|
67
|
+
"AKAN_CI",
|
|
68
|
+
"AKAN_CI_BRANCH",
|
|
69
|
+
"AKAN_CI_ENV",
|
|
70
|
+
"AKAN_CI_TRIGGER",
|
|
71
|
+
"AKAN_CI_BUILD_NUM",
|
|
72
|
+
"AKAN_CI_COMMIT",
|
|
73
|
+
"AKAN_CI_APPS",
|
|
74
|
+
"AKAN_CI_APP",
|
|
75
|
+
"AKAN_CI_PHASE",
|
|
76
|
+
"AKAN_CI_STAGE",
|
|
77
|
+
"AKAN_CI_STEP",
|
|
78
|
+
"AKAN_CI_RESULT",
|
|
79
|
+
] as const;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Names neither an `env` key nor a secret may take, besides every `AKAN_CI_*`: the executor exports a step's env before
|
|
83
|
+
* it runs `timeout` and `bash`, so these would reach its own commands. A step's script may still set them itself.
|
|
84
|
+
*/
|
|
85
|
+
export const pipelineReservedEnv = [
|
|
86
|
+
"CI",
|
|
87
|
+
"AKAN_CI",
|
|
88
|
+
"PATH",
|
|
89
|
+
"HOME",
|
|
90
|
+
"PWD",
|
|
91
|
+
"SHELL",
|
|
92
|
+
"IFS",
|
|
93
|
+
"BASH_ENV",
|
|
94
|
+
"ENV",
|
|
95
|
+
"LD_PRELOAD",
|
|
96
|
+
"LD_LIBRARY_PATH",
|
|
97
|
+
] as const;
|
|
98
|
+
|
|
99
|
+
export const pipelinePlanLimits = {
|
|
100
|
+
phases: 50,
|
|
101
|
+
stages: 400,
|
|
102
|
+
steps: 1000,
|
|
103
|
+
shBytes: 64 * 1024,
|
|
104
|
+
planBytes: 1024 * 1024,
|
|
105
|
+
nameChars: 120,
|
|
106
|
+
descriptionChars: 500,
|
|
107
|
+
patternChars: 256,
|
|
108
|
+
retryAttempts: 10,
|
|
109
|
+
retryDelaySeconds: 3600,
|
|
110
|
+
} as const;
|
|
111
|
+
|
|
112
|
+
export const pipelineIdPattern = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
113
|
+
export const pipelineSecretNamePattern = /^[A-Z][A-Z0-9_]{0,63}$/;
|
|
114
|
+
export const pipelineEnvNamePattern = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
|
|
115
|
+
|
|
116
|
+
/** An exact echo of the planner's context flags: nothing trimmed, reordered or defaulted when the flag was given. */
|
|
117
|
+
export interface PipelinePlanContext {
|
|
118
|
+
branch: string;
|
|
119
|
+
/** AKAN_PUBLIC_ENV the build is for; akasys passes the branch. */
|
|
120
|
+
env: string;
|
|
121
|
+
/** Apps this run builds, after the executor dropped unchanged ones; a duplicate or unknown app is an error. */
|
|
122
|
+
apps: string[];
|
|
123
|
+
trigger: PipelineTrigger;
|
|
124
|
+
buildNum: number;
|
|
125
|
+
commit: string | null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** A file the plan was composed from; `declared: false` means it carries no `pipeline` and its default applied. */
|
|
129
|
+
export interface PipelinePlanSource {
|
|
130
|
+
file: string;
|
|
131
|
+
sha256: string;
|
|
132
|
+
declared: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** A condition that came out false; the node stays in the plan so a UI can show it as skipped. */
|
|
136
|
+
export interface PipelineSkip {
|
|
137
|
+
reason: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface PipelinePlanRetry {
|
|
141
|
+
attempts: number;
|
|
142
|
+
delaySeconds: number;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface PipelinePlanStepBase {
|
|
146
|
+
/** Stable across runs as long as the definition keeps its ids and names. */
|
|
147
|
+
id: string;
|
|
148
|
+
name: string;
|
|
149
|
+
timeoutSeconds: number | null;
|
|
150
|
+
/** `null`: the executor's default (1 attempt for `sh`, the action's own for an action). */
|
|
151
|
+
retry: PipelinePlanRetry | null;
|
|
152
|
+
allowFailure: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface PipelinePlanShellStep extends PipelinePlanStepBase {
|
|
156
|
+
kind: "sh";
|
|
157
|
+
/** Run by `bash -e -o pipefail` in the build pod, from `cwd` under the workspace root. */
|
|
158
|
+
run: string;
|
|
159
|
+
cwd: string;
|
|
160
|
+
/** Effective env: workspace pipeline, then app pipeline, then stage, then step. */
|
|
161
|
+
env: Record<string, string>;
|
|
162
|
+
/** Names only. Values never pass through the planner. */
|
|
163
|
+
secrets: string[];
|
|
164
|
+
/** An exit code here ends the step `skipped` and skips the rest of its stage; that is not a failure. */
|
|
165
|
+
skipExitCodes: number[];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface PipelinePlanActionStepBase extends PipelinePlanStepBase {
|
|
169
|
+
kind: "action";
|
|
170
|
+
actionVersion: 1;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface PipelinePlanAppActionStep extends PipelinePlanActionStepBase {
|
|
174
|
+
action: Exclude<PipelineActionName, "ota">;
|
|
175
|
+
with: { app: string };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** One pack per target and platform; each target is one that declares `native.updates`. */
|
|
179
|
+
export interface PipelinePlanOtaStep extends PipelinePlanActionStepBase {
|
|
180
|
+
action: "ota";
|
|
181
|
+
with: { app: string; targets: string[]; platforms: PipelineOtaPlatform[] };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export type PipelinePlanActionStep = PipelinePlanAppActionStep | PipelinePlanOtaStep;
|
|
185
|
+
|
|
186
|
+
export type PipelinePlanStep = PipelinePlanShellStep | PipelinePlanActionStep;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Stages of one phase run concurrently unless the phase is sequential; a stage's steps run in order. Whether a stage
|
|
190
|
+
* runs and what its failure means live here, not on the phase, because one phase holds stages of many apps.
|
|
191
|
+
*/
|
|
192
|
+
export interface PipelinePlanStage {
|
|
193
|
+
id: string;
|
|
194
|
+
name: string;
|
|
195
|
+
description: string | null;
|
|
196
|
+
/** The app whose `akan.config.ts` declared the stage, or the copy of a workspace `matrix: "apps"` stage. */
|
|
197
|
+
app: string | null;
|
|
198
|
+
milestone: PipelineMilestone;
|
|
199
|
+
skip: PipelineSkip | null;
|
|
200
|
+
/** Conditions only the executor can decide; `changed` is relative to the branch's newest successful build. */
|
|
201
|
+
runtimeWhen: { changed: string[] } | null;
|
|
202
|
+
/** The stage's failure does not fail the run; what the run's result becomes is the executor's to say. */
|
|
203
|
+
allowFailure: boolean;
|
|
204
|
+
timeoutSeconds: number | null;
|
|
205
|
+
steps: PipelinePlanStep[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Phases run in order and are barriers: the next starts once every stage of this one has settled. */
|
|
209
|
+
export interface PipelinePlanPhase {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
description: string | null;
|
|
213
|
+
slot: PipelinePlanSlot;
|
|
214
|
+
milestone: PipelineMilestone;
|
|
215
|
+
action: PipelineActionName | null;
|
|
216
|
+
/** `sequential` runs the stages one at a time in the listed order (`appOrder` for the deploy phase). */
|
|
217
|
+
order: "parallel" | "sequential";
|
|
218
|
+
maxParallel: number | null;
|
|
219
|
+
failFast: boolean;
|
|
220
|
+
/** A workspace `parallel`/`matrix` stage's budget over all of its stages. */
|
|
221
|
+
timeoutSeconds: number | null;
|
|
222
|
+
stages: PipelinePlanStage[];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** Run in the build pod after the last phase, the result's list first and `always` last; best effort. */
|
|
226
|
+
export interface PipelinePlanPost {
|
|
227
|
+
success: PipelinePlanShellStep[];
|
|
228
|
+
failure: PipelinePlanShellStep[];
|
|
229
|
+
canceled: PipelinePlanShellStep[];
|
|
230
|
+
always: PipelinePlanShellStep[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** Bootstrap (checkout, env, install, plan) and cleanup belong to the executor and are not in a plan. */
|
|
234
|
+
export interface PipelinePlan {
|
|
235
|
+
schemaVersion: 1;
|
|
236
|
+
sources: { workspace: PipelinePlanSource | null; apps: Record<string, PipelinePlanSource> };
|
|
237
|
+
planner: { akanVersion: string };
|
|
238
|
+
context: PipelinePlanContext;
|
|
239
|
+
/** `context.apps` ordered by each app's `after`, ties kept in the given order. */
|
|
240
|
+
appOrder: string[];
|
|
241
|
+
timeoutSeconds: number | null;
|
|
242
|
+
requiredSecrets: string[];
|
|
243
|
+
phases: PipelinePlanPhase[];
|
|
244
|
+
post: PipelinePlanPost;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface PipelineDiagnostic {
|
|
248
|
+
severity: "error" | "warning";
|
|
249
|
+
code: string;
|
|
250
|
+
message: string;
|
|
251
|
+
/** The file and where in it, e.g. `apps/api/akan.config.ts` · `pipeline.stages[2].sh`. */
|
|
252
|
+
file: string | null;
|
|
253
|
+
path: string | null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** What `akan pipeline plan --out <file>` always writes, success or not. */
|
|
257
|
+
export type PipelinePlanResult =
|
|
258
|
+
| { ok: true; plan: PipelinePlan; diagnostics: PipelineDiagnostic[] }
|
|
259
|
+
| { ok: false; plan: null; diagnostics: PipelineDiagnostic[] };
|
|
@@ -24,6 +24,7 @@ export const ROOT_LAYOUT_ROUTE_EXPORTS: ReadonlySet<string> = new Set([
|
|
|
24
24
|
"reconnect",
|
|
25
25
|
"wsConnect",
|
|
26
26
|
"layoutStyle",
|
|
27
|
+
"viewport",
|
|
27
28
|
]);
|
|
28
29
|
/** Root-layout exports that are plain config rather than components, so a PascalCase check cannot allow them. */
|
|
29
30
|
export const RESERVED_ROUTE_CONFIG_EXPORTS: ReadonlySet<string> = new Set(
|
package/common/types.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export interface RetryPolicy {
|
|
2
|
+
/** Tries in all, the first one included; 4 unless named. */
|
|
3
|
+
attempts?: number;
|
|
4
|
+
/** The first wait in ms (500 unless named), doubled each try up to `max` (30 s), cut by `jitter` (0.5) at random. */
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
jitter?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
export interface FetchPolicy<Returns = unknown> {
|
|
2
11
|
cache?: boolean | number;
|
|
3
12
|
crystalize?: boolean;
|
|
@@ -9,6 +18,14 @@ export interface FetchPolicy<Returns = unknown> {
|
|
|
9
18
|
timeout?: number | false;
|
|
10
19
|
/** `pubsub` only: called after a resubscribe, since whatever was published while the socket was down is gone. */
|
|
11
20
|
onResync?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Tries again when the server is unreachable, restarting (502/503), too slow (504) or limiting (429, after its
|
|
23
|
+
* Retry-After). A mutation retries under one `Idempotency-Key`, which the server runs once; `false` turns a client's
|
|
24
|
+
* default off.
|
|
25
|
+
*/
|
|
26
|
+
retry?: RetryPolicy | false;
|
|
27
|
+
/** Sent as `Idempotency-Key` on a mutation: a server that already ran it with this key answers that run's result. */
|
|
28
|
+
idempotencyKey?: string;
|
|
12
29
|
}
|
|
13
30
|
|
|
14
31
|
export type SnakeCase<S extends string> = S extends `${infer T}_${infer U}` ? `${Lowercase<T>}_${SnakeCase<U>}` : S;
|
|
@@ -24,6 +24,16 @@ export class ConstantRegistry {
|
|
|
24
24
|
static enum = new Map<string, EnumInstance>();
|
|
25
25
|
static value = new Map<string, unknown>();
|
|
26
26
|
static modelRefNameMap = new Map<Cls, string>();
|
|
27
|
+
|
|
28
|
+
static origin = new Map<`${ConstantOriginKind}:${string}`, string[]>();
|
|
29
|
+
static getOrigin(kind: ConstantOriginKind, key: string): string[] {
|
|
30
|
+
return ConstantRegistry.origin.get(`${kind}:${key}`) ?? [];
|
|
31
|
+
}
|
|
32
|
+
static #addOrigin(kind: ConstantOriginKind, key: string, origin?: string) {
|
|
33
|
+
if (!origin) return;
|
|
34
|
+
const chain = ConstantRegistry.getOrigin(kind, key);
|
|
35
|
+
if (chain.at(-1) !== origin) ConstantRegistry.origin.set(`${kind}:${key}`, [...chain, origin]);
|
|
36
|
+
}
|
|
27
37
|
static has(modelRef: Cls): boolean {
|
|
28
38
|
return ConstantRegistry.modelRefNameMap.has(modelRef);
|
|
29
39
|
}
|
|
@@ -123,6 +133,7 @@ export class ConstantRegistry {
|
|
|
123
133
|
lightRef: LightRef,
|
|
124
134
|
insightRef: InsightRef,
|
|
125
135
|
constExports: Record<string, unknown>,
|
|
136
|
+
origin?: string,
|
|
126
137
|
) {
|
|
127
138
|
const modelRefSet = new Set([inputRef, objectRef, fullRef, lightRef, insightRef]);
|
|
128
139
|
for (const modelRef of modelRefSet) ConstantRegistry.modelRefNameMap.set(modelRef, refName);
|
|
@@ -177,13 +188,15 @@ export class ConstantRegistry {
|
|
|
177
188
|
_StateInsight: null as unknown as GetStateObject<Insight>,
|
|
178
189
|
};
|
|
179
190
|
ConstantRegistry.setDatabase(refName, cnst as unknown as ConstantModel);
|
|
180
|
-
ConstantRegistry.#
|
|
191
|
+
ConstantRegistry.#addOrigin("database", refName, origin);
|
|
192
|
+
ConstantRegistry.#registerExports(constExports, modelRefSet, origin);
|
|
181
193
|
return cnst;
|
|
182
194
|
}
|
|
183
195
|
static buildScalar<T extends string, Model>(
|
|
184
196
|
refName: T,
|
|
185
197
|
Model: Cls<Model>,
|
|
186
198
|
constExports: Record<string, unknown>,
|
|
199
|
+
origin?: string,
|
|
187
200
|
): ScalarConstantModel<T, Model, DefaultOf<Model>, DocumentModel<Model>, PurifiedModel<Model>> {
|
|
188
201
|
ConstantRegistry.modelRefNameMap.set(Model, refName);
|
|
189
202
|
const cnst = {
|
|
@@ -193,16 +206,21 @@ export class ConstantRegistry {
|
|
|
193
206
|
_Doc: null as unknown as DocumentModel<Model>,
|
|
194
207
|
_PurifiedInput: null as unknown as PurifiedModel<Model>,
|
|
195
208
|
};
|
|
209
|
+
|
|
210
|
+
if (!ConstantRegistry.scalar.has(refName)) ConstantRegistry.#addOrigin("scalar", refName, origin);
|
|
196
211
|
ConstantRegistry.setScalar(refName, cnst as unknown as ScalarConstantModel);
|
|
197
|
-
ConstantRegistry.#registerExports(constExports, new Set([Model]));
|
|
212
|
+
ConstantRegistry.#registerExports(constExports, new Set([Model]), origin);
|
|
198
213
|
return cnst;
|
|
199
214
|
}
|
|
200
|
-
static #registerExports(constExports: Record<string, unknown>, modelRefs: Set<unknown
|
|
215
|
+
static #registerExports(constExports: Record<string, unknown>, modelRefs: Set<unknown>, origin?: string) {
|
|
201
216
|
for (const [key, value] of Object.entries(constExports)) {
|
|
202
217
|
if (modelRefs.has(value)) continue;
|
|
203
|
-
if (typeof value === "function" && isEnum(value as Cls))
|
|
204
|
-
|
|
205
|
-
|
|
218
|
+
if (typeof value === "function" && isEnum(value as Cls)) {
|
|
219
|
+
const enumKey = lowerlize(key);
|
|
220
|
+
|
|
221
|
+
if (ConstantRegistry.enum.get(enumKey) !== value) ConstantRegistry.#addOrigin("enum", enumKey, origin);
|
|
222
|
+
ConstantRegistry.enum.set(enumKey, value as EnumInstance);
|
|
223
|
+
} else ConstantRegistry.value.set(key, value);
|
|
206
224
|
}
|
|
207
225
|
}
|
|
208
226
|
static serialize<Value>(modelRef: Cls | Cls[], value: Value, nullable: boolean = false, of?: Cls | Cls[]): Value {
|
|
@@ -238,6 +256,8 @@ export class ConstantRegistry {
|
|
|
238
256
|
}
|
|
239
257
|
}
|
|
240
258
|
|
|
259
|
+
export type ConstantOriginKind = "database" | "scalar" | "enum";
|
|
260
|
+
|
|
241
261
|
export interface ConstantModel<
|
|
242
262
|
T extends string = string,
|
|
243
263
|
Input = any,
|
|
@@ -49,6 +49,14 @@ export const baseDictionary = serviceDictionary(["en", "ko"])
|
|
|
49
49
|
"서버가 예상하지 못한 응답을 보냈습니다. ({status})",
|
|
50
50
|
],
|
|
51
51
|
immutableField: ["{field} cannot be changed after creation.", "{field}은(는) 생성 후에는 바꿀 수 없습니다."],
|
|
52
|
+
relationNotFound: [
|
|
53
|
+
"The {model} that {field} refers to no longer exists.",
|
|
54
|
+
"{field}이(가) 가리키는 {model}을(를) 찾을 수 없습니다.",
|
|
55
|
+
],
|
|
56
|
+
idempotencyInFlight: [
|
|
57
|
+
"The same request is still being handled. Please try again in a moment.",
|
|
58
|
+
"같은 요청을 아직 처리하고 있습니다. 잠시 후 다시 시도해주세요.",
|
|
59
|
+
],
|
|
52
60
|
})
|
|
53
61
|
.translate({
|
|
54
62
|
somethingWrong: ["Something's wrong!", "문제가 생겼어요!"],
|
package/dictionary/trans.ts
CHANGED
|
@@ -19,6 +19,13 @@ export type TransMessage<Locale extends Record<string, unknown>> = {
|
|
|
19
19
|
[K in keyof Locale]-?: `${K & string}${Locale[K] extends Record<string, unknown> ? `.${keyof Locale[K] extends string ? keyof Locale[K] : never}` : ""}`;
|
|
20
20
|
}[keyof Locale];
|
|
21
21
|
|
|
22
|
+
const sortedKeys = <T>(value: T): T => {
|
|
23
|
+
if (Array.isArray(value)) return value.map(sortedKeys) as T;
|
|
24
|
+
if (!value || typeof value !== "object") return value;
|
|
25
|
+
const entries = Object.entries(value).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
26
|
+
return Object.fromEntries(entries.map(([key, child]) => [key, sortedKeys(child)])) as T;
|
|
27
|
+
};
|
|
28
|
+
|
|
22
29
|
export const makeDictionary = <Dicts extends Record<string, unknown>[]>(...dicts: Dicts) =>
|
|
23
30
|
Object.assign(...(dicts as unknown as [object, object])) as Prettify<ObjectAssign<Dicts>>;
|
|
24
31
|
|
|
@@ -185,7 +192,8 @@ export const makeTrans = <
|
|
|
185
192
|
translate,
|
|
186
193
|
msg,
|
|
187
194
|
getDictionary: (lang: Language) => rootDictionary[lang],
|
|
188
|
-
|
|
195
|
+
|
|
196
|
+
getAllDictionary: () => sortedKeys(rootDictionary),
|
|
189
197
|
__Dict_Key__: null as unknown as _DictKey,
|
|
190
198
|
__Error_Key__: null as unknown as _ErrorKey,
|
|
191
199
|
};
|
package/document/into.ts
CHANGED
|
@@ -85,6 +85,11 @@ export type Mdl<
|
|
|
85
85
|
removeMany(query: _RawQuery): Promise<UpdateResult>;
|
|
86
86
|
updateById(id: string, update: DocumentUpdateInput<_RawDoc>, options?: DocumentUpdateOptions): Promise<UpdateResult>;
|
|
87
87
|
removeById(id: string): Promise<UpdateResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Writes the record as the row under its own id, a new one or in place of the stored one, with no hook: a sync's or a
|
|
90
|
+
* backfill's write, which may run twice. `preserveTimestamps` keeps its `createdAt` and `updatedAt`.
|
|
91
|
+
*/
|
|
92
|
+
upsertById(data: Partial<_RawDoc> & { id: string }, options?: { preserveTimestamps?: boolean }): Promise<Doc>;
|
|
88
93
|
bulkWrite(operations: BulkWriteOperation<Raw, _RawDoc, _RawQuery>[]): Promise<UpdateResult>;
|
|
89
94
|
/** @deprecated Renamed to `count`. */
|
|
90
95
|
countDocuments(query: _RawQuery): Promise<number>;
|