@cyberskill/shared 1.208.0 → 1.209.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-CwzVfkkX.js +6 -0
- package/dist/index-BG1UznTl.js +628 -0
- package/dist/{magic-string.es-C6Zk6wMx.js → magic-string.es-BQ9KnLz-.js} +105 -117
- package/dist/src/config/config.type.d.ts +1 -1
- package/dist/src/config/config.util.d.ts +1 -1
- package/dist/src/config/config.util.js +48 -7
- package/dist/src/config/env/env.util.js +10 -10
- package/dist/src/config/eslint/index.js +4 -15
- package/dist/src/config/graphql-codegen/graphql-codegen.util.js +30 -39
- package/dist/src/config/index.js +1 -1
- package/dist/src/config/vitest/vitest.e2e.js +9 -19
- package/dist/src/config/vitest/vitest.unit.js +11 -22
- package/dist/src/config/vitest/vitest.unit.setup.js +9339 -9868
- package/dist/src/constant/common.js +1 -1
- package/dist/src/node/apollo-server/apollo-server.util.js +23 -54
- package/dist/src/node/cli/index.d.ts +2 -1
- package/dist/src/node/cli/index.js +108 -1
- package/dist/src/node/command/command.util.js +9 -10
- package/dist/src/node/command/index.js +1 -1
- package/dist/src/node/express/express.util.js +39 -77
- package/dist/src/node/express/index.js +9 -9
- package/dist/src/node/fs/fs.util.js +40 -59
- package/dist/src/node/log/index.js +6 -6
- package/dist/src/node/log/log.util.js +32 -33
- package/dist/src/node/mongo/mongo.util.js +381 -457
- package/dist/src/node/package/index.js +3 -3
- package/dist/src/node/package/package.util.js +2 -2
- package/dist/src/node/path/index.js +30 -30
- package/dist/src/node/path/path.constant.js +30 -30
- package/dist/src/node/storage/storage.util.js +40 -70
- package/dist/src/node/upload/index.js +1 -1
- package/dist/src/node/upload/upload.util.js +125 -6
- package/dist/src/react/apollo-client/apollo-client.component.js +15 -13
- package/dist/src/react/apollo-client/apollo-client.type.d.ts +1 -1
- package/dist/src/react/apollo-client/apollo-client.util.js +66 -81
- package/dist/src/react/apollo-client/index.js +25 -26
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.js +7 -8
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -21
- package/dist/src/react/apollo-error/apollo-error.component.js +7 -7
- package/dist/src/react/apollo-error/apollo-error.util.js +7 -7
- package/dist/src/react/loading/loading.component.js +24 -45
- package/dist/src/react/loading/loading.provider.d.ts +1 -1
- package/dist/src/react/log/log.util.js +9 -9
- package/dist/src/react/next-intl/next-intl.hoc.d.ts +1 -1
- package/dist/src/react/next-intl/next-intl.hoc.js +17 -29
- package/dist/src/react/next-intl/next-intl.provider.js +18 -19
- package/dist/src/react/next-intl/next-intl.type.d.ts +1 -1
- package/dist/src/react/storage/storage.hook.js +37 -53
- package/dist/src/react/storage/storage.util.js +25 -50
- package/dist/src/react/userback/userback.component.js +16 -43
- package/dist/src/typescript/index.d.ts +2 -2
- package/dist/src/typescript/index.js +2 -2
- package/dist/src/typescript/style.d.js +1 -1
- package/dist/src/util/common/common.util.js +14 -25
- package/dist/src/util/object/object.util.d.ts +1 -1
- package/dist/src/util/object/object.util.js +39 -49
- package/dist/src/util/string/string.util.js +40 -53
- package/dist/style.css +1 -1
- package/package.json +43 -76
- package/dist/config-B7WSlzSh.js +0 -8
- package/dist/config-DDQ9k8fw.cjs +0 -1
- package/dist/config.util-Ci2CZDut.cjs +0 -1
- package/dist/config.util-DKBwEBKR.js +0 -61
- package/dist/favicon/android-icon-144x144.png +0 -0
- package/dist/favicon/android-icon-192x192.png +0 -0
- package/dist/favicon/android-icon-36x36.png +0 -0
- package/dist/favicon/android-icon-48x48.png +0 -0
- package/dist/favicon/android-icon-72x72.png +0 -0
- package/dist/favicon/android-icon-96x96.png +0 -0
- package/dist/favicon/apple-icon-114x114.png +0 -0
- package/dist/favicon/apple-icon-120x120.png +0 -0
- package/dist/favicon/apple-icon-144x144.png +0 -0
- package/dist/favicon/apple-icon-152x152.png +0 -0
- package/dist/favicon/apple-icon-180x180.png +0 -0
- package/dist/favicon/apple-icon-57x57.png +0 -0
- package/dist/favicon/apple-icon-60x60.png +0 -0
- package/dist/favicon/apple-icon-72x72.png +0 -0
- package/dist/favicon/apple-icon-76x76.png +0 -0
- package/dist/favicon/apple-icon-precomposed.png +0 -0
- package/dist/favicon/apple-icon.png +0 -0
- package/dist/favicon/browserconfig.xml +0 -2
- package/dist/favicon/favicon-16x16.png +0 -0
- package/dist/favicon/favicon-32x32.png +0 -0
- package/dist/favicon/favicon-96x96.png +0 -0
- package/dist/favicon/favicon.ico +0 -0
- package/dist/favicon/manifest.json +0 -41
- package/dist/favicon/ms-icon-144x144.png +0 -0
- package/dist/favicon/ms-icon-150x150.png +0 -0
- package/dist/favicon/ms-icon-310x310.png +0 -0
- package/dist/favicon/ms-icon-70x70.png +0 -0
- package/dist/log.type-CMvG6Box.cjs +0 -1
- package/dist/log.type-DTOvZHyz.js +0 -4
- package/dist/magic-string.es-CjWtD8Pa.cjs +0 -10
- package/dist/path.constant-CWtb99gS.cjs +0 -2
- package/dist/path.constant-CvSr0Rrx.js +0 -682
- package/dist/src/config/commitlint/index.cjs +0 -1
- package/dist/src/config/config.util.cjs +0 -1
- package/dist/src/config/env/env.constant.cjs +0 -1
- package/dist/src/config/env/env.d.cjs +0 -1
- package/dist/src/config/env/env.d.js +0 -1
- package/dist/src/config/env/env.util.cjs +0 -1
- package/dist/src/config/env/index.cjs +0 -1
- package/dist/src/config/eslint/index.cjs +0 -1
- package/dist/src/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
- package/dist/src/config/graphql-codegen/index.cjs +0 -1
- package/dist/src/config/index.cjs +0 -1
- package/dist/src/config/lint-staged/index.cjs +0 -1
- package/dist/src/config/vitest/index.cjs +0 -1
- package/dist/src/config/vitest/vitest.e2e.cjs +0 -1
- package/dist/src/config/vitest/vitest.unit.cjs +0 -1
- package/dist/src/config/vitest/vitest.unit.setup.cjs +0 -508
- package/dist/src/constant/common.cjs +0 -1
- package/dist/src/constant/index.cjs +0 -1
- package/dist/src/constant/response-status.cjs +0 -1
- package/dist/src/node/apollo-server/apollo-server.util.cjs +0 -1
- package/dist/src/node/apollo-server/index.cjs +0 -1
- package/dist/src/node/cli/cli.util.cjs +0 -6
- package/dist/src/node/cli/cli.util.d.ts +0 -2
- package/dist/src/node/cli/cli.util.js +0 -171
- package/dist/src/node/cli/index.cjs +0 -1
- package/dist/src/node/command/command.util.cjs +0 -1
- package/dist/src/node/command/index.cjs +0 -1
- package/dist/src/node/express/express.util.cjs +0 -1
- package/dist/src/node/express/index.cjs +0 -1
- package/dist/src/node/fs/fs.util.cjs +0 -1
- package/dist/src/node/fs/index.cjs +0 -1
- package/dist/src/node/log/index.cjs +0 -1
- package/dist/src/node/log/log.util.cjs +0 -1
- package/dist/src/node/mongo/index.cjs +0 -1
- package/dist/src/node/mongo/mongo.constant.cjs +0 -1
- package/dist/src/node/mongo/mongo.util.cjs +0 -5
- package/dist/src/node/package/index.cjs +0 -1
- package/dist/src/node/package/package.util.cjs +0 -1
- package/dist/src/node/path/index.cjs +0 -1
- package/dist/src/node/path/path.constant.cjs +0 -1
- package/dist/src/node/path/path.util.cjs +0 -1
- package/dist/src/node/storage/index.cjs +0 -1
- package/dist/src/node/storage/storage.util.cjs +0 -1
- package/dist/src/node/upload/index.cjs +0 -1
- package/dist/src/node/upload/upload.util.cjs +0 -1
- package/dist/src/node/ws/index.cjs +0 -1
- package/dist/src/node/ws/ts.util.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.component.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.constant.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.context.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.hook.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.util.cjs +0 -1
- package/dist/src/react/apollo-client/index.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/index.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.component.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.context.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.hook.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.provider.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.util.cjs +0 -1
- package/dist/src/react/apollo-error/index.cjs +0 -1
- package/dist/src/react/i18next/i18next.hook.cjs +0 -1
- package/dist/src/react/i18next/i18next.util.cjs +0 -1
- package/dist/src/react/i18next/index.cjs +0 -1
- package/dist/src/react/loading/index.cjs +0 -1
- package/dist/src/react/loading/loading.component.cjs +0 -6
- package/dist/src/react/loading/loading.context.cjs +0 -1
- package/dist/src/react/loading/loading.hook.cjs +0 -1
- package/dist/src/react/loading/loading.provider.cjs +0 -1
- package/dist/src/react/log/index.cjs +0 -1
- package/dist/src/react/log/log.util.cjs +0 -1
- package/dist/src/react/next-intl/index.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.constant.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.context.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.hoc.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.hook.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.provider.cjs +0 -1
- package/dist/src/react/storage/index.cjs +0 -1
- package/dist/src/react/storage/storage.hook.cjs +0 -1
- package/dist/src/react/storage/storage.util.cjs +0 -1
- package/dist/src/react/toast/index.cjs +0 -1
- package/dist/src/react/userback/index.cjs +0 -1
- package/dist/src/react/userback/userback.component.cjs +0 -1
- package/dist/src/typescript/common.cjs +0 -1
- package/dist/src/typescript/common.js +0 -4
- package/dist/src/typescript/index.cjs +0 -1
- package/dist/src/typescript/react.cjs +0 -1
- package/dist/src/typescript/react.js +0 -1
- package/dist/src/typescript/style.d.cjs +0 -1
- package/dist/src/util/common/common.util.cjs +0 -1
- package/dist/src/util/common/index.cjs +0 -1
- package/dist/src/util/index.cjs +0 -1
- package/dist/src/util/object/index.cjs +0 -1
- package/dist/src/util/object/object.util.cjs +0 -1
- package/dist/src/util/serializer/index.cjs +0 -1
- package/dist/src/util/serializer/serializer.util.cjs +0 -1
- package/dist/src/util/string/index.cjs +0 -1
- package/dist/src/util/string/string.util.cjs +0 -1
- package/dist/src/util/validate/index.cjs +0 -1
- package/dist/src/util/validate/validate.util.cjs +0 -1
- package/dist/tsconfig.base.json +0 -37
- package/dist/upload.util-CE3MjBdh.cjs +0 -1
- package/dist/upload.util-D4aUdmPo.js +0 -160
- /package/dist/src/typescript/{common.d.ts → common.type.d.ts} +0 -0
- /package/dist/src/typescript/{react.d.ts → react.type.d.ts} +0 -0
|
@@ -1,62 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var e of S(l))
|
|
9
|
-
p.call(l, e) && c(r, e, l[e]);
|
|
10
|
-
return r;
|
|
11
|
-
};
|
|
12
|
-
var t = (r, l, e) => new Promise((n, v) => {
|
|
13
|
-
var d = (a) => {
|
|
14
|
-
try {
|
|
15
|
-
o(e.next(a));
|
|
16
|
-
} catch (i) {
|
|
17
|
-
v(i);
|
|
18
|
-
}
|
|
19
|
-
}, m = (a) => {
|
|
20
|
-
try {
|
|
21
|
-
o(e.throw(a));
|
|
22
|
-
} catch (i) {
|
|
23
|
-
v(i);
|
|
24
|
-
}
|
|
25
|
-
}, o = (a) => a.done ? n(a.value) : Promise.resolve(a.value).then(d, m);
|
|
26
|
-
o((e = e.apply(r, l)).next());
|
|
27
|
-
});
|
|
28
|
-
import { ApolloServer as s } from "@apollo/server";
|
|
29
|
-
import { expressMiddleware as M } from "@apollo/server/express4";
|
|
30
|
-
import { ApolloServerPluginDrainHttpServer as A } from "@apollo/server/plugin/drainHttpServer";
|
|
31
|
-
import { ApolloServerPluginLandingPageLocalDefault as P, ApolloServerPluginLandingPageProductionDefault as D } from "@apollo/server/plugin/landingPage/default";
|
|
32
|
-
import { log as h } from "../log/log.util.js";
|
|
33
|
-
function E(r) {
|
|
34
|
-
return new s(u({
|
|
1
|
+
import { ApolloServer as e } from "@apollo/server";
|
|
2
|
+
import { expressMiddleware as d } from "@apollo/server/express4";
|
|
3
|
+
import { ApolloServerPluginDrainHttpServer as l } from "@apollo/server/plugin/drainHttpServer";
|
|
4
|
+
import { ApolloServerPluginLandingPageLocalDefault as o, ApolloServerPluginLandingPageProductionDefault as a } from "@apollo/server/plugin/landingPage/default";
|
|
5
|
+
import { log as n } from "../log/log.util.js";
|
|
6
|
+
function c(r) {
|
|
7
|
+
return new e({
|
|
35
8
|
schema: r.schema,
|
|
36
9
|
plugins: [
|
|
37
|
-
r.isDev ?
|
|
38
|
-
|
|
10
|
+
r.isDev ? o() : a(),
|
|
11
|
+
l({ httpServer: r.server }),
|
|
39
12
|
...r.drainServer ? [{
|
|
40
|
-
serverWillStart() {
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
drainServer()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(n = r.drainServer) == null || n.call(r), h.info("Apollo Server drainServer hook called");
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
});
|
|
13
|
+
async serverWillStart() {
|
|
14
|
+
return {
|
|
15
|
+
async drainServer() {
|
|
16
|
+
r.drainServer?.(), n.info("Apollo Server drainServer hook called");
|
|
17
|
+
}
|
|
18
|
+
};
|
|
51
19
|
}
|
|
52
20
|
}] : []
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
21
|
+
],
|
|
22
|
+
...r.isDev && {
|
|
23
|
+
introspection: !0,
|
|
24
|
+
includeStacktraceInErrorResponses: !0
|
|
25
|
+
}
|
|
26
|
+
});
|
|
58
27
|
}
|
|
59
28
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
29
|
+
c as createApolloServer,
|
|
30
|
+
d as expressMiddleware
|
|
62
31
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
|
@@ -1 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import g from "node:process";
|
|
3
|
+
import { hideBin as C } from "yargs/helpers";
|
|
4
|
+
import L from "yargs/yargs";
|
|
5
|
+
import { C as M, c as r, r as t, a as i, g as _, b as l, i as f, P as e, d as O, e as R, S as p, f as G } from "../../../index-BG1UznTl.js";
|
|
6
|
+
import { removeSync as y, readFileSync as E, pathExistsSync as h, writeFileSync as u, appendFileSync as N } from "../fs/fs.util.js";
|
|
7
|
+
import { resolve as P } from "../path/path.util.js";
|
|
8
|
+
import { log as s, catchError as T } from "../log/log.util.js";
|
|
9
|
+
import { E_IssueType as d } from "../log/index.js";
|
|
10
|
+
function D() {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(
|
|
13
|
+
E(P(__dirname, "../../../package.json"), "utf-8")
|
|
14
|
+
).version;
|
|
15
|
+
} catch {
|
|
16
|
+
return "1.0.0";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function S() {
|
|
20
|
+
h(e.TS_CONFIG) ? await t("Performing TypeScript validation", await i.typescriptCheck()) : s.warn("No TypeScript configuration found. Skipping type check.");
|
|
21
|
+
}
|
|
22
|
+
async function k(n = !1) {
|
|
23
|
+
n ? await t("Running ESLint with auto-fix", await i.eslintFix()) : await t("Running ESLint check", await i.eslintCheck());
|
|
24
|
+
}
|
|
25
|
+
function w(n, a) {
|
|
26
|
+
if (!a.length)
|
|
27
|
+
return;
|
|
28
|
+
const o = n === "Errors" ? "red" : "yellow";
|
|
29
|
+
s.printBoxedLog(n === "Errors" ? "✖ Errors" : "⚠ Warnings", a, o);
|
|
30
|
+
}
|
|
31
|
+
async function c() {
|
|
32
|
+
setTimeout(async () => {
|
|
33
|
+
const n = await O(), a = n.filter((m) => m.type === d.Error), o = n.filter((m) => m.type === d.Warning);
|
|
34
|
+
!a.length && !o.length ? s.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (w("Warnings", o), w("Errors", a), a.length > 0 && g.exit(1));
|
|
35
|
+
}, 0);
|
|
36
|
+
}
|
|
37
|
+
async function v() {
|
|
38
|
+
await r();
|
|
39
|
+
const n = await _({ name: l });
|
|
40
|
+
if (!n.success) {
|
|
41
|
+
s.error("Failed to retrieve package information. Aborting lint-staged.");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
n.result.isCurrentProject && await t(`Building package: ${l}`, await i.build()), await t("Executing lint-staged", await i.lintStaged()), c();
|
|
45
|
+
}
|
|
46
|
+
async function B() {
|
|
47
|
+
await t("Inspecting ESLint configuration", await i.eslintInspect());
|
|
48
|
+
}
|
|
49
|
+
async function x() {
|
|
50
|
+
await r(), await Promise.all([S(), k()]), c();
|
|
51
|
+
}
|
|
52
|
+
async function A() {
|
|
53
|
+
await r(), await Promise.all([S(), k(!0)]), c();
|
|
54
|
+
}
|
|
55
|
+
async function F() {
|
|
56
|
+
await r(), await t("Validating commit message", await i.commitLint()), c();
|
|
57
|
+
}
|
|
58
|
+
async function I() {
|
|
59
|
+
await t("Configuring Git hooks", await i.configureGitHook()), y(e.GIT_HOOK);
|
|
60
|
+
const n = await R(G);
|
|
61
|
+
u(e.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(n, null, 4));
|
|
62
|
+
const a = `
|
|
63
|
+
${p}
|
|
64
|
+
`;
|
|
65
|
+
h(e.GIT_IGNORE) ? E(e.GIT_IGNORE, "utf-8").split(`
|
|
66
|
+
`).includes(p) || N(e.GIT_IGNORE, a) : u(e.GIT_IGNORE, a), await t("Setting up simple-git-hooks", await i.simpleGitHooks());
|
|
67
|
+
}
|
|
68
|
+
async function H() {
|
|
69
|
+
await f(), await I();
|
|
70
|
+
}
|
|
71
|
+
async function U() {
|
|
72
|
+
y(e.NODE_MODULES, e.PNPM_LOCK_YAML), await t("Pruning pnpm store", await i.pnpmPruneStore()), await t("Clearing pnpm cache", await i.pnpmCleanCache()), await f(), await I();
|
|
73
|
+
}
|
|
74
|
+
async function b() {
|
|
75
|
+
await t("Inspecting project dependencies", await i.nodeModulesInspect());
|
|
76
|
+
}
|
|
77
|
+
async function K() {
|
|
78
|
+
await t("Running unit tests", await i.testUnit());
|
|
79
|
+
}
|
|
80
|
+
async function j() {
|
|
81
|
+
await t("Running end-to-end tests", await i.testE2e());
|
|
82
|
+
}
|
|
83
|
+
async function J(n) {
|
|
84
|
+
await t("Creating MongoDB migration", await i.mongoMigrateCreate(n));
|
|
85
|
+
}
|
|
86
|
+
async function V() {
|
|
87
|
+
await t("Running MongoDB migrations", await i.mongoMigrateUp());
|
|
88
|
+
}
|
|
89
|
+
async function W() {
|
|
90
|
+
await t("Rolling back MongoDB migration", await i.mongoMigrateDown());
|
|
91
|
+
}
|
|
92
|
+
(async () => {
|
|
93
|
+
try {
|
|
94
|
+
await L(C(g.argv)).scriptName(M).usage("$0 <command> [options]").command("lint", "Check code for linting issues", x).command("lint:fix", "Fix linting issues automatically", A).command("lint:inspect", "View active ESLint configuration", B).command("lint-staged", "Run lint checks on staged files", v).command("commitlint", "Validate commit message format", F).command("ready", "Initialize project and dependencies", H).command("reset", "Reset the project and reinstall dependencies", U).command("inspect", "Analyze installed project dependencies", b).command("test:unit", "Run unit test suite", K).command("test:e2e", "Run end-to-end test suite", j).command("mongo:migrate:create <name>", "Create a MongoDB migration", (n) => n.positional("name", {
|
|
95
|
+
describe: "Migration name",
|
|
96
|
+
type: "string"
|
|
97
|
+
}), async (n) => {
|
|
98
|
+
if (!n.name) {
|
|
99
|
+
s.error("Migration name is required.");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
await J(n.name);
|
|
103
|
+
}).command("mongo:migrate:up", "Apply all MongoDB migrations", V).command("mongo:migrate:down", "Rollback last MongoDB migration", W).demandCommand(1, "Please specify a valid command.").strict().help().alias("h", "help").alias("v", "version").version(D()).epilog(`💡 Tip: Use "--help" with any command to see options
|
|
104
|
+
`).parse();
|
|
105
|
+
} catch (n) {
|
|
106
|
+
T(n), g.exit(1);
|
|
107
|
+
}
|
|
108
|
+
})();
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import "node:child_process";
|
|
2
2
|
import "node:process";
|
|
3
3
|
import "node:util";
|
|
4
|
+
import { c as d, k as n, d as l, j as C, e as c, r as f } from "../../../index-BG1UznTl.js";
|
|
5
|
+
import "../log/index.js";
|
|
6
|
+
import "../storage/storage.util.js";
|
|
4
7
|
import "../../config/env/env.util.js";
|
|
5
|
-
import "../../../log.type-DTOvZHyz.js";
|
|
6
8
|
import "../log/log.util.js";
|
|
7
|
-
import { Z as n, $ as l, Y as C, _ as f, a0 as E, a1 as L } from "../../../path.constant-CvSr0Rrx.js";
|
|
8
|
-
import "../path/path.util.js";
|
|
9
|
-
import "../storage/storage.util.js";
|
|
10
9
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
d as clearAllErrorLists,
|
|
11
|
+
n as formatCommand,
|
|
12
|
+
l as getStoredErrorLists,
|
|
13
|
+
C as rawCommand,
|
|
14
|
+
c as resolveCommands,
|
|
15
|
+
f as runCommand
|
|
17
16
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as s, c as m, k as o, d as e, j as d, e as n, r as t } from "../../../index-BG1UznTl.js";
|
|
2
2
|
export {
|
|
3
3
|
s as E_CommandType,
|
|
4
4
|
m as clearAllErrorLists,
|
|
@@ -1,88 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
d.call(e, s) && r.indexOf(s) < 0 && (t[s] = e[s]);
|
|
16
|
-
if (e != null && f)
|
|
17
|
-
for (var s of f(e))
|
|
18
|
-
r.indexOf(s) < 0 && i.call(e, s) && (t[s] = e[s]);
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
var A = (e, r, t) => new Promise((s, o) => {
|
|
22
|
-
var a = (u) => {
|
|
23
|
-
try {
|
|
24
|
-
n(t.next(u));
|
|
25
|
-
} catch (m) {
|
|
26
|
-
o(m);
|
|
27
|
-
}
|
|
28
|
-
}, c = (u) => {
|
|
29
|
-
try {
|
|
30
|
-
n(t.throw(u));
|
|
31
|
-
} catch (m) {
|
|
32
|
-
o(m);
|
|
33
|
-
}
|
|
34
|
-
}, n = (u) => u.done ? s(u.value) : Promise.resolve(u.value).then(a, c);
|
|
35
|
-
n((t = t.apply(e, r)).next());
|
|
36
|
-
});
|
|
37
|
-
import { NestFactory as N } from "@nestjs/core";
|
|
38
|
-
import { default as T } from "body-parser";
|
|
39
|
-
import P from "compression";
|
|
40
|
-
import S from "cookie-parser";
|
|
41
|
-
import g from "cors";
|
|
42
|
-
import p from "express";
|
|
43
|
-
import { default as W } from "express";
|
|
44
|
-
import G from "express-session";
|
|
45
|
-
import H from "express-useragent";
|
|
46
|
-
import I from "graphql-upload/graphqlUploadExpress.mjs";
|
|
47
|
-
function O(s) {
|
|
48
|
-
var o = s, { isDev: e, whiteList: r } = o, t = y(o, ["isDev", "whiteList"]);
|
|
49
|
-
return x({
|
|
50
|
-
origin: (a, c) => {
|
|
51
|
-
e || !a || r != null && r.includes(a != null ? a : "") ? c(null, !0) : c(new Error("Not allowed by CORS"), !1);
|
|
1
|
+
import { NestFactory as a } from "@nestjs/core";
|
|
2
|
+
import { default as O } from "body-parser";
|
|
3
|
+
import c from "compression";
|
|
4
|
+
import f from "cookie-parser";
|
|
5
|
+
import p from "cors";
|
|
6
|
+
import s from "express";
|
|
7
|
+
import { default as M } from "express";
|
|
8
|
+
import m from "express-session";
|
|
9
|
+
import l from "express-useragent";
|
|
10
|
+
import d from "graphql-upload/graphqlUploadExpress.mjs";
|
|
11
|
+
function x({ isDev: e, whiteList: r, ...o }) {
|
|
12
|
+
return {
|
|
13
|
+
origin: (t, i) => {
|
|
14
|
+
e || !t || r?.includes(t ?? "") ? i(null, !0) : i(new Error("Not allowed by CORS"), !1);
|
|
52
15
|
},
|
|
53
|
-
credentials: !0
|
|
54
|
-
|
|
16
|
+
credentials: !0,
|
|
17
|
+
...o
|
|
18
|
+
};
|
|
55
19
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
20
|
+
function P(e) {
|
|
21
|
+
return p(x(e));
|
|
58
22
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
23
|
+
function S(e) {
|
|
24
|
+
return m(e);
|
|
61
25
|
}
|
|
62
|
-
function
|
|
63
|
-
e.set("trust proxy", 1), e.use(
|
|
26
|
+
function n(e) {
|
|
27
|
+
e.set("trust proxy", 1), e.use(f()), e.use(s.urlencoded({ extended: !0 })), e.use(c()), e.use(l.express());
|
|
64
28
|
}
|
|
65
|
-
function
|
|
66
|
-
r && (Array.isArray(r) ? r : [r]).forEach((
|
|
67
|
-
e.use(
|
|
29
|
+
function u(e, r) {
|
|
30
|
+
r && (Array.isArray(r) ? r : [r]).forEach((t) => {
|
|
31
|
+
e.use(s.static(t));
|
|
68
32
|
});
|
|
69
33
|
}
|
|
70
|
-
function
|
|
71
|
-
const r =
|
|
72
|
-
return
|
|
34
|
+
function h(e) {
|
|
35
|
+
const r = s();
|
|
36
|
+
return n(r), u(r, e?.static), r.use(d()), r;
|
|
73
37
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return E(r.getHttpAdapter().getInstance()), b(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
|
|
78
|
-
});
|
|
38
|
+
async function G(e) {
|
|
39
|
+
const r = await a.create(e.module);
|
|
40
|
+
return n(r.getHttpAdapter().getInstance()), u(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
|
|
79
41
|
}
|
|
80
42
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
43
|
+
O as bodyParser,
|
|
44
|
+
P as createCors,
|
|
45
|
+
x as createCorsOptions,
|
|
46
|
+
h as createExpress,
|
|
47
|
+
G as createNest,
|
|
48
|
+
S as createSession,
|
|
49
|
+
M as express
|
|
88
50
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createCors as s, createCorsOptions as t, createExpress as o, createNest as a, createSession as p } from "./express.util.js";
|
|
2
|
+
import { Router as f, default as x } from "express";
|
|
3
3
|
import { default as m } from "body-parser";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
f as Router,
|
|
6
6
|
m as bodyParser,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
s as createCors,
|
|
8
|
+
t as createCorsOptions,
|
|
9
|
+
o as createExpress,
|
|
10
|
+
a as createNest,
|
|
11
|
+
p as createSession,
|
|
12
|
+
x as express
|
|
13
13
|
};
|
|
@@ -1,67 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (var c in n)
|
|
15
|
-
u.call(n, c) && e.indexOf(c) < 0 && (r[c] = n[c]);
|
|
16
|
-
if (n != null && y)
|
|
17
|
-
for (var c of y(n))
|
|
18
|
-
e.indexOf(c) < 0 && a.call(n, c) && (r[c] = n[c]);
|
|
19
|
-
return r;
|
|
20
|
-
};
|
|
21
|
-
import t from "fs-extra";
|
|
22
|
-
import o from "node:path";
|
|
23
|
-
const v = t, {
|
|
24
|
-
lstatSync: k,
|
|
25
|
-
readdirSync: w,
|
|
26
|
-
mkdirSync: J,
|
|
27
|
-
readFileSync: g,
|
|
28
|
-
unlinkSync: D,
|
|
29
|
-
statSync: x,
|
|
30
|
-
createWriteStream: W
|
|
31
|
-
} = t, b = t.readJsonSync;
|
|
32
|
-
function j(n, e, r) {
|
|
33
|
-
t.writeFileSync(n, e, r != null ? r : "utf-8");
|
|
1
|
+
import e from "fs-extra";
|
|
2
|
+
import y from "node:path";
|
|
3
|
+
const a = e, {
|
|
4
|
+
lstatSync: p,
|
|
5
|
+
readdirSync: d,
|
|
6
|
+
mkdirSync: l,
|
|
7
|
+
readFileSync: m,
|
|
8
|
+
unlinkSync: x,
|
|
9
|
+
statSync: S,
|
|
10
|
+
createWriteStream: F
|
|
11
|
+
} = e, E = e.readJsonSync;
|
|
12
|
+
function h(t, n, r) {
|
|
13
|
+
e.writeFileSync(t, n, r ?? "utf-8");
|
|
34
14
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
15
|
+
function v(t, n, r) {
|
|
16
|
+
e.appendFileSync(t, n, r ?? "utf-8");
|
|
37
17
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
18
|
+
function s(...t) {
|
|
19
|
+
return t.every((n) => e.pathExistsSync(n));
|
|
40
20
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
function k(...t) {
|
|
22
|
+
t.forEach((n) => {
|
|
23
|
+
s(n) && e.removeSync(n);
|
|
44
24
|
});
|
|
45
25
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
filter: (
|
|
50
|
-
|
|
26
|
+
function w(t, n, r = {}) {
|
|
27
|
+
const { extensions: c, ...o } = r;
|
|
28
|
+
e.copySync(t, n, {
|
|
29
|
+
filter: (i) => S(i).isDirectory() || !c || c.length === 0 ? !0 : c.includes(y.extname(i)),
|
|
30
|
+
...o
|
|
31
|
+
});
|
|
51
32
|
}
|
|
52
33
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
34
|
+
v as appendFileSync,
|
|
35
|
+
w as copySync,
|
|
36
|
+
F as createWriteStream,
|
|
37
|
+
a as fs,
|
|
38
|
+
p as lstatSync,
|
|
39
|
+
l as mkdirSync,
|
|
40
|
+
s as pathExistsSync,
|
|
41
|
+
m as readFileSync,
|
|
42
|
+
E as readJsonSync,
|
|
43
|
+
d as readdirSync,
|
|
44
|
+
k as removeSync,
|
|
45
|
+
S as statSync,
|
|
46
|
+
x as unlinkSync,
|
|
47
|
+
h as writeFileSync
|
|
67
48
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { catchError as a, log as g, throwError as c } from "./log.util.js";
|
|
2
|
+
var o = /* @__PURE__ */ ((r) => (r.Error = "error", r.Warning = "warning", r))(o || {});
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
o as E_IssueType,
|
|
5
|
+
a as catchError,
|
|
6
|
+
g as log,
|
|
7
|
+
c as throwError
|
|
8
8
|
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "chalk";
|
|
2
2
|
import r from "consola";
|
|
3
|
-
import { GraphQLError as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
message:
|
|
9
|
-
status:
|
|
10
|
-
type:
|
|
3
|
+
import { GraphQLError as E } from "graphql";
|
|
4
|
+
import { RESPONSE_STATUS as f } from "../../constant/response-status.js";
|
|
5
|
+
import { getEnv as i } from "../../config/env/env.util.js";
|
|
6
|
+
const h = i();
|
|
7
|
+
function d({
|
|
8
|
+
message: e,
|
|
9
|
+
status: o = f.INTERNAL_SERVER_ERROR,
|
|
10
|
+
type: n = "graphql"
|
|
11
11
|
}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}) : new Error(l);
|
|
12
|
+
const t = e ?? o.MESSAGE ?? "Internal server error";
|
|
13
|
+
throw n === "graphql" ? new E(t, {
|
|
14
|
+
extensions: { code: o.CODE }
|
|
15
|
+
}) : new Error(t);
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
return typeof
|
|
17
|
+
h.DEBUG || (r.level = 4);
|
|
18
|
+
function c(e) {
|
|
19
|
+
const o = l[e];
|
|
20
|
+
return typeof o == "function" ? o : l.green;
|
|
22
21
|
}
|
|
23
|
-
const
|
|
22
|
+
const R = {
|
|
24
23
|
silent: r.silent,
|
|
25
24
|
level: r.level,
|
|
26
25
|
fatal: r.fatal,
|
|
@@ -35,26 +34,26 @@ const $ = {
|
|
|
35
34
|
debug: r.debug,
|
|
36
35
|
trace: r.trace,
|
|
37
36
|
verbose: r.verbose,
|
|
38
|
-
printBoxedLog(
|
|
39
|
-
if (!
|
|
40
|
-
r.box(
|
|
37
|
+
printBoxedLog(e, o, n = "red") {
|
|
38
|
+
if (!o?.length) {
|
|
39
|
+
r.box(l.green(e));
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
r.log(`${
|
|
45
|
-
}), r.box(
|
|
42
|
+
o.forEach(({ file: t, position: a, rule: s, message: g }) => {
|
|
43
|
+
r.log(`${l.gray("File:")} ${l.blue(`${t}${a ? `:${a}` : ""}`)}`), s && r.log(` ${c(n)("Rule:")} ${s}`), r.log(` ${c(n)("Message:")} ${g}`);
|
|
44
|
+
}), r.box(c(n)(`${e} : ${o.length}`)), r.log(l.gray("─".repeat(40)));
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
|
-
function
|
|
49
|
-
const { shouldLog:
|
|
50
|
-
return
|
|
47
|
+
function w(e, o) {
|
|
48
|
+
const { shouldLog: n = !0, returnValue: t, callback: a } = o ?? {}, s = e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error");
|
|
49
|
+
return n && R.error(s.message), a && typeof a == "function" && a(s), t || {
|
|
51
50
|
success: !1,
|
|
52
|
-
message:
|
|
53
|
-
code:
|
|
51
|
+
message: s.message,
|
|
52
|
+
code: f.INTERNAL_SERVER_ERROR.CODE
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
55
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
w as catchError,
|
|
57
|
+
R as log,
|
|
58
|
+
d as throwError
|
|
60
59
|
};
|