@akanjs/cli 0.0.40 → 0.0.42
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/index.d.ts +2 -2
- package/index.js +3787 -3286
- package/package.json +33 -2
- package/src/application/application.command.d.ts +26 -0
- package/src/application/application.prompt.d.ts +2 -0
- package/src/application/application.runner.d.ts +35 -0
- package/src/application/application.script.d.ts +36 -0
- package/src/cloud/cloud.command.d.ts +8 -0
- package/src/cloud/cloud.runner.d.ts +7 -0
- package/src/cloud/cloud.script.d.ts +7 -0
- package/src/library/library.command.d.ts +8 -0
- package/src/library/library.runner.d.ts +4 -0
- package/src/library/library.script.d.ts +8 -0
- package/src/module/module.command.d.ts +13 -0
- package/src/module/module.prompt.d.ts +15 -0
- package/src/module/module.runner.d.ts +17 -0
- package/src/module/module.script.d.ts +11 -0
- package/src/package/package.command.d.ts +9 -0
- package/src/package/package.runner.d.ts +6 -0
- package/src/package/package.script.d.ts +7 -0
- package/src/package/page/page.command.d.ts +6 -0
- package/src/package/page/page.runner.d.ts +4 -0
- package/src/package/page/page.script.d.ts +5 -0
- package/src/workspace/workspace.command.d.ts +8 -0
- package/src/workspace/workspace.runner.d.ts +6 -0
- package/src/workspace/workspace.script.d.ts +7 -0
- package/src/templates/__scalar/__model__/__model__.constant.js +0 -34
- package/src/templates/__scalar/__model__/__model__.dictionary.js +0 -45
- package/src/templates/__scalar/__model__/__model__.document.js +0 -32
- package/src/templates/app/akan.config.ts.template +0 -5
- package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +0 -43
- package/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +0 -44
- package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +0 -38
- package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +0 -46
- package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +0 -37
- package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +0 -39
- package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +0 -56
- package/src/templates/app/app/[lang]/(__appName__)/layout.js +0 -48
- package/src/templates/app/app/[lang]/admin/layout.js +0 -49
- package/src/templates/app/app/[lang]/admin/page.js +0 -59
- package/src/templates/app/app/csr.js +0 -30
- package/src/templates/app/app/index.html.template +0 -13
- package/src/templates/app/app/layout.js +0 -34
- package/src/templates/app/app/robots.js +0 -39
- package/src/templates/app/app/sitemap.js +0 -35
- package/src/templates/app/base/baseLogic.js +0 -34
- package/src/templates/app/base/index.js +0 -28
- package/src/templates/app/capacitor.config.ts.template +0 -8
- package/src/templates/app/common/commonLogic.js +0 -34
- package/src/templates/app/common/index.js +0 -28
- package/src/templates/app/env/env.client.js +0 -37
- package/src/templates/app/env/env.client.type.js +0 -34
- package/src/templates/app/env/env.server.js +0 -37
- package/src/templates/app/jest.config.js +0 -35
- package/src/templates/app/lib/___appName__/__appName__.dictionary.js +0 -30
- package/src/templates/app/lib/___appName__/__appName__.service.js +0 -41
- package/src/templates/app/lib/___appName__/__appName__.store.js +0 -35
- package/src/templates/app/lib/___appName__/_server.js +0 -33
- package/src/templates/app/lib/option.js +0 -41
- package/src/templates/app/lib/setting/Setting.Template.js +0 -53
- package/src/templates/app/lib/setting/Setting.Unit.js +0 -34
- package/src/templates/app/lib/setting/Setting.Util.js +0 -30
- package/src/templates/app/lib/setting/Setting.View.js +0 -47
- package/src/templates/app/lib/setting/Setting.Zone.js +0 -76
- package/src/templates/app/lib/setting/_server.js +0 -47
- package/src/templates/app/lib/setting/index.js +0 -57
- package/src/templates/app/lib/setting/setting.constant.js +0 -45
- package/src/templates/app/lib/setting/setting.dictionary.js +0 -45
- package/src/templates/app/lib/setting/setting.document.js +0 -47
- package/src/templates/app/lib/setting/setting.service.js +0 -36
- package/src/templates/app/lib/setting/setting.signal.js +0 -33
- package/src/templates/app/lib/setting/setting.store.js +0 -40
- package/src/templates/app/lib/summary/Summary.Template.js +0 -39
- package/src/templates/app/lib/summary/Summary.Unit.js +0 -34
- package/src/templates/app/lib/summary/Summary.Util.js +0 -29
- package/src/templates/app/lib/summary/Summary.View.js +0 -47
- package/src/templates/app/lib/summary/Summary.Zone.js +0 -58
- package/src/templates/app/lib/summary/_server.js +0 -47
- package/src/templates/app/lib/summary/index.js +0 -63
- package/src/templates/app/lib/summary/summary.constant.js +0 -43
- package/src/templates/app/lib/summary/summary.dictionary.js +0 -48
- package/src/templates/app/lib/summary/summary.document.js +0 -47
- package/src/templates/app/lib/summary/summary.service.js +0 -33
- package/src/templates/app/lib/summary/summary.signal.js +0 -33
- package/src/templates/app/lib/summary/summary.store.js +0 -40
- package/src/templates/app/lib/user/User.Template.js +0 -61
- package/src/templates/app/lib/user/User.Unit.js +0 -34
- package/src/templates/app/lib/user/User.Util.js +0 -90
- package/src/templates/app/lib/user/User.View.js +0 -62
- package/src/templates/app/lib/user/User.Zone.js +0 -70
- package/src/templates/app/lib/user/_server.js +0 -47
- package/src/templates/app/lib/user/index.js +0 -57
- package/src/templates/app/lib/user/user.constant.js +0 -66
- package/src/templates/app/lib/user/user.dictionary.js +0 -51
- package/src/templates/app/lib/user/user.document.js +0 -53
- package/src/templates/app/lib/user/user.service.js +0 -41
- package/src/templates/app/lib/user/user.signal.js +0 -33
- package/src/templates/app/lib/user/user.signal.spec.js +0 -36
- package/src/templates/app/lib/user/user.signal.test.js +0 -38
- package/src/templates/app/lib/user/user.store.js +0 -38
- package/src/templates/app/main.js +0 -39
- package/src/templates/app/middleware.js +0 -34
- package/src/templates/app/nest/backendLogic.js +0 -33
- package/src/templates/app/nest/index.js +0 -28
- package/src/templates/app/next/frontendLogic.js +0 -33
- package/src/templates/app/next/index.js +0 -28
- package/src/templates/app/page.test.ts.template +0 -10
- package/src/templates/app/playwright.config.ts.template +0 -6
- package/src/templates/app/postcss.config.js.template +0 -10
- package/src/templates/app/public/favicon.ico +0 -0
- package/src/templates/app/public/icons/icon-128x128.png +0 -0
- package/src/templates/app/public/icons/icon-144x144.png +0 -0
- package/src/templates/app/public/icons/icon-152x152.png +0 -0
- package/src/templates/app/public/icons/icon-192x192.png +0 -0
- package/src/templates/app/public/icons/icon-256x256.png +0 -0
- package/src/templates/app/public/icons/icon-384x384.png +0 -0
- package/src/templates/app/public/icons/icon-48x48.png +0 -0
- package/src/templates/app/public/icons/icon-512x512.png +0 -0
- package/src/templates/app/public/icons/icon-72x72.png +0 -0
- package/src/templates/app/public/icons/icon-96x96.png +0 -0
- package/src/templates/app/public/logo.svg +0 -70
- package/src/templates/app/public/manifest.json.template +0 -67
- package/src/templates/app/tsconfig.json.template +0 -22
- package/src/templates/app/tsconfig.spec.json.template +0 -7
- package/src/templates/app/ui/Footer.js +0 -63
- package/src/templates/app/ui/MainHeader.js +0 -127
- package/src/templates/app/ui/index.js +0 -29
- package/src/templates/client.js +0 -41
- package/src/templates/crudPages/[__model__Id]/edit/page.js +0 -69
- package/src/templates/crudPages/[__model__Id]/page.js +0 -79
- package/src/templates/crudPages/new/page.js +0 -66
- package/src/templates/crudPages/page.js +0 -67
- package/src/templates/index.js +0 -30
- package/src/templates/lib/__lib/extends/summary.constant.js +0 -42
- package/src/templates/lib/__lib/lib.constant.js +0 -52
- package/src/templates/lib/__lib/lib.dictionary.js +0 -41
- package/src/templates/lib/__lib/lib.document.js +0 -40
- package/src/templates/lib/__lib/lib.service.js +0 -82
- package/src/templates/lib/__lib/lib.signal.js +0 -35
- package/src/templates/lib/__lib/lib.store.js +0 -33
- package/src/templates/lib/__scalar/_server.js +0 -38
- package/src/templates/lib/cnst.js +0 -31
- package/src/templates/lib/cnst_.js +0 -50
- package/src/templates/lib/db.js +0 -52
- package/src/templates/lib/dict.js +0 -44
- package/src/templates/lib/fetch.js +0 -47
- package/src/templates/lib/sig.js +0 -36
- package/src/templates/lib/srv.js +0 -51
- package/src/templates/lib/st.js +0 -35
- package/src/templates/lib/store.js +0 -51
- package/src/templates/lib/usePage.js +0 -32
- package/src/templates/libRoot/.gitignore.template +0 -15
- package/src/templates/libRoot/jest.config.js +0 -35
- package/src/templates/libRoot/package.json.template +0 -5
- package/src/templates/libRoot/tsconfig.json.template +0 -11
- package/src/templates/libRoot/tsconfig.spec.json.template +0 -7
- package/src/templates/module/__Model__.Template.js +0 -50
- package/src/templates/module/__Model__.Unit.js +0 -38
- package/src/templates/module/__Model__.Util.js +0 -66
- package/src/templates/module/__Model__.View.js +0 -44
- package/src/templates/module/__Model__.Zone.js +0 -79
- package/src/templates/module/__model__.constant.js +0 -68
- package/src/templates/module/__model__.dictionary.js +0 -97
- package/src/templates/module/__model__.document.js +0 -52
- package/src/templates/module/__model__.service.js +0 -40
- package/src/templates/module/__model__.signal.js +0 -59
- package/src/templates/module/__model__.signal.spec.js +0 -38
- package/src/templates/module/__model__.signal.test.js +0 -47
- package/src/templates/module/__model__.store.js +0 -38
- package/src/templates/module/_server.js +0 -46
- package/src/templates/module/index.js +0 -57
- package/src/templates/pkgRoot/tsconfig.json.template +0 -12
- package/src/templates/server.js +0 -58
- package/src/templates/workplaceRoot/.env.template +0 -20
- package/src/templates/workplaceRoot/.gitignore.template +0 -195
- package/src/templates/workplaceRoot/.prettierignore.template +0 -10
- package/src/templates/workplaceRoot/.prettierrc.json.template +0 -5
- package/src/templates/workplaceRoot/.swcrc.template +0 -9
- package/src/templates/workplaceRoot/README.md.template +0 -37
- package/src/templates/workplaceRoot/eslint.config.js.template +0 -141
- package/src/templates/workplaceRoot/tsconfig.json.template +0 -29
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var summary_document_exports = {};
|
|
19
|
-
__export(summary_document_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(summary_document_exports);
|
|
23
|
-
function getContent(scanResult, dict = {}) {
|
|
24
|
-
return `
|
|
25
|
-
import { beyond, by, Database, inside, type SchemaOf } from "@akanjs/document";
|
|
26
|
-
|
|
27
|
-
import { rootSummary } from "../__lib/lib.document";
|
|
28
|
-
import { cnst } from "../cnst";
|
|
29
|
-
|
|
30
|
-
@Database.Input(() => cnst.SummaryInput)
|
|
31
|
-
export class SummaryInput extends by(rootSummary.Input, cnst.SummaryInput) {}
|
|
32
|
-
|
|
33
|
-
@Database.Document(() => cnst.Summary)
|
|
34
|
-
export class Summary extends by(rootSummary.Doc, cnst.Summary) {}
|
|
35
|
-
|
|
36
|
-
@Database.Model(() => cnst.Summary)
|
|
37
|
-
export class SummaryModel extends inside(rootSummary.Model, cnst.summaryCnst) {}
|
|
38
|
-
|
|
39
|
-
@Database.Middleware(() => cnst.Summary)
|
|
40
|
-
export class SummaryMiddleware extends beyond(SummaryModel, Summary) {
|
|
41
|
-
onSchema(schema: SchemaOf<SummaryModel, Summary>) {
|
|
42
|
-
//
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
module.exports = module.exports.default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var summary_service_exports = {};
|
|
19
|
-
__export(summary_service_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(summary_service_exports);
|
|
23
|
-
function getContent(scanResult, dict) {
|
|
24
|
-
return `
|
|
25
|
-
import { Service } from "@akanjs/service";
|
|
26
|
-
|
|
27
|
-
import { ProtoSummaryService } from "../__lib/lib.service";
|
|
28
|
-
|
|
29
|
-
@Service("SummaryService")
|
|
30
|
-
export class SummaryService extends ProtoSummaryService {}
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
module.exports = module.exports.default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var summary_signal_exports = {};
|
|
19
|
-
__export(summary_signal_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(summary_signal_exports);
|
|
23
|
-
function getContent(scanResult, dict = {}) {
|
|
24
|
-
return `
|
|
25
|
-
import { LogSignal, Signal } from "@akanjs/signal";
|
|
26
|
-
|
|
27
|
-
import { cnst, Srvs } from "../cnst";
|
|
28
|
-
|
|
29
|
-
@Signal(() => cnst.Summary)
|
|
30
|
-
export class SummarySignal extends LogSignal(Srvs) {}
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
module.exports = module.exports.default;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var summary_store_exports = {};
|
|
19
|
-
__export(summary_store_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(summary_store_exports);
|
|
23
|
-
function getContent(scanResult, dict = {}) {
|
|
24
|
-
return `
|
|
25
|
-
import { stateOf, Store } from "@akanjs/store";
|
|
26
|
-
|
|
27
|
-
import { cnst } from "../cnst";
|
|
28
|
-
import { fetch, summaryGql } from "../fetch";
|
|
29
|
-
|
|
30
|
-
@Store(() => cnst.Summary)
|
|
31
|
-
export class SummaryStore extends stateOf(summaryGql, {
|
|
32
|
-
// state
|
|
33
|
-
}) {
|
|
34
|
-
async getActiveSummary() {
|
|
35
|
-
this.set({ summary: (await fetch.getActiveSummary()) as cnst.Summary, summaryLoading: false });
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
module.exports = module.exports.default;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var User_Template_exports = {};
|
|
19
|
-
__export(User_Template_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(User_Template_exports);
|
|
23
|
-
function getContent(scanResult, dict) {
|
|
24
|
-
return `
|
|
25
|
-
"use client";
|
|
26
|
-
import { clsx } from "@akanjs/client";
|
|
27
|
-
import { Field } from "@shared/ui";
|
|
28
|
-
import { Layout } from "@util/ui";
|
|
29
|
-
import { st, usePage } from "@${dict.appName}/client";
|
|
30
|
-
|
|
31
|
-
interface UserEditProps {
|
|
32
|
-
className?: string;
|
|
33
|
-
userId?: string | null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const General = ({ className, userId = undefined }: UserEditProps) => {
|
|
37
|
-
const userForm = st.use.userForm();
|
|
38
|
-
const { l } = usePage();
|
|
39
|
-
return (
|
|
40
|
-
<Layout.Template className={clsx("flex flex-col gap-4", className)}>
|
|
41
|
-
<div className="w-[150px] flex mt-10 md:mt-0">
|
|
42
|
-
<Field.Img
|
|
43
|
-
label={l.field("user", "image")}
|
|
44
|
-
desc={l.desc("user", "image")}
|
|
45
|
-
sliceName="user"
|
|
46
|
-
value={userForm.image}
|
|
47
|
-
onChange={st.do.setImageOnUser}
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
<Field.Text
|
|
51
|
-
label={l.field("user", "nickname")}
|
|
52
|
-
desc={l.desc("user", "nickname")}
|
|
53
|
-
value={userForm.nickname}
|
|
54
|
-
onChange={st.do.setNicknameOnUser}
|
|
55
|
-
/>
|
|
56
|
-
</Layout.Template>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
`;
|
|
60
|
-
}
|
|
61
|
-
module.exports = module.exports.default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var User_Unit_exports = {};
|
|
19
|
-
__export(User_Unit_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(User_Unit_exports);
|
|
23
|
-
function getContent(scanResult, dict = {}) {
|
|
24
|
-
return `
|
|
25
|
-
import { ModelProps } from "@akanjs/client";
|
|
26
|
-
|
|
27
|
-
import { cnst } from "../cnst";
|
|
28
|
-
|
|
29
|
-
export const Card = ({ className, user }: ModelProps<"user", cnst.LightUser>) => {
|
|
30
|
-
return <div>{user.id}</div>;
|
|
31
|
-
};
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
34
|
-
module.exports = module.exports.default;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var User_Util_exports = {};
|
|
19
|
-
__export(User_Util_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(User_Util_exports);
|
|
23
|
-
function getContent(scanResult, dict) {
|
|
24
|
-
return `
|
|
25
|
-
"use client";
|
|
26
|
-
import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
|
|
27
|
-
import { getQueryMap } from "@akanjs/constant";
|
|
28
|
-
import { cnst, st } from "@${dict.appName}/client";
|
|
29
|
-
import { Data } from "@shared/ui";
|
|
30
|
-
import { AiOutlineEdit, AiOutlineLock, AiOutlineUnlock } from "react-icons/ai";
|
|
31
|
-
|
|
32
|
-
export const Stat = ({
|
|
33
|
-
className,
|
|
34
|
-
summary,
|
|
35
|
-
sliceName = "user",
|
|
36
|
-
queryMap = getQueryMap(cnst.UserSummary),
|
|
37
|
-
hidePresents,
|
|
38
|
-
}: ModelDashboardProps<cnst.Summary>) => {
|
|
39
|
-
return (
|
|
40
|
-
<Data.Dashboard
|
|
41
|
-
className={className}
|
|
42
|
-
summary={summary}
|
|
43
|
-
sliceName={sliceName}
|
|
44
|
-
queryMap={queryMap}
|
|
45
|
-
columns={["totalUser", "dau"]}
|
|
46
|
-
hidePresents={hidePresents}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
export const Insight = ({ className, insight, sliceName = "user" }: ModelInsightProps<cnst.UserInsight>) => {
|
|
51
|
-
return <Data.Insight className={className} insight={insight} sliceName={sliceName} columns={["count"]} />;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
interface RestrictProps {
|
|
55
|
-
id: string;
|
|
56
|
-
}
|
|
57
|
-
export const Restrict = ({ id }: RestrictProps) => {
|
|
58
|
-
return (
|
|
59
|
-
<button className="gap-2 btn btn-sm" onClick={() => st.do.restrictUser(id, "Violated Community Guidelines")}>
|
|
60
|
-
<AiOutlineLock />
|
|
61
|
-
Restrict
|
|
62
|
-
</button>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
interface ReleaseProps {
|
|
67
|
-
id: string;
|
|
68
|
-
}
|
|
69
|
-
export const Release = ({ id }: ReleaseProps) => {
|
|
70
|
-
return (
|
|
71
|
-
<button className="gap-2 border-dashed btn btn-sm btn-outline" onClick={() => st.do.releaseUser(id)}>
|
|
72
|
-
<AiOutlineUnlock />
|
|
73
|
-
Release
|
|
74
|
-
</button>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const EditSelf = () => {
|
|
79
|
-
const self = st.use.self();
|
|
80
|
-
const userModal = st.use.userModal();
|
|
81
|
-
return userModal !== "edit" ? (
|
|
82
|
-
<button className="gap-2 btn" onClick={() => st.do.editUser(self)}>
|
|
83
|
-
<AiOutlineEdit />
|
|
84
|
-
Edit
|
|
85
|
-
</button>
|
|
86
|
-
) : null;
|
|
87
|
-
};
|
|
88
|
-
`;
|
|
89
|
-
}
|
|
90
|
-
module.exports = module.exports.default;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var User_View_exports = {};
|
|
19
|
-
__export(User_View_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(User_View_exports);
|
|
23
|
-
function getContent(scanResult, dict) {
|
|
24
|
-
return `
|
|
25
|
-
import { clsx } from "@akanjs/client";
|
|
26
|
-
import { usePage } from "@${dict.appName}/client";
|
|
27
|
-
import { Avatar } from "@util/ui";
|
|
28
|
-
import { AiOutlineUser } from "react-icons/ai";
|
|
29
|
-
|
|
30
|
-
import { cnst } from "../cnst";
|
|
31
|
-
|
|
32
|
-
interface UserViewProps {
|
|
33
|
-
className?: string;
|
|
34
|
-
user: cnst.User;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const General = ({ className, user }: UserViewProps) => {
|
|
38
|
-
const { l } = usePage();
|
|
39
|
-
return (
|
|
40
|
-
<div className={clsx("flex flex-col gap-4", className)}>
|
|
41
|
-
<div>
|
|
42
|
-
<div className="font-bold">Profile</div>
|
|
43
|
-
<div className="text-base">
|
|
44
|
-
<Avatar
|
|
45
|
-
className="flex items-center justify-center w-24 h-24"
|
|
46
|
-
icon={<AiOutlineUser className="text-4xl" />}
|
|
47
|
-
src={user.image?.url}
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
<div>
|
|
52
|
-
<div className="flex gap-2 items-center">
|
|
53
|
-
<div className="font-bold">Nickname</div>
|
|
54
|
-
</div>
|
|
55
|
-
<p className="text-base">{user.nickname}</p>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
module.exports = module.exports.default;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var User_Zone_exports = {};
|
|
19
|
-
__export(User_Zone_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(User_Zone_exports);
|
|
23
|
-
function getContent(scanResult, dict) {
|
|
24
|
-
return `
|
|
25
|
-
"use client";
|
|
26
|
-
import { ModelsProps } from "@akanjs/client";
|
|
27
|
-
import { DefaultOf } from "@akanjs/signal";
|
|
28
|
-
import { cnst, st, User } from "@${dict.appName}/client";
|
|
29
|
-
import { Data, Model } from "@shared/ui";
|
|
30
|
-
|
|
31
|
-
export const Admin = ({ sliceName = "user", init, query }: ModelsProps<cnst.User>) => {
|
|
32
|
-
return (
|
|
33
|
-
<Data.ListContainer
|
|
34
|
-
init={init}
|
|
35
|
-
query={query}
|
|
36
|
-
sliceName={sliceName}
|
|
37
|
-
renderItem={User.Unit.Card}
|
|
38
|
-
renderDashboard={User.Util.Stat}
|
|
39
|
-
renderInsight={User.Util.Insight}
|
|
40
|
-
renderTemplate={User.Template.General}
|
|
41
|
-
renderTitle={(user: DefaultOf<cnst.User>) => \`\${user.nickname}\`}
|
|
42
|
-
renderView={(user: cnst.User) => <User.View.General user={user} />}
|
|
43
|
-
type="list"
|
|
44
|
-
columns={["nickname", "status", "lastLoginAt", "createdAt"]}
|
|
45
|
-
actions={(user: cnst.LightUser, idx) => [
|
|
46
|
-
"remove",
|
|
47
|
-
"edit",
|
|
48
|
-
"view",
|
|
49
|
-
user.status === "active"
|
|
50
|
-
? { type: "restrict", render: () => <User.Util.Restrict id={user.id} /> }
|
|
51
|
-
: { type: "release", render: () => <User.Util.Release id={user.id} /> },
|
|
52
|
-
]}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Self = () => {
|
|
58
|
-
const self = st.use.self();
|
|
59
|
-
const userModal = st.use.userModal();
|
|
60
|
-
return userModal === "edit" ? (
|
|
61
|
-
<Model.EditModal type="form" sliceName="user" submitOption={{ path: "self" }}>
|
|
62
|
-
<User.Template.General />
|
|
63
|
-
</Model.EditModal>
|
|
64
|
-
) : (
|
|
65
|
-
<User.View.General user={self} />
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
`;
|
|
69
|
-
}
|
|
70
|
-
module.exports = module.exports.default;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var server_exports = {};
|
|
19
|
-
__export(server_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(server_exports);
|
|
23
|
-
function getContent(scanResult, dict = {}) {
|
|
24
|
-
return `
|
|
25
|
-
import { databaseModuleOf } from "@akanjs/server";
|
|
26
|
-
|
|
27
|
-
import { cnst } from "../cnst";
|
|
28
|
-
import * as db from "../db";
|
|
29
|
-
import type { ModulesOptions } from "../option";
|
|
30
|
-
import { allSrvs } from "../srv";
|
|
31
|
-
import { UserService } from "./user.service";
|
|
32
|
-
import { UserSignal } from "./user.signal";
|
|
33
|
-
|
|
34
|
-
export const registerUserModule = (option: ModulesOptions) =>
|
|
35
|
-
databaseModuleOf(
|
|
36
|
-
{
|
|
37
|
-
constant: cnst.userCnst,
|
|
38
|
-
database: db.userDb,
|
|
39
|
-
signal: UserSignal,
|
|
40
|
-
service: UserService,
|
|
41
|
-
extended: true,
|
|
42
|
-
},
|
|
43
|
-
allSrvs
|
|
44
|
-
);
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
module.exports = module.exports.default;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var user_exports = {};
|
|
19
|
-
__export(user_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(user_exports);
|
|
23
|
-
function getContent(scanResult, dict = {}) {
|
|
24
|
-
return `
|
|
25
|
-
import { Signal } from "@util/ui";
|
|
26
|
-
import { AiOutlineUser } from "react-icons/ai";
|
|
27
|
-
|
|
28
|
-
import * as Template from "./User.Template";
|
|
29
|
-
import * as Unit from "./User.Unit";
|
|
30
|
-
import * as Util from "./User.Util";
|
|
31
|
-
import * as View from "./User.View";
|
|
32
|
-
import * as Zone from "./User.Zone";
|
|
33
|
-
|
|
34
|
-
export const User = {
|
|
35
|
-
Menu: {
|
|
36
|
-
Admin: {
|
|
37
|
-
key: "user",
|
|
38
|
-
label: "User",
|
|
39
|
-
icon: <AiOutlineUser />,
|
|
40
|
-
render: () => <Zone.Admin />,
|
|
41
|
-
},
|
|
42
|
-
Doc: {
|
|
43
|
-
key: "user",
|
|
44
|
-
label: "User",
|
|
45
|
-
icon: <AiOutlineUser />,
|
|
46
|
-
render: () => <Signal.Doc.Zone refName="user" />,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
Template,
|
|
50
|
-
Unit,
|
|
51
|
-
Util,
|
|
52
|
-
View,
|
|
53
|
-
Zone,
|
|
54
|
-
};
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
module.exports = module.exports.default;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var user_constant_exports = {};
|
|
19
|
-
__export(user_constant_exports, {
|
|
20
|
-
default: () => getContent
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(user_constant_exports);
|
|
23
|
-
function getContent(scanResult, dict) {
|
|
24
|
-
return `
|
|
25
|
-
import { as, from, Model, sortOf, via } from "@akanjs/constant";
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
libUserFilters,
|
|
29
|
-
libUserInputs,
|
|
30
|
-
libUserInsights,
|
|
31
|
-
libUsers,
|
|
32
|
-
libUserSummaries,
|
|
33
|
-
root,
|
|
34
|
-
} from "../__lib/lib.constant";
|
|
35
|
-
|
|
36
|
-
@Model.Input("${dict.AppName}UserInput")
|
|
37
|
-
export class ${dict.AppName}UserInput {}
|
|
38
|
-
|
|
39
|
-
@Model.Object("${dict.AppName}User")
|
|
40
|
-
export class ${dict.AppName}User extends as(${dict.AppName}UserInput) {}
|
|
41
|
-
|
|
42
|
-
@Model.Insight("${dict.AppName}UserInsight")
|
|
43
|
-
export class ${dict.AppName}UserInsight {}
|
|
44
|
-
|
|
45
|
-
@Model.Summary("${dict.AppName}UserSummary")
|
|
46
|
-
export class ${dict.AppName}UserSummary {}
|
|
47
|
-
|
|
48
|
-
@Model.Filter("${dict.AppName}UserFilter")
|
|
49
|
-
export class ${dict.AppName}UserFilter extends sortOf(root.User, {}) {}
|
|
50
|
-
|
|
51
|
-
export class UserInput extends from(...libUserInputs, ${dict.AppName}UserInput) {}
|
|
52
|
-
export class UserObject extends from(...libUsers, ${dict.AppName}User) {}
|
|
53
|
-
|
|
54
|
-
@Model.Light("LightUser")
|
|
55
|
-
export class LightUser extends via(UserObject, ["nickname", "image", "roles", "status"] as const) {}
|
|
56
|
-
|
|
57
|
-
@Model.Full("User")
|
|
58
|
-
export class User extends via(UserObject, LightUser, root.User, root.LightUser) {}
|
|
59
|
-
|
|
60
|
-
export class UserSummary extends from(...libUserSummaries, ${dict.AppName}UserSummary) {}
|
|
61
|
-
export class UserInsight extends from(...libUserInsights, ${dict.AppName}UserInsight) {}
|
|
62
|
-
|
|
63
|
-
export class UserFilter extends from(...libUserFilters, ${dict.AppName}UserFilter) {}
|
|
64
|
-
`;
|
|
65
|
-
}
|
|
66
|
-
module.exports = module.exports.default;
|