@cyberskill/shared 3.0.0 → 3.1.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/commitlint/index.js +1 -0
- package/dist/config/commitlint/index.js.map +1 -0
- package/dist/config/config.test.unit.d.ts +1 -0
- package/dist/config/config.type.js +1 -0
- package/dist/config/config.type.js.map +1 -0
- package/dist/config/config.type.test.unit.d.ts +1 -0
- package/dist/config/config.util.js +1 -0
- package/dist/config/config.util.js.map +1 -0
- package/dist/config/env/env.constant.js +1 -0
- package/dist/config/env/env.constant.js.map +1 -0
- package/dist/config/env/env.util.js +1 -0
- package/dist/config/env/env.util.js.map +1 -0
- package/dist/config/env/index.js +1 -0
- package/dist/config/env/index.js.map +1 -0
- package/dist/config/eslint/index.js +1 -0
- package/dist/config/eslint/index.js.map +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js.map +1 -0
- package/dist/config/graphql-codegen/index.js +1 -0
- package/dist/config/graphql-codegen/index.js.map +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/lint-staged/index.js +1 -0
- package/dist/config/lint-staged/index.js.map +1 -0
- package/dist/config/storybook/index.js +1 -0
- package/dist/config/storybook/index.js.map +1 -0
- package/dist/config/storybook/storybook.main.js +1 -0
- package/dist/config/storybook/storybook.main.js.map +1 -0
- package/dist/config/storybook/storybook.preview.js +1 -0
- package/dist/config/storybook/storybook.preview.js.map +1 -0
- package/dist/config/vitest/index.js +1 -0
- package/dist/config/vitest/index.js.map +1 -0
- package/dist/config/vitest/vitest.e2e.js +1 -0
- package/dist/config/vitest/vitest.e2e.js.map +1 -0
- package/dist/config/vitest/vitest.unit.js +1 -0
- package/dist/config/vitest/vitest.unit.js.map +1 -0
- package/dist/constant/common.js +1 -0
- package/dist/constant/common.js.map +1 -0
- package/dist/constant/constant.test.unit.d.ts +1 -0
- package/dist/constant/index.js +1 -0
- package/dist/constant/index.js.map +1 -0
- package/dist/constant/response-status.js +1 -0
- package/dist/constant/response-status.js.map +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +1 -0
- package/dist/node/apollo-server/apollo-server.util.js.map +1 -0
- package/dist/node/apollo-server/index.js +1 -0
- package/dist/node/apollo-server/index.js.map +1 -0
- package/dist/node/cli/index.js +1 -0
- package/dist/node/cli/index.js.map +1 -0
- package/dist/node/command/command.test.unit.d.ts +1 -0
- package/dist/node/command/command.type.js +1 -0
- package/dist/node/command/command.type.js.map +1 -0
- package/dist/node/command/command.util.js +110 -102
- package/dist/node/command/command.util.js.map +1 -0
- package/dist/node/command/index.js +1 -0
- package/dist/node/command/index.js.map +1 -0
- package/dist/node/express/express.type.d.ts +4 -0
- package/dist/node/express/express.util.js +53 -35
- package/dist/node/express/express.util.js.map +1 -0
- package/dist/node/express/index.js +1 -0
- package/dist/node/express/index.js.map +1 -0
- package/dist/node/fs/fs.test.unit.d.ts +1 -0
- package/dist/node/fs/fs.util.js +1 -0
- package/dist/node/fs/fs.util.js.map +1 -0
- package/dist/node/fs/index.js +1 -0
- package/dist/node/fs/index.js.map +1 -0
- package/dist/node/log/index.js +1 -0
- package/dist/node/log/index.js.map +1 -0
- package/dist/node/log/log.test.unit.d.ts +1 -0
- package/dist/node/log/log.type.js +1 -0
- package/dist/node/log/log.type.js.map +1 -0
- package/dist/node/log/log.util.js +1 -0
- package/dist/node/log/log.util.js.map +1 -0
- package/dist/node/mongo/index.d.ts +2 -0
- package/dist/node/mongo/index.js +21 -12
- package/dist/node/mongo/index.js.map +1 -0
- package/dist/node/mongo/mongo.constant.js +1 -0
- package/dist/node/mongo/mongo.constant.js.map +1 -0
- package/dist/node/mongo/mongo.controller.d.ts +5 -315
- package/dist/node/mongo/mongo.controller.mongoose.d.ts +234 -0
- package/dist/node/mongo/mongo.controller.mongoose.js +468 -0
- package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -0
- package/dist/node/mongo/mongo.controller.native.d.ts +84 -0
- package/dist/node/mongo/mongo.controller.native.js +214 -0
- package/dist/node/mongo/mongo.controller.native.js.map +1 -0
- package/dist/node/mongo/mongo.dynamic-populate.d.ts +61 -0
- package/dist/node/mongo/mongo.dynamic-populate.js +197 -0
- package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -0
- package/dist/node/mongo/mongo.populate.d.ts +15 -0
- package/dist/node/mongo/mongo.populate.js +269 -0
- package/dist/node/mongo/mongo.populate.js.map +1 -0
- package/dist/node/mongo/mongo.type.js +1 -0
- package/dist/node/mongo/mongo.type.js.map +1 -0
- package/dist/node/mongo/mongo.util.d.ts +52 -0
- package/dist/node/mongo/mongo.util.js +106 -363
- package/dist/node/mongo/mongo.util.js.map +1 -0
- package/dist/node/package/index.js +1 -0
- package/dist/node/package/index.js.map +1 -0
- package/dist/node/package/package.test.unit.d.ts +1 -0
- package/dist/node/package/package.type.js +1 -0
- package/dist/node/package/package.type.js.map +1 -0
- package/dist/node/package/package.util.js +20 -20
- package/dist/node/package/package.util.js.map +1 -0
- package/dist/node/path/index.js +1 -0
- package/dist/node/path/index.js.map +1 -0
- package/dist/node/path/path.constant.js +1 -0
- package/dist/node/path/path.constant.js.map +1 -0
- package/dist/node/path/path.util.js +1 -0
- package/dist/node/path/path.util.js.map +1 -0
- package/dist/node/storage/index.js +1 -0
- package/dist/node/storage/index.js.map +1 -0
- package/dist/node/storage/storage.constant.js +1 -0
- package/dist/node/storage/storage.constant.js.map +1 -0
- package/dist/node/storage/storage.util.js +1 -0
- package/dist/node/storage/storage.util.js.map +1 -0
- package/dist/node/upload/index.js +1 -0
- package/dist/node/upload/index.js.map +1 -0
- package/dist/node/upload/upload.constant.js +1 -0
- package/dist/node/upload/upload.constant.js.map +1 -0
- package/dist/node/upload/upload.type.js +1 -0
- package/dist/node/upload/upload.type.js.map +1 -0
- package/dist/node/upload/upload.util.js +1 -0
- package/dist/node/upload/upload.util.js.map +1 -0
- package/dist/node/ws/index.d.ts +1 -1
- package/dist/node/ws/index.js +2 -1
- package/dist/node/ws/index.js.map +1 -0
- package/dist/node/ws/{ts.util.js → ws.util.js} +1 -0
- package/dist/node/ws/ws.util.js.map +1 -0
- package/dist/node_modules/.pnpm/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 +1 -0
- package/dist/node_modules/.pnpm/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.map +1 -0
- package/dist/react/apollo-client/apollo-client.component.js +1 -0
- package/dist/react/apollo-client/apollo-client.component.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.constant.js +1 -0
- package/dist/react/apollo-client/apollo-client.constant.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.context.js +1 -0
- package/dist/react/apollo-client/apollo-client.context.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.module.scss.js +1 -0
- package/dist/react/apollo-client/apollo-client.module.scss.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.util.js +1 -0
- package/dist/react/apollo-client/apollo-client.util.js.map +1 -0
- package/dist/react/apollo-client/index.js +1 -0
- package/dist/react/apollo-client/index.js.map +1 -0
- package/dist/react/apollo-client/links/index.js +1 -0
- package/dist/react/apollo-client/links/index.js.map +1 -0
- package/dist/react/apollo-client/links/upload.js +1 -0
- package/dist/react/apollo-client/links/upload.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js.map +1 -0
- package/dist/react/apollo-client-nextjs/index.js +1 -0
- package/dist/react/apollo-client-nextjs/index.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +1 -0
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.context.js +1 -0
- package/dist/react/apollo-error/apollo-error.context.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.js +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.provider.js +1 -0
- package/dist/react/apollo-error/apollo-error.provider.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +1 -0
- package/dist/react/apollo-error/apollo-error.util.js.map +1 -0
- package/dist/react/apollo-error/index.js +1 -0
- package/dist/react/apollo-error/index.js.map +1 -0
- package/dist/react/i18next/i18next.hook.js +1 -0
- package/dist/react/i18next/i18next.hook.js.map +1 -0
- package/dist/react/i18next/i18next.util.js +1 -0
- package/dist/react/i18next/i18next.util.js.map +1 -0
- package/dist/react/i18next/index.js +1 -0
- package/dist/react/i18next/index.js.map +1 -0
- package/dist/react/loading/index.js +1 -0
- package/dist/react/loading/index.js.map +1 -0
- package/dist/react/loading/loading.component.js +1 -0
- package/dist/react/loading/loading.component.js.map +1 -0
- package/dist/react/loading/loading.context.js +1 -0
- package/dist/react/loading/loading.context.js.map +1 -0
- package/dist/react/loading/loading.hook.js +1 -0
- package/dist/react/loading/loading.hook.js.map +1 -0
- package/dist/react/loading/loading.module.scss.js +1 -0
- package/dist/react/loading/loading.module.scss.js.map +1 -0
- package/dist/react/loading/loading.provider.js +1 -0
- package/dist/react/loading/loading.provider.js.map +1 -0
- package/dist/react/log/index.js +1 -0
- package/dist/react/log/index.js.map +1 -0
- package/dist/react/log/log.util.js +1 -0
- package/dist/react/log/log.util.js.map +1 -0
- package/dist/react/next-intl/index.js +1 -0
- package/dist/react/next-intl/index.js.map +1 -0
- package/dist/react/next-intl/next-intl.constant.js +1 -0
- package/dist/react/next-intl/next-intl.constant.js.map +1 -0
- package/dist/react/next-intl/next-intl.context.js +1 -0
- package/dist/react/next-intl/next-intl.context.js.map +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +1 -0
- package/dist/react/next-intl/next-intl.hoc.js.map +1 -0
- package/dist/react/next-intl/next-intl.hook.js +1 -0
- package/dist/react/next-intl/next-intl.hook.js.map +1 -0
- package/dist/react/next-intl/next-intl.provider.js +1 -0
- package/dist/react/next-intl/next-intl.provider.js.map +1 -0
- package/dist/react/storage/index.js +1 -0
- package/dist/react/storage/index.js.map +1 -0
- package/dist/react/storage/storage.hook.js +1 -0
- package/dist/react/storage/storage.hook.js.map +1 -0
- package/dist/react/storage/storage.test.unit.d.ts +1 -0
- package/dist/react/storage/storage.util.js +1 -0
- package/dist/react/storage/storage.util.js.map +1 -0
- package/dist/react/toast/index.js +1 -0
- package/dist/react/toast/index.js.map +1 -0
- package/dist/react/userback/index.js +1 -0
- package/dist/react/userback/index.js.map +1 -0
- package/dist/react/userback/userback.component.js +1 -0
- package/dist/react/userback/userback.component.js.map +1 -0
- package/dist/typescript/common.type.js +1 -0
- package/dist/typescript/common.type.js.map +1 -0
- package/dist/typescript/index.js +1 -0
- package/dist/typescript/index.js.map +1 -0
- package/dist/typescript/typescript.test.unit.d.ts +1 -0
- package/dist/util/common/common.util.js +1 -0
- package/dist/util/common/common.util.js.map +1 -0
- package/dist/util/common/index.js +1 -0
- package/dist/util/common/index.js.map +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/object/index.js +1 -0
- package/dist/util/object/index.js.map +1 -0
- package/dist/util/object/object.util.js +1 -0
- package/dist/util/object/object.util.js.map +1 -0
- package/dist/util/serializer/index.js +1 -0
- package/dist/util/serializer/index.js.map +1 -0
- package/dist/util/serializer/serializer.util.js +1 -0
- package/dist/util/serializer/serializer.util.js.map +1 -0
- package/dist/util/string/index.js +1 -0
- package/dist/util/string/index.js.map +1 -0
- package/dist/util/string/string.util.js +1 -0
- package/dist/util/string/string.util.js.map +1 -0
- package/dist/util/validate/index.js +1 -0
- package/dist/util/validate/index.js.map +1 -0
- package/dist/util/validate/validate.util.js +1 -0
- package/dist/util/validate/validate.util.js.map +1 -0
- package/package.json +58 -87
- package/dist/config/commitlint/index.cjs +0 -1
- package/dist/config/config.type.cjs +0 -1
- package/dist/config/config.util.cjs +0 -1
- package/dist/config/env/env.constant.cjs +0 -1
- package/dist/config/env/env.util.cjs +0 -1
- package/dist/config/env/index.cjs +0 -1
- package/dist/config/eslint/index.cjs +0 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
- package/dist/config/graphql-codegen/index.cjs +0 -1
- package/dist/config/index.cjs +0 -1
- package/dist/config/lint-staged/index.cjs +0 -1
- package/dist/config/storybook/index.cjs +0 -1
- package/dist/config/storybook/storybook.main.cjs +0 -1
- package/dist/config/storybook/storybook.preview.cjs +0 -1
- package/dist/config/vitest/index.cjs +0 -1
- package/dist/config/vitest/vitest.e2e.cjs +0 -1
- package/dist/config/vitest/vitest.unit.cjs +0 -1
- package/dist/constant/common.cjs +0 -1
- package/dist/constant/index.cjs +0 -1
- package/dist/constant/response-status.cjs +0 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +0 -1
- package/dist/node/apollo-server/index.cjs +0 -1
- package/dist/node/cli/index.cjs +0 -3
- package/dist/node/command/command.type.cjs +0 -1
- package/dist/node/command/command.util.cjs +0 -2
- package/dist/node/command/index.cjs +0 -1
- package/dist/node/express/express.util.cjs +0 -1
- package/dist/node/express/index.cjs +0 -1
- package/dist/node/fs/fs.util.cjs +0 -4
- package/dist/node/fs/index.cjs +0 -1
- package/dist/node/log/index.cjs +0 -1
- package/dist/node/log/log.type.cjs +0 -1
- package/dist/node/log/log.util.cjs +0 -1
- package/dist/node/mongo/index.cjs +0 -1
- package/dist/node/mongo/mongo.constant.cjs +0 -1
- package/dist/node/mongo/mongo.controller.cjs +0 -1
- package/dist/node/mongo/mongo.controller.js +0 -858
- package/dist/node/mongo/mongo.type.cjs +0 -1
- package/dist/node/mongo/mongo.util.cjs +0 -2
- package/dist/node/package/index.cjs +0 -1
- package/dist/node/package/package.type.cjs +0 -1
- package/dist/node/package/package.util.cjs +0 -1
- package/dist/node/path/index.cjs +0 -1
- package/dist/node/path/path.constant.cjs +0 -1
- package/dist/node/path/path.util.cjs +0 -1
- package/dist/node/storage/index.cjs +0 -1
- package/dist/node/storage/storage.constant.cjs +0 -1
- package/dist/node/storage/storage.util.cjs +0 -1
- package/dist/node/upload/index.cjs +0 -1
- package/dist/node/upload/upload.constant.cjs +0 -1
- package/dist/node/upload/upload.type.cjs +0 -1
- package/dist/node/upload/upload.util.cjs +0 -1
- package/dist/node/ws/index.cjs +0 -1
- package/dist/node/ws/ts.util.cjs +0 -1
- package/dist/node_modules/.pnpm/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 -1
- package/dist/react/apollo-client/apollo-client.component.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.constant.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.context.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.module.scss.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.util.cjs +0 -1
- package/dist/react/apollo-client/index.cjs +0 -1
- package/dist/react/apollo-client/links/index.cjs +0 -1
- package/dist/react/apollo-client/links/upload.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
- package/dist/react/apollo-client-nextjs/index.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.component.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.context.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.hook.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.provider.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.util.cjs +0 -1
- package/dist/react/apollo-error/index.cjs +0 -1
- package/dist/react/i18next/i18next.hook.cjs +0 -1
- package/dist/react/i18next/i18next.util.cjs +0 -1
- package/dist/react/i18next/index.cjs +0 -1
- package/dist/react/loading/index.cjs +0 -1
- package/dist/react/loading/loading.component.cjs +0 -6
- package/dist/react/loading/loading.context.cjs +0 -1
- package/dist/react/loading/loading.hook.cjs +0 -1
- package/dist/react/loading/loading.module.scss.cjs +0 -1
- package/dist/react/loading/loading.provider.cjs +0 -1
- package/dist/react/log/index.cjs +0 -1
- package/dist/react/log/log.util.cjs +0 -1
- package/dist/react/next-intl/index.cjs +0 -1
- package/dist/react/next-intl/next-intl.constant.cjs +0 -1
- package/dist/react/next-intl/next-intl.context.cjs +0 -1
- package/dist/react/next-intl/next-intl.hoc.cjs +0 -1
- package/dist/react/next-intl/next-intl.hook.cjs +0 -1
- package/dist/react/next-intl/next-intl.provider.cjs +0 -1
- package/dist/react/storage/index.cjs +0 -1
- package/dist/react/storage/storage.hook.cjs +0 -1
- package/dist/react/storage/storage.util.cjs +0 -1
- package/dist/react/toast/index.cjs +0 -1
- package/dist/react/userback/index.cjs +0 -1
- package/dist/react/userback/userback.component.cjs +0 -1
- package/dist/typescript/common.type.cjs +0 -1
- package/dist/typescript/index.cjs +0 -1
- package/dist/util/common/common.util.cjs +0 -1
- package/dist/util/common/index.cjs +0 -1
- package/dist/util/index.cjs +0 -1
- package/dist/util/object/index.cjs +0 -1
- package/dist/util/object/object.util.cjs +0 -1
- package/dist/util/serializer/index.cjs +0 -1
- package/dist/util/serializer/serializer.util.cjs +0 -1
- package/dist/util/string/index.cjs +0 -1
- package/dist/util/string/string.util.cjs +0 -1
- package/dist/util/validate/index.cjs +0 -1
- package/dist/util/validate/validate.util.cjs +0 -1
- /package/dist/node/ws/{ts.util.d.ts → ws.util.d.ts} +0 -0
|
@@ -1,153 +1,161 @@
|
|
|
1
|
-
import { exec as
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
1
|
+
import { exec as P, execFile as I } from "node:child_process";
|
|
2
|
+
import m from "node:process";
|
|
3
|
+
import * as $ from "node:util";
|
|
4
4
|
import { storage as g } from "../storage/storage.util.js";
|
|
5
|
-
import { getPackage as
|
|
6
|
-
import { CYBERSKILL_PACKAGE_NAME as
|
|
5
|
+
import { getPackage as C } from "../package/package.util.js";
|
|
6
|
+
import { CYBERSKILL_PACKAGE_NAME as S, PNPM_EXEC_CLI as w, TSX_CLI as T, CYBERSKILL_CLI_PATH as _, CYBERSKILL_CLI as A } 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
|
-
const k =
|
|
11
|
-
async function
|
|
12
|
-
const
|
|
13
|
-
return
|
|
8
|
+
import { log as u, catchError as p } from "../log/log.util.js";
|
|
9
|
+
import { getEnv as L } from "../../config/env/env.util.js";
|
|
10
|
+
const B = $.promisify(P), k = $.promisify(I), N = /[|&;<>`$(){}\[\]!#~*?]/;
|
|
11
|
+
async function h() {
|
|
12
|
+
const t = await C();
|
|
13
|
+
return t.success ? t.result.name : Date.now().toString();
|
|
14
14
|
}
|
|
15
|
-
async function
|
|
16
|
-
if (
|
|
15
|
+
async function x(t) {
|
|
16
|
+
if (t.length === 0)
|
|
17
17
|
return;
|
|
18
|
-
const
|
|
18
|
+
const r = await h();
|
|
19
19
|
try {
|
|
20
|
-
const
|
|
21
|
-
await g.set(
|
|
22
|
-
const
|
|
23
|
-
|
|
20
|
+
const s = [...await R(), ...t];
|
|
21
|
+
await g.set(r, s), setTimeout(async () => {
|
|
22
|
+
const o = await g.getLogLink(r);
|
|
23
|
+
o && u.info(`📂 Open the error list manually: ${o}`);
|
|
24
24
|
}, 0);
|
|
25
25
|
} catch (e) {
|
|
26
26
|
p(e);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
async function
|
|
29
|
+
async function R() {
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
32
|
-
return await g.get(
|
|
33
|
-
} catch (
|
|
34
|
-
return p(
|
|
31
|
+
const t = await h();
|
|
32
|
+
return await g.get(t) ?? [];
|
|
33
|
+
} catch (t) {
|
|
34
|
+
return p(t, {
|
|
35
35
|
returnValue: []
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
39
|
+
async function U() {
|
|
40
40
|
try {
|
|
41
|
-
const
|
|
42
|
-
await g.remove(
|
|
43
|
-
} catch (
|
|
44
|
-
p(
|
|
41
|
+
const t = await h();
|
|
42
|
+
await g.remove(t);
|
|
43
|
+
} catch (t) {
|
|
44
|
+
p(t);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
async function
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
const
|
|
51
|
-
|
|
47
|
+
async function v(t) {
|
|
48
|
+
const r = [], e = [];
|
|
49
|
+
let s = "";
|
|
50
|
+
const o = /^\s*(\d+):(\d+)\s+(error|warning)\s+(.+)\s+(\S+)$/, i = /^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/, n = /^✖\s+(.+)\s+\[([^\]]*)\]$/;
|
|
51
|
+
t.split(`
|
|
52
52
|
`).forEach((a) => {
|
|
53
53
|
if (a.startsWith("/"))
|
|
54
|
-
|
|
54
|
+
s = a.trim();
|
|
55
55
|
else {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
file:
|
|
59
|
-
position: `${
|
|
60
|
-
type:
|
|
61
|
-
message:
|
|
62
|
-
rule:
|
|
63
|
-
}) :
|
|
64
|
-
file:
|
|
65
|
-
position: `${
|
|
66
|
-
type:
|
|
67
|
-
message:
|
|
68
|
-
}) :
|
|
56
|
+
const c = o.exec(a) || [], l = i.exec(a) || [], E = n.exec(a) || [];
|
|
57
|
+
c.length && s ? r.push({
|
|
58
|
+
file: s,
|
|
59
|
+
position: `${c[1]}:${c[2]}`,
|
|
60
|
+
type: c[3] === f.Error ? f.Error : f.Warning,
|
|
61
|
+
message: c?.[4]?.trim() ?? "",
|
|
62
|
+
rule: c?.[5]?.trim() ?? ""
|
|
63
|
+
}) : l.length ? r.push({
|
|
64
|
+
file: l?.[1] ?? "",
|
|
65
|
+
position: `${l[2]}:${l[3]}`,
|
|
66
|
+
type: l[4] === f.Error ? f.Error : f.Warning,
|
|
67
|
+
message: l?.[5]?.trim() ?? ""
|
|
68
|
+
}) : E.length ? r.push({
|
|
69
69
|
file: "commitlint",
|
|
70
70
|
type: f.Error,
|
|
71
|
-
message:
|
|
72
|
-
rule:
|
|
71
|
+
message: E?.[1]?.trim() ?? "",
|
|
72
|
+
rule: E?.[2]?.trim() ?? ""
|
|
73
73
|
}) : e.push(a.trim());
|
|
74
74
|
}
|
|
75
|
-
}),
|
|
75
|
+
}), r.length && await x(r), L().DEBUG && e.length && (u.warn("Unmatched lines:"), e.forEach((a) => u.info(` ${a}`)));
|
|
76
76
|
}
|
|
77
|
-
async function
|
|
77
|
+
async function d(t) {
|
|
78
78
|
try {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
const r = JSON.parse(t), e = [];
|
|
80
|
+
r.forEach(({ filePath: s, messages: o }) => {
|
|
81
|
+
o.forEach(({ severity: i, line: n, column: a, ruleId: c, message: l }) => {
|
|
82
82
|
e.push({
|
|
83
|
-
type:
|
|
84
|
-
file:
|
|
85
|
-
position: `${
|
|
86
|
-
rule:
|
|
87
|
-
message:
|
|
83
|
+
type: i === 2 ? f.Error : f.Warning,
|
|
84
|
+
file: s,
|
|
85
|
+
position: `${n}:${a}`,
|
|
86
|
+
rule: c,
|
|
87
|
+
message: l
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
-
}), e.length && await
|
|
90
|
+
}), e.length && await x(e);
|
|
91
91
|
} catch {
|
|
92
|
-
await
|
|
92
|
+
await v(t);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
async function D(t, r = d, e = {}) {
|
|
96
|
+
const s = new AbortController();
|
|
97
|
+
m.on("SIGINT", () => {
|
|
98
|
+
u.warn("Process interrupted. Terminating..."), s.abort(), m.exit();
|
|
99
99
|
});
|
|
100
100
|
try {
|
|
101
|
-
if (typeof
|
|
102
|
-
const
|
|
103
|
-
maxBuffer:
|
|
104
|
-
signal:
|
|
101
|
+
if (typeof t == "string") {
|
|
102
|
+
const o = {
|
|
103
|
+
maxBuffer: 10485760,
|
|
104
|
+
signal: s.signal,
|
|
105
105
|
timeout: e.timeout
|
|
106
|
-
}
|
|
107
|
-
|
|
106
|
+
};
|
|
107
|
+
let i;
|
|
108
|
+
if (N.test(t))
|
|
109
|
+
i = await B(t, o);
|
|
110
|
+
else {
|
|
111
|
+
const n = t.split(/\s+/).filter(Boolean);
|
|
112
|
+
i = await k(n[0], n.slice(1), o);
|
|
113
|
+
}
|
|
114
|
+
await Promise.all([i.stdout, i.stderr].map((n) => n && r(n)));
|
|
108
115
|
}
|
|
109
|
-
} catch (
|
|
110
|
-
const { stdout:
|
|
111
|
-
await Promise.all([
|
|
116
|
+
} catch (o) {
|
|
117
|
+
const { stdout: i, stderr: n, message: a } = o;
|
|
118
|
+
await Promise.all([i, n].map((c) => c && r(c))), !n && !i && u.error(`Command failed: ${a}`);
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
|
-
function
|
|
115
|
-
return { raw: !0, cmd:
|
|
121
|
+
function Y(t) {
|
|
122
|
+
return { raw: !0, cmd: t };
|
|
116
123
|
}
|
|
117
|
-
function y(
|
|
118
|
-
return
|
|
124
|
+
function y(t, r) {
|
|
125
|
+
return r?.isCurrentProject ? `${w} ${T} ${_} ${t}` : `${w} ${A} ${t}`;
|
|
119
126
|
}
|
|
120
|
-
function
|
|
121
|
-
return typeof
|
|
127
|
+
function M(t, r) {
|
|
128
|
+
return typeof t == "function" ? y(t(r), r) : typeof t == "object" && t?.raw === !0 ? t.cmd : typeof t == "string" ? y(t, r) : t;
|
|
122
129
|
}
|
|
123
|
-
async function
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const e = { isCurrentProject:
|
|
130
|
+
async function X(t) {
|
|
131
|
+
const r = await C({ name: S });
|
|
132
|
+
if (r.success) {
|
|
133
|
+
const e = { isCurrentProject: r.result.isCurrentProject }, s = typeof t == "function" ? t(e) : t;
|
|
127
134
|
return Object.fromEntries(
|
|
128
|
-
Object.entries(
|
|
135
|
+
Object.entries(s).map(([o, i]) => [o, M(i, e)])
|
|
129
136
|
);
|
|
130
137
|
}
|
|
131
138
|
}
|
|
132
|
-
async function
|
|
133
|
-
let
|
|
139
|
+
async function J(t, r, e = {}) {
|
|
140
|
+
let s;
|
|
134
141
|
try {
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
}, 100), await
|
|
140
|
-
} catch (
|
|
141
|
-
if (
|
|
142
|
-
throw
|
|
143
|
-
p(
|
|
142
|
+
const o = Date.now();
|
|
143
|
+
u.start(`${t}`), L().DEBUG ? u.info(`→ ${r}`) : s = setInterval(() => {
|
|
144
|
+
const i = Math.floor((Date.now() - o) / 1e3);
|
|
145
|
+
i > 0 && m.stdout.write(`\r⏳ ${t}... ${i}s`);
|
|
146
|
+
}, 100), await D(r, d, e), s && (clearInterval(s), m.stdout.write("\r\x1B[K")), u.success(`${t} done.`);
|
|
147
|
+
} catch (o) {
|
|
148
|
+
if (s && (clearInterval(s), m.stdout.write("\r\x1B[K")), e.throwOnError)
|
|
149
|
+
throw o;
|
|
150
|
+
p(o);
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
U as clearAllErrorLists,
|
|
155
|
+
M as formatCommand,
|
|
156
|
+
R as getStoredErrorLists,
|
|
157
|
+
Y as rawCommand,
|
|
158
|
+
X as resolveCommands,
|
|
159
|
+
J as runCommand
|
|
153
160
|
};
|
|
161
|
+
//# sourceMappingURL=command.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.util.js","sources":["../../../src/node/command/command.util.ts"],"sourcesContent":["import { exec, execFile } from 'node:child_process';\nimport process from 'node:process';\nimport * as util from 'node:util';\n\nimport { getEnv } from '#config/env/index.js';\n\nimport type { I_IssueEntry } from '../log/index.js';\nimport type { I_CommandContext, I_EslintError, T_Command, T_CommandMapInput } from './command.type.js';\n\nimport { catchError, E_IssueType, log } from '../log/index.js';\nimport { getPackage } from '../package/index.js';\nimport { CYBERSKILL_CLI, CYBERSKILL_CLI_PATH, CYBERSKILL_PACKAGE_NAME, PNPM_EXEC_CLI, TSX_CLI } from '../path/index.js';\nimport { storage } from '../storage/index.js';\n\nconst execPromise = util.promisify(exec);\nconst execFilePromise = util.promisify(execFile);\nconst SHELL_METACHARACTERS = /[|&;<>`$(){}\\[\\]!#~*?]/;\n\n/**\n * Retrieves the package name for the current project.\n * This function attempts to get the package name from the current project's package.json.\n * If the package information cannot be retrieved, it returns a timestamp as a fallback.\n *\n * @returns A promise that resolves to the package name or a timestamp string.\n */\nasync function getPackageName() {\n const pkg = await getPackage();\n\n if (!pkg.success) {\n return Date.now().toString();\n }\n\n return pkg.result.name;\n}\n\n/**\n * Saves a list of error entries to persistent storage.\n * This function stores error information with the package name as the key,\n * and provides a log link for manual inspection of the stored errors.\n *\n * @param errorList - An array of error entries to be stored.\n * @returns A promise that resolves when the storage operation is complete.\n */\nasync function saveErrorListToStorage(errorList: I_IssueEntry[]): Promise<void> {\n if (errorList.length === 0) {\n return;\n }\n\n const packageName = await getPackageName();\n\n try {\n const existingErrors = await getStoredErrorLists();\n const mergedErrors = [...existingErrors, ...errorList];\n\n await storage.set(packageName, mergedErrors);\n\n setTimeout(async () => {\n const logPath = await storage.getLogLink(packageName);\n\n if (logPath) {\n log.info(`📂 Open the error list manually: ${logPath}`);\n }\n }, 0);\n }\n catch (error) {\n catchError(error);\n }\n}\n\n/**\n * Retrieves all stored error lists from persistent storage.\n * This function fetches error entries that were previously saved using the package name as the key.\n *\n * @returns A promise that resolves to an array of error entries, or an empty array if none are found.\n */\nexport async function getStoredErrorLists(): Promise<I_IssueEntry[]> {\n try {\n const packageName = await getPackageName();\n const allErrors = await storage.get<I_IssueEntry[]>(packageName);\n\n return allErrors ?? [];\n }\n catch (error) {\n return catchError<I_IssueEntry[]>(error, {\n returnValue: [],\n });\n }\n}\n\n/**\n * Clears all stored error lists from persistent storage.\n * This function removes all error entries associated with the current package name.\n *\n * @returns A promise that resolves when the clearing operation is complete.\n */\nexport async function clearAllErrorLists(): Promise<void> {\n try {\n const packageName = await getPackageName();\n await storage.remove(packageName);\n }\n catch (error) {\n catchError(error);\n }\n}\n\n/**\n * Parses text-based error output and converts it to structured error entries.\n * This function processes command output that contains error information in text format,\n * extracting file paths, line numbers, error types, messages, and rule violations.\n * It handles multiple error formats including ESLint, TypeScript, and commitlint errors.\n *\n * @param output - The raw text output from a command execution containing error information.\n */\nasync function parseTextErrors(output: string): Promise<void> {\n const errorList: I_IssueEntry[] = [];\n const unmatchedLines: string[] = [];\n let lastFilePath = '';\n const eslintErrorDetailsRegex = /^\\s*(\\d+):(\\d+)\\s+(error|warning)\\s+(.+)\\s+(\\S+)$/;\n const tsRegex = /^(.+?)\\((\\d+),(\\d+)\\):\\s+(error|warning)\\s+TS\\d+:\\s+(\\S.+)$/;\n const commitlintRegex = /^✖\\s+(.+)\\s+\\[([^\\]]*)\\]$/;\n\n output.split('\\n').forEach((line) => {\n if (line.startsWith('/')) {\n lastFilePath = line.trim();\n }\n else {\n const eslintMatch = eslintErrorDetailsRegex.exec(line) || [];\n const tsMatch = tsRegex.exec(line) || [];\n const commitlintMatch = commitlintRegex.exec(line) || [];\n\n if (eslintMatch.length && lastFilePath) {\n errorList.push({\n file: lastFilePath,\n position: `${eslintMatch[1]}:${eslintMatch[2]}`,\n type: eslintMatch[3] === E_IssueType.Error ? E_IssueType.Error : E_IssueType.Warning,\n message: eslintMatch?.[4]?.trim() ?? '',\n rule: eslintMatch?.[5]?.trim() ?? '',\n });\n }\n else if (tsMatch.length) {\n errorList.push({\n file: tsMatch?.[1] ?? '',\n position: `${tsMatch[2]}:${tsMatch[3]}`,\n type: tsMatch[4] === E_IssueType.Error ? E_IssueType.Error : E_IssueType.Warning,\n message: tsMatch?.[5]?.trim() ?? '',\n });\n }\n else if (commitlintMatch.length) {\n errorList.push({\n file: 'commitlint',\n type: E_IssueType.Error,\n message: commitlintMatch?.[1]?.trim() ?? '',\n rule: commitlintMatch?.[2]?.trim() ?? '',\n });\n }\n else {\n unmatchedLines.push(line.trim());\n }\n }\n });\n\n if (errorList.length) {\n await saveErrorListToStorage(errorList);\n }\n\n if (getEnv().DEBUG && unmatchedLines.length) {\n log.warn(`Unmatched lines:`);\n unmatchedLines.forEach(line => log.info(` ${line}`));\n }\n}\n\n/**\n * Parses command output that contains structured error information.\n * This function attempts to parse JSON-formatted error output (typically from ESLint)\n * and converts it to structured error entries. If JSON parsing fails, it falls back\n * to text-based parsing.\n *\n * @param output - The command output to parse, expected to be JSON-formatted error data.\n */\nasync function parseCommandOutput(output: string): Promise<void> {\n try {\n const results: I_EslintError[] = JSON.parse(output);\n const errorList: I_IssueEntry[] = [];\n\n results.forEach(({ filePath, messages }) => {\n messages.forEach(({ severity, line, column, ruleId, message }) => {\n errorList.push({\n type: severity === 2 ? E_IssueType.Error : E_IssueType.Warning,\n file: filePath,\n position: `${line}:${column}`,\n rule: ruleId,\n message,\n });\n });\n });\n\n if (errorList.length) {\n await saveErrorListToStorage(errorList);\n }\n }\n catch {\n await parseTextErrors(output);\n }\n}\n\n/**\n * Executes a command and processes its output for errors.\n * This function runs a command with proper signal handling for graceful termination,\n * processes both stdout and stderr for error information, and handles command failures.\n *\n * @param command - The command string to execute, or undefined if no command should be run.\n * @param parser - The function to use for parsing command output (defaults to parseCommandOutput).\n * @returns A promise that resolves when the command execution is complete.\n */\nasync function executeCommand(command: string | void, parser = parseCommandOutput, options: { timeout?: number } = {}): Promise<void> {\n const controller = new AbortController();\n\n process.on('SIGINT', () => {\n log.warn('Process interrupted. Terminating...');\n controller.abort();\n process.exit();\n });\n\n try {\n if (typeof command === 'string') {\n const execOptions = {\n maxBuffer: 10 * 1024 * 1024,\n signal: controller.signal,\n timeout: options.timeout,\n };\n\n let result: { stdout: string; stderr: string };\n\n if (SHELL_METACHARACTERS.test(command)) {\n result = await execPromise(command, execOptions);\n }\n else {\n const parts = command.split(/\\s+/).filter(Boolean);\n result = await execFilePromise(parts[0]!, parts.slice(1), execOptions);\n }\n\n await Promise.all([result.stdout, result.stderr].map(output => output && parser(output)));\n }\n }\n catch (error) {\n const { stdout, stderr, message } = error as {\n stdout?: string;\n stderr?: string;\n message: string;\n };\n\n await Promise.all([stdout, stderr].map(output => output && parser(output)));\n\n if (!stderr && !stdout) {\n log.error(`Command failed: ${message}`);\n }\n }\n}\n\n/**\n * Creates a raw command object that bypasses CLI formatting.\n * This function wraps a command string in an object that indicates it should be executed\n * as-is without any additional CLI formatting or path resolution.\n *\n * @param cmd - The raw command string to be executed directly.\n * @returns An object containing the raw command with a flag indicating it should not be formatted.\n */\nexport function rawCommand(cmd: string) {\n return { raw: true, cmd };\n}\n\n/**\n * Formats a command for CLI execution based on the current project context.\n * This function determines whether to use the current project's CLI path or the global CLI,\n * and formats the command accordingly with the appropriate executable paths.\n *\n * @param command - The command string to format.\n * @param context - Optional context information about the current project.\n * @returns The formatted command string ready for execution.\n */\nfunction formatCLI(command: string, context?: I_CommandContext) {\n if (context?.isCurrentProject) {\n return `${PNPM_EXEC_CLI} ${TSX_CLI} ${CYBERSKILL_CLI_PATH} ${command}`;\n }\n\n return `${PNPM_EXEC_CLI} ${CYBERSKILL_CLI} ${command}`;\n}\n\n/**\n * Formats a command based on its type and context.\n * This function handles different command types:\n * - Function commands: Executes the function with context and formats the result\n * - Raw commands: Returns the command as-is without formatting\n * - String commands: Formats them as CLI commands\n *\n * @param command - The command to format, which can be a string, function, or raw command object.\n * @param context - Optional context information for command execution.\n * @returns The formatted command string ready for execution.\n */\nexport function formatCommand(command: T_Command, context?: I_CommandContext) {\n if (typeof command === 'function') {\n return formatCLI(command(context), context);\n }\n\n if (typeof command === 'object' && command?.raw === true) {\n return command.cmd;\n }\n\n if (typeof command === 'string') {\n return formatCLI(command, context);\n }\n\n return command;\n}\n\n/**\n * Resolves a map of commands by formatting them based on the current project context.\n * This function takes a command map (either static or dynamic) and formats all commands\n * using the appropriate CLI paths based on whether the current project is the Cyberskill package.\n *\n * @param input - The command map to resolve, which can be static or a function that returns a map.\n * @returns A promise that resolves to an object with formatted command strings, or undefined if package info cannot be retrieved.\n */\nexport async function resolveCommands(input: T_CommandMapInput) {\n const packageData = await getPackage({ name: CYBERSKILL_PACKAGE_NAME });\n\n if (packageData.success) {\n const ctx: I_CommandContext = { isCurrentProject: packageData.result.isCurrentProject };\n const commands = typeof input === 'function' ? input(ctx) : input;\n\n return Object.fromEntries(\n Object.entries(commands).map(([key, cmd]) => [key, formatCommand(cmd, ctx)]),\n );\n }\n}\n\n/**\n * Executes a command with proper logging and error handling.\n * This function provides a standardized way to run commands with:\n * - Progress logging with start and success messages\n * - Debug logging of the actual command when DEBUG mode is enabled\n * - Error handling and reporting\n *\n * @param label - A human-readable label describing what the command does.\n * @param command - The command string to execute, or undefined if no command should be run.\n * @returns A promise that resolves when the command execution is complete.\n */\nexport async function runCommand(label: string, command: string | void, options: { timeout?: number; throwOnError?: boolean } = {}) {\n let timer: NodeJS.Timeout | undefined;\n\n try {\n const startTime = Date.now();\n log.start(`${label}`);\n\n if (getEnv().DEBUG) {\n log.info(`→ ${command}`);\n }\n else {\n timer = setInterval(() => {\n const elapsed = Math.floor((Date.now() - startTime) / 1000);\n\n if (elapsed > 0) {\n process.stdout.write(`\\r⏳ ${label}... ${elapsed}s`);\n }\n }, 100);\n }\n\n await executeCommand(command, parseCommandOutput, options);\n\n if (timer) {\n clearInterval(timer);\n process.stdout.write(`\\r\\x1B[K`);\n }\n\n log.success(`${label} done.`);\n }\n catch (error) {\n if (timer) {\n clearInterval(timer);\n process.stdout.write(`\\r\\x1B[K`);\n }\n\n if (options.throwOnError) {\n throw error;\n }\n catchError(error);\n }\n}\n"],"names":["exec","execFile","process","util","storage","getPackage","CYBERSKILL_PACKAGE_NAME","PNPM_EXEC_CLI","TSX_CLI","CYBERSKILL_CLI_PATH","CYBERSKILL_CLI","E_IssueType","log","catchError","getEnv","execPromise","execFilePromise","SHELL_METACHARACTERS","getPackageName","pkg","saveErrorListToStorage","errorList","packageName","mergedErrors","getStoredErrorLists","logPath","error","clearAllErrorLists","parseTextErrors","output","unmatchedLines","lastFilePath","eslintErrorDetailsRegex","tsRegex","commitlintRegex","line","eslintMatch","tsMatch","commitlintMatch","parseCommandOutput","results","filePath","messages","severity","column","ruleId","message","executeCommand","command","parser","options","controller","execOptions","result","parts","stdout","stderr","rawCommand","cmd","formatCLI","context","formatCommand","resolveCommands","input","packageData","ctx","commands","key","runCommand","label","timer","startTime","elapsed"],"mappings":"AAcA,SAAA,QAAAA,GAAA,YAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,SAAA,cAAAC,SAAA;AAAA,SAAA,2BAAAC,GAAA,iBAAAC,GAAA,WAAAC,GAAA,uBAAAC,GAAA,kBAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,OAAAC,GAAA,cAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,MAAMC,IAAcZ,EAAK,UAAUH,CAAI,GACjCgB,IAAkBb,EAAK,UAAUF,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,GAAKO,CAAG,CAAC,CAAC;AAAA,IAAA;AAAA,EAEnF;AACJ;AAaA,eAAsBG,EAAWC,GAAerB,GAAwBE,IAAwD,CAAA,GAAI;AAChI,MAAIoB;AAEJ,MAAI;AACA,UAAMC,IAAY,KAAK,IAAA;AACvB,IAAA3D,EAAI,MAAM,GAAGyD,CAAK,EAAE,GAEhBvD,EAAA,EAAS,QACTF,EAAI,KAAK,KAAKoC,CAAO,EAAE,IAGvBsB,IAAQ,YAAY,MAAM;AACtB,YAAME,IAAU,KAAK,OAAO,KAAK,IAAA,IAAQD,KAAa,GAAI;AAE1D,MAAIC,IAAU,KACVtE,EAAQ,OAAO,MAAM,OAAOmE,CAAK,OAAOG,CAAO,GAAG;AAAA,IAE1D,GAAG,GAAG,GAGV,MAAMzB,EAAeC,GAAST,GAAoBW,CAAO,GAErDoB,MACA,cAAcA,CAAK,GACnBpE,EAAQ,OAAO,MAAM,UAAU,IAGnCU,EAAI,QAAQ,GAAGyD,CAAK,QAAQ;AAAA,EAChC,SACO3C,GAAO;AAMV,QALI4C,MACA,cAAcA,CAAK,GACnBpE,EAAQ,OAAO,MAAM,UAAU,IAG/BgD,EAAQ;AACR,YAAMxB;AAEV,IAAAb,EAAWa,CAAK;AAAA,EACpB;AACJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -6,6 +6,9 @@ export { Router } from 'express';
|
|
|
6
6
|
export interface I_ExpressOptions {
|
|
7
7
|
isDev?: boolean;
|
|
8
8
|
static?: string | string[];
|
|
9
|
+
maxFileSize?: number;
|
|
10
|
+
maxFiles?: number;
|
|
11
|
+
jsonLimit?: string;
|
|
9
12
|
}
|
|
10
13
|
export interface I_NestOptions {
|
|
11
14
|
module: Type<object>;
|
|
@@ -13,6 +16,7 @@ export interface I_NestOptions {
|
|
|
13
16
|
static?: string | string[];
|
|
14
17
|
filters?: ExceptionFilter[];
|
|
15
18
|
pipes?: ValidationPipe[];
|
|
19
|
+
jsonLimit?: string;
|
|
16
20
|
}
|
|
17
21
|
export type T_CorsType = 'node' | 'nest';
|
|
18
22
|
interface I_BaseCorsOptions {
|
|
@@ -1,54 +1,72 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import m from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import u from "node:process";
|
|
2
|
+
import { NestFactory as n } from "@nestjs/core";
|
|
3
|
+
import l from "compression";
|
|
4
|
+
import m from "cookie-parser";
|
|
5
|
+
import f from "cors";
|
|
6
|
+
import i from "express";
|
|
7
|
+
import { default as G } from "express";
|
|
8
|
+
import d from "express-session";
|
|
8
9
|
import { express as p } from "express-useragent";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
function
|
|
10
|
+
import x from "graphql-upload/graphqlUploadExpress.mjs";
|
|
11
|
+
import y from "helmet";
|
|
12
|
+
function E({ isDev: e, whiteList: r, ...t }) {
|
|
12
13
|
return {
|
|
13
|
-
origin: (
|
|
14
|
-
e || !
|
|
14
|
+
origin: (s, o) => {
|
|
15
|
+
e || !s || r?.includes(s ?? "") ? o(null, !0) : o(new Error("Not allowed by CORS"), !1);
|
|
15
16
|
},
|
|
16
17
|
credentials: !0,
|
|
17
|
-
...
|
|
18
|
+
...t
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
21
|
+
function F(e) {
|
|
22
|
+
return f(E(e));
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
24
|
+
function P(e) {
|
|
25
|
+
const r = {
|
|
26
|
+
resave: !1,
|
|
27
|
+
saveUninitialized: !1,
|
|
28
|
+
cookie: {
|
|
29
|
+
httpOnly: !0,
|
|
30
|
+
sameSite: "lax",
|
|
31
|
+
secure: u.env.NODE_ENV === "production"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return d({
|
|
35
|
+
...r,
|
|
36
|
+
...e,
|
|
37
|
+
cookie: { ...r.cookie, ...e.cookie }
|
|
38
|
+
});
|
|
25
39
|
}
|
|
26
|
-
function c(e, r = !1) {
|
|
40
|
+
function c(e, r = !1, t = "1mb") {
|
|
27
41
|
e.set("trust proxy", 1), e.use(
|
|
28
|
-
|
|
42
|
+
y({
|
|
29
43
|
crossOriginEmbedderPolicy: r ? !1 : void 0,
|
|
30
44
|
contentSecurityPolicy: r ? !1 : void 0
|
|
31
45
|
})
|
|
32
|
-
), e.use(
|
|
46
|
+
), e.use(m()), e.use(i.json({ limit: t })), e.use(i.urlencoded({ extended: !0, limit: t })), e.use(l()), e.use(p());
|
|
33
47
|
}
|
|
34
|
-
function
|
|
35
|
-
r && (Array.isArray(r) ? r : [r]).forEach((
|
|
36
|
-
e.use(`/${
|
|
48
|
+
function a(e, r) {
|
|
49
|
+
r && (Array.isArray(r) ? r : [r]).forEach((s) => {
|
|
50
|
+
e.use(`/${s}`, i.static(s));
|
|
37
51
|
});
|
|
38
52
|
}
|
|
39
|
-
function
|
|
40
|
-
const r =
|
|
41
|
-
return c(r, e?.isDev),
|
|
53
|
+
function z(e) {
|
|
54
|
+
const r = i();
|
|
55
|
+
return c(r, e?.isDev, e?.jsonLimit), a(r, e?.static), r.use(x({
|
|
56
|
+
maxFileSize: e?.maxFileSize ?? 1e7,
|
|
57
|
+
maxFiles: e?.maxFiles ?? 10
|
|
58
|
+
})), r;
|
|
42
59
|
}
|
|
43
|
-
async function
|
|
44
|
-
const r = await
|
|
45
|
-
return c(r.getHttpAdapter().getInstance(), e.isDev),
|
|
60
|
+
async function C(e) {
|
|
61
|
+
const r = await n.create(e.module);
|
|
62
|
+
return c(r.getHttpAdapter().getInstance(), e.isDev, e.jsonLimit), a(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
|
|
46
63
|
}
|
|
47
64
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
F as createCors,
|
|
66
|
+
E as createCorsOptions,
|
|
67
|
+
z as createExpress,
|
|
68
|
+
C as createNest,
|
|
69
|
+
P as createSession,
|
|
70
|
+
G as express
|
|
54
71
|
};
|
|
72
|
+
//# sourceMappingURL=express.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"express.util.js","sources":["../../../src/node/express/express.util.ts"],"sourcesContent":["import type { INestApplication } from '@nestjs/common';\nimport type { Application, RequestHandler } from 'express';\nimport type { SessionOptions } from 'express-session';\n\nimport process from 'node:process';\n\nimport { NestFactory } from '@nestjs/core';\nimport bodyParser from 'body-parser';\nimport compression from 'compression';\nimport cookieParser from 'cookie-parser';\nimport cors from 'cors';\nimport express from 'express';\nimport session from 'express-session';\nimport { express as useragent } from 'express-useragent';\nimport graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';\nimport helmet from 'helmet';\n\nimport type { I_ExpressOptions, I_NestOptions, T_CorsOptions, T_CorsType } from './express.type.js';\n\n/**\n * Creates CORS options with environment-specific configuration.\n * This function generates CORS options based on the development environment,\n * including whitelist configuration for allowed origins.\n *\n * @param options - CORS configuration options.\n * @param options.isDev - Whether the application is running in development mode.\n * @param options.whiteList - Array of allowed origins for CORS requests.\n * @returns CORS options object configured for the specified environment.\n */\nexport function createCorsOptions<T extends T_CorsType>({ isDev, whiteList, ...rest }: T_CorsOptions<T>) {\n return {\n origin: (origin: string | undefined, callback: (err: Error | null, allow?: boolean) => void) => {\n if (isDev || !origin || whiteList?.includes(origin ?? '')) {\n callback(null, true);\n }\n else {\n callback(new Error('Not allowed by CORS'), false);\n }\n },\n credentials: true,\n ...rest,\n };\n}\n\n/**\n * Creates a CORS middleware function with the specified configuration.\n * This function creates a CORS middleware that can be used with both Express and NestJS applications,\n * applying the configured CORS options for origin validation and credential handling.\n *\n * @param options - CORS configuration options to apply to the middleware.\n * @returns A CORS middleware function ready to be used in Express or NestJS applications.\n */\nexport function createCors<T extends T_CorsType>(options: T_CorsOptions<T>) {\n return cors<cors.CorsRequest>(createCorsOptions(options));\n}\n\n/**\n * Creates a session middleware function with the specified configuration.\n * This function creates an Express session middleware that can be used to handle user sessions\n * with the provided session options including secret, cookie settings, and storage configuration.\n *\n * @param options - Session configuration options including secret, cookie settings, and storage.\n * @returns A session middleware function ready to be used in Express applications.\n */\nexport function createSession(options: SessionOptions): RequestHandler {\n const secureDefaults: Partial<SessionOptions> = {\n resave: false,\n saveUninitialized: false,\n cookie: {\n httpOnly: true,\n sameSite: 'lax',\n secure: process.env['NODE_ENV'] === 'production',\n },\n };\n\n return session({\n ...secureDefaults,\n ...options,\n cookie: { ...secureDefaults.cookie, ...options.cookie },\n });\n}\n\n/**\n * Sets up common middleware for Express applications.\n * This function configures essential middleware including:\n * - Trust proxy settings for proper IP handling\n * - Cookie parsing for request cookies\n * - URL-encoded body parsing for form data\n * - Compression for response optimization\n * - User agent parsing for device/browser detection\n *\n * @param app - The Express application instance to configure with middleware.\n */\nfunction setupMiddleware(app: Application, isDev = false, jsonLimit = '1mb') {\n app.set('trust proxy', 1);\n app.use(\n helmet({\n crossOriginEmbedderPolicy: isDev ? false : undefined,\n contentSecurityPolicy: isDev ? false : undefined,\n }),\n );\n app.use(cookieParser());\n app.use(express.json({ limit: jsonLimit }));\n app.use(express.urlencoded({ extended: true, limit: jsonLimit }));\n app.use(compression());\n app.use(useragent());\n}\n\n/**\n * Sets up static file serving for Express applications.\n * This function configures static file serving for the specified folders,\n * making files in those directories accessible via HTTP requests.\n *\n * @param app - The Express application instance to configure with static file serving.\n * @param staticFolders - A string or array of strings representing the paths to serve statically.\n */\nfunction setupStaticFolders(app: Application, staticFolders?: string | string[]) {\n if (staticFolders) {\n const statics = Array.isArray(staticFolders) ? staticFolders : [staticFolders];\n statics.forEach((folder) => {\n app.use(`/${folder}`, express.static(folder));\n });\n }\n}\n\n/**\n * Creates and configures an Express application with common middleware and settings.\n * This function sets up a complete Express application with:\n * - Essential middleware (cookies, body parsing, compression, user agent)\n * - Static file serving for specified folders\n * - GraphQL upload support for file uploads\n *\n * @param options - Optional configuration for the Express application including static folder paths.\n * @returns A configured Express application instance ready for use.\n */\nexport function createExpress(options?: I_ExpressOptions): Application {\n const app = express();\n\n setupMiddleware(app, options?.isDev, options?.jsonLimit);\n setupStaticFolders(app, options?.static);\n app.use(graphqlUploadExpress({\n maxFileSize: options?.maxFileSize ?? 10_000_000,\n maxFiles: options?.maxFiles ?? 10,\n }));\n\n return app;\n}\n\n/**\n * Creates and configures a NestJS application with Express integration.\n * This function sets up a NestJS application with:\n * - Express HTTP adapter configuration\n * - Common middleware (cookies, body parsing, compression, user agent)\n * - Static file serving for specified folders\n * - Global filters and pipes if provided\n *\n * @param options - Configuration options for the NestJS application including module, static folders, filters, and pipes.\n * @returns A promise that resolves to a configured NestJS application instance.\n */\nexport async function createNest(options: I_NestOptions): Promise<INestApplication> {\n const app = await NestFactory.create(options.module);\n\n setupMiddleware(app.getHttpAdapter().getInstance(), options.isDev, options.jsonLimit);\n setupStaticFolders(app.getHttpAdapter().getInstance(), options.static);\n\n if (options.filters) {\n app.useGlobalFilters(...options.filters);\n }\n\n if (options.pipes) {\n app.useGlobalPipes(...options.pipes);\n }\n\n return app;\n}\n\nexport { bodyParser, express };\n"],"names":["createCorsOptions","isDev","whiteList","rest","origin","callback","createCors","options","cors","createSession","secureDefaults","process","session","setupMiddleware","app","jsonLimit","helmet","cookieParser","express","compression","useragent","setupStaticFolders","staticFolders","folder","createExpress","graphqlUploadExpress","createNest","NestFactory"],"mappings":";;;;;;;;;;;AA6BO,SAASA,EAAwC,EAAE,OAAAC,GAAO,WAAAC,GAAW,GAAGC,KAA0B;AACrG,SAAO;AAAA,IACH,QAAQ,CAACC,GAA4BC,MAA2D;AAC5F,MAAIJ,KAAS,CAACG,KAAUF,GAAW,SAASE,KAAU,EAAE,IACpDC,EAAS,MAAM,EAAI,IAGnBA,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;AACnE,QAAMO,IAAMI,EAAA;AAEZ,SAAAL,EAAgBC,GAAKP,GAAS,OAAOA,GAAS,SAAS,GACvDc,EAAmBP,GAAKP,GAAS,MAAM,GACvCO,EAAI,IAAIW,EAAqB;AAAA,IACzB,aAAalB,GAAS,eAAe;AAAA,IACrC,UAAUA,GAAS,YAAY;AAAA,EAAA,CAClC,CAAC,GAEKO;AACX;AAaA,eAAsBY,EAAWnB,GAAmD;AAChF,QAAMO,IAAM,MAAMa,EAAY,OAAOpB,EAAQ,MAAM;AAEnD,SAAAM,EAAgBC,EAAI,iBAAiB,YAAA,GAAeP,EAAQ,OAAOA,EAAQ,SAAS,GACpFc,EAAmBP,EAAI,eAAA,EAAiB,YAAA,GAAeP,EAAQ,MAAM,GAEjEA,EAAQ,WACRO,EAAI,iBAAiB,GAAGP,EAAQ,OAAO,GAGvCA,EAAQ,SACRO,EAAI,eAAe,GAAGP,EAAQ,KAAK,GAGhCO;AACX;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/node/fs/fs.util.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.util.js","sources":["../../../src/node/fs/fs.util.ts"],"sourcesContent":["import fsExtra from 'fs-extra';\nimport path from 'node:path';\n\nimport type { I_CopySyncOptions } from './fs.type.js';\n\n/**\n * Re-export of the fs-extra module for file system operations.\n */\nexport const fs = fsExtra;\n\nexport const {\n lstatSync,\n readdirSync,\n mkdirSync,\n readFileSync,\n unlinkSync,\n statSync,\n createWriteStream,\n} = fsExtra;\n\nexport const readJsonSync: typeof fsExtra.readJsonSync = fsExtra.readJsonSync;\n\n/**\n * Writes data to a file synchronously with UTF-8 encoding as default.\n * This function provides a simplified interface for writing files with automatic UTF-8 encoding\n * when no specific options are provided.\n *\n * @param file - The file path or file descriptor to write to.\n * @param data - The data to write to the file (string or Uint8Array).\n * @param options - Optional write file options (defaults to UTF-8 encoding).\n */\nexport function writeFileSync(file: fsExtra.PathOrFileDescriptor, data: string | Uint8Array, options?: fsExtra.WriteFileOptions): void {\n fsExtra.writeFileSync(file, data, options ?? 'utf-8');\n}\n\n/**\n * Appends data to a file synchronously with UTF-8 encoding as default.\n * This function provides a simplified interface for appending to files with automatic UTF-8 encoding\n * when no specific options are provided.\n *\n * @param path - The file path or file descriptor to append to.\n * @param data - The data to append to the file (string or Uint8Array).\n * @param options - Optional write file options (defaults to UTF-8 encoding).\n */\nexport function appendFileSync(path: fsExtra.PathOrFileDescriptor, data: string | Uint8Array, options?: fsExtra.WriteFileOptions): void {\n fsExtra.appendFileSync(path, data, options ?? 'utf-8');\n}\n\n/**\n * Checks if all specified paths exist synchronously.\n * This function verifies that every path in the provided array exists in the file system.\n * Returns true only if all paths exist, false if any path is missing.\n *\n * @param paths - An array of file or directory paths to check for existence.\n * @returns True if all paths exist, false if any path is missing.\n */\nexport function pathExistsSync(...paths: string[]) {\n return paths.every(path => fsExtra.pathExistsSync(path));\n}\n\n/**\n * Removes files or directories synchronously if they exist.\n * This function safely removes multiple files or directories by checking for existence\n * before attempting removal, preventing errors for non-existent paths.\n *\n * @param paths - An array of file or directory paths to remove.\n */\nexport function removeSync(...paths: string[]) {\n paths.forEach((filePath) => {\n if (pathExistsSync(filePath)) {\n fsExtra.removeSync(filePath);\n }\n });\n}\n\n/**\n * Copies files and directories synchronously with optional filtering.\n * This function copies files from source to destination with support for:\n * - Extension-based filtering (only copy files with specified extensions)\n * - Directory preservation (always copy directories regardless of extension filter)\n * - Additional copy options from fs-extra\n *\n * @param src - The source path to copy from.\n * @param dest - The destination path to copy to.\n * @param options - Optional copy configuration including extensions filter and other fs-extra options.\n */\nexport function copySync(src: string, dest: string, options: I_CopySyncOptions = {}): void {\n const { extensions, ...rest } = options;\n\n fsExtra.copySync(src, dest, {\n filter: (srcPath: string) => {\n if (statSync(srcPath).isDirectory()) {\n return true;\n }\n\n if (!extensions || extensions.length === 0) {\n return true;\n }\n\n return extensions.includes(path.extname(srcPath));\n },\n ...rest,\n });\n}\n\n/**\n * Adds an entry to the .gitignore file if it doesn't already exist.\n * Creates the .gitignore file if it doesn't exist.\n *\n * @param gitIgnorePath - The absolute path to the .gitignore file.\n * @param entry - The entry name to add (e.g. '.agent', '.simple-git-hooks.json').\n */\nexport function addGitIgnoreEntry(gitIgnorePath: string, entry: string): void {\n const gitIgnoreContent = `\\n${entry}\\n`;\n\n if (pathExistsSync(gitIgnorePath)) {\n const gitignore = readFileSync(gitIgnorePath, 'utf-8').split('\\n');\n\n if (!gitignore.includes(entry)) {\n appendFileSync(gitIgnorePath, gitIgnoreContent);\n }\n }\n else {\n writeFileSync(gitIgnorePath, gitIgnoreContent);\n }\n}\n"],"names":["fsExtra","path","fs","lstatSync","readdirSync","mkdirSync","readFileSync","unlinkSync","statSync","createWriteStream","readJsonSync","writeFileSync","file","data","options","appendFileSync","pathExistsSync","paths","removeSync","filePath","copySync","src","dest","extensions","rest","srcPath","addGitIgnoreEntry","gitIgnorePath","entry","gitIgnoreContent"],"mappings":"AAQO,OAAAA,OAAA;AAAA,OAAAC,OAAA;AAAA,MAAMC,IAAKF,GAEL;AAAA,EACT,WAAAG;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AACJ,IAAIT,GAESU,IAA4CV,EAAQ;AAW1D,SAASW,EAAcC,GAAoCC,GAA2BC,GAA0C;AACnI,EAAAd,EAAQ,cAAcY,GAAMC,GAAMC,KAAW,OAAO;AACxD;AAWO,SAASC,EAAed,GAAoCY,GAA2BC,GAA0C;AACpI,EAAAd,EAAQ,eAAeC,GAAMY,GAAMC,KAAW,OAAO;AACzD;AAUO,SAASE,KAAkBC,GAAiB;AAC/C,SAAOA,EAAM,MAAM,CAAAhB,MAAQD,EAAQ,eAAeC,CAAI,CAAC;AAC3D;AASO,SAASiB,KAAcD,GAAiB;AAC3C,EAAAA,EAAM,QAAQ,CAACE,MAAa;AACxB,IAAIH,EAAeG,CAAQ,KACvBnB,EAAQ,WAAWmB,CAAQ;AAAA,EAEnC,CAAC;AACL;AAaO,SAASC,EAASC,GAAaC,GAAcR,IAA6B,CAAA,GAAU;AACvF,QAAM,EAAE,YAAAS,GAAY,GAAGC,EAAA,IAASV;AAEhC,EAAAd,EAAQ,SAASqB,GAAKC,GAAM;AAAA,IACxB,QAAQ,CAACG,MACDjB,EAASiB,CAAO,EAAE,iBAIlB,CAACF,KAAcA,EAAW,WAAW,IAC9B,KAGJA,EAAW,SAAStB,EAAK,QAAQwB,CAAO,CAAC;AAAA,IAEpD,GAAGD;AAAA,EAAA,CACN;AACL;AASO,SAASE,EAAkBC,GAAuBC,GAAqB;AAC1E,QAAMC,IAAmB;AAAA,EAAKD,CAAK;AAAA;AAEnC,EAAIZ,EAAeW,CAAa,IACVrB,EAAaqB,GAAe,OAAO,EAAE,MAAM;AAAA,CAAI,EAElD,SAASC,CAAK,KACzBb,EAAeY,GAAeE,CAAgB,IAIlDlB,EAAcgB,GAAeE,CAAgB;AAErD;"}
|
package/dist/node/fs/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/node/log/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.type.js","sources":["../../../src/node/log/log.type.ts"],"sourcesContent":["import type { I_Log as I_LogCommon } from '#typescript/index.js';\n\n/**\n * Enum representing the type of issues for logging and error handling.\n * - Error: Represents an error issue.\n * - Warning: Represents a warning issue.\n */\nexport enum E_IssueType {\n Error = 'error',\n Warning = 'warning',\n}\n\nexport interface I_IssueEntry {\n type: E_IssueType;\n file: string;\n message: string;\n position?: string;\n rule?: string;\n}\n\nexport interface I_ThrowError {\n message?: string;\n status?: {\n CODE: string | number;\n MESSAGE: string;\n };\n type?: 'graphql' | 'rest';\n}\n\nexport interface I_Log extends I_LogCommon {\n printBoxedLog: (\n title: string,\n issues: I_IssueEntry[],\n color?: string,\n ) => void;\n}\n\nexport interface I_CatchErrorOptions {\n shouldLog?: boolean;\n returnValue?: unknown;\n callback?: (error: Error) => void;\n}\n"],"names":["E_IssueType"],"mappings":"AAOO,IAAKA,sBAAAA,OACRA,EAAA,QAAQ,SACRA,EAAA,UAAU,WAFFA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.util.js","sources":["../../../src/node/log/log.util.ts"],"sourcesContent":["import type { ChalkInstance } from 'chalk';\n\nimport chalk from 'chalk';\nimport consola from 'consola';\nimport { GraphQLError } from 'graphql';\n\nimport type { I_Return } from '#typescript/index.js';\n\nimport { getEnv } from '#config/env/index.js';\nimport { RESPONSE_STATUS } from '#constant/index.js';\n\nimport type { I_CatchErrorOptions, I_IssueEntry, I_Log, I_ThrowError } from './log.type.js';\n\nconst env = getEnv();\n\n/**\n * Throws a standardized error with optional status information and type specification.\n * This function creates and throws errors that can be either GraphQL errors (with extensions)\n * or standard JavaScript errors, depending on the specified type.\n *\n * @param options - Error configuration including message, status information, and error type.\n * @param options.message - The error message to display.\n * @param options.status - The response status information (defaults to INTERNAL_SERVER_ERROR).\n * @param options.type - The type of error to throw ('graphql' or 'rest', defaults to 'graphql').\n * @throws {GraphQLError} When type is 'graphql', throws a GraphQL error with extensions.\n * @throws {Error} When type is 'rest' or unspecified, throws a standard JavaScript error.\n */\nexport function throwError({\n message,\n status = RESPONSE_STATUS.INTERNAL_SERVER_ERROR,\n type = 'graphql',\n}: I_ThrowError): never {\n const responseMessage\n = message ?? status.MESSAGE ?? 'Internal server error';\n\n if (type === 'graphql') {\n throw new GraphQLError(responseMessage, {\n extensions: { code: status.CODE },\n });\n }\n\n else {\n throw new Error(responseMessage);\n }\n}\n\nif (!env.DEBUG) {\n consola.level = 4;\n}\n\n/**\n * Gets a chalk color instance by keyword name.\n * This function safely retrieves a chalk color function by name, falling back to green\n * if the specified color is not available or invalid.\n *\n * @param color - The color keyword to get the chalk instance for.\n * @returns A chalk instance for the specified color, or green as fallback.\n */\nfunction chalkKeyword(color: string): ChalkInstance {\n const chalkColor = chalk[color as keyof typeof chalk];\n\n return typeof chalkColor === 'function' ? (chalkColor as ChalkInstance) : chalk.green;\n}\n\n/**\n * Enhanced logging interface that extends consola with custom functionality.\n * This object provides all standard consola logging methods plus additional features\n * like boxed log printing for structured error/warning display.\n */\nexport const log: I_Log = {\n silent: consola.silent,\n level: consola.level,\n fatal: consola.fatal,\n error: consola.error,\n warn: consola.warn,\n log: consola.log,\n info: consola.info,\n success: consola.success,\n ready: consola.ready,\n start: consola.start,\n box: consola.box,\n debug: consola.debug,\n trace: consola.trace,\n verbose: consola.verbose,\n /**\n * Prints a boxed log with structured issue information.\n * This method displays issues (errors or warnings) in a formatted box with:\n * - File paths and line/column positions\n * - Rule violations (if applicable)\n * - Error/warning messages\n * - Color-coded output based on issue type\n *\n * @param title - The title to display in the box header.\n * @param issues - An array of issue entries to display.\n * @param color - The color to use for highlighting (defaults to 'red').\n */\n printBoxedLog(title: string, issues: I_IssueEntry[], color = 'red') {\n if (!issues?.length) {\n consola.box(chalk.green(title));\n return;\n }\n\n issues.forEach(({ file, position, rule, message }) => {\n const positionSuffix = position ? `:${position}` : '';\n const filePath = `${file}${positionSuffix}`;\n consola.log(`${chalk.gray('File:')} ${chalk.blue(filePath)}`);\n\n if (rule) {\n consola.log(` ${chalkKeyword(color)('Rule:')} ${rule}`);\n }\n\n consola.log(` ${chalkKeyword(color)('Message:')} ${message}`);\n });\n\n consola.box(chalkKeyword(color)(`${title} : ${issues.length}`));\n\n consola.log(chalk.gray('─'.repeat(40)));\n },\n};\n\n/**\n * Catches and handles errors with configurable behavior.\n * This function provides a standardized way to handle errors with options for:\n * - Logging control (whether to log the error)\n * - Return value specification (what to return on error)\n * - Custom callback execution (additional error handling)\n *\n * @param errorInput - The error to catch and handle.\n * @param options - Configuration options for error handling behavior.\n * @returns Either the specified return value or a standardized error response object.\n */\nexport function catchError<T = unknown>(errorInput: unknown, options: I_CatchErrorOptions & { returnValue: T }): T;\nexport function catchError<T = unknown>(errorInput: unknown, options?: I_CatchErrorOptions): I_Return<T>;\nexport function catchError<T = unknown>(errorInput: unknown, options?: I_CatchErrorOptions): I_Return<T> | T {\n const { shouldLog = true, returnValue, callback } = options ?? {};\n\n const error = errorInput instanceof Error\n ? errorInput\n : new Error(typeof errorInput === 'string' ? errorInput : 'Unknown error');\n\n if (shouldLog) {\n log.error(error.message);\n }\n\n if (callback && typeof callback === 'function') {\n callback(error);\n }\n\n if (returnValue) {\n return returnValue as T;\n }\n\n return {\n success: false,\n message: error.message,\n code: RESPONSE_STATUS.INTERNAL_SERVER_ERROR.CODE,\n };\n}\n"],"names":["env","getEnv","throwError","message","status","RESPONSE_STATUS","type","responseMessage","GraphQLError","consola","chalkKeyword","color","chalkColor","chalk","log","title","issues","file","position","rule","positionSuffix","filePath","catchError","errorInput","options","shouldLog","returnValue","callback","error"],"mappings":";;;;;AAaA,MAAMA,IAAMC,EAAA;AAcL,SAASC,EAAW;AAAA,EACvB,SAAAC;AAAA,EACA,QAAAC,IAASC,EAAgB;AAAA,EACzB,MAAAC,IAAO;AACX,GAAwB;AACpB,QAAMC,IACAJ,KAAWC,EAAO,WAAW;AAEnC,QAAIE,MAAS,YACH,IAAIE,EAAaD,GAAiB;AAAA,IACpC,YAAY,EAAE,MAAMH,EAAO,KAAA;AAAA,EAAK,CACnC,IAIK,IAAI,MAAMG,CAAe;AAEvC;AAEKP,EAAI,UACLS,EAAQ,QAAQ;AAWpB,SAASC,EAAaC,GAA8B;AAChD,QAAMC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,EAAQ,IAAII,EAAM,KAAK,IAAI,OAAO,EAAE,CAAC,CAAC;AAAA,EAC1C;AACJ;AAeO,SAASS,EAAwBC,GAAqBC,GAAgD;AACzG,QAAM,EAAE,WAAAC,IAAY,IAAM,aAAAC,GAAa,UAAAC,EAAA,IAAaH,KAAW,CAAA,GAEzDI,IAAQL,aAAsB,QAC9BA,IACA,IAAI,MAAM,OAAOA,KAAe,WAAWA,IAAa,eAAe;AAU7E,SARIE,KACAX,EAAI,MAAMc,EAAM,OAAO,GAGvBD,KAAY,OAAOA,KAAa,cAChCA,EAASC,CAAK,GAGdF,KAIG;AAAA,IACH,SAAS;AAAA,IACT,SAASE,EAAM;AAAA,IACf,MAAMvB,EAAgB,sBAAsB;AAAA,EAAA;AAEpD;"}
|
package/dist/node/mongo/index.js
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { MONGO_MIGRATE_OPTIONS as r, MONGO_SLUG_MAX_ATTEMPTS as t } from "./mongo.constant.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { filterDynamicVirtualsFromPopulate as m, isMongooseDoc as p, isObject as n, populateDynamicVirtuals as a, remapDynamicPopulate as M } from "./mongo.dynamic-populate.js";
|
|
3
|
+
import { applyNestedPopulate as _ } from "./mongo.populate.js";
|
|
4
|
+
import { C_Collection as f, C_Db as u, C_Document as s, C_Model as x } from "./mongo.type.js";
|
|
5
|
+
import { convertEnumToModelName as O, mongo as D } from "./mongo.util.js";
|
|
6
|
+
import { MongoController as N } from "./mongo.controller.native.js";
|
|
7
|
+
import { MongooseController as g } from "./mongo.controller.mongoose.js";
|
|
5
8
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
f as C_Collection,
|
|
10
|
+
u as C_Db,
|
|
11
|
+
s as C_Document,
|
|
12
|
+
x as C_Model,
|
|
10
13
|
r as MONGO_MIGRATE_OPTIONS,
|
|
11
14
|
t as MONGO_SLUG_MAX_ATTEMPTS,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
N as MongoController,
|
|
16
|
+
g as MongooseController,
|
|
17
|
+
_ as applyNestedPopulate,
|
|
18
|
+
O as convertEnumToModelName,
|
|
19
|
+
m as filterDynamicVirtualsFromPopulate,
|
|
20
|
+
p as isMongooseDoc,
|
|
21
|
+
n as isObject,
|
|
22
|
+
D as mongo,
|
|
23
|
+
a as populateDynamicVirtuals,
|
|
24
|
+
M as remapDynamicPopulate
|
|
17
25
|
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|