@cyberskill/shared 2.26.0 → 2.28.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/README.md +1 -1
- package/dist/config/config.util.cjs +1 -1
- package/dist/config/config.util.js +14 -19
- package/dist/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +2 -0
- package/dist/config/eslint/index.js +1 -1
- 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 +1 -1
- package/dist/node/cli/index.cjs +2 -5
- package/dist/node/cli/index.js +108 -103
- package/dist/node/command/command.util.js +1 -1
- 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 +58 -50
- package/dist/node/fs/index.cjs +1 -1
- package/dist/node/fs/index.js +13 -12
- 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 +206 -211
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +53 -51
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +3 -0
- package/dist/node/path/path.constant.js +63 -60
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.js +1 -1
- package/dist/node/upload/upload.util.js +3 -3
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +4 -3
- package/dist/react/apollo-client/apollo-client.context.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.context.d.ts +1 -1
- package/dist/react/apollo-client/apollo-client.context.js +9 -8
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +3 -3
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +9 -8
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +2 -1
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.provider.js +4 -3
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.d.ts +1 -1
- package/dist/react/loading/loading.component.js +7 -6
- package/dist/react/loading/loading.provider.cjs +1 -1
- package/dist/react/loading/loading.provider.d.ts +1 -1
- package/dist/react/loading/loading.provider.js +8 -7
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.d.ts +2 -1
- package/dist/react/next-intl/next-intl.hoc.js +12 -12
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
- package/dist/react/next-intl/next-intl.provider.js +5 -4
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +9 -0
- package/dist/util/common/common.util.js +33 -29
- 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 +23 -22
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +40 -36
- package/package.json +45 -44
- package/dist/node/mongo/mongo.util.d.ts +0 -1040
- /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.0_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.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.0_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,11 +1,11 @@
|
|
|
1
|
-
var A = Object.defineProperty,
|
|
1
|
+
var A = Object.defineProperty, m = Object.defineProperties, d = Object.getOwnPropertyDescriptors, f = Object.getOwnPropertySymbols, v = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable, u = (e, r, n) => r in e ? A(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, y = (e, r) => {
|
|
2
2
|
for (var n in r || (r = {}))
|
|
3
|
-
|
|
3
|
+
v.call(r, n) && u(e, n, r[n]);
|
|
4
4
|
if (f)
|
|
5
5
|
for (var n of f(r))
|
|
6
|
-
|
|
6
|
+
w.call(r, n) && u(e, n, r[n]);
|
|
7
7
|
return e;
|
|
8
|
-
}, p = (e, r) =>
|
|
8
|
+
}, p = (e, r) => m(e, d(r));
|
|
9
9
|
function P(e) {
|
|
10
10
|
try {
|
|
11
11
|
return JSON.parse(e), !0;
|
|
@@ -25,23 +25,27 @@ function _(e, r) {
|
|
|
25
25
|
}
|
|
26
26
|
return n;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (r.length
|
|
28
|
+
function g(e, r, n, o) {
|
|
29
|
+
if (o >= r.length)
|
|
30
30
|
return e;
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
return p(
|
|
34
|
-
[
|
|
31
|
+
const t = r[o];
|
|
32
|
+
if (o === r.length - 1)
|
|
33
|
+
return p(y({}, e), {
|
|
34
|
+
[t]: n
|
|
35
35
|
});
|
|
36
|
-
const s = e[
|
|
37
|
-
return p(
|
|
38
|
-
[
|
|
36
|
+
const s = e[t];
|
|
37
|
+
return p(y({}, e), {
|
|
38
|
+
[t]: g(
|
|
39
39
|
typeof s == "object" && s !== null ? s : {},
|
|
40
|
-
|
|
41
|
-
n
|
|
40
|
+
r,
|
|
41
|
+
n,
|
|
42
|
+
o + 1
|
|
42
43
|
)
|
|
43
44
|
});
|
|
44
45
|
}
|
|
46
|
+
function b(e, r, n) {
|
|
47
|
+
return r.length === 0 ? e : g(e, r, n, 0);
|
|
48
|
+
}
|
|
45
49
|
function O(e) {
|
|
46
50
|
if (e === null || typeof e != "object")
|
|
47
51
|
return e;
|
|
@@ -59,7 +63,7 @@ function O(e) {
|
|
|
59
63
|
Object.prototype.hasOwnProperty.call(e, o) && (n[o] = O(e[o]));
|
|
60
64
|
return n;
|
|
61
65
|
}
|
|
62
|
-
function
|
|
66
|
+
function h(...e) {
|
|
63
67
|
if (e.length === 0)
|
|
64
68
|
return {};
|
|
65
69
|
const r = e.filter((t) => t != null);
|
|
@@ -72,18 +76,18 @@ function w(...e) {
|
|
|
72
76
|
if (r.every((t) => typeof t == "object" && t !== null && !Array.isArray(t))) {
|
|
73
77
|
const t = {};
|
|
74
78
|
for (const s of r) {
|
|
75
|
-
const
|
|
76
|
-
for (const a in
|
|
77
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
78
|
-
const
|
|
79
|
+
const l = s;
|
|
80
|
+
for (const a in l)
|
|
81
|
+
if (Object.prototype.hasOwnProperty.call(l, a)) {
|
|
82
|
+
const i = l[a];
|
|
79
83
|
if (Object.prototype.hasOwnProperty.call(t, a)) {
|
|
80
84
|
const c = t[a];
|
|
81
|
-
typeof
|
|
85
|
+
typeof i == "object" && i !== null && typeof c == "object" && c !== null ? Array.isArray(i) && Array.isArray(c) ? t[a] = c.concat(i) : !Array.isArray(i) && !Array.isArray(c) ? t[a] = h(
|
|
82
86
|
c,
|
|
83
|
-
|
|
84
|
-
) : t[a] =
|
|
87
|
+
i
|
|
88
|
+
) : t[a] = i : t[a] = i;
|
|
85
89
|
} else
|
|
86
|
-
t[a] =
|
|
90
|
+
t[a] = i;
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
return t;
|
|
@@ -101,7 +105,7 @@ function w(...e) {
|
|
|
101
105
|
"deepMerge: Invalid arguments provided. All arguments must be objects or arrays of the same type."
|
|
102
106
|
);
|
|
103
107
|
}
|
|
104
|
-
function
|
|
108
|
+
function j(e) {
|
|
105
109
|
if (!e || typeof e != "object")
|
|
106
110
|
return e;
|
|
107
111
|
const r = {};
|
|
@@ -109,26 +113,26 @@ function b(e) {
|
|
|
109
113
|
for (const s in o) {
|
|
110
114
|
if (!Object.prototype.hasOwnProperty.call(o, s))
|
|
111
115
|
continue;
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
let
|
|
115
|
-
for (const c in
|
|
116
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
117
|
-
|
|
116
|
+
const l = o[s], a = t ? `${t}.${s}` : s;
|
|
117
|
+
if (l && typeof l == "object" && !Array.isArray(l)) {
|
|
118
|
+
let i = !1;
|
|
119
|
+
for (const c in l)
|
|
120
|
+
if (Object.prototype.hasOwnProperty.call(l, c) && c.startsWith("$")) {
|
|
121
|
+
i = !0;
|
|
118
122
|
break;
|
|
119
123
|
}
|
|
120
|
-
|
|
124
|
+
i ? r[a] = l : n(l, a);
|
|
121
125
|
} else
|
|
122
|
-
r[a] =
|
|
126
|
+
r[a] = l;
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
129
|
return n(e, ""), r;
|
|
126
130
|
}
|
|
127
131
|
export {
|
|
128
132
|
O as deepClone,
|
|
129
|
-
|
|
133
|
+
h as deepMerge,
|
|
130
134
|
_ as getNestedValue,
|
|
131
135
|
P as isJSON,
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
j as normalizeMongoFilter,
|
|
137
|
+
b as setNestedValue
|
|
134
138
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberskill/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.28.0",
|
|
5
5
|
"description": "CyberSkill Shared",
|
|
6
6
|
"author": "Stephen Cheng",
|
|
7
7
|
"license": "MIT",
|
|
@@ -198,6 +198,7 @@
|
|
|
198
198
|
"public"
|
|
199
199
|
],
|
|
200
200
|
"scripts": {
|
|
201
|
+
"ai:setup": "tsx src/node/cli/index.ts ai:setup",
|
|
201
202
|
"build": "vite build",
|
|
202
203
|
"commitlint": "tsx src/node/cli/index.ts commitlint",
|
|
203
204
|
"dev": "vite build --watch",
|
|
@@ -212,71 +213,71 @@
|
|
|
212
213
|
"test:unit": "tsx src/node/cli/index.ts test:unit"
|
|
213
214
|
},
|
|
214
215
|
"dependencies": {
|
|
215
|
-
"@antfu/eslint-config": "
|
|
216
|
-
"@apollo/client": "4.
|
|
217
|
-
"@apollo/client-integration-nextjs": "0.14.
|
|
218
|
-
"@apollo/server": "5.
|
|
216
|
+
"@antfu/eslint-config": "7.4.3",
|
|
217
|
+
"@apollo/client": "4.1.5",
|
|
218
|
+
"@apollo/client-integration-nextjs": "0.14.4",
|
|
219
|
+
"@apollo/server": "5.4.0",
|
|
219
220
|
"@as-integrations/express5": "1.1.2",
|
|
220
|
-
"@dotenvx/dotenvx": "1.
|
|
221
|
+
"@dotenvx/dotenvx": "1.52.0",
|
|
221
222
|
"@eddeee888/gcg-typescript-resolver-files": "0.15.0",
|
|
222
|
-
"@eslint-react/eslint-plugin": "2.
|
|
223
|
-
"@graphql-codegen/cli": "6.1.
|
|
224
|
-
"@graphql-codegen/client-preset": "5.2.
|
|
225
|
-
"@nestjs/common": "11.1.
|
|
226
|
-
"@nestjs/core": "11.1.
|
|
223
|
+
"@eslint-react/eslint-plugin": "2.13.0",
|
|
224
|
+
"@graphql-codegen/cli": "6.1.1",
|
|
225
|
+
"@graphql-codegen/client-preset": "5.2.3",
|
|
226
|
+
"@nestjs/common": "11.1.14",
|
|
227
|
+
"@nestjs/core": "11.1.14",
|
|
227
228
|
"@userback/widget": "0.3.12",
|
|
228
|
-
"@vitejs/plugin-react-swc": "4.2.
|
|
229
|
-
"body-parser": "2.2.
|
|
229
|
+
"@vitejs/plugin-react-swc": "4.2.3",
|
|
230
|
+
"body-parser": "2.2.2",
|
|
230
231
|
"chalk": "5.6.2",
|
|
231
232
|
"clsx": "2.1.1",
|
|
232
233
|
"compression": "1.8.1",
|
|
233
234
|
"consola": "3.4.2",
|
|
234
235
|
"cookie-parser": "1.4.7",
|
|
235
|
-
"cors": "2.8.
|
|
236
|
+
"cors": "2.8.6",
|
|
236
237
|
"date-fns": "4.1.0",
|
|
237
238
|
"envalid": "8.1.1",
|
|
238
|
-
"eslint-plugin-format": "1.
|
|
239
|
+
"eslint-plugin-format": "1.4.0",
|
|
239
240
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
240
|
-
"eslint-plugin-react-refresh": "0.
|
|
241
|
+
"eslint-plugin-react-refresh": "0.5.0",
|
|
241
242
|
"express": "5.2.1",
|
|
242
|
-
"express-session": "1.
|
|
243
|
-
"express-useragent": "2.0
|
|
243
|
+
"express-session": "1.19.0",
|
|
244
|
+
"express-useragent": "2.1.0",
|
|
244
245
|
"extract-files": "13.0.0",
|
|
245
246
|
"fs-extra": "11.3.3",
|
|
246
|
-
"globals": "17.
|
|
247
|
+
"globals": "17.3.0",
|
|
247
248
|
"graphql": "16.12.0",
|
|
248
249
|
"graphql-upload": "17.0.0",
|
|
249
|
-
"graphql-ws": "6.0.
|
|
250
|
+
"graphql-ws": "6.0.7",
|
|
250
251
|
"helmet": "8.1.0",
|
|
251
|
-
"i18next": "25.
|
|
252
|
-
"jsdom": "
|
|
252
|
+
"i18next": "25.8.11",
|
|
253
|
+
"jsdom": "28.1.0",
|
|
253
254
|
"localforage": "1.10.0",
|
|
254
255
|
"migrate-mongo": "14.0.7",
|
|
255
|
-
"mongodb": "7.
|
|
256
|
-
"mongoose": "9.1
|
|
256
|
+
"mongodb": "7.1.0",
|
|
257
|
+
"mongoose": "9.2.1",
|
|
257
258
|
"mongoose-aggregate-paginate-v2": "1.1.4",
|
|
258
259
|
"mongoose-paginate-v2": "1.9.1",
|
|
259
|
-
"next-intl": "4.
|
|
260
|
+
"next-intl": "4.8.3",
|
|
260
261
|
"node-fetch": "3.3.2",
|
|
261
|
-
"qs": "6.
|
|
262
|
-
"react": "19.2.
|
|
263
|
-
"react-dom": "19.2.
|
|
262
|
+
"qs": "6.15.0",
|
|
263
|
+
"react": "19.2.4",
|
|
264
|
+
"react-dom": "19.2.4",
|
|
264
265
|
"react-hot-toast": "2.6.0",
|
|
265
|
-
"react-i18next": "16.5.
|
|
266
|
+
"react-i18next": "16.5.4",
|
|
266
267
|
"rxjs": "7.8.2",
|
|
267
268
|
"vite": "7.3.1",
|
|
268
269
|
"ws": "8.19.0",
|
|
269
270
|
"yargs": "18.0.0"
|
|
270
271
|
},
|
|
271
272
|
"devDependencies": {
|
|
272
|
-
"@commitlint/cli": "20.
|
|
273
|
-
"@commitlint/config-conventional": "20.
|
|
273
|
+
"@commitlint/cli": "20.4.2",
|
|
274
|
+
"@commitlint/config-conventional": "20.4.2",
|
|
274
275
|
"@eslint/config-inspector": "1.4.2",
|
|
275
|
-
"@next/eslint-plugin-next": "16.1.
|
|
276
|
-
"@storybook/react": "10.
|
|
277
|
-
"@storybook/react-vite": "10.
|
|
276
|
+
"@next/eslint-plugin-next": "16.1.6",
|
|
277
|
+
"@storybook/react": "10.2.10",
|
|
278
|
+
"@storybook/react-vite": "10.2.10",
|
|
278
279
|
"@testing-library/jest-dom": "6.9.1",
|
|
279
|
-
"@testing-library/react": "16.3.
|
|
280
|
+
"@testing-library/react": "16.3.2",
|
|
280
281
|
"@types/body-parser": "1.19.6",
|
|
281
282
|
"@types/compression": "1.8.1",
|
|
282
283
|
"@types/cookie-parser": "1.4.10",
|
|
@@ -288,25 +289,25 @@
|
|
|
288
289
|
"@types/fs-extra": "11.0.4",
|
|
289
290
|
"@types/graphql-upload": "17.0.0",
|
|
290
291
|
"@types/migrate-mongo": "10.0.6",
|
|
291
|
-
"@types/node": "25.0
|
|
292
|
-
"@types/react": "19.2.
|
|
292
|
+
"@types/node": "25.3.0",
|
|
293
|
+
"@types/react": "19.2.14",
|
|
293
294
|
"@types/react-dom": "19.2.3",
|
|
294
295
|
"@types/ws": "8.18.1",
|
|
295
296
|
"@types/yargs": "17.0.35",
|
|
296
|
-
"@vitest/browser": "4.0.
|
|
297
|
-
"eslint": "
|
|
298
|
-
"eslint-config-next": "16.1.
|
|
299
|
-
"glob": "13.0.
|
|
297
|
+
"@vitest/browser": "4.0.18",
|
|
298
|
+
"eslint": "10.0.0",
|
|
299
|
+
"eslint-config-next": "16.1.6",
|
|
300
|
+
"glob": "13.0.6",
|
|
300
301
|
"lint-staged": "16.2.7",
|
|
301
|
-
"node-modules-inspector": "1.2
|
|
302
|
+
"node-modules-inspector": "1.3.2",
|
|
302
303
|
"npm-run-all2": "8.0.4",
|
|
303
|
-
"sass": "1.97.
|
|
304
|
+
"sass": "1.97.3",
|
|
304
305
|
"simple-git-hooks": "2.13.1",
|
|
305
306
|
"tsx": "4.21.0",
|
|
306
307
|
"typescript": "5.9.3",
|
|
307
308
|
"vite": "7.3.1",
|
|
308
309
|
"vite-plugin-dts": "4.5.4",
|
|
309
|
-
"vitest": "4.0.
|
|
310
|
+
"vitest": "4.0.18"
|
|
310
311
|
},
|
|
311
312
|
"publishConfig": {
|
|
312
313
|
"access": "public",
|