@cyberskill/shared 1.137.0 → 1.139.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 +4 -4
- package/dist/_tsup-dts-rollup.d.cts +43 -289
- package/dist/_tsup-dts-rollup.d.ts +43 -289
- package/dist/config/config.type.d.cts +3 -0
- package/dist/config/config.type.d.ts +3 -0
- package/dist/config/config.util.cjs +1 -0
- package/dist/config/config.util.d.cts +1 -0
- package/dist/config/config.util.d.ts +1 -0
- package/dist/config/config.util.js +1 -0
- package/dist/config/env/env.constant.d.cts +1 -0
- package/dist/config/env/env.constant.d.ts +1 -0
- package/dist/config/env/env.type.d.cts +1 -0
- package/dist/config/env/env.type.d.ts +1 -0
- package/dist/config/env/env.util.d.cts +2 -0
- package/dist/config/env/env.util.d.ts +2 -0
- package/dist/config/env/index.d.cts +4 -0
- package/dist/config/env/index.d.ts +4 -0
- package/dist/config/graphql-codegen/graphql-codegen.type.d.cts +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.type.d.ts +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.d.cts +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.d.ts +1 -0
- package/dist/{configs/graphql-codegen/graphql-codegen.util.d.cts → config/graphql-codegen/index.d.cts} +1 -0
- package/dist/{configs/graphql-codegen/graphql-codegen.util.d.ts → config/graphql-codegen/index.d.ts} +1 -0
- package/dist/config/index.cjs +1 -0
- package/dist/config/index.d.cts +13 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.js +1 -0
- package/dist/constant/common.d.cts +1 -0
- package/dist/constant/common.d.ts +1 -0
- package/dist/{constants/common.d.cts → constant/index.d.cts} +1 -0
- package/dist/{constants/common.d.ts → constant/index.d.ts} +1 -0
- package/dist/{constants/index.d.cts → constant/response-status.d.cts} +0 -1
- package/dist/{constants/index.d.ts → constant/response-status.d.ts} +0 -1
- package/dist/node/apollo-server/apollo-server.type.d.cts +1 -1
- package/dist/node/apollo-server/apollo-server.type.d.ts +1 -1
- package/dist/node/apollo-server/apollo-server.util.d.cts +2 -2
- package/dist/node/apollo-server/apollo-server.util.d.ts +2 -2
- package/dist/node/apollo-server/index.d.cts +3 -3
- package/dist/node/apollo-server/index.d.ts +3 -3
- package/dist/node/cli/cli.util.cjs +1 -1
- package/dist/node/cli/cli.util.js +1 -1
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.js +1 -1
- package/dist/node/command/command.type.d.cts +8 -8
- package/dist/node/command/command.type.d.ts +8 -8
- package/dist/node/command/command.util.cjs +1 -1
- package/dist/node/command/command.util.d.cts +6 -6
- package/dist/node/command/command.util.d.ts +6 -6
- package/dist/node/command/command.util.js +1 -1
- package/dist/node/command/index.cjs +1 -1
- package/dist/node/command/index.d.cts +14 -14
- package/dist/node/command/index.d.ts +14 -14
- package/dist/node/command/index.js +1 -1
- package/dist/node/express/express.type.d.cts +8 -8
- package/dist/node/express/express.type.d.ts +8 -8
- package/dist/node/express/express.util.d.cts +7 -7
- package/dist/node/express/express.util.d.ts +7 -7
- package/dist/node/express/index.d.cts +15 -15
- package/dist/node/express/index.d.ts +15 -15
- package/dist/node/fs/fs.type.d.cts +1 -1
- package/dist/node/fs/fs.type.d.ts +1 -1
- package/dist/node/fs/fs.util.d.cts +13 -13
- package/dist/node/fs/fs.util.d.ts +13 -13
- package/dist/node/fs/index.d.cts +14 -14
- package/dist/node/fs/index.d.ts +14 -14
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +176 -176
- package/dist/node/index.d.ts +176 -176
- package/dist/node/index.js +1 -1
- package/dist/node/log/index.cjs +1 -1
- package/dist/node/log/index.d.cts +8 -8
- package/dist/node/log/index.d.ts +8 -8
- package/dist/node/log/index.js +1 -1
- package/dist/node/log/log.type.d.cts +5 -5
- package/dist/node/log/log.type.d.ts +5 -5
- package/dist/node/log/log.util.cjs +1 -1
- package/dist/node/log/log.util.d.cts +3 -3
- package/dist/node/log/log.util.d.ts +3 -3
- package/dist/node/log/log.util.js +1 -1
- package/dist/node/mongo/index.cjs +1 -1
- package/dist/node/mongo/index.d.cts +61 -61
- package/dist/node/mongo/index.d.ts +61 -61
- package/dist/node/mongo/index.js +1 -1
- package/dist/node/mongo/mongo.constant.d.cts +1 -1
- package/dist/node/mongo/mongo.constant.d.ts +1 -1
- package/dist/node/mongo/mongo.type.d.cts +55 -55
- package/dist/node/mongo/mongo.type.d.ts +55 -55
- package/dist/node/mongo/mongo.util.cjs +1 -1
- package/dist/node/mongo/mongo.util.d.cts +5 -5
- package/dist/node/mongo/mongo.util.d.ts +5 -5
- package/dist/node/mongo/mongo.util.js +1 -1
- package/dist/node/package/index.cjs +1 -1
- package/dist/node/package/index.d.cts +9 -9
- package/dist/node/package/index.d.ts +9 -9
- package/dist/node/package/index.js +1 -1
- package/dist/node/package/package.type.d.cts +4 -4
- package/dist/node/package/package.type.d.ts +4 -4
- package/dist/node/package/package.util.cjs +1 -1
- package/dist/node/package/package.util.d.cts +5 -5
- package/dist/node/package/package.util.d.ts +5 -5
- package/dist/node/package/package.util.js +1 -1
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.d.cts +47 -47
- package/dist/node/path/index.d.ts +47 -47
- package/dist/node/path/index.js +1 -1
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.cts +43 -43
- package/dist/node/path/path.constant.d.ts +43 -43
- package/dist/node/path/path.constant.js +1 -1
- package/dist/node/path/path.util.d.cts +4 -4
- package/dist/node/path/path.util.d.ts +4 -4
- package/dist/node/storage/index.cjs +1 -1
- package/dist/node/storage/index.d.cts +1 -1
- package/dist/node/storage/index.d.ts +1 -1
- package/dist/node/storage/index.js +1 -1
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.d.cts +1 -1
- package/dist/node/storage/storage.util.d.ts +1 -1
- package/dist/node/storage/storage.util.js +1 -1
- package/dist/node/ws/index.d.cts +4 -4
- package/dist/node/ws/index.d.ts +4 -4
- package/dist/node/ws/ts.util.d.cts +2 -2
- package/dist/node/ws/ts.util.d.ts +2 -2
- package/dist/node/ws/ws.type.d.cts +2 -2
- package/dist/node/ws/ws.type.d.ts +2 -2
- package/dist/react/apollo-client/apollo-client.component.d.cts +1 -1
- package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
- package/dist/react/apollo-client/apollo-client.constant.d.cts +1 -1
- package/dist/react/apollo-client/apollo-client.constant.d.ts +1 -1
- package/dist/react/apollo-client/apollo-client.type.d.cts +5 -5
- package/dist/react/apollo-client/apollo-client.type.d.ts +5 -5
- package/dist/react/apollo-client/index.d.cts +7 -7
- package/dist/react/apollo-client/index.d.ts +7 -7
- package/dist/react/apollo-error/apollo-error.component.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.context.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.context.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.hook.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.hook.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.provider.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.type.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.type.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.util.d.cts +2 -2
- package/dist/react/apollo-error/apollo-error.util.d.ts +2 -2
- package/dist/react/apollo-error/index.d.cts +7 -7
- package/dist/react/apollo-error/index.d.ts +7 -7
- package/dist/react/apollo-error/index.js +1 -1
- package/dist/react/i18next/i18next.hook.d.cts +1 -1
- package/dist/react/i18next/i18next.hook.d.ts +1 -1
- package/dist/react/i18next/i18next.util.d.cts +1 -1
- package/dist/react/i18next/i18next.util.d.ts +1 -1
- package/dist/react/i18next/index.d.cts +2 -2
- package/dist/react/i18next/index.d.ts +2 -2
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.cts +41 -42
- package/dist/react/index.d.ts +41 -42
- package/dist/react/index.js +1 -1
- package/dist/react/loading/index.d.cts +6 -6
- package/dist/react/loading/index.d.ts +6 -6
- package/dist/react/loading/loading.component.d.cts +1 -1
- package/dist/react/loading/loading.component.d.ts +1 -1
- package/dist/react/loading/loading.context.d.cts +1 -1
- package/dist/react/loading/loading.context.d.ts +1 -1
- package/dist/react/loading/loading.hook.d.cts +1 -1
- package/dist/react/loading/loading.hook.d.ts +1 -1
- package/dist/react/loading/loading.provider.d.cts +1 -1
- package/dist/react/loading/loading.provider.d.ts +1 -1
- package/dist/react/loading/loading.type.d.cts +2 -2
- package/dist/react/loading/loading.type.d.ts +2 -2
- package/dist/react/log/index.d.cts +3 -4
- package/dist/react/log/index.d.ts +3 -4
- package/dist/react/log/log.type.d.cts +1 -2
- package/dist/react/log/log.type.d.ts +1 -2
- package/dist/react/log/log.util.d.cts +2 -2
- package/dist/react/log/log.util.d.ts +2 -2
- package/dist/react/next-intl/index.d.cts +10 -10
- package/dist/react/next-intl/index.d.ts +10 -10
- package/dist/react/next-intl/next-intl.constant.d.cts +1 -1
- package/dist/react/next-intl/next-intl.constant.d.ts +1 -1
- package/dist/react/next-intl/next-intl.context.d.cts +1 -1
- package/dist/react/next-intl/next-intl.context.d.ts +1 -1
- package/dist/react/next-intl/next-intl.hoc.d.cts +1 -1
- package/dist/react/next-intl/next-intl.hoc.d.ts +1 -1
- package/dist/react/next-intl/next-intl.hook.d.cts +2 -2
- package/dist/react/next-intl/next-intl.hook.d.ts +2 -2
- package/dist/react/next-intl/next-intl.provider.d.cts +1 -1
- package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
- package/dist/react/next-intl/next-intl.type.d.cts +4 -4
- package/dist/react/next-intl/next-intl.type.d.ts +4 -4
- package/dist/react/storage/index.d.cts +2 -2
- package/dist/react/storage/index.d.ts +2 -2
- package/dist/react/storage/storage.hook.d.cts +1 -1
- package/dist/react/storage/storage.hook.d.ts +1 -1
- package/dist/react/storage/storage.util.d.cts +1 -1
- package/dist/react/storage/storage.util.d.ts +1 -1
- package/dist/react/toast/index.d.cts +2 -2
- package/dist/react/toast/index.d.ts +2 -2
- package/dist/react/vitest/index.cjs +1 -1
- package/dist/react/vitest/index.d.cts +2 -2
- package/dist/react/vitest/index.d.ts +2 -2
- package/dist/react/vitest/index.js +1 -1
- package/dist/react/vitest/vitest.e2e.d.cts +1 -1
- package/dist/react/vitest/vitest.e2e.d.ts +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -1
- package/dist/react/vitest/vitest.unit.d.cts +1 -1
- package/dist/react/vitest/vitest.unit.d.ts +1 -1
- package/dist/react/vitest/vitest.unit.js +1 -1
- package/dist/typescript/common.d.cts +5 -4
- package/dist/typescript/common.d.ts +5 -4
- package/dist/typescript/index.d.cts +7 -6
- package/dist/typescript/index.d.ts +7 -6
- package/dist/typescript/react.d.cts +2 -2
- package/dist/typescript/react.d.ts +2 -2
- package/dist/util/common/common.util.cjs +1 -0
- package/dist/util/common/common.util.d.cts +3 -0
- package/dist/util/common/common.util.d.ts +3 -0
- package/dist/util/common/common.util.js +1 -0
- package/dist/util/common/index.cjs +1 -0
- package/dist/{utils/common/common.util.d.cts → util/common/index.d.cts} +1 -0
- package/dist/{utils/common/common.util.d.ts → util/common/index.d.ts} +1 -0
- package/dist/util/common/index.js +1 -0
- package/dist/util/index.cjs +1 -0
- package/dist/util/index.d.cts +18 -0
- package/dist/util/index.d.ts +18 -0
- package/dist/util/index.js +1 -0
- package/dist/util/object/index.d.cts +3 -0
- package/dist/util/object/index.d.ts +3 -0
- package/dist/util/serializer/index.d.cts +5 -0
- package/dist/util/serializer/index.d.ts +5 -0
- package/dist/{utils/serializer/index.d.cts → util/serializer/serializer.type.d.cts} +0 -1
- package/dist/{utils/serializer/index.d.ts → util/serializer/serializer.type.d.ts} +0 -1
- package/dist/util/serializer/serializer.util.d.cts +1 -0
- package/dist/util/serializer/serializer.util.d.ts +1 -0
- package/dist/util/string/index.d.cts +6 -0
- package/dist/util/string/index.d.ts +6 -0
- package/dist/util/string/string.type.d.cts +1 -0
- package/dist/util/string/string.type.d.ts +1 -0
- package/dist/{utils/string/index.d.cts → util/string/string.util.d.cts} +0 -1
- package/dist/{utils/string/index.d.ts → util/string/string.util.d.ts} +0 -1
- package/dist/util/validate/index.d.cts +1 -0
- package/dist/util/validate/index.d.ts +1 -0
- package/package.json +65 -46
- package/public/tsconfig.base.json +1 -1
- package/public/wiki/convention.md +1 -1
- package/dist/configs/config.type.d.cts +0 -3
- package/dist/configs/config.type.d.ts +0 -3
- package/dist/configs/config.util.cjs +0 -1
- package/dist/configs/config.util.d.cts +0 -1
- package/dist/configs/config.util.d.ts +0 -1
- package/dist/configs/config.util.js +0 -1
- package/dist/configs/env/env.constant.d.cts +0 -1
- package/dist/configs/env/env.constant.d.ts +0 -1
- package/dist/configs/env/env.type.d.cts +0 -1
- package/dist/configs/env/env.type.d.ts +0 -1
- package/dist/configs/env/env.util.d.cts +0 -2
- package/dist/configs/env/env.util.d.ts +0 -2
- package/dist/configs/env/index.d.cts +0 -4
- package/dist/configs/env/index.d.ts +0 -4
- package/dist/configs/graphql-codegen/graphql-codegen.type.d.cts +0 -1
- package/dist/configs/graphql-codegen/graphql-codegen.type.d.ts +0 -1
- package/dist/configs/graphql-codegen/index.d.cts +0 -2
- package/dist/configs/graphql-codegen/index.d.ts +0 -2
- package/dist/configs/index.cjs +0 -1
- package/dist/configs/index.d.cts +0 -13
- package/dist/configs/index.d.ts +0 -13
- package/dist/configs/index.js +0 -1
- package/dist/constants/response-status.d.cts +0 -1
- package/dist/constants/response-status.d.ts +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -256
- package/dist/index.d.ts +0 -256
- package/dist/index.js +0 -1
- package/dist/utils/common/common.util.cjs +0 -1
- package/dist/utils/common/common.util.js +0 -1
- package/dist/utils/common/index.cjs +0 -1
- package/dist/utils/common/index.d.cts +0 -2
- package/dist/utils/common/index.d.ts +0 -2
- package/dist/utils/common/index.js +0 -1
- package/dist/utils/index.cjs +0 -1
- package/dist/utils/index.d.cts +0 -17
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -1
- package/dist/utils/object/object.util.d.cts +0 -3
- package/dist/utils/object/object.util.d.ts +0 -3
- package/dist/utils/serializer/serializer.type.d.cts +0 -4
- package/dist/utils/serializer/serializer.type.d.ts +0 -4
- package/dist/utils/serializer/serializer.util.d.cts +0 -1
- package/dist/utils/serializer/serializer.util.d.ts +0 -1
- package/dist/utils/string/string.type.d.cts +0 -1
- package/dist/utils/string/string.type.d.ts +0 -1
- package/dist/utils/string/string.util.d.cts +0 -5
- package/dist/utils/string/string.util.d.ts +0 -5
- package/dist/utils/validate/validate.util.d.cts +0 -1
- package/dist/utils/validate/validate.util.d.ts +0 -1
- /package/dist/{configs → config}/commitlint/index.cjs +0 -0
- /package/dist/{configs → config}/commitlint/index.d.cts +0 -0
- /package/dist/{configs → config}/commitlint/index.d.ts +0 -0
- /package/dist/{configs → config}/commitlint/index.js +0 -0
- /package/dist/{configs → config}/config.type.cjs +0 -0
- /package/dist/{configs → config}/config.type.js +0 -0
- /package/dist/{configs → config}/env/env.constant.cjs +0 -0
- /package/dist/{configs → config}/env/env.constant.js +0 -0
- /package/dist/{configs → config}/env/env.type.cjs +0 -0
- /package/dist/{configs → config}/env/env.type.js +0 -0
- /package/dist/{configs → config}/env/env.util.cjs +0 -0
- /package/dist/{configs → config}/env/env.util.js +0 -0
- /package/dist/{configs → config}/env/index.cjs +0 -0
- /package/dist/{configs → config}/env/index.js +0 -0
- /package/dist/{configs → config}/eslint/index.cjs +0 -0
- /package/dist/{configs → config}/eslint/index.d.cts +0 -0
- /package/dist/{configs → config}/eslint/index.d.ts +0 -0
- /package/dist/{configs → config}/eslint/index.js +0 -0
- /package/dist/{configs → config}/graphql-codegen/graphql-codegen.type.cjs +0 -0
- /package/dist/{configs → config}/graphql-codegen/graphql-codegen.type.js +0 -0
- /package/dist/{configs → config}/graphql-codegen/graphql-codegen.util.cjs +0 -0
- /package/dist/{configs → config}/graphql-codegen/graphql-codegen.util.js +0 -0
- /package/dist/{configs → config}/graphql-codegen/index.cjs +0 -0
- /package/dist/{configs → config}/graphql-codegen/index.js +0 -0
- /package/dist/{configs → config}/lint-staged/index.cjs +0 -0
- /package/dist/{configs → config}/lint-staged/index.d.cts +0 -0
- /package/dist/{configs → config}/lint-staged/index.d.ts +0 -0
- /package/dist/{configs → config}/lint-staged/index.js +0 -0
- /package/dist/{constants → constant}/common.cjs +0 -0
- /package/dist/{constants → constant}/common.js +0 -0
- /package/dist/{constants → constant}/index.cjs +0 -0
- /package/dist/{constants → constant}/index.js +0 -0
- /package/dist/{constants → constant}/response-status.cjs +0 -0
- /package/dist/{constants → constant}/response-status.js +0 -0
- /package/dist/{styles → style}/reset.css +0 -0
- /package/dist/{styles → style}/reset.d.cts +0 -0
- /package/dist/{styles → style}/reset.d.ts +0 -0
- /package/dist/{utils → util}/object/index.cjs +0 -0
- /package/dist/{utils → util}/object/index.js +0 -0
- /package/dist/{utils → util}/object/object.util.cjs +0 -0
- /package/dist/{utils/object/index.d.cts → util/object/object.util.d.cts} +0 -0
- /package/dist/{utils/object/index.d.ts → util/object/object.util.d.ts} +0 -0
- /package/dist/{utils → util}/object/object.util.js +0 -0
- /package/dist/{utils → util}/serializer/index.cjs +0 -0
- /package/dist/{utils → util}/serializer/index.js +0 -0
- /package/dist/{utils → util}/serializer/serializer.type.cjs +0 -0
- /package/dist/{utils → util}/serializer/serializer.type.js +0 -0
- /package/dist/{utils → util}/serializer/serializer.util.cjs +0 -0
- /package/dist/{utils → util}/serializer/serializer.util.js +0 -0
- /package/dist/{utils → util}/string/index.cjs +0 -0
- /package/dist/{utils → util}/string/index.js +0 -0
- /package/dist/{utils → util}/string/string.type.cjs +0 -0
- /package/dist/{utils → util}/string/string.type.js +0 -0
- /package/dist/{utils → util}/string/string.util.cjs +0 -0
- /package/dist/{utils → util}/string/string.util.js +0 -0
- /package/dist/{utils → util}/validate/index.cjs +0 -0
- /package/dist/{utils → util}/validate/index.js +0 -0
- /package/dist/{utils → util}/validate/validate.util.cjs +0 -0
- /package/dist/{utils/validate/index.d.cts → util/validate/validate.util.d.cts} +0 -0
- /package/dist/{utils/validate/index.d.ts → util/validate/validate.util.d.ts} +0 -0
- /package/dist/{utils → util}/validate/validate.util.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { throwError_alias_2 as throwError } from '../../_tsup-dts-rollup.js';
|
|
2
|
+
export { catchError_alias_2 as catchError } from '../../_tsup-dts-rollup.js';
|
|
3
|
+
export { log_alias_2 as log } from '../../_tsup-dts-rollup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function E(E,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](E)}else{return E instanceof e}}var e=Object.defineProperty;var o=function(E,o){return e(E,"name",{value:o,configurable:!0})};import t from"chalk";import r from"consola";import{GraphQLError as S}from"graphql";var n=".cyberskill-storage";import a from"@dotenvx/dotenvx";import{bool as O,cleanEnv as i,str as A}from"envalid";import R from"node:os";import D from"node:path";import s from"node:process";var T=!1;function C(){T||(a.config(),T=!0)}o(C,"loadEnvFile");function c(){C();var E=i(s.env,{CWD:A({default:s.cwd()}),DEBUG:O({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:A({default:D.join(R.homedir(),n)})});return{CWD:E.CWD,DEBUG:E.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:E.CYBERSKILL_STORAGE_DIRECTORY}}o(c,"getEnv");var _={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var l=c();function I(E){var e=E.message,o=E.status,t=o===void 0?_.INTERNAL_SERVER_ERROR:o,r=E.type,n=r===void 0?"graphql":r;var a;var O=(a=e!==null&&e!==void 0?e:t.MESSAGE)!==null&&a!==void 0?a:"Internal server error";throw n==="graphql"?new S(O,{extensions:{code:t.CODE}}):new Error(O)}o(I,"throwError");l.DEBUG||(r.level=4);function u(E){var e=t[E];return typeof e=="function"?e:t.green}o(u,"chalkKeyword");var
|
|
1
|
+
function E(E,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](E)}else{return E instanceof e}}var e=Object.defineProperty;var o=function(E,o){return e(E,"name",{value:o,configurable:!0})};import t from"chalk";import r from"consola";import{GraphQLError as S}from"graphql";var n=".cyberskill-storage";import a from"@dotenvx/dotenvx";import{bool as O,cleanEnv as i,str as A}from"envalid";import R from"node:os";import D from"node:path";import s from"node:process";var T=!1;function C(){T||(a.config(),T=!0)}o(C,"loadEnvFile");function c(){C();var E=i(s.env,{CWD:A({default:s.cwd()}),DEBUG:O({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:A({default:D.join(R.homedir(),n)})});return{CWD:E.CWD,DEBUG:E.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:E.CYBERSKILL_STORAGE_DIRECTORY}}o(c,"getEnv");var _={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var l=c();function I(E){var e=E.message,o=E.status,t=o===void 0?_.INTERNAL_SERVER_ERROR:o,r=E.type,n=r===void 0?"graphql":r;var a;var O=(a=e!==null&&e!==void 0?e:t.MESSAGE)!==null&&a!==void 0?a:"Internal server error";throw n==="graphql"?new S(O,{extensions:{code:t.CODE}}):new Error(O)}o(I,"throwError");l.DEBUG||(r.level=4);function u(E){var e=t[E];return typeof e=="function"?e:t.green}o(u,"chalkKeyword");var M={silent:r.silent,level:r.level,fatal:r.fatal,error:r.error,warn:r.warn,log:r.log,info:r.info,success:r.success,ready:r.ready,start:r.start,box:r.box,debug:r.debug,trace:r.trace,verbose:r.verbose,printBoxedLog:function E(E,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(e===null||e===void 0?void 0:e.length)){r.box(t.green(E));return}e.forEach(function(E){var e=E.file,S=E.position,n=E.rule,a=E.message;r.log("".concat(t.gray("File:")," ").concat(t.blue("".concat(e).concat(S?":".concat(S):"")))),n&&r.log(" ".concat(u(o)("Rule:")," ").concat(n)),r.log(" ".concat(u(o)("Message:")," ").concat(a))}),r.box(u(o)("".concat(E," : ").concat(e.length))),r.log(t.gray("─".repeat(40)))}};function G(e,o){var t=o!==null&&o!==void 0?o:{},r=t.shouldLog,S=r===void 0?!0:r,n=t.returnValue,a=t.callback,O=E(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return S&&M.error(O.message),a&&typeof a=="function"&&a(O),n||{success:!1,message:O.message,code:_.INTERNAL_SERVER_ERROR.CODE}}o(G,"catchError");export{G as catchError,M as log,I as throwError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function a(e,t,n,r,a,s,o){try{var u=e[s](o);var c=u.value}catch(e){n(e);return}if(u.done){t(c)}else{Promise.resolve(c).then(r,a)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var o=e.apply(t,n);function u(e){a(o,r,s,u,c,"next",e)}function c(e){a(o,r,s,u,c,"throw",e)}u(undefined)})}}function o(e,t,n){t=f(t);return S(e,T()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function i(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)D(e,t)}function E(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function p(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var a=true;var s=false;var o,u;try{for(n=n.call(e);!(a=(o=n.next()).done);a=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;u=e}finally{try{if(!a&&n["return"]!=null)n["return"]()}finally{if(s)throw u}}return r}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){l(e,t,n[t])})}return e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function O(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{g(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function S(e,t){if(t&&(N(t)==="object"||typeof t==="function")){return t}return r(e)}function D(e,t){D=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return D(e,t)}function C(e,n){return t(e)||h(e,n)||I(e,n)||m()}function _(e){return n(e)||p(e)||I(e)||v()}function N(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function I(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}function b(e,t){var n,r,a,s={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=u(0),o["throw"]=u(1),o["return"]=u(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return c([e,t])}}function c(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(s=0)),s)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:s.label++;return{value:u[1],done:false};case 5:s.label++;r=u[1];u=[0];continue;case 7:u=s.ops.pop();s.trys.pop();continue;default:if(!(a=s.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){s=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){s.label=u[1];break}if(u[0]===6&&s.label<a[1]){s.label=a[1];a=u;break}if(a&&s.label<a[2]){s.label=a[2];s.ops.push(u);break}if(a[2])s.ops.pop();s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var A=Object.create;var R=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var L=function(e,t,n){return t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var U=function(e,t){return R(e,"name",{value:t,configurable:!0})};var k=function(e,t){for(var n in t)R(e,n,{get:t[n],enumerable:!0})},j=function(e,t,n,r){var a=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":N(t))=="object"||typeof t=="function")try{var u=function(){var a=i.value;!w.call(e,a)&&a!==n&&R(e,a,{get:function(){return t[a]},enumerable:!(r=G(t,a))||r.enumerable})};for(var c=M(t)[Symbol.iterator](),i;!(a=(i=c.next()).done);a=true)u()}catch(e){s=true;o=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw o}}}return e};var F=function(e,t,n){return n=e!=null?A(P(e)):{},j(t||!e||!e.__esModule?R(n,"default",{value:e,enumerable:!0}):n,e)},x=function(e){return j(R({},"__esModule",{value:!0}),e)};var q=function(e,t,n){return L(e,(typeof t==="undefined"?"undefined":N(t))!="symbol"?t+"":t,n)};var Y={};k(Y,{C_Collection:function(){return Z},C_Db:function(){return Q},C_Document:function(){return J},C_Model:function(){return z},MONGO_MIGRATE_OPTIONS:function(){return V},MongoController:function(){return t6},MongooseController:function(){return t9},aggregatePaginate:function(){return er.default},mongo:function(){return t5},mongoosePaginate:function(){return ea.default}});module.exports=x(Y);var V="MONGO_MIGRATE_OPTIONS";var B=require("mongodb"),H=require("mongoose");var K=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(B.Db);U(K,"C_Db");var Q=K,W=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(H.Document);U(W,"C_Document");var J=W,$=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(H.Model);U($,"C_Model");var z=$,X=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(B.Collection);U(X,"C_Collection");var Z=X;var ee=require("date-fns"),et=F(require("migrate-mongo"),1),en=require("mongoose"),er=F(require("mongoose-aggregate-paginate-v2"),1),ea=F(require("mongoose-paginate-v2"),1),es=require("uuid");var eo={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var eu=F(require("unorm"),1);var ec={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},ei=Object.entries(ec).reduce(function(e,t){var n=C(t,2),r=n[0],a=n[1];return e[r.toUpperCase()]=a.map(function(e){return e.toUpperCase()}),e},{});function el(e){return(typeof e==="undefined"?"undefined":N(e))=="object"&&e!==null&&!Array.isArray(e)}U(el,"isObject");var ef=F(require("crypto-js"),1),ed=F(require("slugify"),1);var eE=ed.default.default||ed.default;function ep(e,t){var n=U(function(e){var n,r;return eE(e!==null&&e!==void 0?e:"",y({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(el(e)){var r={};var a=true,s=false,o=undefined;try{for(var u=Object.entries(e)[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var i=C(c.value,2),l=i[0],f=i[1];r[l]=n(f)}}catch(e){s=true;o=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw o}}}return r}return n(e)}U(ep,"generateSlug");function eh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return ef.default.SHA256(e).toString(ef.default.enc.Hex).slice(0,t)}U(eh,"generateShortId");var em={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":N(e))=="object"?E(e,Date)?!1:E(e,Map)||E(e,Set)?e.size===0:E(e,WeakMap)||E(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var ev=F(require("fs-extra"),1),ey=F(require("path"),1);var eg=ev.default,eO=eg.lstatSync,eS=eg.readdirSync,eD=eg.mkdirSync,eC=eg.readFileSync,e_=eg.unlinkSync,eN=eg.statSync,eI=ev.default.readJsonSync;function eT(e,t,n){ev.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}U(eT,"writeFileSync");function eb(e,t,n){ev.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}U(eb,"appendFileSync");function eA(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return ev.default.pathExistsSync(e)})}U(eA,"pathExistsSync");var eR=function(e){return e.Error="error",e.Warning="warning",e}({});var eG=F(require("chalk"),1),eM=F(require("consola"),1),eP=require("graphql");var ew=".cyberskill-storage";var eL=F(require("@dotenvx/dotenvx"),1),eU=require("envalid"),ek=F(require("os"),1),ej=F(require("path"),1),eF=F(require("process"),1);var ex=!1;function eq(){ex||(eL.default.config(),ex=!0)}U(eq,"loadEnvFile");function eY(){eq();var e=(0,eU.cleanEnv)(eF.default.env,{CWD:(0,eU.str)({default:eF.default.cwd()}),DEBUG:(0,eU.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,eU.str)({default:ej.default.join(ek.default.homedir(),ew)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}U(eY,"getEnv");var eV=eY();eV.DEBUG||(eM.default.level=4);function eB(e){var t=eG.default[e];return typeof t=="function"?t:eG.default.green}U(eB,"chalkKeyword");var eH={silent:eM.default.silent,level:eM.default.level,fatal:eM.default.fatal,error:eM.default.error,warn:eM.default.warn,log:eM.default.log,info:eM.default.info,success:eM.default.success,ready:eM.default.ready,start:eM.default.start,box:eM.default.box,debug:eM.default.debug,trace:eM.default.trace,verbose:eM.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){eM.default.box(eG.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,a=e.rule,s=e.message;eM.default.log("".concat(eG.default.gray("File:")," ").concat(eG.default.blue("".concat(t).concat(r?":".concat(r):"")))),a&&eM.default.log(" ".concat(eB(n)("Rule:")," ").concat(a)),eM.default.log(" ".concat(eB(n)("Message:")," ").concat(s))}),eM.default.box(eB(n)("".concat(e," : ").concat(t.length))),eM.default.log(eG.default.gray("─".repeat(40)))}};function eK(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,a=r===void 0?!0:r,s=n.returnValue,o=n.callback,u=E(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return a&&eH.error(u.message),o&&typeof o=="function"&&o(u),s||{success:!1,message:u.message,code:eo.INTERNAL_SERVER_ERROR.CODE}}U(eK,"catchErrorNode");var eQ=F(require("fs-extra"),1);var eW=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var eJ=require("child_process"),e$=F(require("process"),1),ez=F(require("util"),1);var eX=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});var eZ=F(require("node-fetch"),1);var e0=eY();function e1(e){return s(function(){var t,n,r,a;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,eZ.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=s.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=s.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:a=s.sent();return[2,eK(a)];case 4:return[2]}})})()}U(e1,"getLatestPackageVersion");function e2(e){return s(function(){var t,n,r,a,s,o,u,c,i,l,f,d,E,p,h,m,v,y,g;return b(this,function(O){switch(O.label){case 0:O.trys.push([0,2,,3]);if(!eA(t2.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eX.DEPENDENCY,isDevDependency:e.type===eX.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=eI(t2.PACKAGE_JSON),n=t.name,r=t.version,a=r===void 0?"":r,s=t.dependencies,o=s===void 0?{}:s,u=t.devDependencies,c=u===void 0?{}:u;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:a,latestVersion:a,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===eX.DEPENDENCY,isDevDependency:e.type===eX.DEV_DEPENDENCY,installedPath:t2.PACKAGE_JSON,file:t}}];i=e.name in o,l=e.name in c;return[4,e1(e.name)];case 1:f=O.sent();if(!f.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:i,isDevDependency:l,installedPath:"",file:{}}}];if(!i&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:f.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eX.DEPENDENCY,isDevDependency:e.type===eX.DEV_DEPENDENCY,installedPath:"",file:{}}}];p=(E=(d=o[e.name])!==null&&d!==void 0?d:c[e.name])!==null&&E!==void 0?E:"",h=th(e0.CWD,tg,e.name,tS);if(!eA(h))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:f.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:i,isDevDependency:l,installedPath:"",file:{}}}];m=eI(h),v=m.version,y=v===void 0?"":v;return[2,p!==y?{success:!0,result:{name:e.name,currentVersion:y||p,latestVersion:f.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:i,isDevDependency:l,installedPath:h,file:m}}:{success:!0,result:{name:e.name,currentVersion:p,latestVersion:f.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:p===f.result,isDependency:i,isDevDependency:l,installedPath:h,file:m}}];case 2:g=O.sent();return[2,eK(g)];case 3:return[2]}})})()}U(e2,"getPackage");function e4(e){return s(function(){var t,n,r,a,s;return b(this,function(o){try{;r=eI(t2.PACKAGE_JSON),a=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?a[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),eT(t2.PACKAGE_JSON,JSON.stringify(r,null,4)),eH.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){eK(e)}return[2]})})()}U(e4,"updatePackage");function e3(){return s(function(){var e,t,n,r,a,s,o,u,c,i,l,f,d;return b(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:U(function(){return t3.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:U(function(){return t3.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:U(function(){return t3.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;E.label=1;case 1:E.trys.push([1,9,10,11]);a=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=a.next()).done))return[3,8];o=s.value,u=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,u()];case 4:i=E.sent();return[4,tl("".concat(c," using: ").concat(i),i)];case 5:E.sent();return[2];case 6:l=E.sent();eK(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=E.sent();n=true;r=f;return[3,11];case 10:try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:d=E.sent();eK(d);return[3,13];case 13:return[2]}})})()}U(e3,"installDependencies");function e5(e,t){return s(function(){var n,r,a,s,o,u,c,i,l,f,d,E;return b(this,function(p){switch(p.label){case 0:if(!eA(t2.PACKAGE_JSON)){eH.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,16,,17]);return[4,Promise.all(e.map(e2))];case 2:n=p.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?e4(e.result):Promise.resolve()}))];case 3:p.sent();return[4,e3()];case 4:p.sent();a=["Running ESLint with auto-fix"];return[4,t3.eslintFix()];case 5:return[4,tl.apply(void 0,a.concat([p.sent()]))];case 6:r=p.sent();p.label=7;case 7:r;o=true,u=false,c=undefined;p.label=8;case 8:p.trys.push([8,13,14,15]);i=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=9;case 9:if(!!(o=(l=i.next()).done))return[3,12];f=l.value;return[4,f()];case 10:p.sent();p.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:d=p.sent();u=true;c=d;return[3,15];case 14:try{if(!o&&i.return!=null){i.return()}}finally{if(u){throw c}}return[7];case 15:return[3,17];case 16:E=p.sent();eK(E);return[3,17];case 17:return[2]}})})()}U(e5,"setupPackages");var e7=F(require("node-persist"),1);var e6=eY();function e8(){return s(function(){var e;return b(this,function(t){switch(t.label){case 0:e=e7.default.defaultInstance;if(e)return[3,2];return[4,e7.default.init({dir:e6.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}U(e8,"initNodePersist");var e9={get:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e8()];case 1:r.sent();return[4,e7.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,eK(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e8()];case 1:r.sent();return[4,e7.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();eK(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e8()];case 1:n.sent();return[4,e7.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();eK(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e8()];case 1:n.sent();return[4,e7.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(eH.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,eK(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return b(this,function(t){try{return[2,"".concat(e6.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,eK(e,{returnValue:null})]}return[2]})})()}};var te=eY(),tt=ez.promisify(eJ.exec);function tn(e){return"error_list:".concat(e)}U(tn,"getErrorListKey");function tr(e){return s(function(){var t,n,r;return b(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tn(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,e9.set(n,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(function(){return s(function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,e9.getLogLink(n)];case 1:e=t.sent();e&&eH.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=a.sent();eK(r);return[3,4];case 4:return[2]}})})()}U(tr,"saveErrorListToStorage");function ta(e){var t=[],n=[],r="",a=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,s=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var u,c,i,l,f;var d=a.exec(e)||[],E=s.exec(e)||[],p=o.exec(e)||[];var h,m,v,y,g,O;d.length&&r?t.push({file:r,position:"".concat(d[1],":").concat(d[2]),type:d[3]===eR.Error?eR.Error:eR.Warning,message:(h=d===null||d===void 0?void 0:(u=d[4])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:"",rule:(m=d===null||d===void 0?void 0:(c=d[5])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:""}):E.length?t.push({file:(v=E===null||E===void 0?void 0:E[1])!==null&&v!==void 0?v:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===eR.Error?eR.Error:eR.Warning,message:(y=E===null||E===void 0?void 0:(i=E[5])===null||i===void 0?void 0:i.trim())!==null&&y!==void 0?y:""}):p.length?t.push({file:"commitlint",type:eR.Error,message:(g=p===null||p===void 0?void 0:(l=p[1])===null||l===void 0?void 0:l.trim())!==null&&g!==void 0?g:"",rule:(O=p===null||p===void 0?void 0:(f=p[2])===null||f===void 0?void 0:f.trim())!==null&&O!==void 0?O:""}):n.push(e.trim())}}),t.length&&tr(t),te.DEBUG&&n.length&&(eH.warn("Unmatched lines:"),n.forEach(function(e){return eH.info(" ".concat(e))}))}U(ta,"parseTextErrors");function ts(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,a=e.line,s=e.column,o=e.ruleId,u=e.message;n.push({type:r===2?eR.Error:eR.Warning,file:t,position:"".concat(a,":").concat(s),rule:o,message:u})})}),n.length&&tr(n)}catch(t){ta(e)}}U(ts,"parseCommandOutput");function to(e){return s(function(e){var t,n,r,a,s,o,u,c,i;var l=arguments;return b(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ts;n=new AbortController;e$.default.on("SIGINT",function(){eH.warn("Process interrupted. Terminating..."),n.abort(),e$.default.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tt(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),a=r.stdout,s=r.stderr;[a,s].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:o=f.sent();u=o.stdout,c=o.stderr,i=o.message;[u,c].forEach(function(e){return e&&t(e)}),!c&&!u&&eH.error("Command failed: ".concat(i));return[3,5];case 5:return[2]}})}).apply(this,arguments)}U(to,"executeCommand");function tu(e){return{raw:!0,cmd:e}}U(tu,"rawCommand");function tc(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tQ," ").concat(tB," ").concat(tM," ").concat(e):"".concat(tQ," ").concat(tG," ").concat(e)}U(tc,"formatCLI");function ti(e,t){return typeof e=="function"?tc(e(t),t):(typeof e==="undefined"?"undefined":N(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tc(e,t):e}U(ti,"formatCommand");function tl(e,t){return s(function(){var n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);eH.start("".concat(e)),te.DEBUG&&eH.info("→ ".concat(t));return[4,to(t)];case 1:r.sent(),eH.success("".concat(e," done."));return[3,3];case 2:n=r.sent();eK(n);return[3,3];case 3:return[2]}})})()}U(tl,"runCommand");var tf=F(require("path"),1);var td=eY(),tE=tf.default;function tp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=tE).resolve.apply(r,[td.CWD].concat(_(t)))}U(tp,"resolveWorkingPath");function th(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=tE).join.apply(r,_(t))}U(th,"join");var tm=eY(),tv=tm.CWD,ty="@cyberskill/shared",tg="node_modules",tO="dist",tS="package.json",tD="package-lock.json",tC="tsconfig.json",t_=".gitignore",tN=".simple-git-hooks.json",tI="pnpm-lock.yaml",tT=".git/hooks/",tb=".git/COMMIT_EDITMSG",tA=".migrate-mongo.config.js",tR=function(){var e=eQ.default.readJsonSync(tp(tS)).name===ty?tv:th(tv,tg,ty);return th(e,tO)}(),tG="cyberskill",tM="src/node/cli/index.ts",tP="eslint",tw="eslint",tL="vitest";var tU="vitest",tk="@commitlint/cli",tj="@commitlint/config-conventional",tF="commitlint",tx="lint-staged",tq="lint-staged",tY="typescript",tV="tsc",tB="tsx",tH="git",tK="pnpm",tQ="pnpm exec",tW="simple-git-hooks",tJ="simple-git-hooks",t$="@eslint/config-inspector",tz="eslint-config-inspector",tX="node-modules-inspector",tZ="node-modules-inspector",t0="migrate-mongo",t1="./node_modules/migrate-mongo/bin/migrate-mongo",t2={CYBERSKILL_DIRECTORY:tR,WORKING_DIRECTORY:tv,TS_CONFIG:tp(tC),GIT_IGNORE:tp(t_),GIT_HOOK:tp(tT),GIT_COMMIT_MSG:tp(tb),SIMPLE_GIT_HOOKS_JSON:tp(tN),PACKAGE_JSON:tp(tS),PACKAGE_LOCK_JSON:tp(tD),PNPM_LOCK_YAML:tp(tI),NODE_MODULES:tp(tg),MIGRATE_MONGO_CONFIG:tp(tA),LINT_STAGED_CONFIG:tp("".concat(tR,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:tp("".concat(tR,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:tp("".concat(tR,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:tp("".concat(tR,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:tp("".concat(tR,"/react/vitest/vitest.e2e.js"))};function t4(e){var t=e.type,n=e.packages,r=e.command;var a=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return s(function(){var e;return b(this,function(n){switch(n.label){case 0:switch(t){case eW.CLI:return[3,1];case eW.STRING:return[3,4]}return[3,5];case 1:e=a===null||a===void 0?void 0:a.length;if(!e)return[3,3];return[4,e5(a,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,ti(tu("".concat(tQ," ").concat(r))))];case 4:return[2,ti(tu(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}U(t4,"buildCommand");var t3={simpleGitHooks:t4({type:eW.CLI,packages:[{name:tW,type:eX.DEV_DEPENDENCY}],command:tJ}),eslintInspect:t4({type:eW.CLI,packages:[{name:t$,type:eX.DEV_DEPENDENCY}],command:tz}),nodeModulesInspect:t4({type:eW.CLI,packages:[{name:tX,type:eX.DEV_DEPENDENCY}],command:tZ}),eslintCheck:t4({type:eW.CLI,packages:[{name:tP,type:eX.DEV_DEPENDENCY}],command:"".concat(tw," ").concat(t2.WORKING_DIRECTORY," --no-cache")}),eslintFix:t4({type:eW.CLI,packages:[{name:tP,type:eX.DEV_DEPENDENCY}],command:"".concat(tw," ").concat(t2.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:t4({type:eW.CLI,packages:[{name:tY,type:eX.DEPENDENCY}],command:"".concat(tV," -p ").concat(t2.TS_CONFIG," --noEmit")}),testUnit:t4({type:eW.CLI,packages:[{name:tL,type:eX.DEV_DEPENDENCY}],command:"".concat(tU," --config ").concat(t2.UNIT_TEST_CONFIG)}),testE2e:t4({type:eW.CLI,packages:[{name:tL,type:eX.DEV_DEPENDENCY}],command:"".concat(tU," --config ").concat(t2.E2E_TEST_CONFIG)}),mongoMigrateCreate:U(function(e){return t4({type:eW.CLI,packages:[{name:t0,type:eX.DEPENDENCY}],command:"".concat(tB," ").concat(t1," create ").concat(e," -f ").concat(t2.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:t4({type:eW.CLI,packages:[{name:t0,type:eX.DEPENDENCY}],command:"".concat(tB," ").concat(t1," up -f ").concat(t2.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:t4({type:eW.CLI,packages:[{name:t0,type:eX.DEPENDENCY}],command:"".concat(tB," ").concat(t1," down -f ").concat(t2.MIGRATE_MONGO_CONFIG)}),commitLint:t4({type:eW.CLI,packages:[{name:tk,type:eX.DEV_DEPENDENCY},{name:tj,type:eX.DEV_DEPENDENCY}],command:"".concat(tF," --edit ").concat(t2.GIT_COMMIT_MSG," --config ").concat(t2.COMMITLINT_CONFIG)}),lintStaged:t4({type:eW.CLI,packages:[{name:tx,type:eX.DEV_DEPENDENCY}],command:"".concat(tq," --config ").concat(t2.LINT_STAGED_CONFIG)}),configureGitHook:t4({type:eW.STRING,command:"".concat(tH," config core.hooksPath ").concat(t2.GIT_HOOK)}),stageBuildDirectory:t4({type:eW.STRING,command:"".concat(tH," add ").concat(tO)}),build:t4({type:eW.STRING,command:"".concat(tK," run --if-present build")}),pnpmInstallStandard:t4({type:eW.STRING,command:"".concat(tK," install --no-frozen-lockfile")}),pnpmInstallLegacy:t4({type:eW.STRING,command:"".concat(tK," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:t4({type:eW.STRING,command:"".concat(tK," install --no-frozen-lockfile --force")})};var t5={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return(0,ee.format)(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?t5.getDateTime():new Date;return{id:(0,es.v4)(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,a=t.post;n&&r&&e.pre(n,r),n&&a&&e.post(n,a)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:es.v4,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,a=r===void 0?[]:r,s=e.standalone,o=s===void 0?!1:s;var u=new t.Schema(n,{strict:!0});return a.forEach(function(e){var t=e.name,n=e.options,r=e.get;var a=u.virtual(t,n);r&&a.get(r)}),o||u.add(t5.createGenericSchema(t)),u},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,a=e.pagination,s=a===void 0?!1:a,o=e.aggregate,u=o===void 0?!1:o,c=e.virtuals,i=c===void 0?[]:c,l=e.middlewares,f=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var d=t5.createSchema({mongoose:t,schema:r,virtuals:i});return t5.applyPlugins(d,[s&&ea.default,u&&er.default]),t5.applyMiddlewares(d,f),t.model(n,d)},validator:{isEmpty:function e(){return function(e){return s(function(){return b(this,function(t){return[2,!em.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return s(function(){var n;return b(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return s(function(){return b(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!E(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:O(y({},et.default),{setConfig:U(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eT(t2.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(tA,"\n");eA(t2.GIT_IGNORE)?eC(t2.GIT_IGNORE,"utf-8").split("\n").includes(tA)||eb(t2.GIT_IGNORE,n):eT(t2.GIT_IGNORE,n)},"setConfig")})},t7=/*#__PURE__*/function(){function e(t,n){u(this,e);q(this,"collection");this.collection=t.collection(n)}i(e,[{key:"createOne",value:function e(e){return s(function(){var t,n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);t=y({},t5.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,this.collection.insertOne(t)];case 1:return[2,(n.result=a.sent(),n)];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return s(function(){var t,n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);t=e.map(function(e){return y({},t5.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=a.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:eo.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return s(function(){var e,t,n;var r=arguments;return b(this,function(a){switch(a.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};a.label=1;case 1:a.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=a.sent(),t)];case 3:n=a.sent();return[2,eK(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return s(function(){var e,t,n;var r=arguments;return b(this,function(a){switch(a.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};a.label=1;case 1:a.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=a.sent(),t)];case 3:n=a.sent();return[2,eK(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return s(function(){var n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=a.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return s(function(){var n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=a.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}}]);return e}();U(t7,"MongoController");var t6=t7,t8=/*#__PURE__*/function(){function e(t){u(this,e);q(this,"model");this.model=t}i(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return s(function(){var e,t,n,r,a,s,o;var u=arguments;return b(this,function(c){switch(c.label){case 0:e=u.length>0&&u[0]!==void 0?u[0]:{},t=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2&&u[2]!==void 0?u[2]:{},r=u.length>3?u[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);a=this.model.findOne(e,t,n);r&&a.populate(r);return[4,a.exec()];case 2:s=c.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:eo.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,eK(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return s(function(){var e,t,n,r,a,s,o;var u=arguments;return b(this,function(c){switch(c.label){case 0:e=u.length>0&&u[0]!==void 0?u[0]:{},t=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2&&u[2]!==void 0?u[2]:{},r=u.length>3?u[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);a=this.model.find(e,t,n);r&&a.populate(r);s={success:!0};return[4,a.exec()];case 2:return[2,(s.result=c.sent(),s)];case 3:o=c.sent();return[2,eK(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return s(function(){var e,t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=s.sent(),n)];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return s(function(e){var t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=s.sent(),n)];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return s(function(){var e,t,n;var r=arguments;return b(this,function(a){switch(a.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};a.label=1;case 1:a.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=a.sent(),t)];case 3:n=a.sent();return[2,eK(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return s(function(e){var t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=s.sent().map(function(e){return E(e,en.Document)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return s(function(){var e,t,n,r,a;var s=arguments;return b(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{},n=s.length>2&&s[2]!==void 0?s[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:eo.NOT_FOUND.CODE}];case 3:a=o.sent();return[2,eK(a)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return s(function(){var e,t,n,r,a;var s=arguments;return b(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{},n=s.length>2&&s[2]!==void 0?s[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:a=o.sent();return[2,eK(a)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return s(function(){var e,t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=s.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:eo.NOT_FOUND.CODE}];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return s(function(){var e,t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=s.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:eo.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return s(function(){var n,r,a,s,o;return b(this,function(u){switch(u.label){case 0:u.trys.push([0,6,,7]);n=new Set;r=0;u.label=1;case 1:if(!(r<10))return[3,5];a=eh(e,r+t);s=!n.has(a);if(!s)return[3,3];n.add(a);return[4,this.model.exists({shortId:a})];case 2:s=!u.sent();u.label=3;case 3:if(s)return[2,{success:!0,result:a}];u.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:eo.INTERNAL_SERVER_ERROR.CODE}];case 6:o=u.sent();return[2,eK(o)];case 7:return[2]}})}).call(this)}},{key:"createSlug",value:function e(e,t,n){return s(function(){var r,a,o,u,c,i,f,d,E,p;return b(this,function(h){switch(h.label){case 0:r=this;h.label=1;case 1:h.trys.push([1,5,,6]);a=t[e],o=el(a),u=U(function(t){var r=y({},n!==null&&n!==void 0?n:{});return o?O(y({},r),{$or:[l({},"slug.".concat(e),t),{slugHistory:{$elemMatch:l({},"slug.".concat(e),t)}}]}):O(y({},r),{$or:[{slug:t},{slugHistory:t}]})},"generateSlugQuery"),c=U(function(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:t=e,n=1;r.label=1;case 1:return[4,this.model.exists(u(t))];case 2:if(!r.sent())return[3,4];t="".concat(e,"-").concat(n++);r.label=3;case 3:return[3,1];case 4:return[2,t]}})}).call(r)},"generateUniqueSlug");if(!o)return[3,3];i={success:!0};f=Object.fromEntries;return[4,Promise.all(Object.entries(a).map(function(e){var t=C(e,2),n=t[0],r=t[1];return s(function(){var e,t;return b(this,function(a){switch(a.label){case 0:e=ep(r);t=[n];return[4,c(e)];case 1:return[2,t.concat([a.sent()])]}})})()}))];case 2:return[2,(i.result=f.apply(Object,[h.sent()]),i)];case 3:d=ep(a);E={success:!0};return[4,c(d)];case 4:return[2,(E.result=h.sent(),E)];case 5:p=h.sent();return[2,eK(p)];case 6:return[2]}})}).call(this)}},{key:"aggregate",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}}]);return e}();U(t8,"MongooseController");var t9=t8;0&&(module.exports={C_Collection:C_Collection,C_Db:C_Db,C_Document:C_Document,C_Model:C_Model,MONGO_MIGRATE_OPTIONS:MONGO_MIGRATE_OPTIONS,MongoController:MongoController,MongooseController:MongooseController,aggregatePaginate:aggregatePaginate,mongo:mongo,mongoosePaginate:mongoosePaginate});
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function a(e,t,n,r,a,s,o){try{var u=e[s](o);var c=u.value}catch(e){n(e);return}if(u.done){t(c)}else{Promise.resolve(c).then(r,a)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var o=e.apply(t,n);function u(e){a(o,r,s,u,c,"next",e)}function c(e){a(o,r,s,u,c,"throw",e)}u(undefined)})}}function o(e,t,n){t=f(t);return S(e,T()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function i(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)D(e,t)}function E(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function p(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var a=true;var s=false;var o,u;try{for(n=n.call(e);!(a=(o=n.next()).done);a=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;u=e}finally{try{if(!a&&n["return"]!=null)n["return"]()}finally{if(s)throw u}}return r}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){l(e,t,n[t])})}return e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function O(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{g(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function S(e,t){if(t&&(N(t)==="object"||typeof t==="function")){return t}return r(e)}function D(e,t){D=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return D(e,t)}function C(e,n){return t(e)||h(e,n)||I(e,n)||m()}function _(e){return n(e)||p(e)||I(e)||v()}function N(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function I(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}function b(e,t){var n,r,a,s={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=u(0),o["throw"]=u(1),o["return"]=u(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return c([e,t])}}function c(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(s=0)),s)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:s.label++;return{value:u[1],done:false};case 5:s.label++;r=u[1];u=[0];continue;case 7:u=s.ops.pop();s.trys.pop();continue;default:if(!(a=s.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){s=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){s.label=u[1];break}if(u[0]===6&&s.label<a[1]){s.label=a[1];a=u;break}if(a&&s.label<a[2]){s.label=a[2];s.ops.push(u);break}if(a[2])s.ops.pop();s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var A=Object.create;var R=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var L=function(e,t,n){return t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var U=function(e,t){return R(e,"name",{value:t,configurable:!0})};var k=function(e,t){for(var n in t)R(e,n,{get:t[n],enumerable:!0})},j=function(e,t,n,r){var a=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":N(t))=="object"||typeof t=="function")try{var u=function(){var a=i.value;!w.call(e,a)&&a!==n&&R(e,a,{get:function(){return t[a]},enumerable:!(r=G(t,a))||r.enumerable})};for(var c=M(t)[Symbol.iterator](),i;!(a=(i=c.next()).done);a=true)u()}catch(e){s=true;o=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw o}}}return e};var F=function(e,t,n){return n=e!=null?A(P(e)):{},j(t||!e||!e.__esModule?R(n,"default",{value:e,enumerable:!0}):n,e)},x=function(e){return j(R({},"__esModule",{value:!0}),e)};var q=function(e,t,n){return L(e,(typeof t==="undefined"?"undefined":N(t))!="symbol"?t+"":t,n)};var Y={};k(Y,{C_Collection:function(){return Z},C_Db:function(){return Q},C_Document:function(){return J},C_Model:function(){return z},MONGO_MIGRATE_OPTIONS:function(){return V},MongoController:function(){return t6},MongooseController:function(){return t9},aggregatePaginate:function(){return er.default},mongo:function(){return t5},mongoosePaginate:function(){return ea.default}});module.exports=x(Y);var V="MONGO_MIGRATE_OPTIONS";var B=require("mongodb"),H=require("mongoose");var K=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(B.Db);U(K,"C_Db");var Q=K,W=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(H.Document);U(W,"C_Document");var J=W,$=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(H.Model);U($,"C_Model");var z=$,X=/*#__PURE__*/function(e){d(t,e);function t(){u(this,t);return o(this,t,arguments)}return t}(B.Collection);U(X,"C_Collection");var Z=X;var ee=require("date-fns"),et=F(require("migrate-mongo"),1),en=require("mongoose"),er=F(require("mongoose-aggregate-paginate-v2"),1),ea=F(require("mongoose-paginate-v2"),1),es=require("uuid");var eo={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var eu=F(require("unorm"),1);var ec={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},ei=Object.entries(ec).reduce(function(e,t){var n=C(t,2),r=n[0],a=n[1];return e[r.toUpperCase()]=a.map(function(e){return e.toUpperCase()}),e},{});function el(e){return(typeof e==="undefined"?"undefined":N(e))=="object"&&e!==null&&!Array.isArray(e)}U(el,"isObject");var ef=F(require("crypto-js"),1),ed=F(require("slugify"),1);var eE=ed.default.default||ed.default;function ep(e,t){var n=U(function(e){var n,r;return eE(e!==null&&e!==void 0?e:"",y({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(el(e)){var r={};var a=true,s=false,o=undefined;try{for(var u=Object.entries(e)[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var i=C(c.value,2),l=i[0],f=i[1];r[l]=n(f)}}catch(e){s=true;o=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw o}}}return r}return n(e)}U(ep,"generateSlug");function eh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return ef.default.SHA256(e).toString(ef.default.enc.Hex).slice(0,t)}U(eh,"generateShortId");var em={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":N(e))=="object"?E(e,Date)?!1:E(e,Map)||E(e,Set)?e.size===0:E(e,WeakMap)||E(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var ev=F(require("fs-extra"),1),ey=F(require("path"),1);var eg=ev.default,eO=eg.lstatSync,eS=eg.readdirSync,eD=eg.mkdirSync,eC=eg.readFileSync,e_=eg.unlinkSync,eN=eg.statSync,eI=ev.default.readJsonSync;function eT(e,t,n){ev.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}U(eT,"writeFileSync");function eb(e,t,n){ev.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}U(eb,"appendFileSync");function eA(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return ev.default.pathExistsSync(e)})}U(eA,"pathExistsSync");var eR=function(e){return e.Error="error",e.Warning="warning",e}({});var eG=F(require("chalk"),1),eM=F(require("consola"),1),eP=require("graphql");var ew=".cyberskill-storage";var eL=F(require("@dotenvx/dotenvx"),1),eU=require("envalid"),ek=F(require("os"),1),ej=F(require("path"),1),eF=F(require("process"),1);var ex=!1;function eq(){ex||(eL.default.config(),ex=!0)}U(eq,"loadEnvFile");function eY(){eq();var e=(0,eU.cleanEnv)(eF.default.env,{CWD:(0,eU.str)({default:eF.default.cwd()}),DEBUG:(0,eU.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,eU.str)({default:ej.default.join(ek.default.homedir(),ew)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}U(eY,"getEnv");var eV=eY();eV.DEBUG||(eM.default.level=4);function eB(e){var t=eG.default[e];return typeof t=="function"?t:eG.default.green}U(eB,"chalkKeyword");var eH={silent:eM.default.silent,level:eM.default.level,fatal:eM.default.fatal,error:eM.default.error,warn:eM.default.warn,log:eM.default.log,info:eM.default.info,success:eM.default.success,ready:eM.default.ready,start:eM.default.start,box:eM.default.box,debug:eM.default.debug,trace:eM.default.trace,verbose:eM.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){eM.default.box(eG.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,a=e.rule,s=e.message;eM.default.log("".concat(eG.default.gray("File:")," ").concat(eG.default.blue("".concat(t).concat(r?":".concat(r):"")))),a&&eM.default.log(" ".concat(eB(n)("Rule:")," ").concat(a)),eM.default.log(" ".concat(eB(n)("Message:")," ").concat(s))}),eM.default.box(eB(n)("".concat(e," : ").concat(t.length))),eM.default.log(eG.default.gray("─".repeat(40)))}};function eK(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,a=r===void 0?!0:r,s=n.returnValue,o=n.callback,u=E(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return a&&eH.error(u.message),o&&typeof o=="function"&&o(u),s||{success:!1,message:u.message,code:eo.INTERNAL_SERVER_ERROR.CODE}}U(eK,"catchError");var eQ=F(require("fs-extra"),1);var eW=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var eJ=require("child_process"),e$=F(require("process"),1),ez=F(require("util"),1);var eX=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});var eZ=F(require("node-fetch"),1);var e0=eY();function e1(e){return s(function(){var t,n,r,a;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,eZ.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=s.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=s.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:a=s.sent();return[2,eK(a)];case 4:return[2]}})})()}U(e1,"getLatestPackageVersion");function e2(e){return s(function(){var t,n,r,a,s,o,u,c,i,l,f,d,E,p,h,m,v,y,g;return b(this,function(O){switch(O.label){case 0:O.trys.push([0,2,,3]);if(!eA(t2.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eX.DEPENDENCY,isDevDependency:e.type===eX.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=eI(t2.PACKAGE_JSON),n=t.name,r=t.version,a=r===void 0?"":r,s=t.dependencies,o=s===void 0?{}:s,u=t.devDependencies,c=u===void 0?{}:u;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:a,latestVersion:a,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===eX.DEPENDENCY,isDevDependency:e.type===eX.DEV_DEPENDENCY,installedPath:t2.PACKAGE_JSON,file:t}}];i=e.name in o,l=e.name in c;return[4,e1(e.name)];case 1:f=O.sent();if(!f.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:i,isDevDependency:l,installedPath:"",file:{}}}];if(!i&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:f.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eX.DEPENDENCY,isDevDependency:e.type===eX.DEV_DEPENDENCY,installedPath:"",file:{}}}];p=(E=(d=o[e.name])!==null&&d!==void 0?d:c[e.name])!==null&&E!==void 0?E:"",h=th(e0.CWD,tg,e.name,tS);if(!eA(h))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:f.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:i,isDevDependency:l,installedPath:"",file:{}}}];m=eI(h),v=m.version,y=v===void 0?"":v;return[2,p!==y?{success:!0,result:{name:e.name,currentVersion:y||p,latestVersion:f.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:i,isDevDependency:l,installedPath:h,file:m}}:{success:!0,result:{name:e.name,currentVersion:p,latestVersion:f.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:p===f.result,isDependency:i,isDevDependency:l,installedPath:h,file:m}}];case 2:g=O.sent();return[2,eK(g)];case 3:return[2]}})})()}U(e2,"getPackage");function e4(e){return s(function(){var t,n,r,a,s;return b(this,function(o){try{;r=eI(t2.PACKAGE_JSON),a=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?a[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),eT(t2.PACKAGE_JSON,JSON.stringify(r,null,4)),eH.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){eK(e)}return[2]})})()}U(e4,"updatePackage");function e3(){return s(function(){var e,t,n,r,a,s,o,u,c,i,l,f,d;return b(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:U(function(){return t3.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:U(function(){return t3.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:U(function(){return t3.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;E.label=1;case 1:E.trys.push([1,9,10,11]);a=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=a.next()).done))return[3,8];o=s.value,u=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,u()];case 4:i=E.sent();return[4,tl("".concat(c," using: ").concat(i),i)];case 5:E.sent();return[2];case 6:l=E.sent();eK(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=E.sent();n=true;r=f;return[3,11];case 10:try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:d=E.sent();eK(d);return[3,13];case 13:return[2]}})})()}U(e3,"installDependencies");function e5(e,t){return s(function(){var n,r,a,s,o,u,c,i,l,f,d,E;return b(this,function(p){switch(p.label){case 0:if(!eA(t2.PACKAGE_JSON)){eH.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,16,,17]);return[4,Promise.all(e.map(e2))];case 2:n=p.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?e4(e.result):Promise.resolve()}))];case 3:p.sent();return[4,e3()];case 4:p.sent();a=["Running ESLint with auto-fix"];return[4,t3.eslintFix()];case 5:return[4,tl.apply(void 0,a.concat([p.sent()]))];case 6:r=p.sent();p.label=7;case 7:r;o=true,u=false,c=undefined;p.label=8;case 8:p.trys.push([8,13,14,15]);i=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=9;case 9:if(!!(o=(l=i.next()).done))return[3,12];f=l.value;return[4,f()];case 10:p.sent();p.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:d=p.sent();u=true;c=d;return[3,15];case 14:try{if(!o&&i.return!=null){i.return()}}finally{if(u){throw c}}return[7];case 15:return[3,17];case 16:E=p.sent();eK(E);return[3,17];case 17:return[2]}})})()}U(e5,"setupPackages");var e7=F(require("node-persist"),1);var e6=eY();function e8(){return s(function(){var e;return b(this,function(t){switch(t.label){case 0:e=e7.default.defaultInstance;if(e)return[3,2];return[4,e7.default.init({dir:e6.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}U(e8,"initNodePersist");var e9={get:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e8()];case 1:r.sent();return[4,e7.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,eK(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e8()];case 1:r.sent();return[4,e7.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();eK(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e8()];case 1:n.sent();return[4,e7.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();eK(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e8()];case 1:n.sent();return[4,e7.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(eH.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,eK(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return b(this,function(t){try{return[2,"".concat(e6.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,eK(e,{returnValue:null})]}return[2]})})()}};var te=eY(),tt=ez.promisify(eJ.exec);function tn(e){return"error_list:".concat(e)}U(tn,"getErrorListKey");function tr(e){return s(function(){var t,n,r;return b(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tn(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,e9.set(n,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(function(){return s(function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,e9.getLogLink(n)];case 1:e=t.sent();e&&eH.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=a.sent();eK(r);return[3,4];case 4:return[2]}})})()}U(tr,"saveErrorListToStorage");function ta(e){var t=[],n=[],r="",a=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,s=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var u,c,i,l,f;var d=a.exec(e)||[],E=s.exec(e)||[],p=o.exec(e)||[];var h,m,v,y,g,O;d.length&&r?t.push({file:r,position:"".concat(d[1],":").concat(d[2]),type:d[3]===eR.Error?eR.Error:eR.Warning,message:(h=d===null||d===void 0?void 0:(u=d[4])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:"",rule:(m=d===null||d===void 0?void 0:(c=d[5])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:""}):E.length?t.push({file:(v=E===null||E===void 0?void 0:E[1])!==null&&v!==void 0?v:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===eR.Error?eR.Error:eR.Warning,message:(y=E===null||E===void 0?void 0:(i=E[5])===null||i===void 0?void 0:i.trim())!==null&&y!==void 0?y:""}):p.length?t.push({file:"commitlint",type:eR.Error,message:(g=p===null||p===void 0?void 0:(l=p[1])===null||l===void 0?void 0:l.trim())!==null&&g!==void 0?g:"",rule:(O=p===null||p===void 0?void 0:(f=p[2])===null||f===void 0?void 0:f.trim())!==null&&O!==void 0?O:""}):n.push(e.trim())}}),t.length&&tr(t),te.DEBUG&&n.length&&(eH.warn("Unmatched lines:"),n.forEach(function(e){return eH.info(" ".concat(e))}))}U(ta,"parseTextErrors");function ts(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,a=e.line,s=e.column,o=e.ruleId,u=e.message;n.push({type:r===2?eR.Error:eR.Warning,file:t,position:"".concat(a,":").concat(s),rule:o,message:u})})}),n.length&&tr(n)}catch(t){ta(e)}}U(ts,"parseCommandOutput");function to(e){return s(function(e){var t,n,r,a,s,o,u,c,i;var l=arguments;return b(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ts;n=new AbortController;e$.default.on("SIGINT",function(){eH.warn("Process interrupted. Terminating..."),n.abort(),e$.default.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tt(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),a=r.stdout,s=r.stderr;[a,s].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:o=f.sent();u=o.stdout,c=o.stderr,i=o.message;[u,c].forEach(function(e){return e&&t(e)}),!c&&!u&&eH.error("Command failed: ".concat(i));return[3,5];case 5:return[2]}})}).apply(this,arguments)}U(to,"executeCommand");function tu(e){return{raw:!0,cmd:e}}U(tu,"rawCommand");function tc(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tQ," ").concat(tB," ").concat(tM," ").concat(e):"".concat(tQ," ").concat(tG," ").concat(e)}U(tc,"formatCLI");function ti(e,t){return typeof e=="function"?tc(e(t),t):(typeof e==="undefined"?"undefined":N(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tc(e,t):e}U(ti,"formatCommand");function tl(e,t){return s(function(){var n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);eH.start("".concat(e)),te.DEBUG&&eH.info("→ ".concat(t));return[4,to(t)];case 1:r.sent(),eH.success("".concat(e," done."));return[3,3];case 2:n=r.sent();eK(n);return[3,3];case 3:return[2]}})})()}U(tl,"runCommand");var tf=F(require("path"),1);var td=eY(),tE=tf.default;function tp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=tE).resolve.apply(r,[td.CWD].concat(_(t)))}U(tp,"resolveWorkingPath");function th(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=tE).join.apply(r,_(t))}U(th,"join");var tm=eY(),tv=tm.CWD,ty="@cyberskill/shared",tg="node_modules",tO="dist",tS="package.json",tD="package-lock.json",tC="tsconfig.json",t_=".gitignore",tN=".simple-git-hooks.json",tI="pnpm-lock.yaml",tT=".git/hooks/",tb=".git/COMMIT_EDITMSG",tA=".migrate-mongo.config.js",tR=function(){var e=eQ.default.readJsonSync(tp(tS)).name===ty?tv:th(tv,tg,ty);return th(e,tO)}(),tG="cyberskill",tM="src/node/cli/index.ts",tP="eslint",tw="eslint",tL="vitest";var tU="vitest",tk="@commitlint/cli",tj="@commitlint/config-conventional",tF="commitlint",tx="lint-staged",tq="lint-staged",tY="typescript",tV="tsc",tB="tsx",tH="git",tK="pnpm",tQ="pnpm exec",tW="simple-git-hooks",tJ="simple-git-hooks",t$="@eslint/config-inspector",tz="eslint-config-inspector",tX="node-modules-inspector",tZ="node-modules-inspector",t0="migrate-mongo",t1="./node_modules/migrate-mongo/bin/migrate-mongo",t2={CYBERSKILL_DIRECTORY:tR,WORKING_DIRECTORY:tv,TS_CONFIG:tp(tC),GIT_IGNORE:tp(t_),GIT_HOOK:tp(tT),GIT_COMMIT_MSG:tp(tb),SIMPLE_GIT_HOOKS_JSON:tp(tN),PACKAGE_JSON:tp(tS),PACKAGE_LOCK_JSON:tp(tD),PNPM_LOCK_YAML:tp(tI),NODE_MODULES:tp(tg),MIGRATE_MONGO_CONFIG:tp(tA),LINT_STAGED_CONFIG:tp("".concat(tR,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:tp("".concat(tR,"/config/commitlint/index.js")),UNIT_TEST_CONFIG:tp("".concat(tR,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:tp("".concat(tR,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:tp("".concat(tR,"/react/vitest/vitest.e2e.js"))};function t4(e){var t=e.type,n=e.packages,r=e.command;var a=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return s(function(){var e;return b(this,function(n){switch(n.label){case 0:switch(t){case eW.CLI:return[3,1];case eW.STRING:return[3,4]}return[3,5];case 1:e=a===null||a===void 0?void 0:a.length;if(!e)return[3,3];return[4,e5(a,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,ti(tu("".concat(tQ," ").concat(r))))];case 4:return[2,ti(tu(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}U(t4,"buildCommand");var t3={simpleGitHooks:t4({type:eW.CLI,packages:[{name:tW,type:eX.DEV_DEPENDENCY}],command:tJ}),eslintInspect:t4({type:eW.CLI,packages:[{name:t$,type:eX.DEV_DEPENDENCY}],command:tz}),nodeModulesInspect:t4({type:eW.CLI,packages:[{name:tX,type:eX.DEV_DEPENDENCY}],command:tZ}),eslintCheck:t4({type:eW.CLI,packages:[{name:tP,type:eX.DEV_DEPENDENCY}],command:"".concat(tw," ").concat(t2.WORKING_DIRECTORY," --no-cache")}),eslintFix:t4({type:eW.CLI,packages:[{name:tP,type:eX.DEV_DEPENDENCY}],command:"".concat(tw," ").concat(t2.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:t4({type:eW.CLI,packages:[{name:tY,type:eX.DEPENDENCY}],command:"".concat(tV," -p ").concat(t2.TS_CONFIG," --noEmit")}),testUnit:t4({type:eW.CLI,packages:[{name:tL,type:eX.DEV_DEPENDENCY}],command:"".concat(tU," --config ").concat(t2.UNIT_TEST_CONFIG)}),testE2e:t4({type:eW.CLI,packages:[{name:tL,type:eX.DEV_DEPENDENCY}],command:"".concat(tU," --config ").concat(t2.E2E_TEST_CONFIG)}),mongoMigrateCreate:U(function(e){return t4({type:eW.CLI,packages:[{name:t0,type:eX.DEPENDENCY}],command:"".concat(tB," ").concat(t1," create ").concat(e," -f ").concat(t2.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:t4({type:eW.CLI,packages:[{name:t0,type:eX.DEPENDENCY}],command:"".concat(tB," ").concat(t1," up -f ").concat(t2.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:t4({type:eW.CLI,packages:[{name:t0,type:eX.DEPENDENCY}],command:"".concat(tB," ").concat(t1," down -f ").concat(t2.MIGRATE_MONGO_CONFIG)}),commitLint:t4({type:eW.CLI,packages:[{name:tk,type:eX.DEV_DEPENDENCY},{name:tj,type:eX.DEV_DEPENDENCY}],command:"".concat(tF," --edit ").concat(t2.GIT_COMMIT_MSG," --config ").concat(t2.COMMITLINT_CONFIG)}),lintStaged:t4({type:eW.CLI,packages:[{name:tx,type:eX.DEV_DEPENDENCY}],command:"".concat(tq," --config ").concat(t2.LINT_STAGED_CONFIG)}),configureGitHook:t4({type:eW.STRING,command:"".concat(tH," config core.hooksPath ").concat(t2.GIT_HOOK)}),stageBuildDirectory:t4({type:eW.STRING,command:"".concat(tH," add ").concat(tO)}),build:t4({type:eW.STRING,command:"".concat(tK," run --if-present build")}),pnpmInstallStandard:t4({type:eW.STRING,command:"".concat(tK," install --no-frozen-lockfile")}),pnpmInstallLegacy:t4({type:eW.STRING,command:"".concat(tK," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:t4({type:eW.STRING,command:"".concat(tK," install --no-frozen-lockfile --force")})};var t5={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return(0,ee.format)(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?t5.getDateTime():new Date;return{id:(0,es.v4)(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,a=t.post;n&&r&&e.pre(n,r),n&&a&&e.post(n,a)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:es.v4,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,a=r===void 0?[]:r,s=e.standalone,o=s===void 0?!1:s;var u=new t.Schema(n,{strict:!0});return a.forEach(function(e){var t=e.name,n=e.options,r=e.get;var a=u.virtual(t,n);r&&a.get(r)}),o||u.add(t5.createGenericSchema(t)),u},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,a=e.pagination,s=a===void 0?!1:a,o=e.aggregate,u=o===void 0?!1:o,c=e.virtuals,i=c===void 0?[]:c,l=e.middlewares,f=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var d=t5.createSchema({mongoose:t,schema:r,virtuals:i});return t5.applyPlugins(d,[s&&ea.default,u&&er.default]),t5.applyMiddlewares(d,f),t.model(n,d)},validator:{isEmpty:function e(){return function(e){return s(function(){return b(this,function(t){return[2,!em.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return s(function(){var n;return b(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return s(function(){return b(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!E(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:O(y({},et.default),{setConfig:U(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eT(t2.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(tA,"\n");eA(t2.GIT_IGNORE)?eC(t2.GIT_IGNORE,"utf-8").split("\n").includes(tA)||eb(t2.GIT_IGNORE,n):eT(t2.GIT_IGNORE,n)},"setConfig")})},t7=/*#__PURE__*/function(){function e(t,n){u(this,e);q(this,"collection");this.collection=t.collection(n)}i(e,[{key:"createOne",value:function e(e){return s(function(){var t,n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);t=y({},t5.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,this.collection.insertOne(t)];case 1:return[2,(n.result=a.sent(),n)];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return s(function(){var t,n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);t=e.map(function(e){return y({},t5.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=a.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:eo.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return s(function(){var e,t,n;var r=arguments;return b(this,function(a){switch(a.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};a.label=1;case 1:a.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=a.sent(),t)];case 3:n=a.sent();return[2,eK(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return s(function(){var e,t,n;var r=arguments;return b(this,function(a){switch(a.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};a.label=1;case 1:a.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=a.sent(),t)];case 3:n=a.sent();return[2,eK(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return s(function(){var n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=a.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return s(function(){var n,r;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=a.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=a.sent();return[2,eK(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eo.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}}]);return e}();U(t7,"MongoController");var t6=t7,t8=/*#__PURE__*/function(){function e(t){u(this,e);q(this,"model");this.model=t}i(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return s(function(){var e,t,n,r,a,s,o;var u=arguments;return b(this,function(c){switch(c.label){case 0:e=u.length>0&&u[0]!==void 0?u[0]:{},t=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2&&u[2]!==void 0?u[2]:{},r=u.length>3?u[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);a=this.model.findOne(e,t,n);r&&a.populate(r);return[4,a.exec()];case 2:s=c.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:eo.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,eK(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return s(function(){var e,t,n,r,a,s,o;var u=arguments;return b(this,function(c){switch(c.label){case 0:e=u.length>0&&u[0]!==void 0?u[0]:{},t=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2&&u[2]!==void 0?u[2]:{},r=u.length>3?u[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);a=this.model.find(e,t,n);r&&a.populate(r);s={success:!0};return[4,a.exec()];case 2:return[2,(s.result=c.sent(),s)];case 3:o=c.sent();return[2,eK(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return s(function(){var e,t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=s.sent(),n)];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return s(function(e){var t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=s.sent(),n)];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return s(function(){var e,t,n;var r=arguments;return b(this,function(a){switch(a.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};a.label=1;case 1:a.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=a.sent(),t)];case 3:n=a.sent();return[2,eK(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return s(function(e){var t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=s.sent().map(function(e){return E(e,en.Document)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return s(function(){var e,t,n,r,a;var s=arguments;return b(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{},n=s.length>2&&s[2]!==void 0?s[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:eo.NOT_FOUND.CODE}];case 3:a=o.sent();return[2,eK(a)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return s(function(){var e,t,n,r,a;var s=arguments;return b(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{},n=s.length>2&&s[2]!==void 0?s[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:a=o.sent();return[2,eK(a)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return s(function(){var e,t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=s.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:eo.NOT_FOUND.CODE}];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return s(function(){var e,t,n,r;var a=arguments;return b(this,function(s){switch(s.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{};s.label=1;case 1:s.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=s.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:eo.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=s.sent();return[2,eK(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return s(function(){var n,r,a,s,o;return b(this,function(u){switch(u.label){case 0:u.trys.push([0,6,,7]);n=new Set;r=0;u.label=1;case 1:if(!(r<10))return[3,5];a=eh(e,r+t);s=!n.has(a);if(!s)return[3,3];n.add(a);return[4,this.model.exists({shortId:a})];case 2:s=!u.sent();u.label=3;case 3:if(s)return[2,{success:!0,result:a}];u.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:eo.INTERNAL_SERVER_ERROR.CODE}];case 6:o=u.sent();return[2,eK(o)];case 7:return[2]}})}).call(this)}},{key:"createSlug",value:function e(e,t,n){return s(function(){var r,a,o,u,c,i,f,d,E,p;return b(this,function(h){switch(h.label){case 0:r=this;h.label=1;case 1:h.trys.push([1,5,,6]);a=t[e],o=el(a),u=U(function(t){var r=y({},n!==null&&n!==void 0?n:{});return o?O(y({},r),{$or:[l({},"slug.".concat(e),t),{slugHistory:{$elemMatch:l({},"slug.".concat(e),t)}}]}):O(y({},r),{$or:[{slug:t},{slugHistory:t}]})},"generateSlugQuery"),c=U(function(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:t=e,n=1;r.label=1;case 1:return[4,this.model.exists(u(t))];case 2:if(!r.sent())return[3,4];t="".concat(e,"-").concat(n++);r.label=3;case 3:return[3,1];case 4:return[2,t]}})}).call(r)},"generateUniqueSlug");if(!o)return[3,3];i={success:!0};f=Object.fromEntries;return[4,Promise.all(Object.entries(a).map(function(e){var t=C(e,2),n=t[0],r=t[1];return s(function(){var e,t;return b(this,function(a){switch(a.label){case 0:e=ep(r);t=[n];return[4,c(e)];case 1:return[2,t.concat([a.sent()])]}})})()}))];case 2:return[2,(i.result=f.apply(Object,[h.sent()]),i)];case 3:d=ep(a);E={success:!0};return[4,c(d)];case 4:return[2,(E.result=h.sent(),E)];case 5:p=h.sent();return[2,eK(p)];case 6:return[2]}})}).call(this)}},{key:"aggregate",value:function e(e){return s(function(){var t,n;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eK(n)];case 3:return[2]}})}).call(this)}}]);return e}();U(t8,"MongooseController");var t9=t8;0&&(module.exports={C_Collection:C_Collection,C_Db:C_Db,C_Document:C_Document,C_Model:C_Model,MONGO_MIGRATE_OPTIONS:MONGO_MIGRATE_OPTIONS,MongoController:MongoController,MongooseController:MongooseController,aggregatePaginate:aggregatePaginate,mongo:mongo,mongoosePaginate:mongoosePaginate});
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
48
|
-
export {
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export {
|
|
58
|
-
export {
|
|
59
|
-
export {
|
|
60
|
-
export {
|
|
61
|
-
export {
|
|
1
|
+
export { MONGO_MIGRATE_OPTIONS_alias_1 as MONGO_MIGRATE_OPTIONS } from '../../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { C_Db_alias_1 as C_Db } from '../../_tsup-dts-rollup.cjs';
|
|
3
|
+
export { T_Filter_alias_1 as T_Filter } from '../../_tsup-dts-rollup.cjs';
|
|
4
|
+
export { T_InsertOneResult_alias_1 as T_InsertOneResult } from '../../_tsup-dts-rollup.cjs';
|
|
5
|
+
export { T_InsertManyResult_alias_1 as T_InsertManyResult } from '../../_tsup-dts-rollup.cjs';
|
|
6
|
+
export { T_UpdateResult_alias_1 as T_UpdateResult } from '../../_tsup-dts-rollup.cjs';
|
|
7
|
+
export { T_DeleteResult_alias_1 as T_DeleteResult } from '../../_tsup-dts-rollup.cjs';
|
|
8
|
+
export { T_WithId_alias_1 as T_WithId } from '../../_tsup-dts-rollup.cjs';
|
|
9
|
+
export { T_OptionalUnlessRequiredId_alias_1 as T_OptionalUnlessRequiredId } from '../../_tsup-dts-rollup.cjs';
|
|
10
|
+
export { C_Document_alias_1 as C_Document } from '../../_tsup-dts-rollup.cjs';
|
|
11
|
+
export { C_Model_alias_1 as C_Model } from '../../_tsup-dts-rollup.cjs';
|
|
12
|
+
export { C_Collection_alias_1 as C_Collection } from '../../_tsup-dts-rollup.cjs';
|
|
13
|
+
export { I_ExtendedModel_alias_1 as I_ExtendedModel } from '../../_tsup-dts-rollup.cjs';
|
|
14
|
+
export { T_FilterQuery_alias_1 as T_FilterQuery } from '../../_tsup-dts-rollup.cjs';
|
|
15
|
+
export { T_ProjectionType_alias_1 as T_ProjectionType } from '../../_tsup-dts-rollup.cjs';
|
|
16
|
+
export { T_QueryOptions_alias_1 as T_QueryOptions } from '../../_tsup-dts-rollup.cjs';
|
|
17
|
+
export { T_PaginateOptions_alias_1 as T_PaginateOptions } from '../../_tsup-dts-rollup.cjs';
|
|
18
|
+
export { T_PopulateOption_alias_1 as T_PopulateOption } from '../../_tsup-dts-rollup.cjs';
|
|
19
|
+
export { T_PopulateOptions_alias_1 as T_PopulateOptions } from '../../_tsup-dts-rollup.cjs';
|
|
20
|
+
export { T_PipelineStage_alias_1 as T_PipelineStage } from '../../_tsup-dts-rollup.cjs';
|
|
21
|
+
export { T_PaginateResult_alias_1 as T_PaginateResult } from '../../_tsup-dts-rollup.cjs';
|
|
22
|
+
export { T_AggregatePaginateResult_alias_1 as T_AggregatePaginateResult } from '../../_tsup-dts-rollup.cjs';
|
|
23
|
+
export { T_InsertManyOptions_alias_1 as T_InsertManyOptions } from '../../_tsup-dts-rollup.cjs';
|
|
24
|
+
export { T_UpdateQuery_alias_1 as T_UpdateQuery } from '../../_tsup-dts-rollup.cjs';
|
|
25
|
+
export { T_QueryWithHelpers_alias_1 as T_QueryWithHelpers } from '../../_tsup-dts-rollup.cjs';
|
|
26
|
+
export { T_PreMiddlewareFunction_alias_1 as T_PreMiddlewareFunction } from '../../_tsup-dts-rollup.cjs';
|
|
27
|
+
export { T_PreSaveMiddlewareFunction_alias_1 as T_PreSaveMiddlewareFunction } from '../../_tsup-dts-rollup.cjs';
|
|
28
|
+
export { T_PostMiddlewareFunction_alias_1 as T_PostMiddlewareFunction } from '../../_tsup-dts-rollup.cjs';
|
|
29
|
+
export { T_ErrorHandlingMiddlewareFunction_alias_1 as T_ErrorHandlingMiddlewareFunction } from '../../_tsup-dts-rollup.cjs';
|
|
30
|
+
export { T_ErrorHandlingMiddlewareWithOption_alias_1 as T_ErrorHandlingMiddlewareWithOption } from '../../_tsup-dts-rollup.cjs';
|
|
31
|
+
export { T_MongooseShema_alias_1 as T_MongooseShema } from '../../_tsup-dts-rollup.cjs';
|
|
32
|
+
export { T_Input_MongooseSchema_alias_1 as T_Input_MongooseSchema } from '../../_tsup-dts-rollup.cjs';
|
|
33
|
+
export { T_MongoosePlugin_alias_1 as T_MongoosePlugin } from '../../_tsup-dts-rollup.cjs';
|
|
34
|
+
export { I_GenericDocument_alias_1 as I_GenericDocument } from '../../_tsup-dts-rollup.cjs';
|
|
35
|
+
export { I_MongooseOptions_alias_1 as I_MongooseOptions } from '../../_tsup-dts-rollup.cjs';
|
|
36
|
+
export { I_CreateSchemaOptions_alias_1 as I_CreateSchemaOptions } from '../../_tsup-dts-rollup.cjs';
|
|
37
|
+
export { T_MongooseMiddlewareMethod_alias_1 as T_MongooseMiddlewareMethod } from '../../_tsup-dts-rollup.cjs';
|
|
38
|
+
export { T_MongooseMiddlewarePreFunction_alias_1 as T_MongooseMiddlewarePreFunction } from '../../_tsup-dts-rollup.cjs';
|
|
39
|
+
export { T_MongooseMiddlewarePostFunction_alias_1 as T_MongooseMiddlewarePostFunction } from '../../_tsup-dts-rollup.cjs';
|
|
40
|
+
export { T_MongooseHookNextFunction_alias_1 as T_MongooseHookNextFunction } from '../../_tsup-dts-rollup.cjs';
|
|
41
|
+
export { I_MongooseModelMiddleware_alias_1 as I_MongooseModelMiddleware } from '../../_tsup-dts-rollup.cjs';
|
|
42
|
+
export { I_CreateModelOptions_alias_1 as I_CreateModelOptions } from '../../_tsup-dts-rollup.cjs';
|
|
43
|
+
export { T_Input_Populate_alias_1 as T_Input_Populate } from '../../_tsup-dts-rollup.cjs';
|
|
44
|
+
export { T_PaginateOptionsWithPopulate_alias_1 as T_PaginateOptionsWithPopulate } from '../../_tsup-dts-rollup.cjs';
|
|
45
|
+
export { I_Input_FindOne_alias_1 as I_Input_FindOne } from '../../_tsup-dts-rollup.cjs';
|
|
46
|
+
export { I_Input_FindAll_alias_1 as I_Input_FindAll } from '../../_tsup-dts-rollup.cjs';
|
|
47
|
+
export { I_Input_FindPaging_alias_1 as I_Input_FindPaging } from '../../_tsup-dts-rollup.cjs';
|
|
48
|
+
export { I_Input_FindPagingAggregate_alias_1 as I_Input_FindPagingAggregate } from '../../_tsup-dts-rollup.cjs';
|
|
49
|
+
export { I_Input_CreateOne_alias_1 as I_Input_CreateOne } from '../../_tsup-dts-rollup.cjs';
|
|
50
|
+
export { I_Input_CreateMany_alias_1 as I_Input_CreateMany } from '../../_tsup-dts-rollup.cjs';
|
|
51
|
+
export { I_UpdateOptionsExtended_alias_1 as I_UpdateOptionsExtended } from '../../_tsup-dts-rollup.cjs';
|
|
52
|
+
export { I_Input_UpdateOne_alias_1 as I_Input_UpdateOne } from '../../_tsup-dts-rollup.cjs';
|
|
53
|
+
export { I_Input_UpdateMany_alias_1 as I_Input_UpdateMany } from '../../_tsup-dts-rollup.cjs';
|
|
54
|
+
export { I_DeleteOptionsExtended_alias_1 as I_DeleteOptionsExtended } from '../../_tsup-dts-rollup.cjs';
|
|
55
|
+
export { I_Input_DeleteOne_alias_1 as I_Input_DeleteOne } from '../../_tsup-dts-rollup.cjs';
|
|
56
|
+
export { I_Input_DeleteMany_alias_1 as I_Input_DeleteMany } from '../../_tsup-dts-rollup.cjs';
|
|
57
|
+
export { aggregatePaginate_alias_1 as aggregatePaginate } from '../../_tsup-dts-rollup.cjs';
|
|
58
|
+
export { mongoosePaginate_alias_1 as mongoosePaginate } from '../../_tsup-dts-rollup.cjs';
|
|
59
|
+
export { mongo_alias_1 as mongo } from '../../_tsup-dts-rollup.cjs';
|
|
60
|
+
export { MongoController_alias_1 as MongoController } from '../../_tsup-dts-rollup.cjs';
|
|
61
|
+
export { MongooseController_alias_1 as MongooseController } from '../../_tsup-dts-rollup.cjs';
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
48
|
-
export {
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export {
|
|
58
|
-
export {
|
|
59
|
-
export {
|
|
60
|
-
export {
|
|
61
|
-
export {
|
|
1
|
+
export { MONGO_MIGRATE_OPTIONS_alias_1 as MONGO_MIGRATE_OPTIONS } from '../../_tsup-dts-rollup.js';
|
|
2
|
+
export { C_Db_alias_1 as C_Db } from '../../_tsup-dts-rollup.js';
|
|
3
|
+
export { T_Filter_alias_1 as T_Filter } from '../../_tsup-dts-rollup.js';
|
|
4
|
+
export { T_InsertOneResult_alias_1 as T_InsertOneResult } from '../../_tsup-dts-rollup.js';
|
|
5
|
+
export { T_InsertManyResult_alias_1 as T_InsertManyResult } from '../../_tsup-dts-rollup.js';
|
|
6
|
+
export { T_UpdateResult_alias_1 as T_UpdateResult } from '../../_tsup-dts-rollup.js';
|
|
7
|
+
export { T_DeleteResult_alias_1 as T_DeleteResult } from '../../_tsup-dts-rollup.js';
|
|
8
|
+
export { T_WithId_alias_1 as T_WithId } from '../../_tsup-dts-rollup.js';
|
|
9
|
+
export { T_OptionalUnlessRequiredId_alias_1 as T_OptionalUnlessRequiredId } from '../../_tsup-dts-rollup.js';
|
|
10
|
+
export { C_Document_alias_1 as C_Document } from '../../_tsup-dts-rollup.js';
|
|
11
|
+
export { C_Model_alias_1 as C_Model } from '../../_tsup-dts-rollup.js';
|
|
12
|
+
export { C_Collection_alias_1 as C_Collection } from '../../_tsup-dts-rollup.js';
|
|
13
|
+
export { I_ExtendedModel_alias_1 as I_ExtendedModel } from '../../_tsup-dts-rollup.js';
|
|
14
|
+
export { T_FilterQuery_alias_1 as T_FilterQuery } from '../../_tsup-dts-rollup.js';
|
|
15
|
+
export { T_ProjectionType_alias_1 as T_ProjectionType } from '../../_tsup-dts-rollup.js';
|
|
16
|
+
export { T_QueryOptions_alias_1 as T_QueryOptions } from '../../_tsup-dts-rollup.js';
|
|
17
|
+
export { T_PaginateOptions_alias_1 as T_PaginateOptions } from '../../_tsup-dts-rollup.js';
|
|
18
|
+
export { T_PopulateOption_alias_1 as T_PopulateOption } from '../../_tsup-dts-rollup.js';
|
|
19
|
+
export { T_PopulateOptions_alias_1 as T_PopulateOptions } from '../../_tsup-dts-rollup.js';
|
|
20
|
+
export { T_PipelineStage_alias_1 as T_PipelineStage } from '../../_tsup-dts-rollup.js';
|
|
21
|
+
export { T_PaginateResult_alias_1 as T_PaginateResult } from '../../_tsup-dts-rollup.js';
|
|
22
|
+
export { T_AggregatePaginateResult_alias_1 as T_AggregatePaginateResult } from '../../_tsup-dts-rollup.js';
|
|
23
|
+
export { T_InsertManyOptions_alias_1 as T_InsertManyOptions } from '../../_tsup-dts-rollup.js';
|
|
24
|
+
export { T_UpdateQuery_alias_1 as T_UpdateQuery } from '../../_tsup-dts-rollup.js';
|
|
25
|
+
export { T_QueryWithHelpers_alias_1 as T_QueryWithHelpers } from '../../_tsup-dts-rollup.js';
|
|
26
|
+
export { T_PreMiddlewareFunction_alias_1 as T_PreMiddlewareFunction } from '../../_tsup-dts-rollup.js';
|
|
27
|
+
export { T_PreSaveMiddlewareFunction_alias_1 as T_PreSaveMiddlewareFunction } from '../../_tsup-dts-rollup.js';
|
|
28
|
+
export { T_PostMiddlewareFunction_alias_1 as T_PostMiddlewareFunction } from '../../_tsup-dts-rollup.js';
|
|
29
|
+
export { T_ErrorHandlingMiddlewareFunction_alias_1 as T_ErrorHandlingMiddlewareFunction } from '../../_tsup-dts-rollup.js';
|
|
30
|
+
export { T_ErrorHandlingMiddlewareWithOption_alias_1 as T_ErrorHandlingMiddlewareWithOption } from '../../_tsup-dts-rollup.js';
|
|
31
|
+
export { T_MongooseShema_alias_1 as T_MongooseShema } from '../../_tsup-dts-rollup.js';
|
|
32
|
+
export { T_Input_MongooseSchema_alias_1 as T_Input_MongooseSchema } from '../../_tsup-dts-rollup.js';
|
|
33
|
+
export { T_MongoosePlugin_alias_1 as T_MongoosePlugin } from '../../_tsup-dts-rollup.js';
|
|
34
|
+
export { I_GenericDocument_alias_1 as I_GenericDocument } from '../../_tsup-dts-rollup.js';
|
|
35
|
+
export { I_MongooseOptions_alias_1 as I_MongooseOptions } from '../../_tsup-dts-rollup.js';
|
|
36
|
+
export { I_CreateSchemaOptions_alias_1 as I_CreateSchemaOptions } from '../../_tsup-dts-rollup.js';
|
|
37
|
+
export { T_MongooseMiddlewareMethod_alias_1 as T_MongooseMiddlewareMethod } from '../../_tsup-dts-rollup.js';
|
|
38
|
+
export { T_MongooseMiddlewarePreFunction_alias_1 as T_MongooseMiddlewarePreFunction } from '../../_tsup-dts-rollup.js';
|
|
39
|
+
export { T_MongooseMiddlewarePostFunction_alias_1 as T_MongooseMiddlewarePostFunction } from '../../_tsup-dts-rollup.js';
|
|
40
|
+
export { T_MongooseHookNextFunction_alias_1 as T_MongooseHookNextFunction } from '../../_tsup-dts-rollup.js';
|
|
41
|
+
export { I_MongooseModelMiddleware_alias_1 as I_MongooseModelMiddleware } from '../../_tsup-dts-rollup.js';
|
|
42
|
+
export { I_CreateModelOptions_alias_1 as I_CreateModelOptions } from '../../_tsup-dts-rollup.js';
|
|
43
|
+
export { T_Input_Populate_alias_1 as T_Input_Populate } from '../../_tsup-dts-rollup.js';
|
|
44
|
+
export { T_PaginateOptionsWithPopulate_alias_1 as T_PaginateOptionsWithPopulate } from '../../_tsup-dts-rollup.js';
|
|
45
|
+
export { I_Input_FindOne_alias_1 as I_Input_FindOne } from '../../_tsup-dts-rollup.js';
|
|
46
|
+
export { I_Input_FindAll_alias_1 as I_Input_FindAll } from '../../_tsup-dts-rollup.js';
|
|
47
|
+
export { I_Input_FindPaging_alias_1 as I_Input_FindPaging } from '../../_tsup-dts-rollup.js';
|
|
48
|
+
export { I_Input_FindPagingAggregate_alias_1 as I_Input_FindPagingAggregate } from '../../_tsup-dts-rollup.js';
|
|
49
|
+
export { I_Input_CreateOne_alias_1 as I_Input_CreateOne } from '../../_tsup-dts-rollup.js';
|
|
50
|
+
export { I_Input_CreateMany_alias_1 as I_Input_CreateMany } from '../../_tsup-dts-rollup.js';
|
|
51
|
+
export { I_UpdateOptionsExtended_alias_1 as I_UpdateOptionsExtended } from '../../_tsup-dts-rollup.js';
|
|
52
|
+
export { I_Input_UpdateOne_alias_1 as I_Input_UpdateOne } from '../../_tsup-dts-rollup.js';
|
|
53
|
+
export { I_Input_UpdateMany_alias_1 as I_Input_UpdateMany } from '../../_tsup-dts-rollup.js';
|
|
54
|
+
export { I_DeleteOptionsExtended_alias_1 as I_DeleteOptionsExtended } from '../../_tsup-dts-rollup.js';
|
|
55
|
+
export { I_Input_DeleteOne_alias_1 as I_Input_DeleteOne } from '../../_tsup-dts-rollup.js';
|
|
56
|
+
export { I_Input_DeleteMany_alias_1 as I_Input_DeleteMany } from '../../_tsup-dts-rollup.js';
|
|
57
|
+
export { aggregatePaginate_alias_1 as aggregatePaginate } from '../../_tsup-dts-rollup.js';
|
|
58
|
+
export { mongoosePaginate_alias_1 as mongoosePaginate } from '../../_tsup-dts-rollup.js';
|
|
59
|
+
export { mongo_alias_1 as mongo } from '../../_tsup-dts-rollup.js';
|
|
60
|
+
export { MongoController_alias_1 as MongoController } from '../../_tsup-dts-rollup.js';
|
|
61
|
+
export { MongooseController_alias_1 as MongooseController } from '../../_tsup-dts-rollup.js';
|