@akanjs/cli 0.9.42 → 0.9.44
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/cjs/index.js +50 -40
- package/cjs/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -1
- package/cjs/src/guidelines/componentRule/componentRule.instruction.md +0 -18
- package/cjs/src/guidelines/cssRule/cssRule.instruction.md +2 -2
- package/cjs/src/guidelines/databaseModule/databaseModule.instruction.md +13 -7
- package/cjs/src/guidelines/modelConstant/modelConstant.instruction.md +0 -30
- package/cjs/src/guidelines/modelDictionary/modelDictionary.generate.json +0 -7
- package/cjs/src/guidelines/modelDictionary/modelDictionary.instruction.md +2 -38
- package/cjs/src/guidelines/modelDocument/modelDocument.instruction.md +1 -1
- package/cjs/src/guidelines/modelService/modelService.generate.json +0 -30
- package/cjs/src/guidelines/modelService/modelService.instruction.md +1 -165
- package/cjs/src/guidelines/modelSignal/modelSignal.instruction.md +4 -4
- package/cjs/src/guidelines/modelStore/modelStore.instruction.md +4 -4
- package/cjs/src/templates/app/lib/___appName__/__appName__.dictionary.js +6 -1
- package/cjs/src/templates/app/lib/___appName__/__appName__.service.js +3 -13
- package/cjs/src/templates/app/lib/{user/user.signal.js → ___appName__/__appName__.signal.js} +8 -8
- package/cjs/src/templates/client.js +4 -5
- package/cjs/src/templates/index.js +2 -3
- package/cjs/src/templates/lib/__lib/lib.constant.js +22 -12
- package/cjs/src/templates/lib/__lib/lib.dictionary.js +15 -8
- package/cjs/src/templates/lib/__lib/lib.document.js +17 -7
- package/cjs/src/templates/lib/__lib/lib.service.js +14 -33
- package/cjs/src/templates/lib/cnst.js +19 -1
- package/cjs/src/templates/lib/db.js +3 -10
- package/cjs/src/templates/lib/dict.js +2 -2
- package/cjs/src/templates/lib/sig.js +20 -0
- package/cjs/src/templates/lib/st.js +13 -1
- package/cjs/src/templates/lib/usePage.js +2 -2
- package/cjs/src/templates/module/__Model__.Util.js +6 -36
- package/cjs/src/templates/module/__Model__.Zone.js +2 -26
- package/cjs/src/templates/module/__model__.constant.js +0 -6
- package/cjs/src/templates/module/__model__.dictionary.js +1 -14
- package/cjs/src/templates/module/__model__.document.js +2 -8
- package/cjs/src/templates/module/__model__.service.js +2 -8
- package/cjs/src/templates/module/__model__.signal.js +2 -2
- package/cjs/src/templates/module/__model__.signal.spec.js +2 -2
- package/cjs/src/templates/module/__model__.signal.test.js +2 -2
- package/cjs/src/templates/module/__model__.store.js +2 -2
- package/cjs/src/templates/server.js +4 -3
- package/cjs/src/templates/workspaceRoot/.gitignore.template +0 -6
- package/cjs/src/templates/workspaceRoot/.vscode/settings.json.template +0 -1
- package/esm/index.js +51 -41
- package/esm/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -1
- package/esm/src/guidelines/componentRule/componentRule.instruction.md +0 -18
- package/esm/src/guidelines/cssRule/cssRule.instruction.md +2 -2
- package/esm/src/guidelines/databaseModule/databaseModule.instruction.md +13 -7
- package/esm/src/guidelines/modelConstant/modelConstant.instruction.md +0 -30
- package/esm/src/guidelines/modelDictionary/modelDictionary.generate.json +0 -7
- package/esm/src/guidelines/modelDictionary/modelDictionary.instruction.md +2 -38
- package/esm/src/guidelines/modelDocument/modelDocument.instruction.md +1 -1
- package/esm/src/guidelines/modelService/modelService.generate.json +0 -30
- package/esm/src/guidelines/modelService/modelService.instruction.md +1 -165
- package/esm/src/guidelines/modelSignal/modelSignal.instruction.md +4 -4
- package/esm/src/guidelines/modelStore/modelStore.instruction.md +4 -4
- package/esm/src/templates/app/lib/___appName__/__appName__.dictionary.js +6 -1
- package/esm/src/templates/app/lib/___appName__/__appName__.service.js +3 -13
- package/esm/src/templates/app/lib/___appName__/__appName__.signal.js +14 -0
- package/esm/src/templates/client.js +4 -5
- package/esm/src/templates/index.js +2 -3
- package/esm/src/templates/lib/__lib/lib.constant.js +22 -12
- package/esm/src/templates/lib/__lib/lib.dictionary.js +15 -8
- package/esm/src/templates/lib/__lib/lib.document.js +17 -7
- package/esm/src/templates/lib/__lib/lib.service.js +14 -33
- package/esm/src/templates/lib/cnst.js +19 -1
- package/esm/src/templates/lib/db.js +3 -10
- package/esm/src/templates/lib/dict.js +2 -2
- package/esm/src/templates/lib/sig.js +20 -0
- package/esm/src/templates/lib/st.js +13 -1
- package/esm/src/templates/lib/usePage.js +2 -2
- package/esm/src/templates/module/__Model__.Util.js +6 -36
- package/esm/src/templates/module/__Model__.Zone.js +2 -26
- package/esm/src/templates/module/__model__.constant.js +0 -6
- package/esm/src/templates/module/__model__.dictionary.js +1 -14
- package/esm/src/templates/module/__model__.document.js +2 -8
- package/esm/src/templates/module/__model__.service.js +2 -8
- package/esm/src/templates/module/__model__.signal.js +2 -2
- package/esm/src/templates/module/__model__.signal.spec.js +2 -2
- package/esm/src/templates/module/__model__.signal.test.js +2 -2
- package/esm/src/templates/module/__model__.store.js +2 -2
- package/esm/src/templates/server.js +4 -3
- package/esm/src/templates/workspaceRoot/.gitignore.template +0 -6
- package/esm/src/templates/workspaceRoot/.vscode/settings.json.template +0 -1
- package/package.json +1 -1
- package/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -1
- package/src/guidelines/componentRule/componentRule.instruction.md +0 -18
- package/src/guidelines/cssRule/cssRule.instruction.md +2 -2
- package/src/guidelines/databaseModule/databaseModule.instruction.md +13 -7
- package/src/guidelines/modelConstant/modelConstant.instruction.md +0 -30
- package/src/guidelines/modelDictionary/modelDictionary.instruction.md +2 -38
- package/src/guidelines/modelDocument/modelDocument.instruction.md +1 -1
- package/src/guidelines/modelService/modelService.instruction.md +1 -165
- package/src/guidelines/modelSignal/modelSignal.instruction.md +4 -4
- package/src/guidelines/modelStore/modelStore.instruction.md +4 -4
- package/src/templates/lib/cnst.d.ts +1 -1
- package/ui/MultiScrollList.d.ts +4 -1
- package/cjs/src/templates/app/app/[lang]/admin/page.js +0 -63
- package/cjs/src/templates/app/lib/setting/Setting.Template.js +0 -44
- package/cjs/src/templates/app/lib/setting/Setting.Unit.js +0 -38
- package/cjs/src/templates/app/lib/setting/Setting.Util.js +0 -40
- package/cjs/src/templates/app/lib/setting/Setting.View.js +0 -48
- package/cjs/src/templates/app/lib/setting/Setting.Zone.js +0 -74
- package/cjs/src/templates/app/lib/setting/setting.constant.js +0 -46
- package/cjs/src/templates/app/lib/setting/setting.dictionary.js +0 -46
- package/cjs/src/templates/app/lib/setting/setting.document.js +0 -48
- package/cjs/src/templates/app/lib/setting/setting.service.js +0 -37
- package/cjs/src/templates/app/lib/setting/setting.signal.js +0 -34
- package/cjs/src/templates/app/lib/setting/setting.store.js +0 -41
- package/cjs/src/templates/app/lib/summary/Summary.Template.js +0 -44
- package/cjs/src/templates/app/lib/summary/Summary.Unit.js +0 -37
- package/cjs/src/templates/app/lib/summary/Summary.Util.js +0 -40
- package/cjs/src/templates/app/lib/summary/Summary.View.js +0 -47
- package/cjs/src/templates/app/lib/summary/Summary.Zone.js +0 -60
- package/cjs/src/templates/app/lib/summary/summary.constant.js +0 -44
- package/cjs/src/templates/app/lib/summary/summary.dictionary.js +0 -49
- package/cjs/src/templates/app/lib/summary/summary.document.js +0 -48
- package/cjs/src/templates/app/lib/summary/summary.service.js +0 -34
- package/cjs/src/templates/app/lib/summary/summary.signal.js +0 -34
- package/cjs/src/templates/app/lib/summary/summary.store.js +0 -41
- package/cjs/src/templates/app/lib/user/User.Template.js +0 -64
- package/cjs/src/templates/app/lib/user/User.Unit.js +0 -37
- package/cjs/src/templates/app/lib/user/User.Util.js +0 -73
- package/cjs/src/templates/app/lib/user/User.View.js +0 -64
- package/cjs/src/templates/app/lib/user/User.Zone.js +0 -77
- package/cjs/src/templates/app/lib/user/user.constant.js +0 -67
- package/cjs/src/templates/app/lib/user/user.dictionary.js +0 -52
- package/cjs/src/templates/app/lib/user/user.document.js +0 -54
- package/cjs/src/templates/app/lib/user/user.service.js +0 -42
- package/cjs/src/templates/app/lib/user/user.signal.spec.js +0 -37
- package/cjs/src/templates/app/lib/user/user.signal.test.js +0 -39
- package/cjs/src/templates/app/lib/user/user.store.js +0 -39
- package/cjs/src/templates/lib/__lib/extends/summary.constant.js +0 -45
- package/cjs/src/templates/lib/cnst_.js +0 -51
- package/cjs/src/templates/lib/fetch.js +0 -48
- package/cjs/src/templates/lib/store.js +0 -50
- package/cjs/src/templates/libRoot/lib/setting/Setting.Template.js +0 -44
- package/cjs/src/templates/libRoot/lib/setting/Setting.Unit.js +0 -38
- package/cjs/src/templates/libRoot/lib/setting/Setting.Util.js +0 -40
- package/cjs/src/templates/libRoot/lib/setting/Setting.View.js +0 -48
- package/cjs/src/templates/libRoot/lib/setting/Setting.Zone.js +0 -74
- package/cjs/src/templates/libRoot/lib/setting/setting.constant.js +0 -46
- package/cjs/src/templates/libRoot/lib/setting/setting.dictionary.js +0 -46
- package/cjs/src/templates/libRoot/lib/setting/setting.document.js +0 -48
- package/cjs/src/templates/libRoot/lib/setting/setting.service.js +0 -37
- package/cjs/src/templates/libRoot/lib/setting/setting.signal.js +0 -34
- package/cjs/src/templates/libRoot/lib/setting/setting.store.js +0 -41
- package/cjs/src/templates/libRoot/lib/summary/Summary.Template.js +0 -44
- package/cjs/src/templates/libRoot/lib/summary/Summary.Unit.js +0 -37
- package/cjs/src/templates/libRoot/lib/summary/Summary.Util.js +0 -40
- package/cjs/src/templates/libRoot/lib/summary/Summary.View.js +0 -47
- package/cjs/src/templates/libRoot/lib/summary/Summary.Zone.js +0 -60
- package/cjs/src/templates/libRoot/lib/summary/summary.constant.js +0 -44
- package/cjs/src/templates/libRoot/lib/summary/summary.dictionary.js +0 -49
- package/cjs/src/templates/libRoot/lib/summary/summary.document.js +0 -48
- package/cjs/src/templates/libRoot/lib/summary/summary.service.js +0 -34
- package/cjs/src/templates/libRoot/lib/summary/summary.signal.js +0 -34
- package/cjs/src/templates/libRoot/lib/summary/summary.store.js +0 -41
- package/cjs/src/templates/libRoot/lib/user/User.Template.js +0 -64
- package/cjs/src/templates/libRoot/lib/user/User.Unit.js +0 -37
- package/cjs/src/templates/libRoot/lib/user/User.Util.js +0 -73
- package/cjs/src/templates/libRoot/lib/user/User.View.js +0 -64
- package/cjs/src/templates/libRoot/lib/user/User.Zone.js +0 -77
- package/cjs/src/templates/libRoot/lib/user/user.constant.js +0 -67
- package/cjs/src/templates/libRoot/lib/user/user.dictionary.js +0 -52
- package/cjs/src/templates/libRoot/lib/user/user.document.js +0 -54
- package/cjs/src/templates/libRoot/lib/user/user.service.js +0 -42
- package/cjs/src/templates/libRoot/lib/user/user.signal.js +0 -34
- package/cjs/src/templates/libRoot/lib/user/user.signal.spec.js +0 -37
- package/cjs/src/templates/libRoot/lib/user/user.signal.test.js +0 -39
- package/cjs/src/templates/libRoot/lib/user/user.store.js +0 -39
- package/esm/src/templates/app/app/[lang]/admin/page.js +0 -43
- package/esm/src/templates/app/lib/setting/Setting.Template.js +0 -24
- package/esm/src/templates/app/lib/setting/Setting.Unit.js +0 -18
- package/esm/src/templates/app/lib/setting/Setting.Util.js +0 -20
- package/esm/src/templates/app/lib/setting/Setting.View.js +0 -28
- package/esm/src/templates/app/lib/setting/Setting.Zone.js +0 -54
- package/esm/src/templates/app/lib/setting/setting.constant.js +0 -26
- package/esm/src/templates/app/lib/setting/setting.dictionary.js +0 -26
- package/esm/src/templates/app/lib/setting/setting.document.js +0 -28
- package/esm/src/templates/app/lib/setting/setting.service.js +0 -17
- package/esm/src/templates/app/lib/setting/setting.signal.js +0 -14
- package/esm/src/templates/app/lib/setting/setting.store.js +0 -21
- package/esm/src/templates/app/lib/summary/Summary.Template.js +0 -24
- package/esm/src/templates/app/lib/summary/Summary.Unit.js +0 -17
- package/esm/src/templates/app/lib/summary/Summary.Util.js +0 -20
- package/esm/src/templates/app/lib/summary/Summary.View.js +0 -27
- package/esm/src/templates/app/lib/summary/Summary.Zone.js +0 -40
- package/esm/src/templates/app/lib/summary/summary.constant.js +0 -24
- package/esm/src/templates/app/lib/summary/summary.dictionary.js +0 -29
- package/esm/src/templates/app/lib/summary/summary.document.js +0 -28
- package/esm/src/templates/app/lib/summary/summary.service.js +0 -14
- package/esm/src/templates/app/lib/summary/summary.signal.js +0 -14
- package/esm/src/templates/app/lib/summary/summary.store.js +0 -21
- package/esm/src/templates/app/lib/user/User.Template.js +0 -44
- package/esm/src/templates/app/lib/user/User.Unit.js +0 -17
- package/esm/src/templates/app/lib/user/User.Util.js +0 -53
- package/esm/src/templates/app/lib/user/User.View.js +0 -44
- package/esm/src/templates/app/lib/user/User.Zone.js +0 -57
- package/esm/src/templates/app/lib/user/user.constant.js +0 -47
- package/esm/src/templates/app/lib/user/user.dictionary.js +0 -32
- package/esm/src/templates/app/lib/user/user.document.js +0 -34
- package/esm/src/templates/app/lib/user/user.service.js +0 -22
- package/esm/src/templates/app/lib/user/user.signal.js +0 -14
- package/esm/src/templates/app/lib/user/user.signal.spec.js +0 -17
- package/esm/src/templates/app/lib/user/user.signal.test.js +0 -19
- package/esm/src/templates/app/lib/user/user.store.js +0 -19
- package/esm/src/templates/lib/__lib/extends/summary.constant.js +0 -25
- package/esm/src/templates/lib/cnst_.js +0 -31
- package/esm/src/templates/lib/fetch.js +0 -28
- package/esm/src/templates/lib/store.js +0 -30
- package/esm/src/templates/libRoot/lib/setting/Setting.Template.js +0 -24
- package/esm/src/templates/libRoot/lib/setting/Setting.Unit.js +0 -18
- package/esm/src/templates/libRoot/lib/setting/Setting.Util.js +0 -20
- package/esm/src/templates/libRoot/lib/setting/Setting.View.js +0 -28
- package/esm/src/templates/libRoot/lib/setting/Setting.Zone.js +0 -54
- package/esm/src/templates/libRoot/lib/setting/setting.constant.js +0 -26
- package/esm/src/templates/libRoot/lib/setting/setting.dictionary.js +0 -26
- package/esm/src/templates/libRoot/lib/setting/setting.document.js +0 -28
- package/esm/src/templates/libRoot/lib/setting/setting.service.js +0 -17
- package/esm/src/templates/libRoot/lib/setting/setting.signal.js +0 -14
- package/esm/src/templates/libRoot/lib/setting/setting.store.js +0 -21
- package/esm/src/templates/libRoot/lib/summary/Summary.Template.js +0 -24
- package/esm/src/templates/libRoot/lib/summary/Summary.Unit.js +0 -17
- package/esm/src/templates/libRoot/lib/summary/Summary.Util.js +0 -20
- package/esm/src/templates/libRoot/lib/summary/Summary.View.js +0 -27
- package/esm/src/templates/libRoot/lib/summary/Summary.Zone.js +0 -40
- package/esm/src/templates/libRoot/lib/summary/summary.constant.js +0 -24
- package/esm/src/templates/libRoot/lib/summary/summary.dictionary.js +0 -29
- package/esm/src/templates/libRoot/lib/summary/summary.document.js +0 -28
- package/esm/src/templates/libRoot/lib/summary/summary.service.js +0 -14
- package/esm/src/templates/libRoot/lib/summary/summary.signal.js +0 -14
- package/esm/src/templates/libRoot/lib/summary/summary.store.js +0 -21
- package/esm/src/templates/libRoot/lib/user/User.Template.js +0 -44
- package/esm/src/templates/libRoot/lib/user/User.Unit.js +0 -17
- package/esm/src/templates/libRoot/lib/user/User.Util.js +0 -53
- package/esm/src/templates/libRoot/lib/user/User.View.js +0 -44
- package/esm/src/templates/libRoot/lib/user/User.Zone.js +0 -57
- package/esm/src/templates/libRoot/lib/user/user.constant.js +0 -47
- package/esm/src/templates/libRoot/lib/user/user.dictionary.js +0 -32
- package/esm/src/templates/libRoot/lib/user/user.document.js +0 -34
- package/esm/src/templates/libRoot/lib/user/user.service.js +0 -22
- package/esm/src/templates/libRoot/lib/user/user.signal.js +0 -14
- package/esm/src/templates/libRoot/lib/user/user.signal.spec.js +0 -17
- package/esm/src/templates/libRoot/lib/user/user.signal.test.js +0 -19
- package/esm/src/templates/libRoot/lib/user/user.store.js +0 -19
- package/src/templates/app/app/[lang]/admin/page.d.ts +0 -9
- package/src/templates/app/lib/setting/Setting.Template.d.ts +0 -9
- package/src/templates/app/lib/setting/Setting.Unit.d.ts +0 -9
- package/src/templates/app/lib/setting/Setting.Util.d.ts +0 -9
- package/src/templates/app/lib/setting/Setting.View.d.ts +0 -9
- package/src/templates/app/lib/setting/Setting.Zone.d.ts +0 -9
- package/src/templates/app/lib/setting/setting.dictionary.d.ts +0 -7
- package/src/templates/app/lib/setting/setting.document.d.ts +0 -6
- package/src/templates/app/lib/setting/setting.service.d.ts +0 -7
- package/src/templates/app/lib/setting/setting.signal.d.ts +0 -6
- package/src/templates/app/lib/setting/setting.store.d.ts +0 -6
- package/src/templates/app/lib/summary/Summary.Template.d.ts +0 -9
- package/src/templates/app/lib/summary/Summary.Unit.d.ts +0 -9
- package/src/templates/app/lib/summary/Summary.Util.d.ts +0 -9
- package/src/templates/app/lib/summary/Summary.View.d.ts +0 -9
- package/src/templates/app/lib/summary/Summary.Zone.d.ts +0 -9
- package/src/templates/app/lib/summary/summary.constant.d.ts +0 -7
- package/src/templates/app/lib/summary/summary.dictionary.d.ts +0 -7
- package/src/templates/app/lib/summary/summary.document.d.ts +0 -6
- package/src/templates/app/lib/summary/summary.service.d.ts +0 -7
- package/src/templates/app/lib/summary/summary.signal.d.ts +0 -6
- package/src/templates/app/lib/summary/summary.store.d.ts +0 -6
- package/src/templates/app/lib/user/User.Template.d.ts +0 -9
- package/src/templates/app/lib/user/User.Unit.d.ts +0 -9
- package/src/templates/app/lib/user/User.Util.d.ts +0 -9
- package/src/templates/app/lib/user/User.View.d.ts +0 -9
- package/src/templates/app/lib/user/User.Zone.d.ts +0 -9
- package/src/templates/app/lib/user/user.constant.d.ts +0 -7
- package/src/templates/app/lib/user/user.dictionary.d.ts +0 -7
- package/src/templates/app/lib/user/user.document.d.ts +0 -7
- package/src/templates/app/lib/user/user.service.d.ts +0 -7
- package/src/templates/app/lib/user/user.signal.d.ts +0 -6
- package/src/templates/app/lib/user/user.signal.spec.d.ts +0 -6
- package/src/templates/app/lib/user/user.signal.test.d.ts +0 -6
- package/src/templates/app/lib/user/user.store.d.ts +0 -6
- package/src/templates/lib/__lib/extends/summary.constant.d.ts +0 -4
- package/src/templates/lib/cnst_.d.ts +0 -4
- package/src/templates/lib/fetch.d.ts +0 -4
- package/src/templates/lib/store.d.ts +0 -4
- package/src/templates/libRoot/lib/setting/Setting.Template.d.ts +0 -9
- package/src/templates/libRoot/lib/setting/Setting.Unit.d.ts +0 -9
- package/src/templates/libRoot/lib/setting/Setting.Util.d.ts +0 -9
- package/src/templates/libRoot/lib/setting/Setting.View.d.ts +0 -9
- package/src/templates/libRoot/lib/setting/Setting.Zone.d.ts +0 -9
- package/src/templates/libRoot/lib/setting/setting.constant.d.ts +0 -7
- package/src/templates/libRoot/lib/setting/setting.dictionary.d.ts +0 -7
- package/src/templates/libRoot/lib/setting/setting.document.d.ts +0 -6
- package/src/templates/libRoot/lib/setting/setting.service.d.ts +0 -7
- package/src/templates/libRoot/lib/setting/setting.signal.d.ts +0 -6
- package/src/templates/libRoot/lib/setting/setting.store.d.ts +0 -6
- package/src/templates/libRoot/lib/summary/Summary.Template.d.ts +0 -9
- package/src/templates/libRoot/lib/summary/Summary.Unit.d.ts +0 -9
- package/src/templates/libRoot/lib/summary/Summary.Util.d.ts +0 -9
- package/src/templates/libRoot/lib/summary/Summary.View.d.ts +0 -9
- package/src/templates/libRoot/lib/summary/Summary.Zone.d.ts +0 -9
- package/src/templates/libRoot/lib/summary/summary.constant.d.ts +0 -7
- package/src/templates/libRoot/lib/summary/summary.dictionary.d.ts +0 -7
- package/src/templates/libRoot/lib/summary/summary.document.d.ts +0 -6
- package/src/templates/libRoot/lib/summary/summary.service.d.ts +0 -7
- package/src/templates/libRoot/lib/summary/summary.signal.d.ts +0 -6
- package/src/templates/libRoot/lib/summary/summary.store.d.ts +0 -6
- package/src/templates/libRoot/lib/user/User.Template.d.ts +0 -9
- package/src/templates/libRoot/lib/user/User.Unit.d.ts +0 -9
- package/src/templates/libRoot/lib/user/User.Util.d.ts +0 -9
- package/src/templates/libRoot/lib/user/User.View.d.ts +0 -9
- package/src/templates/libRoot/lib/user/User.Zone.d.ts +0 -9
- package/src/templates/libRoot/lib/user/user.constant.d.ts +0 -7
- package/src/templates/libRoot/lib/user/user.dictionary.d.ts +0 -7
- package/src/templates/libRoot/lib/user/user.document.d.ts +0 -7
- package/src/templates/libRoot/lib/user/user.service.d.ts +0 -7
- package/src/templates/libRoot/lib/user/user.signal.d.ts +0 -6
- package/src/templates/libRoot/lib/user/user.signal.spec.d.ts +0 -6
- package/src/templates/libRoot/lib/user/user.signal.test.d.ts +0 -6
- package/src/templates/libRoot/lib/user/user.store.d.ts +0 -6
- /package/src/templates/app/lib/{setting/setting.constant.d.ts → ___appName__/__appName__.signal.d.ts} +0 -0
|
@@ -136,97 +136,6 @@ Injects a websocket server instance for real-time communication:
|
|
|
136
136
|
protected readonly websocket: Websocket<ChatSignal>;
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
## Lifecycle Methods
|
|
140
|
-
|
|
141
|
-
Akan.js services can implement lifecycle hooks that are called by the NestJS framework.
|
|
142
|
-
|
|
143
|
-
### onModuleInit()
|
|
144
|
-
|
|
145
|
-
Called once the module has been initialized by NestJS. Use this for setup operations:
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
async onModuleInit() {
|
|
149
|
-
// Initialize service resources
|
|
150
|
-
await this.loadInitialData();
|
|
151
|
-
this.setupEventListeners();
|
|
152
|
-
this.logger.log('Service initialized successfully');
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
Common use cases:
|
|
157
|
-
|
|
158
|
-
- Initializing in-memory cache
|
|
159
|
-
- Setting up event listeners
|
|
160
|
-
- Loading configuration data
|
|
161
|
-
- Establishing connections to external services
|
|
162
|
-
|
|
163
|
-
### onModuleDestroy()
|
|
164
|
-
|
|
165
|
-
Called just before the application shuts down. Use this for cleanup operations:
|
|
166
|
-
|
|
167
|
-
```typescript
|
|
168
|
-
async onModuleDestroy() {
|
|
169
|
-
// Clean up resources
|
|
170
|
-
await Promise.all(this.connections.map(conn => conn.close()));
|
|
171
|
-
this.clearTimers();
|
|
172
|
-
this.logger.log('Service resources released');
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Common use cases:
|
|
177
|
-
|
|
178
|
-
- Closing database connections
|
|
179
|
-
- Releasing external resources
|
|
180
|
-
- Clearing timers and intervals
|
|
181
|
-
- Unregistering event listeners
|
|
182
|
-
|
|
183
|
-
## Scheduled Tasks
|
|
184
|
-
|
|
185
|
-
Akan.js provides decorators for scheduling recurring tasks.
|
|
186
|
-
|
|
187
|
-
### @Cron Decorator
|
|
188
|
-
|
|
189
|
-
Executes methods on a cron schedule:
|
|
190
|
-
|
|
191
|
-
```typescript
|
|
192
|
-
@Cron("0 0 * * *") // Run at midnight every day
|
|
193
|
-
async dailyCleanup() {
|
|
194
|
-
await this.cleanupExpiredRecords();
|
|
195
|
-
this.logger.log('Daily cleanup completed');
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
@Cron("*/5 * * * *", { serverMode: "batch" }) // Run every 5 minutes, only in batch mode
|
|
199
|
-
async periodicSync() {
|
|
200
|
-
await this.syncExternalData();
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
The first parameter uses standard cron syntax:
|
|
205
|
-
|
|
206
|
-
- `* * * * *` = minute hour day-of-month month day-of-week
|
|
207
|
-
- Special patterns like `@daily`, `@hourly` are also supported
|
|
208
|
-
|
|
209
|
-
Options include:
|
|
210
|
-
|
|
211
|
-
- `serverMode`: Restrict to a specific server mode (e.g., "batch")
|
|
212
|
-
- `name`: Assign a name to the scheduled job
|
|
213
|
-
- `timeZone`: Specify the timezone for the schedule
|
|
214
|
-
|
|
215
|
-
### @Interval Decorator
|
|
216
|
-
|
|
217
|
-
Executes methods at fixed time intervals in milliseconds:
|
|
218
|
-
|
|
219
|
-
```typescript
|
|
220
|
-
@Interval(60000) // Run every minute (60,000 ms)
|
|
221
|
-
async checkStatus() {
|
|
222
|
-
await this.monitorSystemHealth();
|
|
223
|
-
}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Options:
|
|
227
|
-
|
|
228
|
-
- `name`: Assign a name to the interval
|
|
229
|
-
|
|
230
139
|
## Database Operations
|
|
231
140
|
|
|
232
141
|
When extending `DbService`, your service automatically inherits numerous methods for working with the database model.
|
|
@@ -606,34 +515,6 @@ class PaymentService extends DbService(db.paymentDb) {
|
|
|
606
515
|
}
|
|
607
516
|
```
|
|
608
517
|
|
|
609
|
-
### 3. Proper Resource Management
|
|
610
|
-
|
|
611
|
-
Clean up resources in lifecycle hooks:
|
|
612
|
-
|
|
613
|
-
```typescript
|
|
614
|
-
@Service("ExternalApiService")
|
|
615
|
-
class ExternalApiService extends LogService("ExternalApiService") {
|
|
616
|
-
private client: ApiClient;
|
|
617
|
-
private timers: NodeJS.Timeout[] = [];
|
|
618
|
-
|
|
619
|
-
async onModuleInit() {
|
|
620
|
-
this.client = new ApiClient();
|
|
621
|
-
await this.client.connect();
|
|
622
|
-
|
|
623
|
-
this.timers.push(setInterval(() => this.refreshToken(), 3600000));
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
async onModuleDestroy() {
|
|
627
|
-
// Clean up resources
|
|
628
|
-
await this.client.disconnect();
|
|
629
|
-
|
|
630
|
-
for (const timer of this.timers) {
|
|
631
|
-
clearInterval(timer);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
```
|
|
636
|
-
|
|
637
518
|
### 4. Transaction Safety
|
|
638
519
|
|
|
639
520
|
Use hooks for validating operations:
|
|
@@ -724,7 +605,7 @@ import { Cron } from "@akanjs/nest";
|
|
|
724
605
|
import { DbService, Service, Srv, Use } from "@akanjs/service";
|
|
725
606
|
import type { EmailApi } from "@util/nest";
|
|
726
607
|
|
|
727
|
-
import
|
|
608
|
+
import * as cnst from "../cnst";
|
|
728
609
|
import * as db from "../db";
|
|
729
610
|
import { Revert } from "../dict";
|
|
730
611
|
import type * as srv from "../srv";
|
|
@@ -818,25 +699,6 @@ export class OrderService extends DbService(db.orderDb) {
|
|
|
818
699
|
|
|
819
700
|
return data;
|
|
820
701
|
}
|
|
821
|
-
|
|
822
|
-
// Scheduled task
|
|
823
|
-
@Cron("0 0 * * *", { serverMode: "batch" })
|
|
824
|
-
async cleanupAbandonedOrders() {
|
|
825
|
-
const cutoffDate = dayjs().subtract(7, "days");
|
|
826
|
-
const orders = await this.listPendingOrders(cutoffDate);
|
|
827
|
-
|
|
828
|
-
for (const order of orders) {
|
|
829
|
-
await this.cancelOrder(order.id);
|
|
830
|
-
this.logger.log(`Cancelled abandoned order: ${order.id}`);
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
// Summary method
|
|
835
|
-
async summarize(): Promise<cnst.OrderSummary> {
|
|
836
|
-
return {
|
|
837
|
-
...(await this.orderModel.getSummary()),
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
702
|
}
|
|
841
703
|
```
|
|
842
704
|
|
|
@@ -894,32 +756,6 @@ If a service isn't being injected correctly:
|
|
|
894
756
|
}
|
|
895
757
|
```
|
|
896
758
|
|
|
897
|
-
### Scheduled Tasks Not Running
|
|
898
|
-
|
|
899
|
-
1. Verify cron syntax:
|
|
900
|
-
|
|
901
|
-
```typescript
|
|
902
|
-
// Correct syntax
|
|
903
|
-
@Cron("0 * * * *") // Every hour at minute 0
|
|
904
|
-
|
|
905
|
-
// Incorrect syntax
|
|
906
|
-
@Cron("0 * * *") // Missing day-of-week field
|
|
907
|
-
```
|
|
908
|
-
|
|
909
|
-
2. Check server mode restrictions:
|
|
910
|
-
|
|
911
|
-
```typescript
|
|
912
|
-
// Only runs in batch mode
|
|
913
|
-
@Cron("0 * * * *", { serverMode: "batch" })
|
|
914
|
-
```
|
|
915
|
-
|
|
916
|
-
3. Ensure the service is properly initialized:
|
|
917
|
-
```typescript
|
|
918
|
-
onModuleInit() {
|
|
919
|
-
this.logger.log('Service initialized'); // Is this being logged?
|
|
920
|
-
}
|
|
921
|
-
```
|
|
922
|
-
|
|
923
759
|
## Summary
|
|
924
760
|
|
|
925
761
|
Model services in Akan.js are powerful components that encapsulate business logic and data operations. By following the patterns and best practices outlined in this guide, you can create maintainable, scalable services that effectively implement your application's domain logic while maintaining clean separation of concerns.
|
|
@@ -23,11 +23,11 @@ import { ID, Int } from "@akanjs/base";
|
|
|
23
23
|
import { SortOf } from "@akanjs/constant";
|
|
24
24
|
import { Arg, DbSignal, Mutation, Query, resolve, Self, Signal } from "@akanjs/signal";
|
|
25
25
|
|
|
26
|
-
import
|
|
26
|
+
import * as cnst from "../cnst";
|
|
27
27
|
import type * as db from "../db";
|
|
28
28
|
|
|
29
29
|
@Signal(() => cnst.ModelName)
|
|
30
|
-
export class ModelNameSignal extends DbSignal(cnst.modelNameCnst, Srvs, {
|
|
30
|
+
export class ModelNameSignal extends DbSignal(cnst.modelNameCnst, cnst.Srvs, {
|
|
31
31
|
guards: { get: Query.Public, cru: Mutation.User },
|
|
32
32
|
}) {
|
|
33
33
|
// Signal methods here...
|
|
@@ -289,7 +289,7 @@ DbSignal creates standard operations that you don't need to implement:
|
|
|
289
289
|
|
|
290
290
|
```typescript
|
|
291
291
|
@Signal(() => cnst.Board)
|
|
292
|
-
export class BoardSignal extends DbSignal(cnst.boardCnst, Srvs, {
|
|
292
|
+
export class BoardSignal extends DbSignal(cnst.boardCnst, cnst.Srvs, {
|
|
293
293
|
guards: { get: Query.Public, cru: Mutation.Admin },
|
|
294
294
|
}) {
|
|
295
295
|
// Custom methods beyond CRUD go here
|
|
@@ -409,7 +409,7 @@ async getProjectDetails(
|
|
|
409
409
|
|
|
410
410
|
```typescript
|
|
411
411
|
@Signal(() => cnst.Product)
|
|
412
|
-
export class ProductSignal extends DbSignal(cnst.productCnst, Srvs, {
|
|
412
|
+
export class ProductSignal extends DbSignal(cnst.productCnst, cnst.Srvs, {
|
|
413
413
|
guards: { get: Query.Public, cru: Mutation.Admin },
|
|
414
414
|
}) {
|
|
415
415
|
// Custom methods beyond auto-generated CRUD
|
|
@@ -34,8 +34,8 @@ Model stores follow a consistent architecture pattern:
|
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
36
|
import { stateOf, Store } from "@akanjs/store";
|
|
37
|
-
import
|
|
38
|
-
import { fetch } from "../
|
|
37
|
+
import * as cnst from "../cnst";
|
|
38
|
+
import { fetch } from "../sig";
|
|
39
39
|
|
|
40
40
|
@Store(() => cnst.Product)
|
|
41
41
|
export class ProductStore extends stateOf(fetch.productGql, {
|
|
@@ -485,8 +485,8 @@ initProductChat(productId: string) {
|
|
|
485
485
|
|
|
486
486
|
```typescript
|
|
487
487
|
import { stateOf, Store, Toast } from "@akanjs/store";
|
|
488
|
-
import
|
|
489
|
-
import { fetch } from "../
|
|
488
|
+
import * as cnst from "../cnst";
|
|
489
|
+
import { fetch } from "../sig";
|
|
490
490
|
import { msg } from "../msg";
|
|
491
491
|
|
|
492
492
|
@Store(() => cnst.Product)
|
|
@@ -24,8 +24,13 @@ __export(appName_dictionary_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(appName_dictionary_exports);
|
|
25
25
|
function getContent(scanInfo, dict) {
|
|
26
26
|
return `
|
|
27
|
+
import type { SignalDictionary } from "@akanjs/dictionary";
|
|
28
|
+
import type { ${dict.AppName}Signal } from "./${dict.appName}.signal";
|
|
29
|
+
|
|
27
30
|
const dictionary = {} as const;
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
const signalDictionary = {} satisfies SignalDictionary<${dict.AppName}Signal>;
|
|
33
|
+
|
|
34
|
+
export const ${dict.appName}Dictionary = { ...dictionary, ...signalDictionary };
|
|
30
35
|
`;
|
|
31
36
|
}
|
|
@@ -24,19 +24,9 @@ __export(appName_service_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(appName_service_exports);
|
|
25
25
|
function getContent(scanInfo, dict) {
|
|
26
26
|
return `
|
|
27
|
-
import {
|
|
28
|
-
import { LogService, Service, Srv } from "@akanjs/service";
|
|
29
|
-
|
|
30
|
-
import type * as srv from "../srv";
|
|
27
|
+
import { LogService, Service } from "@akanjs/service";
|
|
31
28
|
|
|
32
29
|
@Service("${dict.appName}Service", { serverMode: "batch" })
|
|
33
|
-
export class ${dict.AppName}Service extends LogService("${dict.appName}Service") {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@Cron("0 * * * *")
|
|
37
|
-
async takePeriodicSnapshot() {
|
|
38
|
-
await this.summaryService.makeSummary();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
30
|
+
export class ${dict.AppName}Service extends LogService("${dict.appName}Service") {}
|
|
31
|
+
`;
|
|
42
32
|
}
|
package/cjs/src/templates/app/lib/{user/user.signal.js → ___appName__/__appName__.signal.js}
RENAMED
|
@@ -16,19 +16,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// pkgs/@akanjs/cli/src/templates/app/lib/
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/___appName__/__appName__.signal.ts
|
|
20
|
+
var appName_signal_exports = {};
|
|
21
|
+
__export(appName_signal_exports, {
|
|
22
22
|
default: () => getContent
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
function getContent(scanInfo, dict
|
|
24
|
+
module.exports = __toCommonJS(appName_signal_exports);
|
|
25
|
+
function getContent(scanInfo, dict) {
|
|
26
26
|
return `
|
|
27
27
|
import { LogSignal, Signal } from "@akanjs/signal";
|
|
28
28
|
|
|
29
|
-
import
|
|
29
|
+
import * as cnst from "../cnst";
|
|
30
30
|
|
|
31
|
-
@Signal(
|
|
32
|
-
export class
|
|
31
|
+
@Signal({ name: "${dict.AppName}" })
|
|
32
|
+
export class ${dict.AppName}Signal extends LogSignal(cnst.Srvs) {}
|
|
33
33
|
`;
|
|
34
34
|
}
|
|
@@ -36,11 +36,10 @@ function getContent(scanInfo, dict = {}) {
|
|
|
36
36
|
([_, fileTypes]) => fileTypes.has("template") || fileTypes.has("unit") || fileTypes.has("util") || fileTypes.has("view") || fileTypes.has("zone")
|
|
37
37
|
).map(([key]) => key);
|
|
38
38
|
return `
|
|
39
|
-
export {
|
|
40
|
-
export { store } from "./lib/
|
|
41
|
-
export {
|
|
42
|
-
export
|
|
43
|
-
export { cnst } from "./lib/cnst";
|
|
39
|
+
export { Revert, msg, usePage } from "./lib/usePage";
|
|
40
|
+
export { st, store } from "./lib/st";
|
|
41
|
+
export { fetch } from "./lib/sig";
|
|
42
|
+
export * as cnst from "./lib/cnst"
|
|
44
43
|
${scalarModules.map((module2) => `export { ${capitalize(module2)} } from "./lib/__scalar/${module2}";`).join("\n")}
|
|
45
44
|
${serviceModules.map((module2) => `export { ${capitalize(module2)} } from "./lib/_${module2}";`).join("\n")}
|
|
46
45
|
${databaseModules.map((module2) => `export { ${capitalize(module2)} } from "./lib/${module2}";`).join("\n")}
|
|
@@ -24,8 +24,7 @@ __export(templates_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(templates_exports);
|
|
25
25
|
function getContent(scanInfo, dict = {}) {
|
|
26
26
|
return `
|
|
27
|
-
export
|
|
28
|
-
export { fetch } from "./lib/
|
|
29
|
-
export * from "./lib/dict";
|
|
27
|
+
export * as cnst from "./lib/cnst";
|
|
28
|
+
export { fetch } from "./lib/sig";
|
|
30
29
|
`;
|
|
31
30
|
}
|
|
@@ -22,28 +22,38 @@ __export(lib_constant_exports, {
|
|
|
22
22
|
default: () => getContent
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(lib_constant_exports);
|
|
25
|
+
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
25
26
|
function getContent(scanInfo, dict = {}) {
|
|
26
27
|
if (!scanInfo)
|
|
27
28
|
return null;
|
|
28
29
|
const scanResult = scanInfo.getScanResult();
|
|
29
30
|
const libs = scanResult.akanConfig.libs;
|
|
30
31
|
const libInfos = scanInfo.getLibInfos();
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const extendedModels = Object.fromEntries(
|
|
33
|
+
[...scanInfo.file.constant.databases].map(
|
|
34
|
+
(modelName) => [
|
|
35
|
+
modelName,
|
|
36
|
+
[...libInfos.values()].filter((libInfo) => libInfo.file.constant.databases.has(modelName)).map((libInfo) => libInfo.name)
|
|
37
|
+
]
|
|
38
|
+
).filter(([_, libNames]) => libNames.length > 0)
|
|
39
|
+
);
|
|
34
40
|
return `
|
|
35
41
|
${libs.map((lib) => `import { cnst as ${lib} } from "@${lib}";`).join("\n")}
|
|
36
42
|
|
|
37
43
|
${libs.map((lib) => `export { cnst as ${lib} } from "@${lib}";`).join("\n")}
|
|
38
44
|
|
|
39
|
-
${
|
|
40
|
-
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
${Object.entries(extendedModels).map(([modelName, extendedModels2]) => {
|
|
46
|
+
const ModelName = capitalize(modelName);
|
|
47
|
+
return `export const ${modelName} = {
|
|
48
|
+
inputs: [${extendedModels2.map((libName) => `${libName}.${ModelName}Input`).join(", ")}] as const,
|
|
49
|
+
objects: [${extendedModels2.map((libName) => `${libName}.${ModelName}Object`).join(", ")}] as const,
|
|
50
|
+
lights: [${extendedModels2.map((libName) => `${libName}.Light${ModelName}`).join(", ")}] as const,
|
|
51
|
+
models: [${extendedModels2.map((libName) => `${libName}.${ModelName}`).join(", ")}] as const,
|
|
52
|
+
insights: [${extendedModels2.map((libName) => `${libName}.${ModelName}Insight`).join(", ")}] as const,
|
|
53
|
+
filters: [${extendedModels2.map((libName) => `${libName}.${ModelName}Filter`).join(", ")}] as const,
|
|
54
|
+
}`;
|
|
55
|
+
}).join("\n")}
|
|
56
|
+
|
|
57
|
+
export const allLibs = [${libs.join(", ")}] as const;
|
|
48
58
|
`;
|
|
49
59
|
}
|
|
@@ -25,18 +25,25 @@ module.exports = __toCommonJS(lib_dictionary_exports);
|
|
|
25
25
|
function getContent(scanInfo, dict = {}) {
|
|
26
26
|
if (!scanInfo)
|
|
27
27
|
return null;
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
const scanResult = scanInfo.getScanResult();
|
|
29
|
+
const libs = scanInfo.akanConfig.libs;
|
|
30
|
+
const libInfos = scanInfo.getLibInfos();
|
|
31
|
+
const extendedModels = Object.fromEntries(
|
|
32
|
+
[...scanInfo.file.dictionary.databases].map(
|
|
33
|
+
(modelName) => [
|
|
34
|
+
modelName,
|
|
35
|
+
[...libInfos.values()].filter((libInfo) => libInfo.file.dictionary.databases.has(modelName)).map((libInfo) => libInfo.name)
|
|
36
|
+
]
|
|
37
|
+
).filter(([_, libNames]) => libNames.length > 0)
|
|
31
38
|
);
|
|
32
39
|
return `
|
|
33
40
|
${libs.length === 0 ? `import { dictionary as base } from "@akanjs/dictionary";` : ""}
|
|
34
|
-
${libs.map((lib) => `import { dictionary as ${lib} } from "@${lib}";`).join("\n")}
|
|
41
|
+
${libs.map((lib) => `import { dictionary as ${lib} } from "@${lib}/server";`).join("\n")}
|
|
35
42
|
|
|
36
|
-
${
|
|
43
|
+
${Object.entries(extendedModels).map(([modelName, extendedModels2]) => {
|
|
44
|
+
return `export const ${modelName} = Object.assign({}, ${extendedModels2.map((libName) => `${libName}.${modelName}`).join(", ")});`;
|
|
45
|
+
}).join("\n")}
|
|
37
46
|
|
|
38
|
-
export const
|
|
39
|
-
|
|
40
|
-
export const libSummaryDictionary = { ${moduleDictionaries.map((module2) => `...${module2}SummaryDictionary`).join(", ")} };
|
|
47
|
+
export const allLibs = [${libs.length === 0 ? "base" : libs.join(", ")}] as const;
|
|
41
48
|
`;
|
|
42
49
|
}
|
|
@@ -26,16 +26,26 @@ function getContent(scanInfo, dict = {}) {
|
|
|
26
26
|
if (!scanInfo)
|
|
27
27
|
return null;
|
|
28
28
|
const libs = scanInfo.getLibs();
|
|
29
|
-
const
|
|
29
|
+
const libInfos = [...scanInfo.getLibInfos().values()];
|
|
30
|
+
const extendedModels = Object.fromEntries(
|
|
31
|
+
[...scanInfo.file.document.databases].map(
|
|
32
|
+
(modelName) => [
|
|
33
|
+
modelName,
|
|
34
|
+
libInfos.filter((libInfo) => libInfo.file.document.databases.has(modelName)).map((libInfo) => libInfo.name)
|
|
35
|
+
]
|
|
36
|
+
).filter(([_, libNames]) => libNames.length > 0)
|
|
37
|
+
);
|
|
30
38
|
return `
|
|
31
39
|
${libs.map((lib) => `import { db as ${lib} } from "@${lib}/server";`).join("\n")}
|
|
32
|
-
|
|
33
40
|
${libs.map((lib) => `export { db as ${lib} } from "@${lib}/server";`).join("\n")}
|
|
34
41
|
|
|
35
|
-
${
|
|
36
|
-
|
|
37
|
-
${
|
|
38
|
-
${
|
|
39
|
-
|
|
42
|
+
${Object.entries(extendedModels).map(
|
|
43
|
+
([modelName, extendedModels2]) => `export const ${modelName} = {
|
|
44
|
+
inputs: [${extendedModels2.map((libName) => `${libName}.${modelName}Db.Input`).join(", ")}] as const,
|
|
45
|
+
docs: [${extendedModels2.map((libName) => `${libName}.${modelName}Db.Doc`).join(", ")}] as const,
|
|
46
|
+
models: [${extendedModels2.map((libName) => `${libName}.${modelName}Db.Model`).join(", ")}] as const,
|
|
47
|
+
}`
|
|
48
|
+
).join("\n")}
|
|
49
|
+
export const allLibs = [${libs.join(", ")}] as const;
|
|
40
50
|
`;
|
|
41
51
|
}
|
|
@@ -28,16 +28,16 @@ function getContent(scanInfo, dict = {}) {
|
|
|
28
28
|
return null;
|
|
29
29
|
const libs = scanInfo.getLibs();
|
|
30
30
|
const libInfos = [...scanInfo.getLibInfos().values()];
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const extendedModels = Object.fromEntries(
|
|
32
|
+
[...scanInfo.file.service.databases].map(
|
|
33
|
+
(modelName) => [
|
|
34
|
+
modelName,
|
|
35
|
+
libInfos.filter((libInfo) => libInfo.file.service.databases.has(modelName)).map((libInfo) => libInfo.name)
|
|
36
|
+
]
|
|
37
|
+
).filter(([_, libNames]) => libNames.length > 0)
|
|
35
38
|
);
|
|
36
|
-
const userLibInfos = libInfos.filter((libInfo) => libInfo.database.has("user"));
|
|
37
|
-
const settingLibInfos = libInfos.filter((libInfo) => libInfo.database.has("setting"));
|
|
38
|
-
const summaryLibInfos = libInfos.filter((libInfo) => libInfo.database.has("summary"));
|
|
39
39
|
return `
|
|
40
|
-
${libs.length ?
|
|
40
|
+
${libs.length ? `import { DbService, Srv } from "@akanjs/service";` : `import type { BackendEnv } from "@akanjs/base";`}
|
|
41
41
|
${libs.map((lib) => `import { option as ${lib}Option, srv as ${lib} } from "@${lib}/server";`).join("\n")}
|
|
42
42
|
|
|
43
43
|
import * as db from "../db";
|
|
@@ -45,34 +45,15 @@ import type * as srv from "../srv";
|
|
|
45
45
|
|
|
46
46
|
${libs.map((lib) => `export { srv as ${lib} } from "@${lib}/server";`).join("\n")}
|
|
47
47
|
|
|
48
|
-
${
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
${Object.entries(extendedModels).map(([modelName, extendedModels2]) => {
|
|
49
|
+
const ModelName = capitalize(modelName);
|
|
50
|
+
return `export const ${modelName} = {
|
|
51
|
+
services: [${extendedModels2.map((libName) => `${libName}.${ModelName}Service`).join(", ")}] as const,
|
|
52
|
+
}`;
|
|
53
|
+
}).join("\n")}
|
|
51
54
|
|
|
52
55
|
export const libAllSrvs = { ${libs.map((lib) => `...${lib}.allSrvs`).join(", ")} };
|
|
53
56
|
|
|
54
57
|
export type LibOptions = ${libs.length ? libs.map((lib) => `${lib}Option.ModulesOptions`).join(" & ") : "BackendEnv"};
|
|
55
|
-
${libs.length ? `
|
|
56
|
-
export class ProtoSummaryService extends ${libInfosHasSummary.length ? "ExtendedSummaryService(db.summaryDb, LibSummaryService)" : "DbService(db.summaryDb)"} {
|
|
57
|
-
@Srv() protected readonly userService: srv.UserService;
|
|
58
|
-
${databaseModulesWithoutExtendModels.map((module2) => ` @Srv() protected readonly ${module2}Service: srv.${capitalize(module2)}Service;`).join("\n")}
|
|
59
|
-
|
|
60
|
-
async get${capitalize(scanInfo.name)}Summary() {
|
|
61
|
-
return {
|
|
62
|
-
${databaseModulesWithoutExtendModels.map((module2) => ` ...(await this.${module2}Service.summarize()),`).join("\n")}
|
|
63
|
-
...(await this.userService.summarize${capitalize(scanInfo.name)}()),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
${scanInfo.exec.type === "app" ? `
|
|
67
|
-
async makeSummary(archiveType: "periodic" | "non-periodic" = "non-periodic"): Promise<db.Summary> {
|
|
68
|
-
const summary = {
|
|
69
|
-
${libInfosHasSummary.map((libInfo) => ` ...(await this.get${capitalize(libInfo.name)}Summary()),`).join("\n")}
|
|
70
|
-
...(await this.get${capitalize(scanInfo.name)}Summary()),
|
|
71
|
-
};
|
|
72
|
-
return (await this.summaryModel.archive(archiveType, summary)) as unknown as db.Summary;
|
|
73
|
-
}
|
|
74
|
-
` : ""}
|
|
75
|
-
}
|
|
76
|
-
` : ""}
|
|
77
58
|
`;
|
|
78
59
|
}
|
|
@@ -22,11 +22,29 @@ __export(cnst_exports, {
|
|
|
22
22
|
default: () => getContent
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(cnst_exports);
|
|
25
|
+
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
25
26
|
function getContent(scanInfo, dict = {}) {
|
|
27
|
+
if (!scanInfo)
|
|
28
|
+
return null;
|
|
29
|
+
const databaseModules = scanInfo.getDatabaseModules();
|
|
30
|
+
const scalarModules = scanInfo.getScalarModules();
|
|
26
31
|
return `
|
|
27
32
|
import type { AllSrvs } from "./srv";
|
|
33
|
+
import { cnstOf, scalarCnstOf } from "@akanjs/constant";
|
|
34
|
+
|
|
35
|
+
${databaseModules.map((module2) => `import * as ${module2} from "./${module2}/${module2}.constant";`).join("\n")}
|
|
36
|
+
${scalarModules.map((module2) => `import { ${capitalize(module2)} } from "./__scalar/${module2}/${module2}.constant";`).join("\n")}
|
|
37
|
+
|
|
38
|
+
export * from "./__lib/lib.constant";
|
|
39
|
+
${databaseModules.map((module2) => `export * from "./${module2}/${module2}.constant";`).join("\n")}
|
|
40
|
+
${scalarModules.map((module2) => `export * from "./__scalar/${module2}/${module2}.constant";`).join("\n")}
|
|
41
|
+
|
|
42
|
+
${databaseModules.map((module2) => {
|
|
43
|
+
const names = { Module: capitalize(module2) };
|
|
44
|
+
return `export const ${module2}Cnst = cnstOf("${module2}" as const, ${module2}.${names.Module}Input, ${module2}.${names.Module}, ${module2}.Light${names.Module}, ${module2}.${names.Module}Insight, ${module2}.${names.Module}Filter);`;
|
|
45
|
+
}).join("\n")}
|
|
46
|
+
${scalarModules.map((module2) => `export const ${module2}Cnst = scalarCnstOf("${module2}" as const, ${capitalize(module2)});`).join("\n")}
|
|
28
47
|
|
|
29
|
-
export * as cnst from "./cnst_";
|
|
30
48
|
export const Srvs = {} as AllSrvs;
|
|
31
49
|
`;
|
|
32
50
|
}
|
|
@@ -27,12 +27,10 @@ function getContent(scanInfo, dict = {}) {
|
|
|
27
27
|
return null;
|
|
28
28
|
const databaseModules = scanInfo.getDatabaseModules();
|
|
29
29
|
const scalarModules = scanInfo.getScalarModules();
|
|
30
|
-
const rootLib = scanInfo.akanConfig.rootLib;
|
|
31
30
|
return `
|
|
32
31
|
import { dbOf } from "@akanjs/document";
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
import { cnst } from "./cnst";
|
|
33
|
+
import * as cnst from "./cnst";
|
|
36
34
|
|
|
37
35
|
${databaseModules.map((module2) => `import * as ${module2} from "./${module2}/${module2}.document";`).join("\n")}
|
|
38
36
|
|
|
@@ -41,13 +39,8 @@ ${databaseModules.map((module2) => `export type * from "./${module2}/${module2}.
|
|
|
41
39
|
${scalarModules.map((module2) => `export type * from "./__scalar/${module2}/${module2}.document";`).join("\n")}
|
|
42
40
|
|
|
43
41
|
${databaseModules.map((module2) => {
|
|
44
|
-
const names = {
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
if (module2 === "setting" || module2 === "summary")
|
|
48
|
-
return `export const ${module2}Db = dbOf("${module2}" as const, ${module2}.${names.Module}Input, ${module2}.${names.Module}, ${module2}.${names.Module}Model, ${module2}.${names.Module}Middleware, cnst.${names.Module}, cnst.${rootLib ? "root." : ""}${names.Module}Insight, cnst.${rootLib ? "root." : ""}${names.Module}Filter);`;
|
|
49
|
-
else
|
|
50
|
-
return `export const ${module2}Db = dbOf("${module2}" as const, ${module2}.${names.Module}Input, ${module2}.${names.Module}, ${module2}.${names.Module}Model, ${module2}.${names.Module}Middleware, cnst.${names.Module}, cnst.${names.Module}Insight, cnst.${names.Module}Filter, cnst.${names.Module}Summary);`;
|
|
42
|
+
const names = { Module: module2.charAt(0).toUpperCase() + module2.slice(1) };
|
|
43
|
+
return `export const ${module2}Db = dbOf("${module2}" as const, ${module2}.${names.Module}Input, ${module2}.${names.Module}, ${module2}.${names.Module}Model, ${module2}.${names.Module}Middleware, cnst.${names.Module}, cnst.${names.Module}Insight, cnst.${names.Module}Filter);`;
|
|
51
44
|
}).join("\n")}
|
|
52
45
|
`;
|
|
53
46
|
}
|
|
@@ -31,12 +31,12 @@ function getContent(scanInfo, dict = {}) {
|
|
|
31
31
|
return `
|
|
32
32
|
import { makeDictionary, makeTrans } from "@akanjs/dictionary";
|
|
33
33
|
|
|
34
|
-
import {
|
|
34
|
+
import { allLibs } from "./__lib/lib.dictionary";
|
|
35
35
|
${databaseModules.map((module2) => `import { ${module2}Dictionary } from "./${module2}/${module2}.dictionary";`).join("\n")}
|
|
36
36
|
${serviceModules.map((module2) => `import { ${module2}Dictionary } from "./_${module2}/${module2}.dictionary";`).join("\n")}
|
|
37
37
|
${scalarModules.map((module2) => `import { ${module2}Dictionary } from "./__scalar/${module2}/${module2}.dictionary";`).join("\n")}
|
|
38
38
|
|
|
39
|
-
export const dictionary = makeDictionary(...
|
|
39
|
+
export const dictionary = makeDictionary(...allLibs, {
|
|
40
40
|
${[...databaseModules, ...scalarModules, ...serviceModules].map((module2) => `${module2}: ${module2}Dictionary`).join(",\n ")}
|
|
41
41
|
} as const);
|
|
42
42
|
|
|
@@ -26,8 +26,28 @@ var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
26
26
|
function getContent(scanInfo, dict = {}) {
|
|
27
27
|
if (!scanInfo)
|
|
28
28
|
return null;
|
|
29
|
+
const databaseModules = [...scanInfo.database.entries()].filter(([_, files]) => files.has("signal")).map(([module2]) => module2);
|
|
30
|
+
const scalarConstantModules = [...scanInfo.scalar.entries()].filter(([_, files]) => files.has("constant")).map(([module2]) => module2);
|
|
31
|
+
const serviceModules = [...scanInfo.service.entries()].filter(([_, files]) => files.has("signal")).map(([module2]) => module2);
|
|
29
32
|
return `
|
|
33
|
+
import { fetchOf, gqlOf, makeFetch, scalarUtilOf } from "@akanjs/signal";
|
|
34
|
+
|
|
35
|
+
import { root, libFetches } from "./__lib/lib.signal";
|
|
36
|
+
import * as cnst from "./cnst";
|
|
37
|
+
|
|
38
|
+
${[...scanInfo.database.entries()].filter(([_, files]) => files.has("signal")).map(([module2]) => `import { ${capitalize(module2)}Signal } from "./${module2}/${module2}.signal";`).join("\n")}
|
|
39
|
+
${[...scanInfo.service.entries()].filter(([_, files]) => files.has("signal")).map(([module2]) => `import { ${capitalize(module2)}Signal } from "./_${module2}/${module2}.signal";`).join("\n")}
|
|
40
|
+
|
|
30
41
|
${[...scanInfo.database.entries()].filter(([_, files]) => files.has("signal")).map(([module2]) => `export { ${capitalize(module2)}Signal } from "./${module2}/${module2}.signal";`).join("\n")}
|
|
31
42
|
${[...scanInfo.service.entries()].filter(([_, files]) => files.has("signal")).map(([module2]) => `export { ${capitalize(module2)}Signal } from "./_${module2}/${module2}.signal";`).join("\n")}
|
|
43
|
+
|
|
44
|
+
${databaseModules.map((module2) => `${["user", "setting", "summary"].includes(module2) ? "export " : ""}const ${module2}Gql = gqlOf(cnst.${module2}Cnst, ${capitalize(module2)}Signal${scanInfo.name !== "shared" && ["user", "setting", "summary"].includes(module2) ? `, { overwrite: root.${module2}Gql }` : ""});`).join("\n")}
|
|
45
|
+
|
|
46
|
+
export const fetch = makeFetch(...libFetches, {
|
|
47
|
+
${databaseModules.map((module2) => `...${module2}Gql,`).join("\n")}
|
|
48
|
+
${scalarConstantModules.map((module2) => `...scalarUtilOf(cnst.${module2}Cnst),`).join("\n")}
|
|
49
|
+
${serviceModules.map((module2) => `...fetchOf(${capitalize(module2)}Signal),`).join("\n")}
|
|
50
|
+
${databaseModules.map((module2) => `${module2}Gql,`).join("\n")}
|
|
51
|
+
});
|
|
32
52
|
`;
|
|
33
53
|
}
|