akanjs 2.0.7 → 2.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +4 -4
- package/README.md +4 -4
- package/client/router.ts +10 -3
- package/document/documentSchema.ts +9 -1
- package/index.ts +187 -0
- package/package.json +6 -50
- package/server/akanApp.ts +2 -24
- package/server/akanAppHeaders.ts +30 -0
- package/server/di/predefinedAdaptor.ts +1 -1
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +8 -8
- package/types/document/documentSchema.d.ts +33 -0
- package/types/document/index.d.ts +1 -1
- package/types/document/schema.d.ts +1 -1
- package/types/document/types.d.ts +1 -1
- package/types/{devkit/akanConfig/types.d.ts → index.d.ts} +45 -54
- package/types/server/akanAppHeaders.d.ts +1 -0
- package/types/server/di/predefinedAdaptor.d.ts +1 -1
- package/types/store/baseSt.d.ts +2 -2
- package/ui/Link/SsrLink.tsx +2 -2
- package/webkit/useCodepush.tsx +1 -1
- package/cli/application/application.command.ts +0 -224
- package/cli/application/application.interface.tsx +0 -225
- package/cli/application/application.runner.ts +0 -355
- package/cli/application/application.script.ts +0 -244
- package/cli/build.ts +0 -27
- package/cli/cloud/cloud.command.ts +0 -48
- package/cli/cloud/cloud.runner.ts +0 -157
- package/cli/cloud/cloud.script.ts +0 -40
- package/cli/guideline/guideline.command.ts +0 -31
- package/cli/guideline/guideline.prompt.ts +0 -212
- package/cli/guideline/guideline.runner.ts +0 -53
- package/cli/guideline/guideline.script.ts +0 -33
- package/cli/guidelines/___library/sharedUiStructureDescription.en.md +0 -767
- package/cli/guidelines/___library/utilUiStructureDescription.en.md +0 -395
- package/cli/guidelines/___lint/lintRuleDescription.en.md +0 -64
- package/cli/guidelines/___module/moduleStructureDescription.en.md +0 -80
- package/cli/guidelines/componentRule/componentRule.generate.json +0 -131
- package/cli/guidelines/componentRule/componentRule.instruction.md +0 -637
- package/cli/guidelines/cssRule/cssRule.generate.json +0 -93
- package/cli/guidelines/cssRule/cssRule.instruction.md +0 -435
- package/cli/guidelines/databaseModule/databaseModule.generate.json +0 -51
- package/cli/guidelines/databaseModule/databaseModule.instruction.md +0 -612
- package/cli/guidelines/docPageRule/docPageRule.generate.json +0 -72
- package/cli/guidelines/docPageRule/docPageRule.instruction.md +0 -389
- package/cli/guidelines/enumConstant/enumConstant.generate.json +0 -24
- package/cli/guidelines/enumConstant/enumConstant.instruction.md +0 -232
- package/cli/guidelines/framework/framework.generate.json +0 -119
- package/cli/guidelines/framework/framework.instruction.md +0 -1110
- package/cli/guidelines/howToUseStore/howToUseStore.generate.json +0 -0
- package/cli/guidelines/modelConstant/modelConstant.generate.json +0 -128
- package/cli/guidelines/modelConstant/modelConstant.instruction.md +0 -506
- package/cli/guidelines/modelDictionary/modelDictionary.generate.json +0 -108
- package/cli/guidelines/modelDictionary/modelDictionary.instruction.md +0 -547
- package/cli/guidelines/modelDocument/modelDocument.generate.json +0 -129
- package/cli/guidelines/modelDocument/modelDocument.instruction.md +0 -509
- package/cli/guidelines/modelService/modelService.generate.json +0 -135
- package/cli/guidelines/modelService/modelService.instruction.md +0 -708
- package/cli/guidelines/modelSignal/modelSignal.generate.json +0 -201
- package/cli/guidelines/modelSignal/modelSignal.instruction.md +0 -552
- package/cli/guidelines/modelStore/modelStore.generate.json +0 -130
- package/cli/guidelines/modelStore/modelStore.instruction.md +0 -585
- package/cli/guidelines/modelTemplate/modelTemplate.generate.json +0 -104
- package/cli/guidelines/modelTemplate/modelTemplate.instruction.md +0 -604
- package/cli/guidelines/modelUnit/modelUnit.generate.json +0 -92
- package/cli/guidelines/modelUnit/modelUnit.instruction.md +0 -541
- package/cli/guidelines/modelUtil/modelUtil.generate.json +0 -93
- package/cli/guidelines/modelUtil/modelUtil.instruction.md +0 -752
- package/cli/guidelines/modelView/modelView.generate.json +0 -80
- package/cli/guidelines/modelView/modelView.instruction.md +0 -1005
- package/cli/guidelines/modelZone/modelZone.generate.json +0 -126
- package/cli/guidelines/modelZone/modelZone.instruction.md +0 -528
- package/cli/guidelines/scalarConstant/scalarConstant.generate.json +0 -106
- package/cli/guidelines/scalarConstant/scalarConstant.instruction.md +0 -442
- package/cli/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -83
- package/cli/guidelines/scalarDictionary/scalarDictionary.instruction.md +0 -273
- package/cli/guidelines/scalarModule/scalarModule.generate.json +0 -35
- package/cli/guidelines/scalarModule/scalarModule.instruction.md +0 -81
- package/cli/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -108
- package/cli/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -310
- package/cli/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -140
- package/cli/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -339
- package/cli/index.js +0 -184444
- package/cli/index.ts +0 -24
- package/cli/library/library.command.ts +0 -28
- package/cli/library/library.runner.ts +0 -66
- package/cli/library/library.script.ts +0 -39
- package/cli/module/module.command.ts +0 -35
- package/cli/module/module.prompt.ts +0 -18
- package/cli/module/module.request.ts +0 -319
- package/cli/module/module.runner.ts +0 -76
- package/cli/module/module.script.ts +0 -161
- package/cli/npmRegistry.ts +0 -13
- package/cli/openBrowser.ts +0 -15
- package/cli/package/package.command.ts +0 -32
- package/cli/package/package.runner.ts +0 -94
- package/cli/package/package.script.ts +0 -35
- package/cli/page/page.command.ts +0 -14
- package/cli/page/page.runner.ts +0 -14
- package/cli/page/page.script.ts +0 -12
- package/cli/pluralizeName.ts +0 -5
- package/cli/scalar/scalar.command.ts +0 -21
- package/cli/scalar/scalar.prompt.ts +0 -131
- package/cli/scalar/scalar.runner.ts +0 -38
- package/cli/scalar/scalar.script.ts +0 -16
- package/cli/semver.ts +0 -18
- package/cli/templates/__scalar/__model__/__model__.constant.ts +0 -15
- package/cli/templates/__scalar/__model__/__model__.dictionary.ts +0 -19
- package/cli/templates/__scalar/__model__/__model__.document.ts +0 -15
- package/cli/templates/app/akan.config.ts +0 -14
- package/cli/templates/app/env/env.client.debug.ts.template +0 -7
- package/cli/templates/app/env/env.client.develop.ts.template +0 -7
- package/cli/templates/app/env/env.client.local.ts.template +0 -7
- package/cli/templates/app/env/env.client.main.ts.template +0 -7
- package/cli/templates/app/env/env.client.testing.ts.template +0 -7
- package/cli/templates/app/env/env.client.ts +0 -21
- package/cli/templates/app/env/env.client.type.ts +0 -16
- package/cli/templates/app/env/env.server.debug.ts.template +0 -7
- package/cli/templates/app/env/env.server.develop.ts.template +0 -7
- package/cli/templates/app/env/env.server.local.ts.template +0 -7
- package/cli/templates/app/env/env.server.main.ts.template +0 -7
- package/cli/templates/app/env/env.server.testing.ts.template +0 -6
- package/cli/templates/app/env/env.server.ts +0 -20
- package/cli/templates/app/lib/___appName__/__appName__.dictionary.ts +0 -17
- package/cli/templates/app/lib/___appName__/__appName__.service.ts +0 -13
- package/cli/templates/app/lib/___appName__/__appName__.signal.ts +0 -17
- package/cli/templates/app/lib/___appName__/__appName__.store.ts +0 -15
- package/cli/templates/app/lib/option.ts +0 -17
- package/cli/templates/app/main.ts +0 -16
- package/cli/templates/app/package.json.template +0 -5
- package/cli/templates/app/page/_index.tsx +0 -296
- package/cli/templates/app/page/_layout.tsx +0 -31
- package/cli/templates/app/page/styles.css.template +0 -53
- package/cli/templates/app/public/favicon.ico +0 -0
- package/cli/templates/app/public/logo.png +0 -0
- package/cli/templates/app/tsconfig.json.template +0 -21
- package/cli/templates/client.ts +0 -46
- package/cli/templates/crudPages/[__model__Id]/edit/page.tsx +0 -47
- package/cli/templates/crudPages/[__model__Id]/page.tsx +0 -52
- package/cli/templates/crudPages/new/page.tsx +0 -42
- package/cli/templates/crudPages/page.tsx +0 -43
- package/cli/templates/crudSinglePage/page.tsx +0 -37
- package/cli/templates/env/_env.server.type.ts +0 -16
- package/cli/templates/facetIndex/index.ts +0 -32
- package/cli/templates/index.ts +0 -10
- package/cli/templates/lib/__lib/lib.constant.ts +0 -38
- package/cli/templates/lib/__lib/lib.dictionary.ts +0 -33
- package/cli/templates/lib/__lib/lib.document.ts +0 -35
- package/cli/templates/lib/__lib/lib.service.ts +0 -33
- package/cli/templates/lib/__lib/lib.signal.ts +0 -34
- package/cli/templates/lib/__lib/lib.store.ts +0 -33
- package/cli/templates/lib/cnst.ts +0 -29
- package/cli/templates/lib/db.ts +0 -32
- package/cli/templates/lib/dict.ts +0 -49
- package/cli/templates/lib/sig.ts +0 -60
- package/cli/templates/lib/srv.ts +0 -34
- package/cli/templates/lib/st.ts +0 -31
- package/cli/templates/lib/useClient.ts +0 -19
- package/cli/templates/lib/useServer.ts +0 -7
- package/cli/templates/libRoot/.gitignore.template +0 -16
- package/cli/templates/libRoot/akan.config.ts +0 -12
- package/cli/templates/libRoot/base/baseLogic.ts +0 -10
- package/cli/templates/libRoot/base/index.ts +0 -8
- package/cli/templates/libRoot/common/commonLogic.ts +0 -10
- package/cli/templates/libRoot/common/index.ts +0 -8
- package/cli/templates/libRoot/env/env.server.example.ts.template +0 -6
- package/cli/templates/libRoot/env/env.server.testing.ts.template +0 -6
- package/cli/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +0 -15
- package/cli/templates/libRoot/lib/___libName__/__libName__.service.ts +0 -11
- package/cli/templates/libRoot/lib/___libName__/__libName__.store.ts +0 -13
- package/cli/templates/libRoot/lib/option.ts +0 -17
- package/cli/templates/libRoot/package.json.template +0 -5
- package/cli/templates/libRoot/srvkit/backendLogic.ts +0 -10
- package/cli/templates/libRoot/srvkit/index.ts +0 -8
- package/cli/templates/libRoot/tsconfig.json.template +0 -11
- package/cli/templates/libRoot/ui/index.ts +0 -7
- package/cli/templates/libRoot/webkit/frontendLogic.ts +0 -10
- package/cli/templates/libRoot/webkit/index.ts +0 -8
- package/cli/templates/localDev/docker-compose.yaml.template +0 -37
- package/cli/templates/module/__Model__.Template.tsx +0 -36
- package/cli/templates/module/__Model__.Unit.tsx +0 -26
- package/cli/templates/module/__Model__.Util.tsx +0 -30
- package/cli/templates/module/__Model__.View.tsx +0 -29
- package/cli/templates/module/__Model__.Zone.tsx +0 -43
- package/cli/templates/module/__model__.constant.ts +0 -24
- package/cli/templates/module/__model__.dictionary.ts +0 -30
- package/cli/templates/module/__model__.document.ts +0 -23
- package/cli/templates/module/__model__.service.ts +0 -16
- package/cli/templates/module/__model__.signal.ts +0 -27
- package/cli/templates/module/__model__.store.ts +0 -19
- package/cli/templates/moduleRoot/index.tsx +0 -31
- package/cli/templates/pkgRoot/tsconfig.json.template +0 -10
- package/cli/templates/server.ts +0 -45
- package/cli/templates/workspaceRoot/.env.template +0 -14
- package/cli/templates/workspaceRoot/.gitignore.template +0 -120
- package/cli/templates/workspaceRoot/.vscode/settings.json.template +0 -23
- package/cli/templates/workspaceRoot/biome.json.template +0 -191
- package/cli/templates/workspaceRoot/bunfig.toml +0 -4
- package/cli/templates/workspaceRoot/package.json.template +0 -7
- package/cli/templates/workspaceRoot/tsconfig.json.template +0 -29
- package/cli/testHelpers.ts +0 -171
- package/cli/workspace/workspace.command.ts +0 -55
- package/cli/workspace/workspace.runner.ts +0 -79
- package/cli/workspace/workspace.script.ts +0 -74
- package/devkit/aiEditor.ts +0 -299
- package/devkit/akanApp/akanApp.host.ts +0 -393
- package/devkit/akanApp/index.ts +0 -1
- package/devkit/akanConfig/akanConfig.ts +0 -360
- package/devkit/akanConfig/index.ts +0 -2
- package/devkit/akanConfig/types.ts +0 -187
- package/devkit/applicationBuildReporter.ts +0 -69
- package/devkit/applicationBuildRunner.ts +0 -302
- package/devkit/applicationReleasePackager.ts +0 -205
- package/devkit/artifact/implicitRootLayout.ts +0 -155
- package/devkit/artifact/index.ts +0 -1
- package/devkit/artifact/routeSeedIndex.ts +0 -128
- package/devkit/auth.ts +0 -41
- package/devkit/builder.ts +0 -164
- package/devkit/capacitor.base.config.ts +0 -88
- package/devkit/capacitorApp.ts +0 -443
- package/devkit/commandDecorators/argMeta.ts +0 -102
- package/devkit/commandDecorators/command.ts +0 -340
- package/devkit/commandDecorators/commandBuilder.ts +0 -224
- package/devkit/commandDecorators/commandMeta.ts +0 -6
- package/devkit/commandDecorators/dependencyBuilder.ts +0 -100
- package/devkit/commandDecorators/helpFormatter.ts +0 -220
- package/devkit/commandDecorators/index.ts +0 -8
- package/devkit/commandDecorators/targetMeta.ts +0 -31
- package/devkit/commandDecorators/types.ts +0 -10
- package/devkit/constants.ts +0 -25
- package/devkit/createTunnel.ts +0 -36
- package/devkit/dependencyScanner.ts +0 -339
- package/devkit/executors.ts +0 -1362
- package/devkit/extractDeps.ts +0 -85
- package/devkit/fileEditor.ts +0 -106
- package/devkit/fileSys.ts +0 -39
- package/devkit/frontendBuild/allRoutesBuilder.ts +0 -103
- package/devkit/frontendBuild/clientBuildTypes.ts +0 -114
- package/devkit/frontendBuild/clientEntriesBundler.ts +0 -300
- package/devkit/frontendBuild/clientEntryDiscovery.ts +0 -196
- package/devkit/frontendBuild/csrArtifactBuilder.ts +0 -237
- package/devkit/frontendBuild/cssCompiler.ts +0 -285
- package/devkit/frontendBuild/cssImportResolver.ts +0 -116
- package/devkit/frontendBuild/fontOptimizer.ts +0 -427
- package/devkit/frontendBuild/hmrChangeClassifier.ts +0 -28
- package/devkit/frontendBuild/hmrWatcher.ts +0 -101
- package/devkit/frontendBuild/index.ts +0 -18
- package/devkit/frontendBuild/pagesBundleBuilder.ts +0 -137
- package/devkit/frontendBuild/pagesEntrySourceGenerator.ts +0 -37
- package/devkit/frontendBuild/precompressArtifacts.ts +0 -59
- package/devkit/frontendBuild/routeClientBuilder.ts +0 -290
- package/devkit/frontendBuild/routesManifestArtifactSerializer.ts +0 -62
- package/devkit/frontendBuild/ssrBaseArtifactBuilder.ts +0 -139
- package/devkit/frontendBuild/vendorSpecifiers.ts +0 -16
- package/devkit/frontendBuild/watchRootResolver.ts +0 -28
- package/devkit/getCredentials.ts +0 -19
- package/devkit/getDirname.ts +0 -3
- package/devkit/getModelFileData.ts +0 -59
- package/devkit/getRelatedCnsts.ts +0 -300
- package/devkit/guideline.ts +0 -19
- package/devkit/incrementalBuilder/incrementalBuilder.host.ts +0 -152
- package/devkit/incrementalBuilder/incrementalBuilder.proc.ts +0 -331
- package/devkit/incrementalBuilder/index.ts +0 -1
- package/devkit/index.ts +0 -36
- package/devkit/lint/no-deep-internal-import.grit +0 -25
- package/devkit/lint/no-import-client-functions.grit +0 -32
- package/devkit/lint/no-import-external-library.grit +0 -21
- package/devkit/lint/no-js-private-class-method.grit +0 -42
- package/devkit/lint/no-use-client-in-server.grit +0 -7
- package/devkit/lint/non-scalar-props-restricted.grit +0 -13
- package/devkit/linter.ts +0 -248
- package/devkit/mobile/index.ts +0 -1
- package/devkit/mobile/mobileTarget.ts +0 -88
- package/devkit/prompter.ts +0 -71
- package/devkit/scanInfo.ts +0 -606
- package/devkit/selectModel.ts +0 -11
- package/devkit/spinner.ts +0 -54
- package/devkit/src/capacitorApp.ts +0 -277
- package/devkit/sshTunnel.ts +0 -151
- package/devkit/streamAi.ts +0 -45
- package/devkit/transforms/barrelAnalyzer.ts +0 -249
- package/devkit/transforms/barrelImportsPlugin.ts +0 -457
- package/devkit/transforms/externalizeFrameworkPlugin.ts +0 -159
- package/devkit/transforms/index.ts +0 -5
- package/devkit/transforms/rscUseClientTransform.ts +0 -52
- package/devkit/transforms/useClientBundlePlugin.ts +0 -47
- package/devkit/typeChecker.ts +0 -260
- package/devkit/types.ts +0 -44
- package/devkit/ui/MultiScrollList.tsx +0 -228
- package/devkit/ui/ScrollList.tsx +0 -106
- package/devkit/ui/index.ts +0 -2
- package/devkit/uploadRelease.ts +0 -95
- package/devkit/useStdoutDimensions.ts +0 -20
- package/types/cli/application/application.command.d.ts +0 -7
- package/types/cli/application/application.interface.d.ts +0 -40
- package/types/cli/application/application.runner.d.ts +0 -66
- package/types/cli/application/application.script.d.ts +0 -72
- package/types/cli/build.d.ts +0 -1
- package/types/cli/cloud/cloud.command.d.ts +0 -7
- package/types/cli/cloud/cloud.runner.d.ts +0 -13
- package/types/cli/cloud/cloud.script.d.ts +0 -23
- package/types/cli/guideline/guideline.command.d.ts +0 -7
- package/types/cli/guideline/guideline.prompt.d.ts +0 -29
- package/types/cli/guideline/guideline.runner.d.ts +0 -21
- package/types/cli/guideline/guideline.script.d.ts +0 -16
- package/types/cli/index.d.ts +0 -2
- package/types/cli/library/library.command.d.ts +0 -7
- package/types/cli/library/library.runner.d.ts +0 -11
- package/types/cli/library/library.script.d.ts +0 -13
- package/types/cli/module/module.command.d.ts +0 -7
- package/types/cli/module/module.prompt.d.ts +0 -13
- package/types/cli/module/module.request.d.ts +0 -63
- package/types/cli/module/module.runner.d.ts +0 -55
- package/types/cli/module/module.script.d.ts +0 -22
- package/types/cli/npmRegistry.d.ts +0 -1
- package/types/cli/openBrowser.d.ts +0 -1
- package/types/cli/package/package.command.d.ts +0 -7
- package/types/cli/package/package.runner.d.ts +0 -13
- package/types/cli/package/package.script.d.ts +0 -18
- package/types/cli/page/page.command.d.ts +0 -7
- package/types/cli/page/page.runner.d.ts +0 -10
- package/types/cli/page/page.script.d.ts +0 -13
- package/types/cli/pluralizeName.d.ts +0 -1
- package/types/cli/scalar/scalar.command.d.ts +0 -7
- package/types/cli/scalar/scalar.prompt.d.ts +0 -23
- package/types/cli/scalar/scalar.runner.d.ts +0 -16
- package/types/cli/scalar/scalar.script.d.ts +0 -11
- package/types/cli/semver.d.ts +0 -1
- package/types/cli/templates/__scalar/__model__/__model__.constant.d.ts +0 -7
- package/types/cli/templates/__scalar/__model__/__model__.dictionary.d.ts +0 -7
- package/types/cli/templates/__scalar/__model__/__model__.document.d.ts +0 -7
- package/types/cli/templates/app/akan.config.d.ts +0 -6
- package/types/cli/templates/app/env/env.client.d.ts +0 -6
- package/types/cli/templates/app/env/env.client.type.d.ts +0 -6
- package/types/cli/templates/app/env/env.server.d.ts +0 -6
- package/types/cli/templates/app/lib/___appName__/__appName__.dictionary.d.ts +0 -7
- package/types/cli/templates/app/lib/___appName__/__appName__.service.d.ts +0 -7
- package/types/cli/templates/app/lib/___appName__/__appName__.signal.d.ts +0 -7
- package/types/cli/templates/app/lib/___appName__/__appName__.store.d.ts +0 -7
- package/types/cli/templates/app/lib/option.d.ts +0 -6
- package/types/cli/templates/app/main.d.ts +0 -6
- package/types/cli/templates/app/page/_index.d.ts +0 -9
- package/types/cli/templates/app/page/_layout.d.ts +0 -11
- package/types/cli/templates/client.d.ts +0 -4
- package/types/cli/templates/crudPages/[__model__Id]/edit/page.d.ts +0 -11
- package/types/cli/templates/crudPages/[__model__Id]/page.d.ts +0 -11
- package/types/cli/templates/crudPages/new/page.d.ts +0 -11
- package/types/cli/templates/crudPages/page.d.ts +0 -11
- package/types/cli/templates/crudSinglePage/page.d.ts +0 -11
- package/types/cli/templates/env/_env.server.type.d.ts +0 -7
- package/types/cli/templates/facetIndex/index.d.ts +0 -13
- package/types/cli/templates/facetIndex.d.ts +0 -1
- package/types/cli/templates/index.d.ts +0 -6
- package/types/cli/templates/lib/__lib/lib.constant.d.ts +0 -4
- package/types/cli/templates/lib/__lib/lib.dictionary.d.ts +0 -4
- package/types/cli/templates/lib/__lib/lib.document.d.ts +0 -4
- package/types/cli/templates/lib/__lib/lib.service.d.ts +0 -4
- package/types/cli/templates/lib/__lib/lib.signal.d.ts +0 -4
- package/types/cli/templates/lib/__lib/lib.store.d.ts +0 -4
- package/types/cli/templates/lib/cnst.d.ts +0 -4
- package/types/cli/templates/lib/db.d.ts +0 -4
- package/types/cli/templates/lib/dict.d.ts +0 -4
- package/types/cli/templates/lib/sig.d.ts +0 -4
- package/types/cli/templates/lib/srv.d.ts +0 -4
- package/types/cli/templates/lib/st.d.ts +0 -4
- package/types/cli/templates/lib/useClient.d.ts +0 -4
- package/types/cli/templates/lib/useServer.d.ts +0 -4
- package/types/cli/templates/libRoot/akan.config.d.ts +0 -5
- package/types/cli/templates/libRoot/base/baseLogic.d.ts +0 -5
- package/types/cli/templates/libRoot/base/index.d.ts +0 -5
- package/types/cli/templates/libRoot/base.d.ts +0 -1
- package/types/cli/templates/libRoot/common/commonLogic.d.ts +0 -5
- package/types/cli/templates/libRoot/common/index.d.ts +0 -5
- package/types/cli/templates/libRoot/common.d.ts +0 -1
- package/types/cli/templates/libRoot/lib/___libName__/__libName__.dictionary.d.ts +0 -6
- package/types/cli/templates/libRoot/lib/___libName__/__libName__.service.d.ts +0 -6
- package/types/cli/templates/libRoot/lib/___libName__/__libName__.store.d.ts +0 -6
- package/types/cli/templates/libRoot/lib/option.d.ts +0 -6
- package/types/cli/templates/libRoot/srvkit/backendLogic.d.ts +0 -5
- package/types/cli/templates/libRoot/srvkit/index.d.ts +0 -5
- package/types/cli/templates/libRoot/srvkit.d.ts +0 -1
- package/types/cli/templates/libRoot/ui/index.d.ts +0 -5
- package/types/cli/templates/libRoot/ui.d.ts +0 -1
- package/types/cli/templates/libRoot/webkit/frontendLogic.d.ts +0 -5
- package/types/cli/templates/libRoot/webkit/index.d.ts +0 -5
- package/types/cli/templates/libRoot/webkit.d.ts +0 -1
- package/types/cli/templates/module/__Model__.Template.d.ts +0 -11
- package/types/cli/templates/module/__Model__.Unit.d.ts +0 -11
- package/types/cli/templates/module/__Model__.Util.d.ts +0 -11
- package/types/cli/templates/module/__Model__.View.d.ts +0 -11
- package/types/cli/templates/module/__Model__.Zone.d.ts +0 -11
- package/types/cli/templates/module/__model__.constant.d.ts +0 -8
- package/types/cli/templates/module/__model__.dictionary.d.ts +0 -8
- package/types/cli/templates/module/__model__.document.d.ts +0 -8
- package/types/cli/templates/module/__model__.service.d.ts +0 -8
- package/types/cli/templates/module/__model__.signal.d.ts +0 -9
- package/types/cli/templates/module/__model__.store.d.ts +0 -8
- package/types/cli/templates/moduleRoot/index.d.ts +0 -11
- package/types/cli/templates/moduleRoot.d.ts +0 -1
- package/types/cli/templates/server.d.ts +0 -4
- package/types/cli/templates.d.ts +0 -1
- package/types/cli/testHelpers.d.ts +0 -64
- package/types/cli/workspace/workspace.command.d.ts +0 -7
- package/types/cli/workspace/workspace.runner.d.ts +0 -14
- package/types/cli/workspace/workspace.script.d.ts +0 -29
- package/types/cli.d.ts +0 -1
- package/types/devkit/aiEditor.d.ts +0 -50
- package/types/devkit/akanApp/akanApp.host.d.ts +0 -16
- package/types/devkit/akanApp/index.d.ts +0 -1
- package/types/devkit/akanApp.d.ts +0 -1
- package/types/devkit/akanConfig/akanConfig.d.ts +0 -36
- package/types/devkit/akanConfig/index.d.ts +0 -2
- package/types/devkit/akanConfig.d.ts +0 -1
- package/types/devkit/applicationBuildReporter.d.ts +0 -25
- package/types/devkit/applicationBuildRunner.d.ts +0 -29
- package/types/devkit/applicationReleasePackager.d.ts +0 -17
- package/types/devkit/artifact/implicitRootLayout.d.ts +0 -17
- package/types/devkit/artifact/index.d.ts +0 -1
- package/types/devkit/artifact/routeSeedIndex.d.ts +0 -38
- package/types/devkit/artifact.d.ts +0 -1
- package/types/devkit/auth.d.ts +0 -9
- package/types/devkit/builder.d.ts +0 -18
- package/types/devkit/capacitor.base.config.d.ts +0 -3
- package/types/devkit/capacitorApp.d.ts +0 -58
- package/types/devkit/commandDecorators/argMeta.d.ts +0 -68
- package/types/devkit/commandDecorators/command.d.ts +0 -2
- package/types/devkit/commandDecorators/commandBuilder.d.ts +0 -60
- package/types/devkit/commandDecorators/commandMeta.d.ts +0 -2
- package/types/devkit/commandDecorators/dependencyBuilder.d.ts +0 -22
- package/types/devkit/commandDecorators/helpFormatter.d.ts +0 -3
- package/types/devkit/commandDecorators/index.d.ts +0 -8
- package/types/devkit/commandDecorators/targetMeta.d.ts +0 -21
- package/types/devkit/commandDecorators/types.d.ts +0 -8
- package/types/devkit/commandDecorators.d.ts +0 -1
- package/types/devkit/constants.d.ts +0 -25
- package/types/devkit/createTunnel.d.ts +0 -8
- package/types/devkit/dependencyScanner.d.ts +0 -33
- package/types/devkit/executors.d.ts +0 -320
- package/types/devkit/extractDeps.d.ts +0 -7
- package/types/devkit/fileEditor.d.ts +0 -16
- package/types/devkit/fileSys.d.ts +0 -12
- package/types/devkit/frontendBuild/allRoutesBuilder.d.ts +0 -18
- package/types/devkit/frontendBuild/clientBuildTypes.d.ts +0 -107
- package/types/devkit/frontendBuild/clientEntriesBundler.d.ts +0 -12
- package/types/devkit/frontendBuild/clientEntryDiscovery.d.ts +0 -19
- package/types/devkit/frontendBuild/csrArtifactBuilder.d.ts +0 -16
- package/types/devkit/frontendBuild/cssCompiler.d.ts +0 -25
- package/types/devkit/frontendBuild/cssImportResolver.d.ts +0 -9
- package/types/devkit/frontendBuild/fontOptimizer.d.ts +0 -14
- package/types/devkit/frontendBuild/hmrChangeClassifier.d.ts +0 -5
- package/types/devkit/frontendBuild/hmrWatcher.d.ts +0 -21
- package/types/devkit/frontendBuild/index.d.ts +0 -18
- package/types/devkit/frontendBuild/pagesBundleBuilder.d.ts +0 -28
- package/types/devkit/frontendBuild/pagesEntrySourceGenerator.d.ts +0 -9
- package/types/devkit/frontendBuild/precompressArtifacts.d.ts +0 -7
- package/types/devkit/frontendBuild/routeClientBuilder.d.ts +0 -50
- package/types/devkit/frontendBuild/routesManifestArtifactSerializer.d.ts +0 -12
- package/types/devkit/frontendBuild/ssrBaseArtifactBuilder.d.ts +0 -16
- package/types/devkit/frontendBuild/vendorSpecifiers.d.ts +0 -2
- package/types/devkit/frontendBuild/watchRootResolver.d.ts +0 -6
- package/types/devkit/frontendBuild.d.ts +0 -1
- package/types/devkit/getCredentials.d.ts +0 -12
- package/types/devkit/getDirname.d.ts +0 -1
- package/types/devkit/getModelFileData.d.ts +0 -16
- package/types/devkit/getRelatedCnsts.d.ts +0 -53
- package/types/devkit/guideline.d.ts +0 -19
- package/types/devkit/incrementalBuilder/incrementalBuilder.host.d.ts +0 -30
- package/types/devkit/incrementalBuilder/incrementalBuilder.proc.d.ts +0 -1
- package/types/devkit/incrementalBuilder/index.d.ts +0 -1
- package/types/devkit/incrementalBuilder.d.ts +0 -1
- package/types/devkit/index.d.ts +0 -36
- package/types/devkit/linter.d.ts +0 -108
- package/types/devkit/mobile/index.d.ts +0 -1
- package/types/devkit/mobile/mobileTarget.d.ts +0 -14
- package/types/devkit/mobile.d.ts +0 -1
- package/types/devkit/prompter.d.ts +0 -15
- package/types/devkit/scanInfo.d.ts +0 -82
- package/types/devkit/selectModel.d.ts +0 -1
- package/types/devkit/spinner.d.ts +0 -20
- package/types/devkit/src/capacitorApp.d.ts +0 -39
- package/types/devkit/sshTunnel.d.ts +0 -14
- package/types/devkit/streamAi.d.ts +0 -6
- package/types/devkit/transforms/barrelAnalyzer.d.ts +0 -27
- package/types/devkit/transforms/barrelImportsPlugin.d.ts +0 -26
- package/types/devkit/transforms/externalizeFrameworkPlugin.d.ts +0 -49
- package/types/devkit/transforms/index.d.ts +0 -5
- package/types/devkit/transforms/rscUseClientTransform.d.ts +0 -10
- package/types/devkit/transforms/useClientBundlePlugin.d.ts +0 -19
- package/types/devkit/transforms.d.ts +0 -1
- package/types/devkit/typeChecker.d.ts +0 -62
- package/types/devkit/types.d.ts +0 -43
- package/types/devkit/ui/MultiScrollList.d.ts +0 -13
- package/types/devkit/ui/ScrollList.d.ts +0 -7
- package/types/devkit/ui/index.d.ts +0 -2
- package/types/devkit/ui.d.ts +0 -1
- package/types/devkit/uploadRelease.d.ts +0 -10
- package/types/devkit/useStdoutDimensions.d.ts +0 -1
- package/types/devkit.d.ts +0 -1
package/README.ko.md
CHANGED
|
@@ -50,7 +50,7 @@ akan start <app-name> --open
|
|
|
50
50
|
가장 작은 앱은 설정이 거의 없어도 시작할 수 있습니다.
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
|
-
import type { AppConfig } from "akanjs
|
|
53
|
+
import type { AppConfig } from "akanjs";
|
|
54
54
|
|
|
55
55
|
const config: AppConfig = {};
|
|
56
56
|
|
|
@@ -161,9 +161,9 @@ UI barrel import를 leaf import로 다시 써서 클라이언트 번들을 작
|
|
|
161
161
|
| `akanjs/client` | client routing, cookie, storage, locale, device, CSR type, page helper. |
|
|
162
162
|
| `akanjs/client` | Akan page runtime에서 사용하는 client bootstrap과 location helper. |
|
|
163
163
|
| `akanjs/server` | server app runtime, route composition, SSR/RSC artifact, proxy, sitemap, server type. |
|
|
164
|
-
|
|
|
164
|
+
| `@akanjs/devkit` | build runner, config loader, code generation, scanner, transform, CLI helper, tooling. |
|
|
165
165
|
| `akanjs/test` | test helper와 sample generation utility. |
|
|
166
|
-
|
|
|
166
|
+
| `@akanjs/cli` | programmatic CLI entrypoint. 실행 명령은 `akan`입니다. |
|
|
167
167
|
|
|
168
168
|
특수 public surface:
|
|
169
169
|
|
|
@@ -202,7 +202,7 @@ akan update
|
|
|
202
202
|
routes, domains, base paths, mobile settings로 확장됩니다.
|
|
203
203
|
|
|
204
204
|
```ts
|
|
205
|
-
import type { AppConfig } from "akanjs
|
|
205
|
+
import type { AppConfig } from "akanjs";
|
|
206
206
|
|
|
207
207
|
const config: AppConfig = {
|
|
208
208
|
routes: [
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ akan start <app-name> --open
|
|
|
49
49
|
A minimal app can start with almost no configuration:
|
|
50
50
|
|
|
51
51
|
```ts
|
|
52
|
-
import type { AppConfig } from "akanjs
|
|
52
|
+
import type { AppConfig } from "akanjs";
|
|
53
53
|
|
|
54
54
|
const config: AppConfig = {};
|
|
55
55
|
|
|
@@ -159,9 +159,9 @@ frontend build to rewrite UI barrel imports into leaf imports.
|
|
|
159
159
|
| `akanjs/client` | Client routing, cookies, storage, locale, device, CSR types, and page helpers. |
|
|
160
160
|
| `akanjs/client` | Client bootstrapping and location helpers used by Akan page runtimes. |
|
|
161
161
|
| `akanjs/server` | Server app runtime, route composition, SSR/RSC artifacts, proxying, sitemap, and server types. |
|
|
162
|
-
|
|
|
162
|
+
| `@akanjs/devkit` | Build runners, config loaders, code generation, scanners, transforms, CLI helpers, and tooling. |
|
|
163
163
|
| `akanjs/test` | Test helpers and sample generation utilities. |
|
|
164
|
-
|
|
|
164
|
+
| `@akanjs/cli` | Programmatic CLI entrypoint. The executable command is `akan`. |
|
|
165
165
|
|
|
166
166
|
Special public surfaces:
|
|
167
167
|
|
|
@@ -200,7 +200,7 @@ Common areas:
|
|
|
200
200
|
grow only when the app needs routes, domains, base paths, or mobile settings.
|
|
201
201
|
|
|
202
202
|
```ts
|
|
203
|
-
import type { AppConfig } from "akanjs
|
|
203
|
+
import type { AppConfig } from "akanjs";
|
|
204
204
|
|
|
205
205
|
const config: AppConfig = {
|
|
206
206
|
routes: [
|
package/client/router.ts
CHANGED
|
@@ -62,6 +62,8 @@ function getServerRequestContext() {
|
|
|
62
62
|
|
|
63
63
|
const getConfiguredBasePaths = () => new Set(parseBasePaths(process.env.AKAN_PUBLIC_BASE_PATHS));
|
|
64
64
|
|
|
65
|
+
const shouldExposeBasePath = () => getEnv().operationMode === "local";
|
|
66
|
+
|
|
65
67
|
const getServerBasePath = (reqPathname: string, lang: string, headerBasePath: string | undefined, fallback: string) => {
|
|
66
68
|
return (
|
|
67
69
|
getBasePathFromPathname(reqPathname, {
|
|
@@ -131,14 +133,16 @@ class Router {
|
|
|
131
133
|
push: (href: string, routeOptions) => {
|
|
132
134
|
const router = options.router;
|
|
133
135
|
const pathInfo = this.#getPathInfo(href);
|
|
136
|
+
const navigationPathInfo = this.#getNavigationPathInfo(href);
|
|
134
137
|
this.#postPathChange(pathInfo);
|
|
135
|
-
router.push(
|
|
138
|
+
router.push(navigationPathInfo.href, routeOptions);
|
|
136
139
|
},
|
|
137
140
|
replace: (href: string, routeOptions) => {
|
|
138
141
|
const router = options.router;
|
|
139
142
|
const pathInfo = this.#getPathInfo(href);
|
|
143
|
+
const navigationPathInfo = this.#getNavigationPathInfo(href);
|
|
140
144
|
this.#postPathChange(pathInfo);
|
|
141
|
-
router.replace(
|
|
145
|
+
router.replace(navigationPathInfo.href, routeOptions);
|
|
142
146
|
},
|
|
143
147
|
back: () => {
|
|
144
148
|
const router = options.router;
|
|
@@ -188,6 +192,9 @@ class Router {
|
|
|
188
192
|
#getPathInfo(href: string, prefix = this.#prefix) {
|
|
189
193
|
return getPathInfo(href, this.#lang, prefix);
|
|
190
194
|
}
|
|
195
|
+
#getNavigationPathInfo(href: string) {
|
|
196
|
+
return this.#getPathInfo(href, shouldExposeBasePath() ? this.#prefix : "");
|
|
197
|
+
}
|
|
191
198
|
#postPathChange({ path, pathname, hash }: { path: string; pathname: string; hash: string }) {
|
|
192
199
|
Logger.log(`pathChange-start:${path}${hash ? `#${hash}` : ""}`);
|
|
193
200
|
window.parent.postMessage({ type: "pathChange", path, pathname, hash }, "*");
|
|
@@ -224,7 +231,7 @@ class Router {
|
|
|
224
231
|
const langFromPath = reqPathname.split("/").filter(Boolean)[0];
|
|
225
232
|
const lang = (h.get("x-locale") ?? langFromPath ?? this.#lang) as string;
|
|
226
233
|
const basePath = getServerBasePath(reqPathname, lang, h.get("x-base-path") ?? undefined, this.#prefix);
|
|
227
|
-
const { pathname, href: fullHref } = getPathInfo(href, lang, basePath);
|
|
234
|
+
const { pathname, href: fullHref } = getPathInfo(href, lang, shouldExposeBasePath() ? basePath : "");
|
|
228
235
|
Logger.log(`redirect to:${pathname}`);
|
|
229
236
|
throw new AkanRedirectError(fullHref, "replace");
|
|
230
237
|
} else {
|
|
@@ -13,6 +13,14 @@ export interface DocumentIndexDescriptor {
|
|
|
13
13
|
where?: DocumentQuery;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export interface DocumentIndexBuilder<Schema> {
|
|
17
|
+
path(path: string, order?: 1 | -1): DocumentIndexBuilder<Schema>;
|
|
18
|
+
text(path: string): DocumentIndexBuilder<Schema>;
|
|
19
|
+
unique(): DocumentIndexBuilder<Schema>;
|
|
20
|
+
where(where: DocumentQuery | ((q: DocumentQueryHelper) => DocumentQuery)): DocumentIndexBuilder<Schema>;
|
|
21
|
+
done(): Schema;
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
export type DocumentSaveHook<Doc = unknown> = (
|
|
17
25
|
this: Doc,
|
|
18
26
|
next?: () => void,
|
|
@@ -58,7 +66,7 @@ export class DocumentSchema<Doc = unknown> {
|
|
|
58
66
|
return this;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
createIndex(name: string) {
|
|
69
|
+
createIndex(name: string): DocumentIndexBuilder<this> {
|
|
62
70
|
const schema = this;
|
|
63
71
|
const descriptor: DocumentIndexDescriptor = { name, fields: {} };
|
|
64
72
|
const api = {
|
package/index.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { AkanI18nConfig } from "akanjs/common";
|
|
2
|
+
import type { AkanImageConfig } from "akanjs/server";
|
|
3
|
+
|
|
4
|
+
export const archs = ["amd64", "arm64"] as const;
|
|
5
|
+
export type Arch = (typeof archs)[number];
|
|
6
|
+
|
|
7
|
+
export interface DockerConfig {
|
|
8
|
+
content: string;
|
|
9
|
+
image: string | { [key in Arch]?: string };
|
|
10
|
+
preRuns: (string | { [key in Arch]?: string })[];
|
|
11
|
+
postRuns: (string | { [key in Arch]?: string })[];
|
|
12
|
+
command: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AkanRouteDomains {
|
|
16
|
+
main?: string[];
|
|
17
|
+
develop?: string[];
|
|
18
|
+
debug?: string[];
|
|
19
|
+
[branch: string]: string[] | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface AkanRouteConfig {
|
|
23
|
+
basePath?: string;
|
|
24
|
+
domains: AkanRouteDomains;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type DatabaseMode = "single" | "multiple" | "cluster";
|
|
28
|
+
export type MobileEnv = "local" | "debug" | "develop" | "main";
|
|
29
|
+
export type MobilePermission = "camera" | "contacts" | "location" | "push";
|
|
30
|
+
|
|
31
|
+
export interface AkanMobileTargetAssets {
|
|
32
|
+
icon?: string;
|
|
33
|
+
splash?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface AkanMobileTargetLinks {
|
|
37
|
+
schemes?: string[];
|
|
38
|
+
associatedDomains?: string[];
|
|
39
|
+
androidHosts?: string[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface AkanMobileTargetFiles {
|
|
43
|
+
ios?: Record<string, string>;
|
|
44
|
+
android?: Record<string, string>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface AkanCapacitorLikeConfig {
|
|
48
|
+
plugins?: Record<string, unknown>;
|
|
49
|
+
android?: Record<string, unknown>;
|
|
50
|
+
ios?: Record<string, unknown>;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface AkanMobileTargetConfig extends AkanCapacitorLikeConfig {
|
|
55
|
+
name: string;
|
|
56
|
+
basePath?: string;
|
|
57
|
+
appName: string;
|
|
58
|
+
appId: string;
|
|
59
|
+
version: string;
|
|
60
|
+
buildNum: number;
|
|
61
|
+
assets?: AkanMobileTargetAssets;
|
|
62
|
+
permissions?: MobilePermission[];
|
|
63
|
+
links?: AkanMobileTargetLinks;
|
|
64
|
+
files?: AkanMobileTargetFiles;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface AkanMobileConfig extends AkanCapacitorLikeConfig {
|
|
68
|
+
appName: string;
|
|
69
|
+
appId: string;
|
|
70
|
+
version: string;
|
|
71
|
+
buildNum: number;
|
|
72
|
+
targets: Record<string, AkanMobileTargetConfig>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AppConfigResult {
|
|
76
|
+
docker: DockerConfig;
|
|
77
|
+
defaultDatabaseMode: DatabaseMode;
|
|
78
|
+
routes?: AkanRouteConfig[];
|
|
79
|
+
externalLibs: string[];
|
|
80
|
+
barrelImports: string[];
|
|
81
|
+
optimizeImports: string[];
|
|
82
|
+
images: AkanImageConfig;
|
|
83
|
+
i18n: AkanI18nConfig;
|
|
84
|
+
publicEnv: string[];
|
|
85
|
+
mobile: AkanMobileConfig;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface LibConfigResult {
|
|
89
|
+
externalLibs: string[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type DeepPartial<T> = {
|
|
93
|
+
[P in keyof T]?: T[P] extends unknown[] ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export interface AppConfigContext {
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly type: "app";
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface LibConfigContext {
|
|
102
|
+
readonly name: string;
|
|
103
|
+
readonly type: "lib";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type AppConfig = DeepPartial<AppConfigResult> | ((app: AppConfigContext) => DeepPartial<AppConfigResult>);
|
|
107
|
+
export type LibConfig = DeepPartial<LibConfigResult> | ((lib: LibConfigContext) => DeepPartial<LibConfigResult>);
|
|
108
|
+
export type AkanConfigFile = object;
|
|
109
|
+
|
|
110
|
+
export interface FileConventionScanResult {
|
|
111
|
+
constant: { databases: string[]; scalars: string[] };
|
|
112
|
+
dictionary: { databases: string[]; services: string[]; scalars: string[] };
|
|
113
|
+
document: { databases: string[]; scalars: string[] };
|
|
114
|
+
service: { databases: string[]; services: string[] };
|
|
115
|
+
signal: { databases: string[]; services: string[] };
|
|
116
|
+
store: { databases: string[]; services: string[] };
|
|
117
|
+
template: { databases: string[]; services: string[]; scalars: string[] };
|
|
118
|
+
unit: { databases: string[]; services: string[]; scalars: string[] };
|
|
119
|
+
util: { databases: string[]; services: string[]; scalars: string[] };
|
|
120
|
+
view: { databases: string[]; services: string[]; scalars: string[] };
|
|
121
|
+
zone: { databases: string[]; services: string[]; scalars: string[] };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface ScanResult {
|
|
125
|
+
name: string;
|
|
126
|
+
type: "app" | "lib";
|
|
127
|
+
repoName: string;
|
|
128
|
+
serveDomain: string;
|
|
129
|
+
files: FileConventionScanResult;
|
|
130
|
+
libDeps: string[];
|
|
131
|
+
pkgDeps: string[];
|
|
132
|
+
dependencies: string[];
|
|
133
|
+
devDependencies: string[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface AppScanResult extends ScanResult {
|
|
137
|
+
akanConfig: AppConfigResult;
|
|
138
|
+
routes: string[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface LibScanResult extends ScanResult {
|
|
142
|
+
akanConfig: LibConfigResult;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface PkgScanResult {
|
|
146
|
+
name: string;
|
|
147
|
+
pkgDeps: string[];
|
|
148
|
+
dependencies: string[];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface WorkspaceScanResult {
|
|
152
|
+
appNames: string[];
|
|
153
|
+
libNames: string[];
|
|
154
|
+
pkgNames: string[];
|
|
155
|
+
apps: { [key: string]: AppScanResult };
|
|
156
|
+
libs: { [key: string]: LibScanResult };
|
|
157
|
+
pkgs: { [key: string]: PkgScanResult };
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface AppInfo {
|
|
161
|
+
readonly name: string;
|
|
162
|
+
readonly type: "app";
|
|
163
|
+
readonly database: Map<string, Set<string>>;
|
|
164
|
+
readonly service: Map<string, Set<string>>;
|
|
165
|
+
readonly scalar: Map<string, Set<string>>;
|
|
166
|
+
readonly file: FileConventionScanResult;
|
|
167
|
+
getLibs(): string[];
|
|
168
|
+
getLibInfos(): Map<string, LibInfo>;
|
|
169
|
+
getDatabaseModules(): string[];
|
|
170
|
+
getScalarModules(): string[];
|
|
171
|
+
getServiceModules(): string[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface LibInfo {
|
|
175
|
+
readonly name: string;
|
|
176
|
+
readonly type: "lib";
|
|
177
|
+
readonly database: Map<string, Set<string>>;
|
|
178
|
+
readonly service: Map<string, Set<string>>;
|
|
179
|
+
readonly scalar: Map<string, Set<string>>;
|
|
180
|
+
readonly file: FileConventionScanResult;
|
|
181
|
+
getLibs(): string[];
|
|
182
|
+
getLibInfos(): Map<string, LibInfo>;
|
|
183
|
+
getLibInfo(libName: string): LibInfo | undefined;
|
|
184
|
+
getDatabaseModules(): string[];
|
|
185
|
+
getScalarModules(): string[];
|
|
186
|
+
getServiceModules(): string[];
|
|
187
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akanjs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-rc.1",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"akan": "./cli/index.js",
|
|
8
|
-
"akan2": "./cli/index.js"
|
|
9
|
-
},
|
|
10
6
|
"publishConfig": {
|
|
11
7
|
"access": "public"
|
|
12
8
|
},
|
|
@@ -24,11 +20,6 @@
|
|
|
24
20
|
"default": "./index.ts"
|
|
25
21
|
},
|
|
26
22
|
"./package.json": "./package.json",
|
|
27
|
-
"./capacitor.base.config": {
|
|
28
|
-
"types": "./types/devkit/capacitor.base.config.d.ts",
|
|
29
|
-
"import": "./devkit/capacitor.base.config.ts",
|
|
30
|
-
"default": "./devkit/capacitor.base.config.ts"
|
|
31
|
-
},
|
|
32
23
|
"./base": {
|
|
33
24
|
"types": "./types/base/index.d.ts",
|
|
34
25
|
"import": "./base/index.ts",
|
|
@@ -139,21 +130,11 @@
|
|
|
139
130
|
"import": "./dictionary/index.ts",
|
|
140
131
|
"default": "./dictionary/index.ts"
|
|
141
132
|
},
|
|
142
|
-
"./devkit": {
|
|
143
|
-
"types": "./types/devkit/index.d.ts",
|
|
144
|
-
"import": "./devkit/index.ts",
|
|
145
|
-
"default": "./devkit/index.ts"
|
|
146
|
-
},
|
|
147
133
|
"./test": {
|
|
148
134
|
"types": "./types/test/index.d.ts",
|
|
149
135
|
"import": "./test/index.ts",
|
|
150
136
|
"default": "./test/index.ts"
|
|
151
137
|
},
|
|
152
|
-
"./cli": {
|
|
153
|
-
"types": "./types/cli/index.d.ts",
|
|
154
|
-
"import": "./cli/index.ts",
|
|
155
|
-
"default": "./cli/index.ts"
|
|
156
|
-
},
|
|
157
138
|
"./ui/styles.css": "./ui/styles.css",
|
|
158
139
|
"./server/rsc-worker": {
|
|
159
140
|
"types": "./types/server/rscWorker.d.ts",
|
|
@@ -162,27 +143,10 @@
|
|
|
162
143
|
}
|
|
163
144
|
},
|
|
164
145
|
"dependencies": {
|
|
165
|
-
"@inquirer/prompts": "^8.4.3",
|
|
166
|
-
"@langchain/core": "^1.1.47",
|
|
167
|
-
"@langchain/deepseek": "^1.0.26",
|
|
168
|
-
"@langchain/openai": "^1.4.6",
|
|
169
|
-
"@trapezedev/project": "^7.1.4",
|
|
170
|
-
"chalk": "^5.6.2",
|
|
171
146
|
"clsx": "^2.1.1",
|
|
172
|
-
"commander": "^14.0.3",
|
|
173
147
|
"dayjs": "^1.11.20",
|
|
174
|
-
"fontaine": "^0.8.0",
|
|
175
|
-
"fonteditor-core": "^2.6.3",
|
|
176
|
-
"ignore": "^7.0.5",
|
|
177
148
|
"immer": "^11.1.8",
|
|
178
|
-
"
|
|
179
|
-
"js-yaml": "^4.1.1",
|
|
180
|
-
"ora": "^9.4.0",
|
|
181
|
-
"qrcode": "^1.5.4",
|
|
182
|
-
"sharp": "^0.34.5",
|
|
183
|
-
"ssh2": "^1.17.0",
|
|
184
|
-
"subset-font": "^2.5.0",
|
|
185
|
-
"tailwindcss": "^4.3.0"
|
|
149
|
+
"sharp": "^0.34.5"
|
|
186
150
|
},
|
|
187
151
|
"peerDependencies": {
|
|
188
152
|
"@capacitor-community/contacts": "^7.2.0",
|
|
@@ -190,7 +154,6 @@
|
|
|
190
154
|
"@capacitor/app": "^8.1.0",
|
|
191
155
|
"@capacitor/browser": "^8.0.3",
|
|
192
156
|
"@capacitor/camera": "^8.2.0",
|
|
193
|
-
"@capacitor/cli": "^8.3.4",
|
|
194
157
|
"@capacitor/core": "^8.3.4",
|
|
195
158
|
"@capacitor/device": "^8.0.2",
|
|
196
159
|
"@capacitor/geolocation": "^8.2.0",
|
|
@@ -202,7 +165,7 @@
|
|
|
202
165
|
"@libsql/client": "^0.17.3",
|
|
203
166
|
"@playwright/test": "^1.60.0",
|
|
204
167
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
205
|
-
"@react-spring/web": "^
|
|
168
|
+
"@react-spring/web": "^10.1.0",
|
|
206
169
|
"@use-gesture/react": "^10.3.1",
|
|
207
170
|
"bullmq": "^5.76.10",
|
|
208
171
|
"capacitor-plugin-safe-area": "^5.0.0",
|
|
@@ -211,27 +174,23 @@
|
|
|
211
174
|
"croner": "^10.0.1",
|
|
212
175
|
"daisyui": "^5.5.20",
|
|
213
176
|
"file-saver": "^2.0.5",
|
|
214
|
-
"fontaine": "^0.8.0",
|
|
215
|
-
"fonteditor-core": "^2.6.3",
|
|
216
177
|
"ioredis": "^5.10.1",
|
|
217
178
|
"mermaid": "^11.15.0",
|
|
218
179
|
"postgres": "^3.4.9",
|
|
219
180
|
"protobufjs": "^8.4.0",
|
|
220
|
-
"react": "19.2.
|
|
181
|
+
"react": "19.2.6",
|
|
221
182
|
"react-copy-to-clipboard": "^5.1.1",
|
|
222
183
|
"react-datepicker": "^9.1.0",
|
|
223
184
|
"react-device-detect": "^2.2.3",
|
|
224
|
-
"react-dom": "19.2.
|
|
185
|
+
"react-dom": "19.2.6",
|
|
225
186
|
"react-icons": "^5.6.0",
|
|
226
187
|
"react-refresh": "^0.18.0",
|
|
227
188
|
"react-server-dom-webpack": "^19.2.6",
|
|
228
189
|
"react-simple-pull-to-refresh": "^1.3.4",
|
|
229
|
-
"react-spring": "^
|
|
190
|
+
"react-spring": "^10.0.4",
|
|
230
191
|
"scheduler": "^0.27.0",
|
|
231
192
|
"sharp": "^0.34.5",
|
|
232
|
-
"subset-font": "^2.5.0",
|
|
233
193
|
"tailwind-scrollbar": "^4.0.2",
|
|
234
|
-
"tailwindcss": "^4.3.0",
|
|
235
194
|
"typescript": "^6.0.3"
|
|
236
195
|
},
|
|
237
196
|
"peerDependenciesMeta": {
|
|
@@ -250,9 +209,6 @@
|
|
|
250
209
|
"@capacitor/camera": {
|
|
251
210
|
"optional": true
|
|
252
211
|
},
|
|
253
|
-
"@capacitor/cli": {
|
|
254
|
-
"optional": true
|
|
255
|
-
},
|
|
256
212
|
"@capacitor/core": {
|
|
257
213
|
"optional": true
|
|
258
214
|
},
|
package/server/akanApp.ts
CHANGED
|
@@ -3,6 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { Logger } from "akanjs/common";
|
|
4
4
|
import type { AkanChildRole, AkanChildStatus, AkanIpcMessage, AkanMetricsReport, AkanUpstream } from "akanjs/service";
|
|
5
5
|
import { isTraceEnabled } from "akanjs/signal";
|
|
6
|
+
import { makeAkanChildProxyHeaders } from "./akanAppHeaders";
|
|
6
7
|
import type { BuilderMessage, BuilderReq, BuilderRes } from "./artifact";
|
|
7
8
|
import { RotatingLogWriter } from "./logging/rotatingLogWriter";
|
|
8
9
|
import { ProcessMetricsCollector } from "./processMetricsCollector";
|
|
@@ -60,16 +61,6 @@ export class AkanApp {
|
|
|
60
61
|
static readonly #childRestartBaseDelayMs = 1_000;
|
|
61
62
|
static readonly #childRestartMaxDelayMs = 30_000;
|
|
62
63
|
static readonly #childRestartGraceMs = 5_000;
|
|
63
|
-
static readonly #hopByHopHeaders = new Set([
|
|
64
|
-
"connection",
|
|
65
|
-
"keep-alive",
|
|
66
|
-
"proxy-authenticate",
|
|
67
|
-
"proxy-authorization",
|
|
68
|
-
"te",
|
|
69
|
-
"trailer",
|
|
70
|
-
"transfer-encoding",
|
|
71
|
-
"upgrade",
|
|
72
|
-
]);
|
|
73
64
|
|
|
74
65
|
readonly logger = new Logger("AkanApp");
|
|
75
66
|
readonly #serverPath: string;
|
|
@@ -679,20 +670,7 @@ export class AkanApp {
|
|
|
679
670
|
}
|
|
680
671
|
|
|
681
672
|
#makeProxyHeaders(req: Request, childIdx: number) {
|
|
682
|
-
|
|
683
|
-
for (const key of AkanApp.#hopByHopHeaders) headers.delete(key);
|
|
684
|
-
const forwardedFor = headers.get("x-forwarded-for");
|
|
685
|
-
const clientAddress = headers.get("x-real-ip") ?? "127.0.0.1";
|
|
686
|
-
const host = headers.get("host");
|
|
687
|
-
headers.set("x-forwarded-for", forwardedFor ? `${forwardedFor}, ${clientAddress}` : clientAddress);
|
|
688
|
-
headers.set("x-forwarded-host", host ?? new URL(req.url).host);
|
|
689
|
-
headers.set("x-forwarded-proto", req.url.startsWith("https:") ? "https" : "http");
|
|
690
|
-
headers.set("x-akan-child-idx", String(childIdx));
|
|
691
|
-
if (!headers.has("x-request-id") && process.env.AKAN_BENCH_SKIP_REQUEST_ID !== "1") {
|
|
692
|
-
headers.set("x-request-id", crypto.randomUUID());
|
|
693
|
-
}
|
|
694
|
-
headers.set("host", "akan-child");
|
|
695
|
-
return headers;
|
|
673
|
+
return makeAkanChildProxyHeaders(req, childIdx);
|
|
696
674
|
}
|
|
697
675
|
|
|
698
676
|
#invalidateFederationChildCache() {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const HOP_BY_HOP_HEADERS = new Set([
|
|
2
|
+
"connection",
|
|
3
|
+
"keep-alive",
|
|
4
|
+
"proxy-authenticate",
|
|
5
|
+
"proxy-authorization",
|
|
6
|
+
"te",
|
|
7
|
+
"trailer",
|
|
8
|
+
"transfer-encoding",
|
|
9
|
+
"upgrade",
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
export function makeAkanChildProxyHeaders(req: Request, childIdx: number): Headers {
|
|
13
|
+
const headers = new Headers(req.headers);
|
|
14
|
+
for (const key of HOP_BY_HOP_HEADERS) headers.delete(key);
|
|
15
|
+
const forwardedFor = headers.get("x-forwarded-for");
|
|
16
|
+
const clientAddress = headers.get("x-real-ip") ?? "127.0.0.1";
|
|
17
|
+
const host = headers.get("host");
|
|
18
|
+
headers.set("x-forwarded-for", forwardedFor ? `${forwardedFor}, ${clientAddress}` : clientAddress);
|
|
19
|
+
headers.set("x-forwarded-host", headers.get("x-forwarded-host") ?? host ?? new URL(req.url).host);
|
|
20
|
+
headers.set(
|
|
21
|
+
"x-forwarded-proto",
|
|
22
|
+
headers.get("x-forwarded-proto") ?? (req.url.startsWith("https:") ? "https" : "http"),
|
|
23
|
+
);
|
|
24
|
+
headers.set("x-akan-child-idx", String(childIdx));
|
|
25
|
+
if (!headers.has("x-request-id") && process.env.AKAN_BENCH_SKIP_REQUEST_ID !== "1") {
|
|
26
|
+
headers.set("x-request-id", crypto.randomUUID());
|
|
27
|
+
}
|
|
28
|
+
headers.set("host", "akan-child");
|
|
29
|
+
return headers;
|
|
30
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const baseDictionary: import("./dictInfo.d.ts").ServiceDictInfo<[string, string], string, never, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
1
|
+
export declare const baseDictionary: import("./dictInfo.d.ts").ServiceDictInfo<[string, string], string, never, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BaseEndpoint } from "akanjs/signal";
|
|
2
2
|
export declare const dictionary: {
|
|
3
|
-
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
3
|
+
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, never>;
|
|
4
4
|
};
|
|
5
|
-
export declare const Err: import("./trans.d.ts").ErrConstructor<never>, translate: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
6
|
-
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
7
|
-
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
8
|
-
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
9
|
-
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
10
|
-
loading: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
11
|
-
}, getDictionary: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "
|
|
5
|
+
export declare const Err: import("./trans.d.ts").ErrConstructor<never>, translate: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, data?: import("./trans.d.ts").TranslationData) => string, msg: {
|
|
6
|
+
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
7
|
+
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
8
|
+
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
9
|
+
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
10
|
+
loading: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
11
|
+
}, getDictionary: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "failed" | "ok" | "connecting" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, __Error_Key__: never;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import type { DocumentQuery, DocumentQueryHelper } from "./documentQuery.d.ts";
|
|
3
|
+
import type { CRUDEventType, SaveEventType } from "./into.d.ts";
|
|
4
|
+
export type DocumentHookName = `before${Capitalize<SaveEventType>}` | `after${Capitalize<SaveEventType>}`;
|
|
5
|
+
export interface DocumentIndexDescriptor {
|
|
6
|
+
name?: string;
|
|
7
|
+
fields: Record<string, 1 | -1 | "text" | boolean>;
|
|
8
|
+
unique?: boolean;
|
|
9
|
+
text?: boolean;
|
|
10
|
+
where?: DocumentQuery;
|
|
11
|
+
}
|
|
12
|
+
export interface DocumentIndexBuilder<Schema> {
|
|
13
|
+
path(path: string, order?: 1 | -1): DocumentIndexBuilder<Schema>;
|
|
14
|
+
text(path: string): DocumentIndexBuilder<Schema>;
|
|
15
|
+
unique(): DocumentIndexBuilder<Schema>;
|
|
16
|
+
where(where: DocumentQuery | ((q: DocumentQueryHelper) => DocumentQuery)): DocumentIndexBuilder<Schema>;
|
|
17
|
+
done(): Schema;
|
|
18
|
+
}
|
|
19
|
+
export type DocumentSaveHook<Doc = unknown> = (this: Doc, next?: () => void, type?: CRUDEventType) => PromiseOrObject<void>;
|
|
20
|
+
export declare class DocumentSchema<Doc = unknown> {
|
|
21
|
+
readonly preHooks: Map<SaveEventType, DocumentSaveHook<Doc>[]>;
|
|
22
|
+
readonly postHooks: Map<SaveEventType, DocumentSaveHook<Doc>[]>;
|
|
23
|
+
readonly indexes: DocumentIndexDescriptor[];
|
|
24
|
+
pre<HookDoc = Doc>(type: SaveEventType, hook: DocumentSaveHook<HookDoc>): this;
|
|
25
|
+
post<HookDoc = Doc>(type: SaveEventType, hook: DocumentSaveHook<HookDoc>): this;
|
|
26
|
+
hook(type: DocumentHookName, hook: DocumentSaveHook<Doc>): this;
|
|
27
|
+
index(fields: DocumentIndexDescriptor["fields"], options?: Omit<DocumentIndexDescriptor, "fields">): this;
|
|
28
|
+
text(...fields: string[]): this;
|
|
29
|
+
createIndex(name: string): DocumentIndexBuilder<this>;
|
|
30
|
+
}
|
|
31
|
+
export type SchemaOf<Mdl = unknown, Doc = unknown> = DocumentSchema<Doc> & {
|
|
32
|
+
readonly __model?: Mdl;
|
|
33
|
+
};
|