@cyberskill/shared 2.27.0 → 3.0.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/config.util.cjs +1 -1
- package/dist/config/config.util.js +24 -33
- package/dist/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +6 -0
- package/dist/config/eslint/index.js +4 -12
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.js +28 -33
- package/dist/config/storybook/storybook.preview.cjs +1 -1
- package/dist/config/storybook/storybook.preview.js +10 -13
- package/dist/config/vitest/vitest.e2e.cjs +1 -1
- package/dist/config/vitest/vitest.e2e.js +1 -1
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +19 -8
- package/dist/constant/common.cjs +1 -1
- package/dist/constant/common.js +1 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/node/apollo-server/apollo-server.util.js +21 -48
- package/dist/node/cli/index.cjs +2 -5
- package/dist/node/cli/index.js +109 -170
- package/dist/node/command/command.util.cjs +2 -2
- package/dist/node/command/command.util.js +135 -170
- package/dist/node/express/express.util.cjs +1 -1
- package/dist/node/express/express.util.js +39 -72
- package/dist/node/fs/fs.util.cjs +4 -1
- package/dist/node/fs/fs.util.d.ts +8 -0
- package/dist/node/fs/fs.util.js +46 -53
- package/dist/node/fs/index.cjs +1 -1
- package/dist/node/fs/index.js +13 -12
- package/dist/node/log/log.util.cjs +1 -1
- package/dist/node/log/log.util.js +29 -30
- package/dist/node/mongo/mongo.controller.cjs +1 -1
- package/dist/node/mongo/mongo.controller.js +531 -629
- package/dist/node/mongo/mongo.type.js +3 -3
- package/dist/node/mongo/mongo.util.cjs +2 -5
- package/dist/node/mongo/mongo.util.js +308 -354
- package/dist/node/package/package.util.cjs +1 -1
- package/dist/node/package/package.util.js +197 -226
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +26 -25
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +2 -0
- package/dist/node/path/path.constant.js +130 -150
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.js +110 -158
- package/dist/node/upload/upload.util.cjs +1 -1
- package/dist/node/upload/upload.util.js +119 -150
- package/dist/node/ws/ts.util.cjs +1 -1
- package/dist/node/ws/ts.util.js +31 -54
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +4 -4
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +51 -58
- package/dist/react/apollo-client/links/upload.cjs +1 -1
- package/dist/react/apollo-client/links/upload.js +71 -74
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -18
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +61 -23
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.module.scss.js +6 -6
- package/dist/react/apollo-error/apollo-error.test.unit.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.util.js +6 -6
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.js +30 -46
- package/dist/react/log/log.util.cjs +1 -1
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.js +13 -22
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +43 -59
- package/dist/react/storage/storage.util.cjs +1 -1
- package/dist/react/storage/storage.util.js +28 -53
- package/dist/react/userback/userback.component.cjs +1 -1
- package/dist/react/userback/userback.component.js +18 -42
- package/dist/style.css +1 -1
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +11 -0
- package/dist/util/common/common.util.js +33 -37
- package/dist/util/common/index.cjs +1 -1
- package/dist/util/common/index.js +6 -5
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.js +22 -20
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +70 -70
- package/dist/util/string/index.cjs +1 -1
- package/dist/util/string/index.js +4 -3
- package/dist/util/string/string.util.cjs +1 -1
- package/dist/util/string/string.util.d.ts +12 -0
- package/dist/util/string/string.util.js +63 -44
- package/package.json +53 -44
- package/public/tsconfig.base.json +7 -3
- package/README.md +0 -470
- package/dist/node/mongo/mongo.util.d.ts +0 -1040
- /package/dist/node_modules/.pnpm/{vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
- /package/dist/node_modules/.pnpm/{vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
|
@@ -1,188 +1,153 @@
|
|
|
1
|
-
import { exec as
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import { storage as
|
|
5
|
-
import { getPackage as
|
|
6
|
-
import { CYBERSKILL_PACKAGE_NAME as
|
|
1
|
+
import { exec as x } from "node:child_process";
|
|
2
|
+
import u from "node:process";
|
|
3
|
+
import * as P from "node:util";
|
|
4
|
+
import { storage as g } from "../storage/storage.util.js";
|
|
5
|
+
import { getPackage as $ } from "../package/package.util.js";
|
|
6
|
+
import { CYBERSKILL_PACKAGE_NAME as I, PNPM_EXEC_CLI as w, TSX_CLI as S, CYBERSKILL_CLI_PATH as T, CYBERSKILL_CLI as _ } from "../path/path.constant.js";
|
|
7
7
|
import { E_IssueType as f } from "../log/log.type.js";
|
|
8
|
-
import { log as
|
|
9
|
-
import { getEnv as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} catch (c) {
|
|
15
|
-
i(c);
|
|
16
|
-
}
|
|
17
|
-
}, l = (u) => {
|
|
18
|
-
try {
|
|
19
|
-
n(e.throw(u));
|
|
20
|
-
} catch (c) {
|
|
21
|
-
i(c);
|
|
22
|
-
}
|
|
23
|
-
}, n = (u) => u.done ? s(u.value) : Promise.resolve(u.value).then(o, l);
|
|
24
|
-
n((e = e.apply(r, t)).next());
|
|
25
|
-
});
|
|
26
|
-
const G = K.promisify(A);
|
|
27
|
-
function v() {
|
|
28
|
-
return a(this, null, function* () {
|
|
29
|
-
const r = yield B();
|
|
30
|
-
return r.success ? r.result.name : Date.now().toString();
|
|
31
|
-
});
|
|
8
|
+
import { log as l, catchError as p } from "../log/log.util.js";
|
|
9
|
+
import { getEnv as C } from "../../config/env/env.util.js";
|
|
10
|
+
const k = P.promisify(x);
|
|
11
|
+
async function E() {
|
|
12
|
+
const r = await $();
|
|
13
|
+
return r.success ? r.result.name : Date.now().toString();
|
|
32
14
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function W() {
|
|
50
|
-
return a(this, null, function* () {
|
|
51
|
-
try {
|
|
52
|
-
const r = yield v(), t = yield y.get(r);
|
|
53
|
-
return t != null ? t : [];
|
|
54
|
-
} catch (r) {
|
|
55
|
-
return E(r, {
|
|
56
|
-
returnValue: []
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
15
|
+
async function d(r) {
|
|
16
|
+
if (r.length === 0)
|
|
17
|
+
return;
|
|
18
|
+
const t = await E();
|
|
19
|
+
try {
|
|
20
|
+
const o = [...await B(), ...r];
|
|
21
|
+
await g.set(t, o), setTimeout(async () => {
|
|
22
|
+
const s = await g.getLogLink(t);
|
|
23
|
+
s && l.info(`📂 Open the error list manually: ${s}`);
|
|
24
|
+
}, 0);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
p(e);
|
|
27
|
+
}
|
|
60
28
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
29
|
+
async function B() {
|
|
30
|
+
try {
|
|
31
|
+
const r = await E();
|
|
32
|
+
return await g.get(r) ?? [];
|
|
33
|
+
} catch (r) {
|
|
34
|
+
return p(r, {
|
|
35
|
+
returnValue: []
|
|
36
|
+
});
|
|
37
|
+
}
|
|
70
38
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
r
|
|
77
|
-
|
|
78
|
-
var u, c, _, $, C, w, L, P, x, I, S;
|
|
79
|
-
if (n.startsWith("/"))
|
|
80
|
-
s = n.trim();
|
|
81
|
-
else {
|
|
82
|
-
const m = i.exec(n) || [], d = o.exec(n) || [], g = l.exec(n) || [];
|
|
83
|
-
m.length && s ? t.push({
|
|
84
|
-
file: s,
|
|
85
|
-
position: `${m[1]}:${m[2]}`,
|
|
86
|
-
type: m[3] === f.Error ? f.Error : f.Warning,
|
|
87
|
-
message: (c = (u = m == null ? void 0 : m[4]) == null ? void 0 : u.trim()) != null ? c : "",
|
|
88
|
-
rule: ($ = (_ = m == null ? void 0 : m[5]) == null ? void 0 : _.trim()) != null ? $ : ""
|
|
89
|
-
}) : d.length ? t.push({
|
|
90
|
-
file: (C = d == null ? void 0 : d[1]) != null ? C : "",
|
|
91
|
-
position: `${d[2]}:${d[3]}`,
|
|
92
|
-
type: d[4] === f.Error ? f.Error : f.Warning,
|
|
93
|
-
message: (L = (w = d == null ? void 0 : d[5]) == null ? void 0 : w.trim()) != null ? L : ""
|
|
94
|
-
}) : g.length ? t.push({
|
|
95
|
-
file: "commitlint",
|
|
96
|
-
type: f.Error,
|
|
97
|
-
message: (x = (P = g == null ? void 0 : g[1]) == null ? void 0 : P.trim()) != null ? x : "",
|
|
98
|
-
rule: (S = (I = g == null ? void 0 : g[2]) == null ? void 0 : I.trim()) != null ? S : ""
|
|
99
|
-
}) : e.push(n.trim());
|
|
100
|
-
}
|
|
101
|
-
}), t.length && (yield j(t)), N().DEBUG && e.length && (h.warn("Unmatched lines:"), e.forEach((n) => h.info(` ${n}`)));
|
|
102
|
-
});
|
|
39
|
+
async function b() {
|
|
40
|
+
try {
|
|
41
|
+
const r = await E();
|
|
42
|
+
await g.remove(r);
|
|
43
|
+
} catch (r) {
|
|
44
|
+
p(r);
|
|
45
|
+
}
|
|
103
46
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
47
|
+
async function N(r) {
|
|
48
|
+
const t = [], e = [];
|
|
49
|
+
let o = "";
|
|
50
|
+
const s = /^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/, n = /^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/, c = /^✖\s+(.*?)\s+\[(.*?)\]$/;
|
|
51
|
+
r.split(`
|
|
52
|
+
`).forEach((a) => {
|
|
53
|
+
if (a.startsWith("/"))
|
|
54
|
+
o = a.trim();
|
|
55
|
+
else {
|
|
56
|
+
const i = s.exec(a) || [], m = n.exec(a) || [], h = c.exec(a) || [];
|
|
57
|
+
i.length && o ? t.push({
|
|
58
|
+
file: o,
|
|
59
|
+
position: `${i[1]}:${i[2]}`,
|
|
60
|
+
type: i[3] === f.Error ? f.Error : f.Warning,
|
|
61
|
+
message: i?.[4]?.trim() ?? "",
|
|
62
|
+
rule: i?.[5]?.trim() ?? ""
|
|
63
|
+
}) : m.length ? t.push({
|
|
64
|
+
file: m?.[1] ?? "",
|
|
65
|
+
position: `${m[2]}:${m[3]}`,
|
|
66
|
+
type: m[4] === f.Error ? f.Error : f.Warning,
|
|
67
|
+
message: m?.[5]?.trim() ?? ""
|
|
68
|
+
}) : h.length ? t.push({
|
|
69
|
+
file: "commitlint",
|
|
70
|
+
type: f.Error,
|
|
71
|
+
message: h?.[1]?.trim() ?? "",
|
|
72
|
+
rule: h?.[2]?.trim() ?? ""
|
|
73
|
+
}) : e.push(a.trim());
|
|
121
74
|
}
|
|
122
|
-
});
|
|
75
|
+
}), t.length && await d(t), C().DEBUG && e.length && (l.warn("Unmatched lines:"), e.forEach((a) => l.info(` ${a}`)));
|
|
123
76
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
timeout: s.timeout
|
|
77
|
+
async function L(r) {
|
|
78
|
+
try {
|
|
79
|
+
const t = JSON.parse(r), e = [];
|
|
80
|
+
t.forEach(({ filePath: o, messages: s }) => {
|
|
81
|
+
s.forEach(({ severity: n, line: c, column: a, ruleId: i, message: m }) => {
|
|
82
|
+
e.push({
|
|
83
|
+
type: n === 2 ? f.Error : f.Warning,
|
|
84
|
+
file: o,
|
|
85
|
+
position: `${c}:${a}`,
|
|
86
|
+
rule: i,
|
|
87
|
+
message: m
|
|
136
88
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
89
|
+
});
|
|
90
|
+
}), e.length && await d(e);
|
|
91
|
+
} catch {
|
|
92
|
+
await N(r);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function v(r, t = L, e = {}) {
|
|
96
|
+
const o = new AbortController();
|
|
97
|
+
u.on("SIGINT", () => {
|
|
98
|
+
l.warn("Process interrupted. Terminating..."), o.abort(), u.exit();
|
|
143
99
|
});
|
|
100
|
+
try {
|
|
101
|
+
if (typeof r == "string") {
|
|
102
|
+
const { stdout: s, stderr: n } = await k(r, {
|
|
103
|
+
maxBuffer: 104857600,
|
|
104
|
+
signal: o.signal,
|
|
105
|
+
timeout: e.timeout
|
|
106
|
+
});
|
|
107
|
+
await Promise.all([s, n].map((c) => c && t(c)));
|
|
108
|
+
}
|
|
109
|
+
} catch (s) {
|
|
110
|
+
const { stdout: n, stderr: c, message: a } = s;
|
|
111
|
+
await Promise.all([n, c].map((i) => i && t(i))), !c && !n && l.error(`Command failed: ${a}`);
|
|
112
|
+
}
|
|
144
113
|
}
|
|
145
|
-
function
|
|
114
|
+
function U(r) {
|
|
146
115
|
return { raw: !0, cmd: r };
|
|
147
116
|
}
|
|
148
|
-
function
|
|
149
|
-
return t
|
|
117
|
+
function y(r, t) {
|
|
118
|
+
return t?.isCurrentProject ? `${w} ${S} ${T} ${r}` : `${w} ${_} ${r}`;
|
|
150
119
|
}
|
|
151
|
-
function
|
|
152
|
-
return typeof r == "function" ?
|
|
120
|
+
function D(r, t) {
|
|
121
|
+
return typeof r == "function" ? y(r(t), t) : typeof r == "object" && r?.raw === !0 ? r.cmd : typeof r == "string" ? y(r, t) : r;
|
|
153
122
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
});
|
|
123
|
+
async function Y(r) {
|
|
124
|
+
const t = await $({ name: I });
|
|
125
|
+
if (t.success) {
|
|
126
|
+
const e = { isCurrentProject: t.result.isCurrentProject }, o = typeof r == "function" ? r(e) : r;
|
|
127
|
+
return Object.fromEntries(
|
|
128
|
+
Object.entries(o).map(([s, n]) => [s, D(n, e)])
|
|
129
|
+
);
|
|
130
|
+
}
|
|
164
131
|
}
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
});
|
|
132
|
+
async function X(r, t, e = {}) {
|
|
133
|
+
let o;
|
|
134
|
+
try {
|
|
135
|
+
const s = Date.now();
|
|
136
|
+
l.start(`${r}`), C().DEBUG ? l.info(`→ ${t}`) : o = setInterval(() => {
|
|
137
|
+
const n = Math.floor((Date.now() - s) / 1e3);
|
|
138
|
+
n > 0 && u.stdout.write(`\r⏳ ${r}... ${n}s`);
|
|
139
|
+
}, 100), await v(t, L, e), o && (clearInterval(o), u.stdout.write("\r\x1B[K")), l.success(`${r} done.`);
|
|
140
|
+
} catch (s) {
|
|
141
|
+
if (o && (clearInterval(o), u.stdout.write("\r\x1B[K")), e.throwOnError)
|
|
142
|
+
throw s;
|
|
143
|
+
p(s);
|
|
144
|
+
}
|
|
180
145
|
}
|
|
181
146
|
export {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
147
|
+
b as clearAllErrorLists,
|
|
148
|
+
D as formatCommand,
|
|
149
|
+
B as getStoredErrorLists,
|
|
150
|
+
U as rawCommand,
|
|
151
|
+
Y as resolveCommands,
|
|
152
|
+
X as runCommand
|
|
188
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@nestjs/core"),l=require("compression"),f=require("cookie-parser"),d=require("cors"),s=require("express"),p=require("express-session"),y=require("express-useragent"),q=require("graphql-upload/graphqlUploadExpress.mjs"),g=require("helmet");function c({isDev:e,whiteList:r,...i}){return{origin:(t,u)=>{e||!t||r?.includes(t??"")?u(null,!0):u(new Error("Not allowed by CORS"),!1)},credentials:!0,...i}}function x(e){return d(c(e))}function S(e){return p(e)}function n(e,r=!1){e.set("trust proxy",1),e.use(g({crossOriginEmbedderPolicy:r?!1:void 0,contentSecurityPolicy:r?!1:void 0})),e.use(f()),e.use(s.urlencoded({extended:!0})),e.use(l()),e.use(y.express())}function a(e,r){r&&(Array.isArray(r)?r:[r]).forEach(t=>{e.use(`/${t}`,s.static(t))})}function E(e){const r=s();return n(r,e?.isDev),a(r,e?.static),r.use(q()),r}async function b(e){const r=await o.NestFactory.create(e.module);return n(r.getHttpAdapter().getInstance(),e.isDev),a(r.getHttpAdapter().getInstance(),e.static),e.filters&&r.useGlobalFilters(...e.filters),e.pipes&&r.useGlobalPipes(...e.pipes),r}exports.express=s;exports.createCors=x;exports.createCorsOptions=c;exports.createExpress=E;exports.createNest=b;exports.createSession=S;
|
|
@@ -1,87 +1,54 @@
|
|
|
1
|
-
import { NestFactory as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { default as
|
|
7
|
-
import
|
|
8
|
-
import { express as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
for (var t of o(r))
|
|
16
|
-
d.call(r, t) && m(e, t, r[t]);
|
|
17
|
-
return e;
|
|
18
|
-
}, A = (e, r) => {
|
|
19
|
-
var t = {};
|
|
20
|
-
for (var s in e)
|
|
21
|
-
p.call(e, s) && r.indexOf(s) < 0 && (t[s] = e[s]);
|
|
22
|
-
if (e != null && o)
|
|
23
|
-
for (var s of o(e))
|
|
24
|
-
r.indexOf(s) < 0 && d.call(e, s) && (t[s] = e[s]);
|
|
25
|
-
return t;
|
|
26
|
-
}, I = (e, r, t) => new Promise((s, n) => {
|
|
27
|
-
var a = (i) => {
|
|
28
|
-
try {
|
|
29
|
-
f(t.next(i));
|
|
30
|
-
} catch (u) {
|
|
31
|
-
n(u);
|
|
32
|
-
}
|
|
33
|
-
}, l = (i) => {
|
|
34
|
-
try {
|
|
35
|
-
f(t.throw(i));
|
|
36
|
-
} catch (u) {
|
|
37
|
-
n(u);
|
|
38
|
-
}
|
|
39
|
-
}, f = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(a, l);
|
|
40
|
-
f((t = t.apply(e, r)).next());
|
|
41
|
-
});
|
|
42
|
-
function N(e) {
|
|
43
|
-
var r = e, { isDev: t, whiteList: s } = r, n = A(r, ["isDev", "whiteList"]);
|
|
44
|
-
return S({
|
|
45
|
-
origin: (a, l) => {
|
|
46
|
-
t || !a || s != null && s.includes(a != null ? a : "") ? l(null, !0) : l(new Error("Not allowed by CORS"), !1);
|
|
1
|
+
import { NestFactory as u } from "@nestjs/core";
|
|
2
|
+
import a from "compression";
|
|
3
|
+
import f from "cookie-parser";
|
|
4
|
+
import m from "cors";
|
|
5
|
+
import s from "express";
|
|
6
|
+
import { default as $ } from "express";
|
|
7
|
+
import l from "express-session";
|
|
8
|
+
import { express as p } from "express-useragent";
|
|
9
|
+
import d from "graphql-upload/graphqlUploadExpress.mjs";
|
|
10
|
+
import x from "helmet";
|
|
11
|
+
function y({ 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);
|
|
47
15
|
},
|
|
48
|
-
credentials: !0
|
|
49
|
-
|
|
16
|
+
credentials: !0,
|
|
17
|
+
...o
|
|
18
|
+
};
|
|
50
19
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
20
|
+
function C(e) {
|
|
21
|
+
return m(y(e));
|
|
53
22
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
23
|
+
function N(e) {
|
|
24
|
+
return l(e);
|
|
56
25
|
}
|
|
57
|
-
function
|
|
26
|
+
function c(e, r = !1) {
|
|
58
27
|
e.set("trust proxy", 1), e.use(
|
|
59
|
-
|
|
28
|
+
x({
|
|
60
29
|
crossOriginEmbedderPolicy: r ? !1 : void 0,
|
|
61
30
|
contentSecurityPolicy: r ? !1 : void 0
|
|
62
31
|
})
|
|
63
|
-
), e.use(
|
|
32
|
+
), e.use(f()), e.use(s.urlencoded({ extended: !0 })), e.use(a()), e.use(p());
|
|
64
33
|
}
|
|
65
|
-
function
|
|
66
|
-
r && (Array.isArray(r) ? r : [r]).forEach((
|
|
67
|
-
e.use(`/${
|
|
34
|
+
function n(e, r) {
|
|
35
|
+
r && (Array.isArray(r) ? r : [r]).forEach((t) => {
|
|
36
|
+
e.use(`/${t}`, s.static(t));
|
|
68
37
|
});
|
|
69
38
|
}
|
|
70
|
-
function
|
|
71
|
-
const r =
|
|
72
|
-
return
|
|
39
|
+
function O(e) {
|
|
40
|
+
const r = s();
|
|
41
|
+
return c(r, e?.isDev), n(r, e?.static), r.use(d()), r;
|
|
73
42
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return v(r.getHttpAdapter().getInstance(), e.isDev), y(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
|
|
78
|
-
});
|
|
43
|
+
async function G(e) {
|
|
44
|
+
const r = await u.create(e.module);
|
|
45
|
+
return c(r.getHttpAdapter().getInstance(), e.isDev), n(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
|
|
79
46
|
}
|
|
80
47
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
48
|
+
C as createCors,
|
|
49
|
+
y as createCorsOptions,
|
|
50
|
+
O as createExpress,
|
|
51
|
+
G as createNest,
|
|
52
|
+
N as createSession,
|
|
53
|
+
$ as express
|
|
87
54
|
};
|
package/dist/node/fs/fs.util.cjs
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("fs-extra"),d=require("node:path"),l=c,{lstatSync:f,readdirSync:p,mkdirSync:m,readFileSync:S,unlinkSync:F,statSync:o,createWriteStream:E}=c,x=c.readJsonSync;function s(n,e,t){c.writeFileSync(n,e,t??"utf-8")}function a(n,e,t){c.appendFileSync(n,e,t??"utf-8")}function i(...n){return n.every(e=>c.pathExistsSync(e))}function g(...n){n.forEach(e=>{i(e)&&c.removeSync(e)})}function v(n,e,t={}){const{extensions:r,...u}=t;c.copySync(n,e,{filter:y=>o(y).isDirectory()||!r||r.length===0?!0:r.includes(d.extname(y)),...u})}function k(n,e){const t=`
|
|
2
|
+
${e}
|
|
3
|
+
`;i(n)?S(n,"utf-8").split(`
|
|
4
|
+
`).includes(e)||a(n,t):s(n,t)}exports.addGitIgnoreEntry=k;exports.appendFileSync=a;exports.copySync=v;exports.createWriteStream=E;exports.fs=l;exports.lstatSync=f;exports.mkdirSync=m;exports.pathExistsSync=i;exports.readFileSync=S;exports.readJsonSync=x;exports.readdirSync=p;exports.removeSync=g;exports.statSync=o;exports.unlinkSync=F;exports.writeFileSync=s;
|
|
@@ -55,3 +55,11 @@ export declare function removeSync(...paths: string[]): void;
|
|
|
55
55
|
* @param options - Optional copy configuration including extensions filter and other fs-extra options.
|
|
56
56
|
*/
|
|
57
57
|
export declare function copySync(src: string, dest: string, options?: I_CopySyncOptions): void;
|
|
58
|
+
/**
|
|
59
|
+
* Adds an entry to the .gitignore file if it doesn't already exist.
|
|
60
|
+
* Creates the .gitignore file if it doesn't exist.
|
|
61
|
+
*
|
|
62
|
+
* @param gitIgnorePath - The absolute path to the .gitignore file.
|
|
63
|
+
* @param entry - The entry name to add (e.g. '.agent', '.simple-git-hooks.json').
|
|
64
|
+
*/
|
|
65
|
+
export declare function addGitIgnoreEntry(gitIgnorePath: string, entry: string): void;
|
package/dist/node/fs/fs.util.js
CHANGED
|
@@ -1,63 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
y.call(n, e) && o(r, e, n[e]);
|
|
9
|
-
return r;
|
|
10
|
-
}, m = (r, n) => {
|
|
11
|
-
var e = {};
|
|
12
|
-
for (var t in r)
|
|
13
|
-
l.call(r, t) && n.indexOf(t) < 0 && (e[t] = r[t]);
|
|
14
|
-
if (r != null && a)
|
|
15
|
-
for (var t of a(r))
|
|
16
|
-
n.indexOf(t) < 0 && y.call(r, t) && (e[t] = r[t]);
|
|
17
|
-
return e;
|
|
18
|
-
};
|
|
19
|
-
const x = i, {
|
|
20
|
-
lstatSync: w,
|
|
21
|
-
readdirSync: E,
|
|
22
|
-
mkdirSync: g,
|
|
23
|
-
readFileSync: h,
|
|
1
|
+
import c from "fs-extra";
|
|
2
|
+
import y from "node:path";
|
|
3
|
+
const l = c, {
|
|
4
|
+
lstatSync: m,
|
|
5
|
+
readdirSync: x,
|
|
6
|
+
mkdirSync: E,
|
|
7
|
+
readFileSync: f,
|
|
24
8
|
unlinkSync: F,
|
|
25
|
-
statSync:
|
|
26
|
-
createWriteStream:
|
|
27
|
-
} =
|
|
28
|
-
function
|
|
29
|
-
|
|
9
|
+
statSync: S,
|
|
10
|
+
createWriteStream: v
|
|
11
|
+
} = c, g = c.readJsonSync;
|
|
12
|
+
function u(n, t, e) {
|
|
13
|
+
c.writeFileSync(n, t, e ?? "utf-8");
|
|
14
|
+
}
|
|
15
|
+
function p(n, t, e) {
|
|
16
|
+
c.appendFileSync(n, t, e ?? "utf-8");
|
|
30
17
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
18
|
+
function o(...n) {
|
|
19
|
+
return n.every((t) => c.pathExistsSync(t));
|
|
33
20
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
21
|
+
function k(...n) {
|
|
22
|
+
n.forEach((t) => {
|
|
23
|
+
o(t) && c.removeSync(t);
|
|
24
|
+
});
|
|
36
25
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
function w(n, t, e = {}) {
|
|
27
|
+
const { extensions: i, ...s } = e;
|
|
28
|
+
c.copySync(n, t, {
|
|
29
|
+
filter: (r) => S(r).isDirectory() || !i || i.length === 0 ? !0 : i.includes(y.extname(r)),
|
|
30
|
+
...s
|
|
40
31
|
});
|
|
41
32
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
function J(n, t) {
|
|
34
|
+
const e = `
|
|
35
|
+
${t}
|
|
36
|
+
`;
|
|
37
|
+
o(n) ? f(n, "utf-8").split(`
|
|
38
|
+
`).includes(t) || p(n, e) : u(n, e);
|
|
47
39
|
}
|
|
48
40
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
41
|
+
J as addGitIgnoreEntry,
|
|
42
|
+
p as appendFileSync,
|
|
43
|
+
w as copySync,
|
|
44
|
+
v as createWriteStream,
|
|
45
|
+
l as fs,
|
|
46
|
+
m as lstatSync,
|
|
47
|
+
E as mkdirSync,
|
|
48
|
+
o as pathExistsSync,
|
|
49
|
+
f as readFileSync,
|
|
50
|
+
g as readJsonSync,
|
|
51
|
+
x as readdirSync,
|
|
52
|
+
k as removeSync,
|
|
53
|
+
S as statSync,
|
|
61
54
|
F as unlinkSync,
|
|
62
|
-
|
|
55
|
+
u as writeFileSync
|
|
63
56
|
};
|
package/dist/node/fs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./fs.util.cjs");exports.appendFileSync=e.appendFileSync;exports.copySync=e.copySync;exports.createWriteStream=e.createWriteStream;exports.fs=e.fs;exports.lstatSync=e.lstatSync;exports.mkdirSync=e.mkdirSync;exports.pathExistsSync=e.pathExistsSync;exports.readFileSync=e.readFileSync;exports.readJsonSync=e.readJsonSync;exports.readdirSync=e.readdirSync;exports.removeSync=e.removeSync;exports.statSync=e.statSync;exports.unlinkSync=e.unlinkSync;exports.writeFileSync=e.writeFileSync;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./fs.util.cjs");exports.addGitIgnoreEntry=e.addGitIgnoreEntry;exports.appendFileSync=e.appendFileSync;exports.copySync=e.copySync;exports.createWriteStream=e.createWriteStream;exports.fs=e.fs;exports.lstatSync=e.lstatSync;exports.mkdirSync=e.mkdirSync;exports.pathExistsSync=e.pathExistsSync;exports.readFileSync=e.readFileSync;exports.readJsonSync=e.readJsonSync;exports.readdirSync=e.readdirSync;exports.removeSync=e.removeSync;exports.statSync=e.statSync;exports.unlinkSync=e.unlinkSync;exports.writeFileSync=e.writeFileSync;
|
package/dist/node/fs/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { addGitIgnoreEntry as c, appendFileSync as r, copySync as y, createWriteStream as t, fs as S, lstatSync as a, mkdirSync as i, pathExistsSync as d, readFileSync as o, readJsonSync as s, readdirSync as l, removeSync as p, statSync as m, unlinkSync as F, writeFileSync as f } from "./fs.util.js";
|
|
2
2
|
export {
|
|
3
|
-
c as
|
|
3
|
+
c as addGitIgnoreEntry,
|
|
4
|
+
r as appendFileSync,
|
|
4
5
|
y as copySync,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
t as createWriteStream,
|
|
7
|
+
S as fs,
|
|
8
|
+
a as lstatSync,
|
|
9
|
+
i as mkdirSync,
|
|
10
|
+
d as pathExistsSync,
|
|
11
|
+
o as readFileSync,
|
|
11
12
|
s as readJsonSync,
|
|
12
13
|
l as readdirSync,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
p as removeSync,
|
|
15
|
+
m as statSync,
|
|
16
|
+
F as unlinkSync,
|
|
17
|
+
f as writeFileSync
|
|
17
18
|
};
|