@cyberskill/shared 1.187.0 → 1.189.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +5 -1
- package/dist/_tsup-dts-rollup.d.ts +5 -1
- package/dist/config/config.util.cjs +1 -1
- package/dist/config/config.util.js +1 -1
- package/dist/config/index.cjs +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/vitest/index.cjs +1 -1
- package/dist/config/vitest/index.js +1 -1
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +1 -1
- package/dist/config/vitest/vitest.unit.setup.cjs +1 -1
- package/dist/config/vitest/vitest.unit.setup.js +1 -1
- 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.util.cjs +1 -1
- package/dist/node/command/command.util.js +1 -1
- package/dist/node/command/index.cjs +1 -1
- package/dist/node/command/index.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/mongo/index.cjs +1 -1
- package/dist/node/mongo/index.js +1 -1
- package/dist/node/mongo/mongo.util.cjs +1 -1
- package/dist/node/mongo/mongo.util.js +1 -1
- package/dist/node/package/index.cjs +1 -1
- package/dist/node/package/index.js +1 -1
- package/dist/node/package/package.util.cjs +1 -1
- package/dist/node/package/package.util.js +1 -1
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +1 -1
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.js +1 -1
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +1 -1
- package/dist/react/apollo-client/apollo-client.type.d.cts +1 -0
- package/dist/react/apollo-client/apollo-client.type.d.ts +1 -0
- package/dist/react/apollo-client/index.cjs +1 -1
- package/dist/react/apollo-client/index.d.cts +1 -0
- package/dist/react/apollo-client/index.d.ts +1 -0
- package/dist/react/apollo-client/index.js +1 -1
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +1 -1
- package/dist/react/apollo-error/index.cjs +1 -1
- package/dist/react/apollo-error/index.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.css +1 -1
- package/dist/react/index.d.cts +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -1
- package/dist/react/loading/index.cjs +1 -1
- package/dist/react/loading/index.css +1 -1
- package/dist/react/loading/index.js +1 -1
- package/dist/react/loading/loading.component.cjs +1 -1
- package/dist/react/loading/loading.component.css +1 -1
- package/dist/react/loading/loading.component.js +1 -1
- package/dist/react/loading/loading.provider.cjs +1 -1
- package/dist/react/loading/loading.provider.css +1 -1
- package/dist/react/loading/loading.provider.js +1 -1
- package/package.json +14 -15
package/dist/node/cli/index.cjs
CHANGED
|
@@ -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,t,n,r,i,s,o){try{var a=e[s](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,c,"next",e)}function c(e){r(o,i,s,a,c,"throw",e)}a(undefined)})}}function s(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 o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw a}}return r}function u(){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 l(){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 d(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){s(e,t,n[t])})}return e}function p(e,n){return t(e)||c(e,n)||m(e,n)||u()}function E(e){return n(e)||a(e)||m(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(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 g(e,t){var n,r,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(s=0)),s)try{if(n=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;r=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var h=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(e,t){return h(e,"name",{value:t,configurable:!0})};var I=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var i=u.value;!O.call(e,i)&&i!==n&&h(e,i,{get:function(){return t[i]},enumerable:!(r=v(t,i))||r.enumerable})};for(var c=S(t)[Symbol.iterator](),u;!(i=(u=c.next()).done);i=true)a()}catch(e){s=true;o=e}finally{try{if(!i&&c.return!=null){c.return()}}finally{if(s){throw o}}}return e};var N=function(e,t,n){return n=e!=null?y(D(e)):{},I(t||!e||!e.__esModule?h(n,"default",{value:e,enumerable:!0}):n,e)},T=function(e){return I(h({},"__esModule",{value:!0}),e)};var x={};module.exports=T(x);var A=N(require("process"),1),_=require("yargs/helpers"),R=N(require("yargs/yargs"),1);var b={name:"@cyberskill/shared",type:"module",version:"1.186.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.15.0","@apollo/client":"3.13.8","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@eslint-react/eslint-plugin":"1.52.2","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.2","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.10.2","@vitest/browser":"3.2.4","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.53.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3","react-icons":"5.5.0",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.5",ws:"8.18.2",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.3","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","esbuild-sass-plugin":"3.3.1",eslint:"9.29.0","lint-staged":"16.1.2","node-modules-inspector":"0.6.9",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var G=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var P=require("child_process"),M=N(require("process"),1),w=N(require("util"),1);var j=".cyberskill-storage";var L=N(require("@dotenvx/dotenvx"),1),U=require("envalid"),k=N(require("os"),1),q=N(require("path"),1),F=N(require("process"),1);var V=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var Y=!1;function B(){F.default.env.NODE_ENV!==V.PRODUCTION&&!Y&&(L.default.config(),Y=!0)}C(B,"loadEnvFile");function K(){B();var e=(0,U.cleanEnv)(F.default.env,{CWD:(0,U.str)({default:F.default.cwd()}),DEBUG:(0,U.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,U.str)({default:q.default.join(k.default.homedir(),j)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}C(K,"getEnv");var H=function(e){return e.Error="error",e.Warning="warning",e}({});var Q=N(require("chalk"),1),W=N(require("consola"),1),J=require("graphql");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 z=K();z.DEBUG||(W.default.level=4);function X(e){var t=Q.default[e];return typeof t=="function"?t:Q.default.green}C(X,"chalkKeyword");var Z={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.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)){W.default.box(Q.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;W.default.log("".concat(Q.default.gray("File:")," ").concat(Q.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&W.default.log(" ".concat(X(n)("Rule:")," ").concat(i)),W.default.log(" ".concat(X(n)("Message:")," ").concat(s))}),W.default.box(X(n)("".concat(e," : ").concat(t.length))),W.default.log(Q.default.gray("─".repeat(40)))}};function ee(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,i=r===void 0?!0:r,s=n.returnValue,a=n.callback,c=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return i&&Z.error(c.message),a&&typeof a=="function"&&a(c),s||{success:!1,message:c.message,code:$.INTERNAL_SERVER_ERROR.CODE}}C(ee,"catchError");var et=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});var en=N(require("node-fetch"),1);var er=N(require("fs-extra"),1),ei=N(require("path"),1);var es=er.default,eo=es.lstatSync,ea=es.readdirSync,ec=es.mkdirSync,eu=es.readFileSync,el=es.unlinkSync,ed=es.statSync,ep=er.default.readJsonSync;function eE(e,t,n){er.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(eE,"writeFileSync");function ef(e,t,n){er.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(ef,"appendFileSync");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return er.default.pathExistsSync(e)})}C(em,"pathExistsSync");function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){em(e)&&er.default.removeSync(e)})}C(eg,"removeSync");var ey=N(require("fs-extra"),1);var eh=N(require("path"),1);var ev=K(),eS=eh.default;function eD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eS).resolve.apply(r,[ev.CWD].concat(E(t)))}C(eD,"resolveWorkingPath");function eO(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eS).join.apply(r,E(t))}C(eO,"join");var eC=K(),eI=eC.CWD,eN="@cyberskill/shared",eT="node_modules",ex="dist",eA="public",e_="package.json",eR="package-lock.json",eb="tsconfig.json",eG=".gitignore",eP=".simple-git-hooks.json",eM="pnpm-lock.yaml",ew=".git/hooks/",ej=".git/COMMIT_EDITMSG",eL=".migrate-mongo.config.js",eU=function(){var e=ey.default.readJsonSync(eD(e_)).name===eN?eI:eO(eI,eT,eN);return eO(e,ex)}(),ek="cyberskill",eq="src/node/cli/index.ts",eF="eslint",eV="eslint",eY="vitest";var eB="vitest",eK="@commitlint/cli",eH="@commitlint/config-conventional",eQ="commitlint",eW="lint-staged",eJ="lint-staged",e$="typescript",ez="tsc",eX="tsx",eZ="git",e0="pnpm",e1="pnpm exec",e2="simple-git-hooks",e4="simple-git-hooks",e3="@eslint/config-inspector",e5="eslint-config-inspector",e8="node-modules-inspector",e6="node-modules-inspector",e7="migrate-mongo",e9="./node_modules/migrate-mongo/bin/migrate-mongo",te={CYBERSKILL_DIRECTORY:eU,WORKING_DIRECTORY:eI,PUBLIC_DIRECTORY:eD(eA),TS_CONFIG:eD(eb),GIT_IGNORE:eD(eG),GIT_HOOK:eD(ew),GIT_COMMIT_MSG:eD(ej),SIMPLE_GIT_HOOKS_JSON:eD(eP),PACKAGE_JSON:eD(e_),PACKAGE_LOCK_JSON:eD(eR),PNPM_LOCK_YAML:eD(eM),NODE_MODULES:eD(eT),MIGRATE_MONGO_CONFIG:eD(eL),LINT_STAGED_CONFIG:eD("".concat(eU,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eD("".concat(eU,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eD("".concat(eU,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eD("".concat(eU,"/config/vitest/vitest.unit.setup.ts")),VITEST_E2E_CONFIG:eD("".concat(eU,"/config/vitest/vitest.e2e.js"))};function tt(e){var t=e.isCurrentProject;return d({"pre-commit":eJ,"commit-msg":eQ},t&&{"pre-push":tC("".concat(eZ," pull"))})}C(tt,"createGitHooksConfig");function tn(e){var t=e.type,n=e.packages,r=e.command;var s=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 i(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case G.CLI:return[3,1];case G.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tu(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tN(tC("".concat(e1," ").concat(r))))];case 4:return[2,tN(tC(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}C(tn,"buildCommand");var tr={simpleGitHooks:tn({type:G.CLI,packages:[{name:e2,type:et.DEV_DEPENDENCY}],command:e4}),eslintInspect:tn({type:G.CLI,packages:[{name:e3,type:et.DEV_DEPENDENCY}],command:e5}),nodeModulesInspect:tn({type:G.CLI,packages:[{name:e8,type:et.DEV_DEPENDENCY}],command:e6}),eslintCheck:tn({type:G.CLI,packages:[{name:eF,type:et.DEV_DEPENDENCY}],command:"".concat(eV," ").concat(te.WORKING_DIRECTORY," --no-cache")}),eslintFix:tn({type:G.CLI,packages:[{name:eF,type:et.DEV_DEPENDENCY}],command:"".concat(eV," ").concat(te.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tn({type:G.CLI,packages:[{name:e$,type:et.DEV_DEPENDENCY}],command:"".concat(ez," -p ").concat(te.TS_CONFIG," --noEmit")}),testUnit:tn({type:G.CLI,packages:[{name:eY,type:et.DEV_DEPENDENCY}],command:"".concat(eB," --config ").concat(te.VITEST_UNIT_CONFIG)}),testE2e:tn({type:G.CLI,packages:[{name:eY,type:et.DEV_DEPENDENCY}],command:"".concat(eB," --config ").concat(te.VITEST_E2E_CONFIG)}),mongoMigrateCreate:C(function(e){return tn({type:G.CLI,packages:[{name:eX,type:et.DEPENDENCY},{name:e7,type:et.DEPENDENCY}],command:"".concat(eX," ").concat(e9," create ").concat(e," -f ").concat(te.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tn({type:G.CLI,packages:[{name:eX,type:et.DEPENDENCY},{name:e7,type:et.DEPENDENCY}],command:"".concat(eX," ").concat(e9," up -f ").concat(te.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tn({type:G.CLI,packages:[{name:eX,type:et.DEPENDENCY},{name:e7,type:et.DEPENDENCY}],command:"".concat(eX," ").concat(e9," down -f ").concat(te.MIGRATE_MONGO_CONFIG)}),commitLint:tn({type:G.CLI,packages:[{name:eK,type:et.DEV_DEPENDENCY},{name:eH,type:et.DEV_DEPENDENCY}],command:"".concat(eQ," --edit ").concat(te.GIT_COMMIT_MSG," --config ").concat(te.COMMITLINT_CONFIG)}),lintStaged:tn({type:G.CLI,packages:[{name:eW,type:et.DEV_DEPENDENCY}],command:"".concat(eJ," --config ").concat(te.LINT_STAGED_CONFIG)}),configureGitHook:tn({type:G.STRING,command:"".concat(eZ," config core.hooksPath ").concat(te.GIT_HOOK)}),build:tn({type:G.STRING,command:"".concat(e0," run --if-present build")}),pnpmInstallStandard:tn({type:G.STRING,command:"".concat(e0," install --ignore-scripts")}),pnpmInstallLegacy:tn({type:G.STRING,command:"".concat(e0," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:tn({type:G.STRING,command:"".concat(e0," install --ignore-scripts --force")}),pnpmPruneStore:tn({type:G.STRING,command:"".concat(e0," store prune")}),pnpmCleanCache:tn({type:G.STRING,command:"".concat(e0," cache delete")})};var ti=K();function ts(e){return i(function(){var t,n,r,i;return g(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,en.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:i=s.sent();return[2,ee(i)];case 4:return[2]}})})()}C(ts,"getLatestPackageVersion");function to(e){return i(function(){var t,n,r,i,s,o,a,c,u,l,d,p,E,f,m,y,h,v,S,D,O,C,I,N;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!e){if(em(te.PACKAGE_JSON)){t=ep(te.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,i=t.version,s=i===void 0?"":i;return[2,{success:!0,result:{name:r,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:te.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!em(te.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===et.DEPENDENCY,isDevDependency:e.type===et.DEV_DEPENDENCY,installedPath:"",file:{}}}];o=ep(te.PACKAGE_JSON),a=o.name,c=o.version,u=c===void 0?"":c,l=o.dependencies,d=l===void 0?{}:l,p=o.devDependencies,E=p===void 0?{}:p;if(e.name===a)return[2,{success:!0,result:{name:a,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===et.DEPENDENCY,isDevDependency:e.type===et.DEV_DEPENDENCY,installedPath:te.PACKAGE_JSON,file:o}}];f=e.name in d,m=e.name in E;return[4,ts(e.name)];case 1:y=g.sent();if(!y.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:f,isDevDependency:m,installedPath:"",file:{}}}];if(!f&&!m)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===et.DEPENDENCY,isDevDependency:e.type===et.DEV_DEPENDENCY,installedPath:"",file:{}}}];S=(v=(h=d[e.name])!==null&&h!==void 0?h:E[e.name])!==null&&v!==void 0?v:"",D=eO(ti.CWD,eT,e.name,e_);if(!em(D))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:f,isDevDependency:m,installedPath:"",file:{}}}];O=ep(D),C=O.version,I=C===void 0?"":C;return[2,S!==I?{success:!0,result:{name:e.name,currentVersion:I||S,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:f,isDevDependency:m,installedPath:D,file:O}}:{success:!0,result:{name:e.name,currentVersion:S,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:S===y.result,isDependency:f,isDevDependency:m,installedPath:D,file:O}}];case 2:N=g.sent();return[2,ee(N)];case 3:return[2]}})})()}C(to,"getPackage");function ta(e){return i(function(){var t,n,r,i,s;return g(this,function(o){try{;r=ep(te.PACKAGE_JSON),i=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?i[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),eE(te.PACKAGE_JSON,JSON.stringify(r,null,4)),Z.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){ee(e)}return[2]})})()}C(ta,"updatePackage");function tc(){return i(function(){var e,t,n,r,i,s,o,a,c,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:C(function(){return tr.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:C(function(){return tr.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:C(function(){return tr.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]);i=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,a=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,a()];case 4:u=E.sent();return[4,tx("".concat(c," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();ee(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();ee(p);return[3,13];case 13:return[2]}})})()}C(tc,"installDependencies");function tu(e,t){return i(function(){var n,r,i,s,o,a,c,u,l,d,p,f,m,y,h,v,S;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,15,,16]);if(!em(te.PACKAGE_JSON)){Z.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(to))];case 1:i=g.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),s=i.filter(function(e){return!e.isInstalled}),o=i.filter(function(e){return!e.isUpToDate}),a=[];(t===null||t===void 0?void 0:t.install)&&s.length>0&&(n=a).push.apply(n,E(s.map(ta))),(t===null||t===void 0?void 0:t.update)&&o.length>0&&(r=a).push.apply(r,E(o.map(ta)));c=a.length>0;if(!c)return[3,6];return[4,Promise.all(a)];case 2:g.sent();return[4,tc()];case 3:g.sent();u=["Running ESLint with auto-fix"];return[4,tr.eslintFix()];case 4:return[4,tx.apply(void 0,u.concat([g.sent()]))];case 5:c=g.sent();g.label=6;case 6:c;d=true,p=false,f=undefined;g.label=7;case 7:g.trys.push([7,12,13,14]);m=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();g.label=8;case 8:if(!!(d=(y=m.next()).done))return[3,11];h=y.value;return[4,h()];case 9:g.sent();g.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:v=g.sent();p=true;f=v;return[3,14];case 13:try{if(!d&&m.return!=null){m.return()}}finally{if(p){throw f}}return[7];case 14:return[3,16];case 15:S=g.sent();ee(S);return[3,16];case 16:return[2]}})})()}C(tu,"setupPackages");var tl=N(require("node-persist"),1);var td=K();function tp(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=tl.default.defaultInstance;if(e)return[3,2];return[4,tl.default.init({dir:td.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}C(tp,"initNodePersist");var tE={get:function e(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tp()];case 1:r.sent();return[4,tl.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,ee(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tp()];case 1:r.sent();return[4,tl.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();ee(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tp()];case 1:n.sent();return[4,tl.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ee(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tp()];case 1:n.sent();return[4,tl.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(Z.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,ee(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return g(this,function(t){try{return[2,"".concat(td.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,ee(e,{returnValue:null})]}return[2]})})()}};var tf=K(),tm=w.promisify(P.exec);function tg(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,to()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}C(tg,"getPackageName");function ty(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,tg()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,tE.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return g(this,function(n){switch(n.label){case 0:return[4,tE.getLogLink(t)];case 1:e=n.sent();e&&Z.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();ee(n);return[3,5];case 5:return[2]}})})()}C(ty,"saveErrorListToStorage");function th(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tg()];case 1:e=r.sent();return[4,tE.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,ee(n,{returnValue:[]})];case 4:return[2]}})})()}C(th,"getStoredErrorLists");function tv(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tg()];case 1:e=n.sent();return[4,tE.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ee(t);return[3,4];case 4:return[2]}})})()}C(tv,"clearAllErrorLists");function tS(e){var t=[],n=[],r="",i=/^\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 a,c,u,l,d;var p=i.exec(e)||[],E=s.exec(e)||[],f=o.exec(e)||[];var m,g,y,h,v,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===H.Error?H.Error:H.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===H.Error?H.Error:H.Warning,message:(h=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:"commitlint",type:H.Error,message:(v=f===null||f===void 0?void 0:(l=f[1])===null||l===void 0?void 0:l.trim())!==null&&v!==void 0?v:"",rule:(S=f===null||f===void 0?void 0:(d=f[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&ty(t),tf.DEBUG&&n.length&&(Z.warn("Unmatched lines:"),n.forEach(function(e){return Z.info(" ".concat(e))}))}C(tS,"parseTextErrors");function tD(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,i=e.line,s=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?H.Error:H.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:a})})}),n.length&&ty(n)}catch(t){tS(e)}}C(tD,"parseCommandOutput");function tO(e){return i(function(e){var t,n,r,i,s,o,a,c,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tD;n=new AbortController;M.default.on("SIGINT",function(){Z.warn("Process interrupted. Terminating..."),n.abort(),M.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tm(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&Z.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}C(tO,"executeCommand");function tC(e){return{raw:!0,cmd:e}}C(tC,"rawCommand");function tI(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e1," ").concat(eX," ").concat(eq," ").concat(e):"".concat(e1," ").concat(ek," ").concat(e)}C(tI,"formatCLI");function tN(e,t){return typeof e=="function"?tI(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tI(e,t):e}C(tN,"formatCommand");function tT(e){return i(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,to({name:eN})];case 1:t=i.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],i=t[1];return[r,tN(i,n)]}))]}return[2]}})})()}C(tT,"resolveCommands");function tx(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);Z.start("".concat(e)),tf.DEBUG&&Z.info("→ ".concat(t));return[4,tO(t)];case 1:r.sent(),Z.success("".concat(e," done."));return[3,3];case 2:n=r.sent();ee(n);return[3,3];case 3:return[2]}})})()}C(tx,"runCommand");function tA(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!em(te.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tr.typescriptCheck()];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=Z.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}C(tA,"checkTypescript");function t_(){return i(function(){var e,t,n,r;var i=arguments;return g(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,tr.eslintFix()];case 1:return[4,tx.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tr.eslintCheck()];case 4:return[4,tx.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})}).apply(this,arguments)}C(t_,"checkEslint");function tR(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";Z.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}C(tR,"printIssues");function tb(){return i(function(){return g(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,th()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===H.Error}),n=e.filter(function(e){return e.type===H.Warning});!t.length&&!n.length?Z.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tR("Warnings",n),tR("Errors",t),(t.length>0||n.length>0)&&A.default.exit(1));return[2]}})})()},0);return[2]})})()}C(tb,"showCheckResult");function tG(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,tv()];case 1:i.sent();return[4,to({name:eN})];case 2:e=i.sent();if(!e.success){Z.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(eN)];return[4,tr.build()];case 3:return[4,tx.apply(void 0,n.concat([i.sent()]))];case 4:t=i.sent();i.label=5;case 5:t;r=["Executing lint-staged"];return[4,tr.lintStaged()];case 6:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 7:i.sent(),tb();return[2]}})})()}C(tG,"lintStaged");function tP(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tr.eslintInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tP,"inspectLint");function tM(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tv()];case 1:e.sent();return[4,Promise.all([tA(),t_()])];case 2:e.sent(),tb();return[2]}})})()}C(tM,"lintCheck");function tw(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tv()];case 1:e.sent();return[4,Promise.all([tA(),t_(!0)])];case 2:e.sent(),tb();return[2]}})})()}C(tw,"lintFix");function tj(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,tv()];case 1:t.sent();e=["Validating commit message"];return[4,tr.commitLint()];case 2:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tb();return[2]}})})()}C(tj,"commitLint");function tL(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,tr.configureGitHook()];case 1:return[4,tx.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),eg(te.GIT_HOOK);return[4,tT(tt)];case 3:t=i.sent();eE(te.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eP,"\n");em(te.GIT_IGNORE)?eu(te.GIT_IGNORE,"utf-8").split("\n").includes(eP)||ef(te.GIT_IGNORE,n):eE(te.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tr.simpleGitHooks()];case 4:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})})()}C(tL,"setupGitHook");function tU(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,tL()];case 2:e.sent();return[2]}})})()}C(tU,"ready");function tk(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:eg(te.NODE_MODULES,te.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,tr.pnpmPruneStore()];case 1:return[4,tx.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,tr.pnpmCleanCache()];case 3:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,tc()];case 5:n.sent();return[4,tL()];case 6:n.sent();return[2]}})})()}C(tk,"reset");function tq(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tr.nodeModulesInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tq,"inspect");function tF(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tr.testUnit()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tF,"testUnit");function tV(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tr.testE2e()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tV,"testE2E");function tY(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tr.mongoMigrateCreate(e)];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}C(tY,"mongoMigrateCreate");function tB(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tr.mongoMigrateUp()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tB,"mongoMigrateUp");function tK(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tr.mongoMigrateDown()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tK,"mongoMigrateDown");(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,R.default)((0,_.hideBin)(A.default.argv)).scriptName(ek).usage("$0 <command> [options]").command("lint","Check code for linting issues",tM).command("lint:fix","Fix linting issues automatically",tw).command("lint:inspect","View active ESLint configuration",tP).command("lint-staged","Run lint checks on staged files",tG).command("commitlint","Validate commit message format",tj).command("ready","Initialize project and dependencies",tU).command("reset","Reset the project and reinstall dependencies",tk).command("inspect","Analyze installed project dependencies",tq).command("test:unit","Run unit test suite",tF).command("test:e2e","Run end-to-end test suite",tV).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){Z.error("Migration name is required.");return[2]}return[4,tY(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tB).command("mongo:migrate:down","Rollback last MongoDB migration",tK).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();ee(e),A.default.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
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,t,n,r,i,s,o){try{var a=e[s](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,c,"next",e)}function c(e){r(o,i,s,a,c,"throw",e)}a(undefined)})}}function s(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 o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw a}}return r}function u(){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 l(){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 d(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){s(e,t,n[t])})}return e}function p(e,n){return t(e)||c(e,n)||m(e,n)||u()}function E(e){return n(e)||a(e)||m(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(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 g(e,t){var n,r,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(s=0)),s)try{if(n=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;r=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var h=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(e,t){return h(e,"name",{value:t,configurable:!0})};var I=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var i=u.value;!O.call(e,i)&&i!==n&&h(e,i,{get:function(){return t[i]},enumerable:!(r=v(t,i))||r.enumerable})};for(var c=S(t)[Symbol.iterator](),u;!(i=(u=c.next()).done);i=true)a()}catch(e){s=true;o=e}finally{try{if(!i&&c.return!=null){c.return()}}finally{if(s){throw o}}}return e};var N=function(e,t,n){return n=e!=null?y(D(e)):{},I(t||!e||!e.__esModule?h(n,"default",{value:e,enumerable:!0}):n,e)},T=function(e){return I(h({},"__esModule",{value:!0}),e)};var x={};module.exports=T(x);var A=N(require("process"),1),_=require("yargs/helpers"),R=N(require("yargs/yargs"),1);var b={name:"@cyberskill/shared",type:"module",version:"1.188.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.2","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.0","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.5",ws:"8.18.2",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.3","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4","esbuild-sass-plugin":"3.3.1",eslint:"9.29.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var G=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var P=require("child_process"),M=N(require("process"),1),w=N(require("util"),1);var j=".cyberskill-storage";var L=N(require("@dotenvx/dotenvx"),1),U=require("envalid"),k=N(require("os"),1),q=N(require("path"),1),F=N(require("process"),1);var V=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var Y=!1;function B(){F.default.env.NODE_ENV!==V.PRODUCTION&&!Y&&(L.default.config(),Y=!0)}C(B,"loadEnvFile");function K(){B();var e=(0,U.cleanEnv)(F.default.env,{CWD:(0,U.str)({default:F.default.cwd()}),DEBUG:(0,U.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,U.str)({default:q.default.join(k.default.homedir(),j)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}C(K,"getEnv");var H=function(e){return e.Error="error",e.Warning="warning",e}({});var Q=N(require("chalk"),1),W=N(require("consola"),1),J=require("graphql");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 z=K();z.DEBUG||(W.default.level=4);function X(e){var t=Q.default[e];return typeof t=="function"?t:Q.default.green}C(X,"chalkKeyword");var Z={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.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)){W.default.box(Q.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;W.default.log("".concat(Q.default.gray("File:")," ").concat(Q.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&W.default.log(" ".concat(X(n)("Rule:")," ").concat(i)),W.default.log(" ".concat(X(n)("Message:")," ").concat(s))}),W.default.box(X(n)("".concat(e," : ").concat(t.length))),W.default.log(Q.default.gray("─".repeat(40)))}};function ee(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,i=r===void 0?!0:r,s=n.returnValue,a=n.callback,c=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return i&&Z.error(c.message),a&&typeof a=="function"&&a(c),s||{success:!1,message:c.message,code:$.INTERNAL_SERVER_ERROR.CODE}}C(ee,"catchError");var et=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});var en=N(require("node-fetch"),1);var er=N(require("fs-extra"),1),ei=N(require("path"),1);var es=er.default,eo=es.lstatSync,ea=es.readdirSync,ec=es.mkdirSync,eu=es.readFileSync,el=es.unlinkSync,ed=es.statSync,ep=er.default.readJsonSync;function eE(e,t,n){er.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(eE,"writeFileSync");function ef(e,t,n){er.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(ef,"appendFileSync");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return er.default.pathExistsSync(e)})}C(em,"pathExistsSync");function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){em(e)&&er.default.removeSync(e)})}C(eg,"removeSync");var ey=N(require("fs-extra"),1);var eh=N(require("path"),1);var ev=K(),eS=eh.default;function eD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eS).resolve.apply(r,[ev.CWD].concat(E(t)))}C(eD,"resolveWorkingPath");function eO(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eS).join.apply(r,E(t))}C(eO,"join");var eC=K(),eI=eC.CWD,eN="@cyberskill/shared",eT="node_modules",ex="dist",eA="public",e_="package.json",eR="package-lock.json",eb="tsconfig.json",eG=".gitignore",eP=".simple-git-hooks.json",eM="pnpm-lock.yaml",ew=".git/hooks/",ej=".git/COMMIT_EDITMSG",eL=".migrate-mongo.config.js",eU=function(){var e=ey.default.readJsonSync(eD(e_)).name===eN?eI:eO(eI,eT,eN);return eO(e,ex)}(),ek="cyberskill",eq="src/node/cli/index.ts",eF="eslint",eV="eslint",eY="vitest";var eB="vitest",eK="@commitlint/cli",eH="@commitlint/config-conventional",eQ="commitlint",eW="lint-staged",eJ="lint-staged",e$="typescript",ez="tsc",eX="tsx",eZ="git",e0="pnpm",e1="pnpm exec",e2="simple-git-hooks",e4="simple-git-hooks",e3="@eslint/config-inspector",e5="eslint-config-inspector",e8="node-modules-inspector",e6="node-modules-inspector",e7="migrate-mongo",e9="./node_modules/migrate-mongo/bin/migrate-mongo",te={CYBERSKILL_DIRECTORY:eU,WORKING_DIRECTORY:eI,PUBLIC_DIRECTORY:eD(eA),TS_CONFIG:eD(eb),GIT_IGNORE:eD(eG),GIT_HOOK:eD(ew),GIT_COMMIT_MSG:eD(ej),SIMPLE_GIT_HOOKS_JSON:eD(eP),PACKAGE_JSON:eD(e_),PACKAGE_LOCK_JSON:eD(eR),PNPM_LOCK_YAML:eD(eM),NODE_MODULES:eD(eT),MIGRATE_MONGO_CONFIG:eD(eL),LINT_STAGED_CONFIG:eD("".concat(eU,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eD("".concat(eU,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eD("".concat(eU,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eD("".concat(eU,"/config/vitest/vitest.unit.setup.js")),VITEST_E2E_CONFIG:eD("".concat(eU,"/config/vitest/vitest.e2e.js"))};function tt(e){var t=e.isCurrentProject;return d({"pre-commit":eJ,"commit-msg":eQ},t&&{"pre-push":tC("".concat(eZ," pull"))})}C(tt,"createGitHooksConfig");function tn(e){var t=e.type,n=e.packages,r=e.command;var s=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 i(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case G.CLI:return[3,1];case G.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tu(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tN(tC("".concat(e1," ").concat(r))))];case 4:return[2,tN(tC(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}C(tn,"buildCommand");var tr={simpleGitHooks:tn({type:G.CLI,packages:[{name:e2,type:et.DEV_DEPENDENCY}],command:e4}),eslintInspect:tn({type:G.CLI,packages:[{name:e3,type:et.DEV_DEPENDENCY}],command:e5}),nodeModulesInspect:tn({type:G.CLI,packages:[{name:e8,type:et.DEV_DEPENDENCY}],command:e6}),eslintCheck:tn({type:G.CLI,packages:[{name:eF,type:et.DEV_DEPENDENCY}],command:"".concat(eV," ").concat(te.WORKING_DIRECTORY," --no-cache")}),eslintFix:tn({type:G.CLI,packages:[{name:eF,type:et.DEV_DEPENDENCY}],command:"".concat(eV," ").concat(te.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tn({type:G.CLI,packages:[{name:e$,type:et.DEV_DEPENDENCY}],command:"".concat(ez," -p ").concat(te.TS_CONFIG," --noEmit")}),testUnit:tn({type:G.CLI,packages:[{name:eY,type:et.DEV_DEPENDENCY}],command:"".concat(eB," --config ").concat(te.VITEST_UNIT_CONFIG)}),testE2e:tn({type:G.CLI,packages:[{name:eY,type:et.DEV_DEPENDENCY}],command:"".concat(eB," --config ").concat(te.VITEST_E2E_CONFIG)}),mongoMigrateCreate:C(function(e){return tn({type:G.CLI,packages:[{name:eX,type:et.DEPENDENCY},{name:e7,type:et.DEPENDENCY}],command:"".concat(eX," ").concat(e9," create ").concat(e," -f ").concat(te.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tn({type:G.CLI,packages:[{name:eX,type:et.DEPENDENCY},{name:e7,type:et.DEPENDENCY}],command:"".concat(eX," ").concat(e9," up -f ").concat(te.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tn({type:G.CLI,packages:[{name:eX,type:et.DEPENDENCY},{name:e7,type:et.DEPENDENCY}],command:"".concat(eX," ").concat(e9," down -f ").concat(te.MIGRATE_MONGO_CONFIG)}),commitLint:tn({type:G.CLI,packages:[{name:eK,type:et.DEV_DEPENDENCY},{name:eH,type:et.DEV_DEPENDENCY}],command:"".concat(eQ," --edit ").concat(te.GIT_COMMIT_MSG," --config ").concat(te.COMMITLINT_CONFIG)}),lintStaged:tn({type:G.CLI,packages:[{name:eW,type:et.DEV_DEPENDENCY}],command:"".concat(eJ," --config ").concat(te.LINT_STAGED_CONFIG)}),configureGitHook:tn({type:G.STRING,command:"".concat(eZ," config core.hooksPath ").concat(te.GIT_HOOK)}),build:tn({type:G.STRING,command:"".concat(e0," run --if-present build")}),pnpmInstallStandard:tn({type:G.STRING,command:"".concat(e0," install --ignore-scripts")}),pnpmInstallLegacy:tn({type:G.STRING,command:"".concat(e0," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:tn({type:G.STRING,command:"".concat(e0," install --ignore-scripts --force")}),pnpmPruneStore:tn({type:G.STRING,command:"".concat(e0," store prune")}),pnpmCleanCache:tn({type:G.STRING,command:"".concat(e0," cache delete")})};var ti=K();function ts(e){return i(function(){var t,n,r,i;return g(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,en.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:i=s.sent();return[2,ee(i)];case 4:return[2]}})})()}C(ts,"getLatestPackageVersion");function to(e){return i(function(){var t,n,r,i,s,o,a,c,u,l,d,p,E,f,m,y,h,v,S,D,O,C,I,N;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!e){if(em(te.PACKAGE_JSON)){t=ep(te.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,i=t.version,s=i===void 0?"":i;return[2,{success:!0,result:{name:r,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:te.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!em(te.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===et.DEPENDENCY,isDevDependency:e.type===et.DEV_DEPENDENCY,installedPath:"",file:{}}}];o=ep(te.PACKAGE_JSON),a=o.name,c=o.version,u=c===void 0?"":c,l=o.dependencies,d=l===void 0?{}:l,p=o.devDependencies,E=p===void 0?{}:p;if(e.name===a)return[2,{success:!0,result:{name:a,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===et.DEPENDENCY,isDevDependency:e.type===et.DEV_DEPENDENCY,installedPath:te.PACKAGE_JSON,file:o}}];f=e.name in d,m=e.name in E;return[4,ts(e.name)];case 1:y=g.sent();if(!y.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:f,isDevDependency:m,installedPath:"",file:{}}}];if(!f&&!m)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===et.DEPENDENCY,isDevDependency:e.type===et.DEV_DEPENDENCY,installedPath:"",file:{}}}];S=(v=(h=d[e.name])!==null&&h!==void 0?h:E[e.name])!==null&&v!==void 0?v:"",D=eO(ti.CWD,eT,e.name,e_);if(!em(D))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:f,isDevDependency:m,installedPath:"",file:{}}}];O=ep(D),C=O.version,I=C===void 0?"":C;return[2,S!==I?{success:!0,result:{name:e.name,currentVersion:I||S,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:f,isDevDependency:m,installedPath:D,file:O}}:{success:!0,result:{name:e.name,currentVersion:S,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:S===y.result,isDependency:f,isDevDependency:m,installedPath:D,file:O}}];case 2:N=g.sent();return[2,ee(N)];case 3:return[2]}})})()}C(to,"getPackage");function ta(e){return i(function(){var t,n,r,i,s;return g(this,function(o){try{;r=ep(te.PACKAGE_JSON),i=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?i[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),eE(te.PACKAGE_JSON,JSON.stringify(r,null,4)),Z.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){ee(e)}return[2]})})()}C(ta,"updatePackage");function tc(){return i(function(){var e,t,n,r,i,s,o,a,c,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:C(function(){return tr.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:C(function(){return tr.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:C(function(){return tr.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]);i=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,a=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,a()];case 4:u=E.sent();return[4,tx("".concat(c," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();ee(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();ee(p);return[3,13];case 13:return[2]}})})()}C(tc,"installDependencies");function tu(e,t){return i(function(){var n,r,i,s,o,a,c,u,l,d,p,f,m,y,h,v,S;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,15,,16]);if(!em(te.PACKAGE_JSON)){Z.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(to))];case 1:i=g.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),s=i.filter(function(e){return!e.isInstalled}),o=i.filter(function(e){return!e.isUpToDate}),a=[];(t===null||t===void 0?void 0:t.install)&&s.length>0&&(n=a).push.apply(n,E(s.map(ta))),(t===null||t===void 0?void 0:t.update)&&o.length>0&&(r=a).push.apply(r,E(o.map(ta)));c=a.length>0;if(!c)return[3,6];return[4,Promise.all(a)];case 2:g.sent();return[4,tc()];case 3:g.sent();u=["Running ESLint with auto-fix"];return[4,tr.eslintFix()];case 4:return[4,tx.apply(void 0,u.concat([g.sent()]))];case 5:c=g.sent();g.label=6;case 6:c;d=true,p=false,f=undefined;g.label=7;case 7:g.trys.push([7,12,13,14]);m=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();g.label=8;case 8:if(!!(d=(y=m.next()).done))return[3,11];h=y.value;return[4,h()];case 9:g.sent();g.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:v=g.sent();p=true;f=v;return[3,14];case 13:try{if(!d&&m.return!=null){m.return()}}finally{if(p){throw f}}return[7];case 14:return[3,16];case 15:S=g.sent();ee(S);return[3,16];case 16:return[2]}})})()}C(tu,"setupPackages");var tl=N(require("node-persist"),1);var td=K();function tp(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=tl.default.defaultInstance;if(e)return[3,2];return[4,tl.default.init({dir:td.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}C(tp,"initNodePersist");var tE={get:function e(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tp()];case 1:r.sent();return[4,tl.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,ee(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tp()];case 1:r.sent();return[4,tl.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();ee(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tp()];case 1:n.sent();return[4,tl.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ee(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tp()];case 1:n.sent();return[4,tl.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(Z.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,ee(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return g(this,function(t){try{return[2,"".concat(td.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,ee(e,{returnValue:null})]}return[2]})})()}};var tf=K(),tm=w.promisify(P.exec);function tg(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,to()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}C(tg,"getPackageName");function ty(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,tg()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,tE.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return g(this,function(n){switch(n.label){case 0:return[4,tE.getLogLink(t)];case 1:e=n.sent();e&&Z.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();ee(n);return[3,5];case 5:return[2]}})})()}C(ty,"saveErrorListToStorage");function th(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tg()];case 1:e=r.sent();return[4,tE.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,ee(n,{returnValue:[]})];case 4:return[2]}})})()}C(th,"getStoredErrorLists");function tv(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tg()];case 1:e=n.sent();return[4,tE.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ee(t);return[3,4];case 4:return[2]}})})()}C(tv,"clearAllErrorLists");function tS(e){var t=[],n=[],r="",i=/^\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 a,c,u,l,d;var p=i.exec(e)||[],E=s.exec(e)||[],f=o.exec(e)||[];var m,g,y,h,v,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===H.Error?H.Error:H.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===H.Error?H.Error:H.Warning,message:(h=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:"commitlint",type:H.Error,message:(v=f===null||f===void 0?void 0:(l=f[1])===null||l===void 0?void 0:l.trim())!==null&&v!==void 0?v:"",rule:(S=f===null||f===void 0?void 0:(d=f[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&ty(t),tf.DEBUG&&n.length&&(Z.warn("Unmatched lines:"),n.forEach(function(e){return Z.info(" ".concat(e))}))}C(tS,"parseTextErrors");function tD(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,i=e.line,s=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?H.Error:H.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:a})})}),n.length&&ty(n)}catch(t){tS(e)}}C(tD,"parseCommandOutput");function tO(e){return i(function(e){var t,n,r,i,s,o,a,c,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tD;n=new AbortController;M.default.on("SIGINT",function(){Z.warn("Process interrupted. Terminating..."),n.abort(),M.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tm(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&Z.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}C(tO,"executeCommand");function tC(e){return{raw:!0,cmd:e}}C(tC,"rawCommand");function tI(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e1," ").concat(eX," ").concat(eq," ").concat(e):"".concat(e1," ").concat(ek," ").concat(e)}C(tI,"formatCLI");function tN(e,t){return typeof e=="function"?tI(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tI(e,t):e}C(tN,"formatCommand");function tT(e){return i(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,to({name:eN})];case 1:t=i.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],i=t[1];return[r,tN(i,n)]}))]}return[2]}})})()}C(tT,"resolveCommands");function tx(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);Z.start("".concat(e)),tf.DEBUG&&Z.info("→ ".concat(t));return[4,tO(t)];case 1:r.sent(),Z.success("".concat(e," done."));return[3,3];case 2:n=r.sent();ee(n);return[3,3];case 3:return[2]}})})()}C(tx,"runCommand");function tA(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!em(te.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tr.typescriptCheck()];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=Z.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}C(tA,"checkTypescript");function t_(){return i(function(){var e,t,n,r;var i=arguments;return g(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,tr.eslintFix()];case 1:return[4,tx.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tr.eslintCheck()];case 4:return[4,tx.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})}).apply(this,arguments)}C(t_,"checkEslint");function tR(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";Z.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}C(tR,"printIssues");function tb(){return i(function(){return g(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,th()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===H.Error}),n=e.filter(function(e){return e.type===H.Warning});!t.length&&!n.length?Z.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tR("Warnings",n),tR("Errors",t),(t.length>0||n.length>0)&&A.default.exit(1));return[2]}})})()},0);return[2]})})()}C(tb,"showCheckResult");function tG(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,tv()];case 1:i.sent();return[4,to({name:eN})];case 2:e=i.sent();if(!e.success){Z.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(eN)];return[4,tr.build()];case 3:return[4,tx.apply(void 0,n.concat([i.sent()]))];case 4:t=i.sent();i.label=5;case 5:t;r=["Executing lint-staged"];return[4,tr.lintStaged()];case 6:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 7:i.sent(),tb();return[2]}})})()}C(tG,"lintStaged");function tP(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tr.eslintInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tP,"inspectLint");function tM(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tv()];case 1:e.sent();return[4,Promise.all([tA(),t_()])];case 2:e.sent(),tb();return[2]}})})()}C(tM,"lintCheck");function tw(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tv()];case 1:e.sent();return[4,Promise.all([tA(),t_(!0)])];case 2:e.sent(),tb();return[2]}})})()}C(tw,"lintFix");function tj(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,tv()];case 1:t.sent();e=["Validating commit message"];return[4,tr.commitLint()];case 2:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tb();return[2]}})})()}C(tj,"commitLint");function tL(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,tr.configureGitHook()];case 1:return[4,tx.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),eg(te.GIT_HOOK);return[4,tT(tt)];case 3:t=i.sent();eE(te.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eP,"\n");em(te.GIT_IGNORE)?eu(te.GIT_IGNORE,"utf-8").split("\n").includes(eP)||ef(te.GIT_IGNORE,n):eE(te.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tr.simpleGitHooks()];case 4:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})})()}C(tL,"setupGitHook");function tU(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,tL()];case 2:e.sent();return[2]}})})()}C(tU,"ready");function tk(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:eg(te.NODE_MODULES,te.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,tr.pnpmPruneStore()];case 1:return[4,tx.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,tr.pnpmCleanCache()];case 3:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,tc()];case 5:n.sent();return[4,tL()];case 6:n.sent();return[2]}})})()}C(tk,"reset");function tq(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tr.nodeModulesInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tq,"inspect");function tF(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tr.testUnit()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tF,"testUnit");function tV(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tr.testE2e()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tV,"testE2E");function tY(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tr.mongoMigrateCreate(e)];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}C(tY,"mongoMigrateCreate");function tB(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tr.mongoMigrateUp()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tB,"mongoMigrateUp");function tK(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tr.mongoMigrateDown()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tK,"mongoMigrateDown");(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,R.default)((0,_.hideBin)(A.default.argv)).scriptName(ek).usage("$0 <command> [options]").command("lint","Check code for linting issues",tM).command("lint:fix","Fix linting issues automatically",tw).command("lint:inspect","View active ESLint configuration",tP).command("lint-staged","Run lint checks on staged files",tG).command("commitlint","Validate commit message format",tj).command("ready","Initialize project and dependencies",tU).command("reset","Reset the project and reinstall dependencies",tk).command("inspect","Analyze installed project dependencies",tq).command("test:unit","Run unit test suite",tF).command("test:e2e","Run end-to-end test suite",tV).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){Z.error("Migration name is required.");return[2]}return[4,tY(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tB).command("mongo:migrate:down","Rollback last MongoDB migration",tK).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();ee(e),A.default.exit(1);return[3,3];case 3:return[2]}})})()})();
|
package/dist/node/cli/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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,t,n,r,i,s,o){try{var c=e[s](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function c(e){r(o,i,s,c,a,"next",e)}function a(e){r(o,i,s,c,a,"throw",e)}c(undefined)})}}function s(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 o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,c;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;c=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw c}}return r}function u(){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 l(){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 d(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){s(e,t,n[t])})}return e}function p(e,n){return t(e)||a(e,n)||f(e,n)||u()}function E(e){return n(e)||c(e)||f(e)||l()}function m(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(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 g(e,t){var n,r,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(s=0)),s)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:s.label++;return{value:c[1],done:false};case 5:s.label++;r=c[1];c=[0];continue;case 7:c=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1];i=c;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(c);break}if(i[2])s.ops.pop();s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.defineProperty;var h=function(e,t){return y(e,"name",{value:t,configurable:!0})};import S from"process";import{hideBin as v}from"yargs/helpers";import D from"yargs/yargs";var O={name:"@cyberskill/shared",type:"module",version:"1.186.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.15.0","@apollo/client":"3.13.8","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@eslint-react/eslint-plugin":"1.52.2","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.2","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.10.2","@vitest/browser":"3.2.4","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.53.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3","react-icons":"5.5.0",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.5",ws:"8.18.2",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.3","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","esbuild-sass-plugin":"3.3.1",eslint:"9.29.0","lint-staged":"16.1.2","node-modules-inspector":"0.6.9",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as I}from"child_process";import N from"process";import*as T from"util";var x=".cyberskill-storage";import A from"@dotenvx/dotenvx";import{bool as _,cleanEnv as R,str as G}from"envalid";import b from"os";import P from"path";import M from"process";var w=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var L=!1;function j(){M.env.NODE_ENV!==w.PRODUCTION&&!L&&(A.config(),L=!0)}h(j,"loadEnvFile");function U(){j();var e=R(M.env,{CWD:G({default:M.cwd()}),DEBUG:_({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:G({default:P.join(b.homedir(),x)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}h(U,"getEnv");var k=function(e){return e.Error="error",e.Warning="warning",e}({});import F from"chalk";import q from"consola";import{GraphQLError as V}from"graphql";var Y={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 B=U();B.DEBUG||(q.level=4);function K(e){var t=F[e];return typeof t=="function"?t:F.green}h(K,"chalkKeyword");var H={silent:q.silent,level:q.level,fatal:q.fatal,error:q.error,warn:q.warn,log:q.log,info:q.info,success:q.success,ready:q.ready,start:q.start,box:q.box,debug:q.debug,trace:q.trace,verbose:q.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)){q.box(F.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;q.log("".concat(F.gray("File:")," ").concat(F.blue("".concat(t).concat(r?":".concat(r):"")))),i&&q.log(" ".concat(K(n)("Rule:")," ").concat(i)),q.log(" ".concat(K(n)("Message:")," ").concat(s))}),q.box(K(n)("".concat(e," : ").concat(t.length))),q.log(F.gray("─".repeat(40)))}};function Q(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,i=r===void 0?!0:r,s=n.returnValue,c=n.callback,a=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return i&&H.error(a.message),c&&typeof c=="function"&&c(a),s||{success:!1,message:a.message,code:Y.INTERNAL_SERVER_ERROR.CODE}}h(Q,"catchError");var W=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import J from"node-fetch";import $ from"fs-extra";import z from"path";var X=$.lstatSync,Z=$.readdirSync,ee=$.mkdirSync,et=$.readFileSync,en=$.unlinkSync,er=$.statSync,ei=$.readJsonSync;function es(e,t,n){$.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(es,"writeFileSync");function eo(e,t,n){$.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(eo,"appendFileSync");function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return $.pathExistsSync(e)})}h(ec,"pathExistsSync");function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ec(e)&&$.removeSync(e)})}h(ea,"removeSync");import eu from"fs-extra";import el from"path";var ed=U(),ep=el;function eE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ep).resolve.apply(r,[ed.CWD].concat(E(t)))}h(eE,"resolveWorkingPath");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ep).join.apply(r,E(t))}h(em,"join");var ef=U(),eg=ef.CWD,ey="@cyberskill/shared",eh="node_modules",eS="dist",ev="public",eD="package.json",eO="package-lock.json",eC="tsconfig.json",eI=".gitignore",eN=".simple-git-hooks.json",eT="pnpm-lock.yaml",ex=".git/hooks/",eA=".git/COMMIT_EDITMSG",e_=".migrate-mongo.config.js",eR=function(){var e=eu.readJsonSync(eE(eD)).name===ey?eg:em(eg,eh,ey);return em(e,eS)}(),eG="cyberskill",eb="src/node/cli/index.ts",eP="eslint",eM="eslint",ew="vitest";var eL="vitest",ej="@commitlint/cli",eU="@commitlint/config-conventional",ek="commitlint",eF="lint-staged",eq="lint-staged",eV="typescript",eY="tsc",eB="tsx",eK="git",eH="pnpm",eQ="pnpm exec",eW="simple-git-hooks",eJ="simple-git-hooks",e$="@eslint/config-inspector",ez="eslint-config-inspector",eX="node-modules-inspector",eZ="node-modules-inspector",e0="migrate-mongo",e1="./node_modules/migrate-mongo/bin/migrate-mongo",e2={CYBERSKILL_DIRECTORY:eR,WORKING_DIRECTORY:eg,PUBLIC_DIRECTORY:eE(ev),TS_CONFIG:eE(eC),GIT_IGNORE:eE(eI),GIT_HOOK:eE(ex),GIT_COMMIT_MSG:eE(eA),SIMPLE_GIT_HOOKS_JSON:eE(eN),PACKAGE_JSON:eE(eD),PACKAGE_LOCK_JSON:eE(eO),PNPM_LOCK_YAML:eE(eT),NODE_MODULES:eE(eh),MIGRATE_MONGO_CONFIG:eE(e_),LINT_STAGED_CONFIG:eE("".concat(eR,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eE("".concat(eR,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eE("".concat(eR,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eE("".concat(eR,"/config/vitest/vitest.unit.setup.ts")),VITEST_E2E_CONFIG:eE("".concat(eR,"/config/vitest/vitest.e2e.js"))};function e4(e){var t=e.isCurrentProject;return d({"pre-commit":eq,"commit-msg":ek},t&&{"pre-push":tf("".concat(eK," pull"))})}h(e4,"createGitHooksConfig");function e3(e){var t=e.type,n=e.packages,r=e.command;var s=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 i(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case C.CLI:return[3,1];case C.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tt(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,ty(tf("".concat(eQ," ").concat(r))))];case 4:return[2,ty(tf(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}h(e3,"buildCommand");var e5={simpleGitHooks:e3({type:C.CLI,packages:[{name:eW,type:W.DEV_DEPENDENCY}],command:eJ}),eslintInspect:e3({type:C.CLI,packages:[{name:e$,type:W.DEV_DEPENDENCY}],command:ez}),nodeModulesInspect:e3({type:C.CLI,packages:[{name:eX,type:W.DEV_DEPENDENCY}],command:eZ}),eslintCheck:e3({type:C.CLI,packages:[{name:eP,type:W.DEV_DEPENDENCY}],command:"".concat(eM," ").concat(e2.WORKING_DIRECTORY," --no-cache")}),eslintFix:e3({type:C.CLI,packages:[{name:eP,type:W.DEV_DEPENDENCY}],command:"".concat(eM," ").concat(e2.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:e3({type:C.CLI,packages:[{name:eV,type:W.DEV_DEPENDENCY}],command:"".concat(eY," -p ").concat(e2.TS_CONFIG," --noEmit")}),testUnit:e3({type:C.CLI,packages:[{name:ew,type:W.DEV_DEPENDENCY}],command:"".concat(eL," --config ").concat(e2.VITEST_UNIT_CONFIG)}),testE2e:e3({type:C.CLI,packages:[{name:ew,type:W.DEV_DEPENDENCY}],command:"".concat(eL," --config ").concat(e2.VITEST_E2E_CONFIG)}),mongoMigrateCreate:h(function(e){return e3({type:C.CLI,packages:[{name:eB,type:W.DEPENDENCY},{name:e0,type:W.DEPENDENCY}],command:"".concat(eB," ").concat(e1," create ").concat(e," -f ").concat(e2.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:e3({type:C.CLI,packages:[{name:eB,type:W.DEPENDENCY},{name:e0,type:W.DEPENDENCY}],command:"".concat(eB," ").concat(e1," up -f ").concat(e2.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:e3({type:C.CLI,packages:[{name:eB,type:W.DEPENDENCY},{name:e0,type:W.DEPENDENCY}],command:"".concat(eB," ").concat(e1," down -f ").concat(e2.MIGRATE_MONGO_CONFIG)}),commitLint:e3({type:C.CLI,packages:[{name:ej,type:W.DEV_DEPENDENCY},{name:eU,type:W.DEV_DEPENDENCY}],command:"".concat(ek," --edit ").concat(e2.GIT_COMMIT_MSG," --config ").concat(e2.COMMITLINT_CONFIG)}),lintStaged:e3({type:C.CLI,packages:[{name:eF,type:W.DEV_DEPENDENCY}],command:"".concat(eq," --config ").concat(e2.LINT_STAGED_CONFIG)}),configureGitHook:e3({type:C.STRING,command:"".concat(eK," config core.hooksPath ").concat(e2.GIT_HOOK)}),build:e3({type:C.STRING,command:"".concat(eH," run --if-present build")}),pnpmInstallStandard:e3({type:C.STRING,command:"".concat(eH," install --ignore-scripts")}),pnpmInstallLegacy:e3({type:C.STRING,command:"".concat(eH," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:e3({type:C.STRING,command:"".concat(eH," install --ignore-scripts --force")}),pnpmPruneStore:e3({type:C.STRING,command:"".concat(eH," store prune")}),pnpmCleanCache:e3({type:C.STRING,command:"".concat(eH," cache delete")})};var e8=U();function e6(e){return i(function(){var t,n,r,i;return g(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,J("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:i=s.sent();return[2,Q(i)];case 4:return[2]}})})()}h(e6,"getLatestPackageVersion");function e7(e){return i(function(){var t,n,r,i,s,o,c,a,u,l,d,p,E,m,f,y,h,S,v,D,O,C,I,N;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!e){if(ec(e2.PACKAGE_JSON)){t=ei(e2.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,i=t.version,s=i===void 0?"":i;return[2,{success:!0,result:{name:r,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:e2.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!ec(e2.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===W.DEPENDENCY,isDevDependency:e.type===W.DEV_DEPENDENCY,installedPath:"",file:{}}}];o=ei(e2.PACKAGE_JSON),c=o.name,a=o.version,u=a===void 0?"":a,l=o.dependencies,d=l===void 0?{}:l,p=o.devDependencies,E=p===void 0?{}:p;if(e.name===c)return[2,{success:!0,result:{name:c,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===W.DEPENDENCY,isDevDependency:e.type===W.DEV_DEPENDENCY,installedPath:e2.PACKAGE_JSON,file:o}}];m=e.name in d,f=e.name in E;return[4,e6(e.name)];case 1:y=g.sent();if(!y.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:f,installedPath:"",file:{}}}];if(!m&&!f)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===W.DEPENDENCY,isDevDependency:e.type===W.DEV_DEPENDENCY,installedPath:"",file:{}}}];v=(S=(h=d[e.name])!==null&&h!==void 0?h:E[e.name])!==null&&S!==void 0?S:"",D=em(e8.CWD,eh,e.name,eD);if(!ec(D))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:f,installedPath:"",file:{}}}];O=ei(D),C=O.version,I=C===void 0?"":C;return[2,v!==I?{success:!0,result:{name:e.name,currentVersion:I||v,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:m,isDevDependency:f,installedPath:D,file:O}}:{success:!0,result:{name:e.name,currentVersion:v,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:v===y.result,isDependency:m,isDevDependency:f,installedPath:D,file:O}}];case 2:N=g.sent();return[2,Q(N)];case 3:return[2]}})})()}h(e7,"getPackage");function e9(e){return i(function(){var t,n,r,i,s;return g(this,function(o){try{;r=ei(e2.PACKAGE_JSON),i=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?i[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),es(e2.PACKAGE_JSON,JSON.stringify(r,null,4)),H.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){Q(e)}return[2]})})()}h(e9,"updatePackage");function te(){return i(function(){var e,t,n,r,i,s,o,c,a,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:h(function(){return e5.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:h(function(){return e5.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:h(function(){return e5.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]);i=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,c=o.command,a=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,c()];case 4:u=E.sent();return[4,tS("".concat(a," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();Q(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();Q(p);return[3,13];case 13:return[2]}})})()}h(te,"installDependencies");function tt(e,t){return i(function(){var n,r,i,s,o,c,a,u,l,d,p,m,f,y,h,S,v;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,15,,16]);if(!ec(e2.PACKAGE_JSON)){H.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(e7))];case 1:i=g.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),s=i.filter(function(e){return!e.isInstalled}),o=i.filter(function(e){return!e.isUpToDate}),c=[];(t===null||t===void 0?void 0:t.install)&&s.length>0&&(n=c).push.apply(n,E(s.map(e9))),(t===null||t===void 0?void 0:t.update)&&o.length>0&&(r=c).push.apply(r,E(o.map(e9)));a=c.length>0;if(!a)return[3,6];return[4,Promise.all(c)];case 2:g.sent();return[4,te()];case 3:g.sent();u=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 4:return[4,tS.apply(void 0,u.concat([g.sent()]))];case 5:a=g.sent();g.label=6;case 6:a;d=true,p=false,m=undefined;g.label=7;case 7:g.trys.push([7,12,13,14]);f=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();g.label=8;case 8:if(!!(d=(y=f.next()).done))return[3,11];h=y.value;return[4,h()];case 9:g.sent();g.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:S=g.sent();p=true;m=S;return[3,14];case 13:try{if(!d&&f.return!=null){f.return()}}finally{if(p){throw m}}return[7];case 14:return[3,16];case 15:v=g.sent();Q(v);return[3,16];case 16:return[2]}})})()}h(tt,"setupPackages");import tn from"node-persist";var tr=U();function ti(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=tn.defaultInstance;if(e)return[3,2];return[4,tn.init({dir:tr.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}h(ti,"initNodePersist");var ts={get:function e(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti()];case 1:r.sent();return[4,tn.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,Q(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti()];case 1:r.sent();return[4,tn.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();Q(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ti()];case 1:n.sent();return[4,tn.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Q(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ti()];case 1:n.sent();return[4,tn.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(H.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,Q(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return g(this,function(t){try{return[2,"".concat(tr.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,Q(e,{returnValue:null})]}return[2]})})()}};var to=U(),tc=T.promisify(I);function ta(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,e7()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}h(ta,"getPackageName");function tu(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,ta()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,ts.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return g(this,function(n){switch(n.label){case 0:return[4,ts.getLogLink(t)];case 1:e=n.sent();e&&H.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();Q(n);return[3,5];case 5:return[2]}})})()}h(tu,"saveErrorListToStorage");function tl(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:e=r.sent();return[4,ts.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,Q(n,{returnValue:[]})];case 4:return[2]}})})()}h(tl,"getStoredErrorLists");function td(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:e=n.sent();return[4,ts.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Q(t);return[3,4];case 4:return[2]}})})()}h(td,"clearAllErrorLists");function tp(e){var t=[],n=[],r="",i=/^\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 c,a,u,l,d;var p=i.exec(e)||[],E=s.exec(e)||[],m=o.exec(e)||[];var f,g,y,h,S,v;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===k.Error?k.Error:k.Warning,message:(f=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&f!==void 0?f:"",rule:(g=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===k.Error?k.Error:k.Warning,message:(h=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:k.Error,message:(S=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&S!==void 0?S:"",rule:(v=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&v!==void 0?v:""}):n.push(e.trim())}}),t.length&&tu(t),to.DEBUG&&n.length&&(H.warn("Unmatched lines:"),n.forEach(function(e){return H.info(" ".concat(e))}))}h(tp,"parseTextErrors");function tE(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,i=e.line,s=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?k.Error:k.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:c})})}),n.length&&tu(n)}catch(t){tp(e)}}h(tE,"parseCommandOutput");function tm(e){return i(function(e){var t,n,r,i,s,o,c,a,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tE;n=new AbortController;N.on("SIGINT",function(){H.warn("Process interrupted. Terminating..."),n.abort(),N.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tc(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&H.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}h(tm,"executeCommand");function tf(e){return{raw:!0,cmd:e}}h(tf,"rawCommand");function tg(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eQ," ").concat(eB," ").concat(eb," ").concat(e):"".concat(eQ," ").concat(eG," ").concat(e)}h(tg,"formatCLI");function ty(e,t){return typeof e=="function"?tg(e(t),t):(typeof e==="undefined"?"undefined":m(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tg(e,t):e}h(ty,"formatCommand");function th(e){return i(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,e7({name:ey})];case 1:t=i.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],i=t[1];return[r,ty(i,n)]}))]}return[2]}})})()}h(th,"resolveCommands");function tS(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);H.start("".concat(e)),to.DEBUG&&H.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),H.success("".concat(e," done."));return[3,3];case 2:n=r.sent();Q(n);return[3,3];case 3:return[2]}})})()}h(tS,"runCommand");function tv(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!ec(e2.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e5.typescriptCheck()];case 1:return[4,tS.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=H.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}h(tv,"checkTypescript");function tD(){return i(function(){var e,t,n,r;var i=arguments;return g(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 1:return[4,tS.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e5.eslintCheck()];case 4:return[4,tS.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})}).apply(this,arguments)}h(tD,"checkEslint");function tO(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";H.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}h(tO,"printIssues");function tC(){return i(function(){return g(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,tl()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===k.Error}),n=e.filter(function(e){return e.type===k.Warning});!t.length&&!n.length?H.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tO("Warnings",n),tO("Errors",t),(t.length>0||n.length>0)&&S.exit(1));return[2]}})})()},0);return[2]})})()}h(tC,"showCheckResult");function tI(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,td()];case 1:i.sent();return[4,e7({name:ey})];case 2:e=i.sent();if(!e.success){H.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(ey)];return[4,e5.build()];case 3:return[4,tS.apply(void 0,n.concat([i.sent()]))];case 4:t=i.sent();i.label=5;case 5:t;r=["Executing lint-staged"];return[4,e5.lintStaged()];case 6:return[4,tS.apply(void 0,r.concat([i.sent()]))];case 7:i.sent(),tC();return[2]}})})()}h(tI,"lintStaged");function tN(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e5.eslintInspect()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tN,"inspectLint");function tT(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tv(),tD()])];case 2:e.sent(),tC();return[2]}})})()}h(tT,"lintCheck");function tx(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tv(),tD(!0)])];case 2:e.sent(),tC();return[2]}})})()}h(tx,"lintFix");function tA(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,e5.commitLint()];case 2:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tC();return[2]}})})()}h(tA,"commitLint");function t_(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,e5.configureGitHook()];case 1:return[4,tS.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),ea(e2.GIT_HOOK);return[4,th(e4)];case 3:t=i.sent();es(e2.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eN,"\n");ec(e2.GIT_IGNORE)?et(e2.GIT_IGNORE,"utf-8").split("\n").includes(eN)||eo(e2.GIT_IGNORE,n):es(e2.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e5.simpleGitHooks()];case 4:return[4,tS.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})})()}h(t_,"setupGitHook");function tR(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,te()];case 1:e.sent();return[4,t_()];case 2:e.sent();return[2]}})})()}h(tR,"ready");function tG(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:ea(e2.NODE_MODULES,e2.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,e5.pnpmPruneStore()];case 1:return[4,tS.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,e5.pnpmCleanCache()];case 3:return[4,tS.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,te()];case 5:n.sent();return[4,t_()];case 6:n.sent();return[2]}})})()}h(tG,"reset");function tb(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e5.nodeModulesInspect()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tb,"inspect");function tP(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e5.testUnit()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tP,"testUnit");function tM(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e5.testE2e()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tM,"testE2E");function tw(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e5.mongoMigrateCreate(e)];case 1:return[4,tS.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}h(tw,"mongoMigrateCreate");function tL(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e5.mongoMigrateUp()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tL,"mongoMigrateUp");function tj(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e5.mongoMigrateDown()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tj,"mongoMigrateDown");(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,D(v(S.argv)).scriptName(eG).usage("$0 <command> [options]").command("lint","Check code for linting issues",tT).command("lint:fix","Fix linting issues automatically",tx).command("lint:inspect","View active ESLint configuration",tN).command("lint-staged","Run lint checks on staged files",tI).command("commitlint","Validate commit message format",tA).command("ready","Initialize project and dependencies",tR).command("reset","Reset the project and reinstall dependencies",tG).command("inspect","Analyze installed project dependencies",tb).command("test:unit","Run unit test suite",tP).command("test:e2e","Run end-to-end test suite",tM).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){H.error("Migration name is required.");return[2]}return[4,tw(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tL).command("mongo:migrate:down","Rollback last MongoDB migration",tj).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(O.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();Q(e),S.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
1
|
+
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,t,n,r,i,s,o){try{var c=e[s](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function c(e){r(o,i,s,c,a,"next",e)}function a(e){r(o,i,s,c,a,"throw",e)}c(undefined)})}}function s(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 o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,c;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;c=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw c}}return r}function u(){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 l(){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 d(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){s(e,t,n[t])})}return e}function p(e,n){return t(e)||a(e,n)||f(e,n)||u()}function E(e){return n(e)||c(e)||f(e)||l()}function m(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(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 g(e,t){var n,r,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(s=0)),s)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:s.label++;return{value:c[1],done:false};case 5:s.label++;r=c[1];c=[0];continue;case 7:c=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1];i=c;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(c);break}if(i[2])s.ops.pop();s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.defineProperty;var h=function(e,t){return y(e,"name",{value:t,configurable:!0})};import S from"process";import{hideBin as v}from"yargs/helpers";import D from"yargs/yargs";var O={name:"@cyberskill/shared",type:"module",version:"1.188.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.2","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.0","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.5",ws:"8.18.2",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.3","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4","esbuild-sass-plugin":"3.3.1",eslint:"9.29.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as I}from"child_process";import N from"process";import*as T from"util";var x=".cyberskill-storage";import A from"@dotenvx/dotenvx";import{bool as _,cleanEnv as R,str as G}from"envalid";import b from"os";import P from"path";import M from"process";var w=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var L=!1;function j(){M.env.NODE_ENV!==w.PRODUCTION&&!L&&(A.config(),L=!0)}h(j,"loadEnvFile");function U(){j();var e=R(M.env,{CWD:G({default:M.cwd()}),DEBUG:_({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:G({default:P.join(b.homedir(),x)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}h(U,"getEnv");var k=function(e){return e.Error="error",e.Warning="warning",e}({});import F from"chalk";import q from"consola";import{GraphQLError as V}from"graphql";var Y={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 B=U();B.DEBUG||(q.level=4);function K(e){var t=F[e];return typeof t=="function"?t:F.green}h(K,"chalkKeyword");var H={silent:q.silent,level:q.level,fatal:q.fatal,error:q.error,warn:q.warn,log:q.log,info:q.info,success:q.success,ready:q.ready,start:q.start,box:q.box,debug:q.debug,trace:q.trace,verbose:q.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)){q.box(F.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;q.log("".concat(F.gray("File:")," ").concat(F.blue("".concat(t).concat(r?":".concat(r):"")))),i&&q.log(" ".concat(K(n)("Rule:")," ").concat(i)),q.log(" ".concat(K(n)("Message:")," ").concat(s))}),q.box(K(n)("".concat(e," : ").concat(t.length))),q.log(F.gray("─".repeat(40)))}};function Q(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,i=r===void 0?!0:r,s=n.returnValue,c=n.callback,a=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return i&&H.error(a.message),c&&typeof c=="function"&&c(a),s||{success:!1,message:a.message,code:Y.INTERNAL_SERVER_ERROR.CODE}}h(Q,"catchError");var W=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import J from"node-fetch";import $ from"fs-extra";import z from"path";var X=$.lstatSync,Z=$.readdirSync,ee=$.mkdirSync,et=$.readFileSync,en=$.unlinkSync,er=$.statSync,ei=$.readJsonSync;function es(e,t,n){$.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(es,"writeFileSync");function eo(e,t,n){$.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(eo,"appendFileSync");function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return $.pathExistsSync(e)})}h(ec,"pathExistsSync");function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ec(e)&&$.removeSync(e)})}h(ea,"removeSync");import eu from"fs-extra";import el from"path";var ed=U(),ep=el;function eE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ep).resolve.apply(r,[ed.CWD].concat(E(t)))}h(eE,"resolveWorkingPath");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ep).join.apply(r,E(t))}h(em,"join");var ef=U(),eg=ef.CWD,ey="@cyberskill/shared",eh="node_modules",eS="dist",ev="public",eD="package.json",eO="package-lock.json",eC="tsconfig.json",eI=".gitignore",eN=".simple-git-hooks.json",eT="pnpm-lock.yaml",ex=".git/hooks/",eA=".git/COMMIT_EDITMSG",e_=".migrate-mongo.config.js",eR=function(){var e=eu.readJsonSync(eE(eD)).name===ey?eg:em(eg,eh,ey);return em(e,eS)}(),eG="cyberskill",eb="src/node/cli/index.ts",eP="eslint",eM="eslint",ew="vitest";var eL="vitest",ej="@commitlint/cli",eU="@commitlint/config-conventional",ek="commitlint",eF="lint-staged",eq="lint-staged",eV="typescript",eY="tsc",eB="tsx",eK="git",eH="pnpm",eQ="pnpm exec",eW="simple-git-hooks",eJ="simple-git-hooks",e$="@eslint/config-inspector",ez="eslint-config-inspector",eX="node-modules-inspector",eZ="node-modules-inspector",e0="migrate-mongo",e1="./node_modules/migrate-mongo/bin/migrate-mongo",e2={CYBERSKILL_DIRECTORY:eR,WORKING_DIRECTORY:eg,PUBLIC_DIRECTORY:eE(ev),TS_CONFIG:eE(eC),GIT_IGNORE:eE(eI),GIT_HOOK:eE(ex),GIT_COMMIT_MSG:eE(eA),SIMPLE_GIT_HOOKS_JSON:eE(eN),PACKAGE_JSON:eE(eD),PACKAGE_LOCK_JSON:eE(eO),PNPM_LOCK_YAML:eE(eT),NODE_MODULES:eE(eh),MIGRATE_MONGO_CONFIG:eE(e_),LINT_STAGED_CONFIG:eE("".concat(eR,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eE("".concat(eR,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eE("".concat(eR,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eE("".concat(eR,"/config/vitest/vitest.unit.setup.js")),VITEST_E2E_CONFIG:eE("".concat(eR,"/config/vitest/vitest.e2e.js"))};function e4(e){var t=e.isCurrentProject;return d({"pre-commit":eq,"commit-msg":ek},t&&{"pre-push":tf("".concat(eK," pull"))})}h(e4,"createGitHooksConfig");function e3(e){var t=e.type,n=e.packages,r=e.command;var s=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 i(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case C.CLI:return[3,1];case C.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tt(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,ty(tf("".concat(eQ," ").concat(r))))];case 4:return[2,ty(tf(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}h(e3,"buildCommand");var e5={simpleGitHooks:e3({type:C.CLI,packages:[{name:eW,type:W.DEV_DEPENDENCY}],command:eJ}),eslintInspect:e3({type:C.CLI,packages:[{name:e$,type:W.DEV_DEPENDENCY}],command:ez}),nodeModulesInspect:e3({type:C.CLI,packages:[{name:eX,type:W.DEV_DEPENDENCY}],command:eZ}),eslintCheck:e3({type:C.CLI,packages:[{name:eP,type:W.DEV_DEPENDENCY}],command:"".concat(eM," ").concat(e2.WORKING_DIRECTORY," --no-cache")}),eslintFix:e3({type:C.CLI,packages:[{name:eP,type:W.DEV_DEPENDENCY}],command:"".concat(eM," ").concat(e2.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:e3({type:C.CLI,packages:[{name:eV,type:W.DEV_DEPENDENCY}],command:"".concat(eY," -p ").concat(e2.TS_CONFIG," --noEmit")}),testUnit:e3({type:C.CLI,packages:[{name:ew,type:W.DEV_DEPENDENCY}],command:"".concat(eL," --config ").concat(e2.VITEST_UNIT_CONFIG)}),testE2e:e3({type:C.CLI,packages:[{name:ew,type:W.DEV_DEPENDENCY}],command:"".concat(eL," --config ").concat(e2.VITEST_E2E_CONFIG)}),mongoMigrateCreate:h(function(e){return e3({type:C.CLI,packages:[{name:eB,type:W.DEPENDENCY},{name:e0,type:W.DEPENDENCY}],command:"".concat(eB," ").concat(e1," create ").concat(e," -f ").concat(e2.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:e3({type:C.CLI,packages:[{name:eB,type:W.DEPENDENCY},{name:e0,type:W.DEPENDENCY}],command:"".concat(eB," ").concat(e1," up -f ").concat(e2.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:e3({type:C.CLI,packages:[{name:eB,type:W.DEPENDENCY},{name:e0,type:W.DEPENDENCY}],command:"".concat(eB," ").concat(e1," down -f ").concat(e2.MIGRATE_MONGO_CONFIG)}),commitLint:e3({type:C.CLI,packages:[{name:ej,type:W.DEV_DEPENDENCY},{name:eU,type:W.DEV_DEPENDENCY}],command:"".concat(ek," --edit ").concat(e2.GIT_COMMIT_MSG," --config ").concat(e2.COMMITLINT_CONFIG)}),lintStaged:e3({type:C.CLI,packages:[{name:eF,type:W.DEV_DEPENDENCY}],command:"".concat(eq," --config ").concat(e2.LINT_STAGED_CONFIG)}),configureGitHook:e3({type:C.STRING,command:"".concat(eK," config core.hooksPath ").concat(e2.GIT_HOOK)}),build:e3({type:C.STRING,command:"".concat(eH," run --if-present build")}),pnpmInstallStandard:e3({type:C.STRING,command:"".concat(eH," install --ignore-scripts")}),pnpmInstallLegacy:e3({type:C.STRING,command:"".concat(eH," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:e3({type:C.STRING,command:"".concat(eH," install --ignore-scripts --force")}),pnpmPruneStore:e3({type:C.STRING,command:"".concat(eH," store prune")}),pnpmCleanCache:e3({type:C.STRING,command:"".concat(eH," cache delete")})};var e8=U();function e6(e){return i(function(){var t,n,r,i;return g(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,J("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:i=s.sent();return[2,Q(i)];case 4:return[2]}})})()}h(e6,"getLatestPackageVersion");function e7(e){return i(function(){var t,n,r,i,s,o,c,a,u,l,d,p,E,m,f,y,h,S,v,D,O,C,I,N;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!e){if(ec(e2.PACKAGE_JSON)){t=ei(e2.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,i=t.version,s=i===void 0?"":i;return[2,{success:!0,result:{name:r,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:e2.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!ec(e2.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===W.DEPENDENCY,isDevDependency:e.type===W.DEV_DEPENDENCY,installedPath:"",file:{}}}];o=ei(e2.PACKAGE_JSON),c=o.name,a=o.version,u=a===void 0?"":a,l=o.dependencies,d=l===void 0?{}:l,p=o.devDependencies,E=p===void 0?{}:p;if(e.name===c)return[2,{success:!0,result:{name:c,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===W.DEPENDENCY,isDevDependency:e.type===W.DEV_DEPENDENCY,installedPath:e2.PACKAGE_JSON,file:o}}];m=e.name in d,f=e.name in E;return[4,e6(e.name)];case 1:y=g.sent();if(!y.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:f,installedPath:"",file:{}}}];if(!m&&!f)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===W.DEPENDENCY,isDevDependency:e.type===W.DEV_DEPENDENCY,installedPath:"",file:{}}}];v=(S=(h=d[e.name])!==null&&h!==void 0?h:E[e.name])!==null&&S!==void 0?S:"",D=em(e8.CWD,eh,e.name,eD);if(!ec(D))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:y.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:f,installedPath:"",file:{}}}];O=ei(D),C=O.version,I=C===void 0?"":C;return[2,v!==I?{success:!0,result:{name:e.name,currentVersion:I||v,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:m,isDevDependency:f,installedPath:D,file:O}}:{success:!0,result:{name:e.name,currentVersion:v,latestVersion:y.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:v===y.result,isDependency:m,isDevDependency:f,installedPath:D,file:O}}];case 2:N=g.sent();return[2,Q(N)];case 3:return[2]}})})()}h(e7,"getPackage");function e9(e){return i(function(){var t,n,r,i,s;return g(this,function(o){try{;r=ei(e2.PACKAGE_JSON),i=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?i[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),es(e2.PACKAGE_JSON,JSON.stringify(r,null,4)),H.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){Q(e)}return[2]})})()}h(e9,"updatePackage");function te(){return i(function(){var e,t,n,r,i,s,o,c,a,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:h(function(){return e5.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:h(function(){return e5.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:h(function(){return e5.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]);i=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,c=o.command,a=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,c()];case 4:u=E.sent();return[4,tS("".concat(a," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();Q(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();Q(p);return[3,13];case 13:return[2]}})})()}h(te,"installDependencies");function tt(e,t){return i(function(){var n,r,i,s,o,c,a,u,l,d,p,m,f,y,h,S,v;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,15,,16]);if(!ec(e2.PACKAGE_JSON)){H.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(e7))];case 1:i=g.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),s=i.filter(function(e){return!e.isInstalled}),o=i.filter(function(e){return!e.isUpToDate}),c=[];(t===null||t===void 0?void 0:t.install)&&s.length>0&&(n=c).push.apply(n,E(s.map(e9))),(t===null||t===void 0?void 0:t.update)&&o.length>0&&(r=c).push.apply(r,E(o.map(e9)));a=c.length>0;if(!a)return[3,6];return[4,Promise.all(c)];case 2:g.sent();return[4,te()];case 3:g.sent();u=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 4:return[4,tS.apply(void 0,u.concat([g.sent()]))];case 5:a=g.sent();g.label=6;case 6:a;d=true,p=false,m=undefined;g.label=7;case 7:g.trys.push([7,12,13,14]);f=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();g.label=8;case 8:if(!!(d=(y=f.next()).done))return[3,11];h=y.value;return[4,h()];case 9:g.sent();g.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:S=g.sent();p=true;m=S;return[3,14];case 13:try{if(!d&&f.return!=null){f.return()}}finally{if(p){throw m}}return[7];case 14:return[3,16];case 15:v=g.sent();Q(v);return[3,16];case 16:return[2]}})})()}h(tt,"setupPackages");import tn from"node-persist";var tr=U();function ti(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=tn.defaultInstance;if(e)return[3,2];return[4,tn.init({dir:tr.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}h(ti,"initNodePersist");var ts={get:function e(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti()];case 1:r.sent();return[4,tn.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,Q(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti()];case 1:r.sent();return[4,tn.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();Q(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ti()];case 1:n.sent();return[4,tn.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Q(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ti()];case 1:n.sent();return[4,tn.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(H.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,Q(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return g(this,function(t){try{return[2,"".concat(tr.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,Q(e,{returnValue:null})]}return[2]})})()}};var to=U(),tc=T.promisify(I);function ta(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,e7()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}h(ta,"getPackageName");function tu(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,ta()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,ts.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return g(this,function(n){switch(n.label){case 0:return[4,ts.getLogLink(t)];case 1:e=n.sent();e&&H.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();Q(n);return[3,5];case 5:return[2]}})})()}h(tu,"saveErrorListToStorage");function tl(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:e=r.sent();return[4,ts.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,Q(n,{returnValue:[]})];case 4:return[2]}})})()}h(tl,"getStoredErrorLists");function td(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:e=n.sent();return[4,ts.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Q(t);return[3,4];case 4:return[2]}})})()}h(td,"clearAllErrorLists");function tp(e){var t=[],n=[],r="",i=/^\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 c,a,u,l,d;var p=i.exec(e)||[],E=s.exec(e)||[],m=o.exec(e)||[];var f,g,y,h,S,v;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===k.Error?k.Error:k.Warning,message:(f=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&f!==void 0?f:"",rule:(g=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===k.Error?k.Error:k.Warning,message:(h=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:k.Error,message:(S=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&S!==void 0?S:"",rule:(v=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&v!==void 0?v:""}):n.push(e.trim())}}),t.length&&tu(t),to.DEBUG&&n.length&&(H.warn("Unmatched lines:"),n.forEach(function(e){return H.info(" ".concat(e))}))}h(tp,"parseTextErrors");function tE(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,i=e.line,s=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?k.Error:k.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:c})})}),n.length&&tu(n)}catch(t){tp(e)}}h(tE,"parseCommandOutput");function tm(e){return i(function(e){var t,n,r,i,s,o,c,a,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tE;n=new AbortController;N.on("SIGINT",function(){H.warn("Process interrupted. Terminating..."),n.abort(),N.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tc(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&H.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}h(tm,"executeCommand");function tf(e){return{raw:!0,cmd:e}}h(tf,"rawCommand");function tg(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eQ," ").concat(eB," ").concat(eb," ").concat(e):"".concat(eQ," ").concat(eG," ").concat(e)}h(tg,"formatCLI");function ty(e,t){return typeof e=="function"?tg(e(t),t):(typeof e==="undefined"?"undefined":m(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tg(e,t):e}h(ty,"formatCommand");function th(e){return i(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,e7({name:ey})];case 1:t=i.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],i=t[1];return[r,ty(i,n)]}))]}return[2]}})})()}h(th,"resolveCommands");function tS(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);H.start("".concat(e)),to.DEBUG&&H.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),H.success("".concat(e," done."));return[3,3];case 2:n=r.sent();Q(n);return[3,3];case 3:return[2]}})})()}h(tS,"runCommand");function tv(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!ec(e2.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e5.typescriptCheck()];case 1:return[4,tS.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=H.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}h(tv,"checkTypescript");function tD(){return i(function(){var e,t,n,r;var i=arguments;return g(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 1:return[4,tS.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e5.eslintCheck()];case 4:return[4,tS.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})}).apply(this,arguments)}h(tD,"checkEslint");function tO(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";H.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}h(tO,"printIssues");function tC(){return i(function(){return g(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,tl()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===k.Error}),n=e.filter(function(e){return e.type===k.Warning});!t.length&&!n.length?H.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tO("Warnings",n),tO("Errors",t),(t.length>0||n.length>0)&&S.exit(1));return[2]}})})()},0);return[2]})})()}h(tC,"showCheckResult");function tI(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,td()];case 1:i.sent();return[4,e7({name:ey})];case 2:e=i.sent();if(!e.success){H.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(ey)];return[4,e5.build()];case 3:return[4,tS.apply(void 0,n.concat([i.sent()]))];case 4:t=i.sent();i.label=5;case 5:t;r=["Executing lint-staged"];return[4,e5.lintStaged()];case 6:return[4,tS.apply(void 0,r.concat([i.sent()]))];case 7:i.sent(),tC();return[2]}})})()}h(tI,"lintStaged");function tN(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e5.eslintInspect()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tN,"inspectLint");function tT(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tv(),tD()])];case 2:e.sent(),tC();return[2]}})})()}h(tT,"lintCheck");function tx(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tv(),tD(!0)])];case 2:e.sent(),tC();return[2]}})})()}h(tx,"lintFix");function tA(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,e5.commitLint()];case 2:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tC();return[2]}})})()}h(tA,"commitLint");function t_(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,e5.configureGitHook()];case 1:return[4,tS.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),ea(e2.GIT_HOOK);return[4,th(e4)];case 3:t=i.sent();es(e2.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eN,"\n");ec(e2.GIT_IGNORE)?et(e2.GIT_IGNORE,"utf-8").split("\n").includes(eN)||eo(e2.GIT_IGNORE,n):es(e2.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e5.simpleGitHooks()];case 4:return[4,tS.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})})()}h(t_,"setupGitHook");function tR(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,te()];case 1:e.sent();return[4,t_()];case 2:e.sent();return[2]}})})()}h(tR,"ready");function tG(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:ea(e2.NODE_MODULES,e2.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,e5.pnpmPruneStore()];case 1:return[4,tS.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,e5.pnpmCleanCache()];case 3:return[4,tS.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,te()];case 5:n.sent();return[4,t_()];case 6:n.sent();return[2]}})})()}h(tG,"reset");function tb(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e5.nodeModulesInspect()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tb,"inspect");function tP(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e5.testUnit()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tP,"testUnit");function tM(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e5.testE2e()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tM,"testE2E");function tw(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e5.mongoMigrateCreate(e)];case 1:return[4,tS.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}h(tw,"mongoMigrateCreate");function tL(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e5.mongoMigrateUp()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tL,"mongoMigrateUp");function tj(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e5.mongoMigrateDown()];case 1:return[4,tS.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tj,"mongoMigrateDown");(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,D(v(S.argv)).scriptName(eG).usage("$0 <command> [options]").command("lint","Check code for linting issues",tT).command("lint:fix","Fix linting issues automatically",tx).command("lint:inspect","View active ESLint configuration",tN).command("lint-staged","Run lint checks on staged files",tI).command("commitlint","Validate commit message format",tA).command("ready","Initialize project and dependencies",tR).command("reset","Reset the project and reinstall dependencies",tG).command("inspect","Analyze installed project dependencies",tb).command("test:unit","Run unit test suite",tP).command("test:e2e","Run end-to-end test suite",tM).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){H.error("Migration name is required.");return[2]}return[4,tw(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tL).command("mongo:migrate:down","Rollback last MongoDB migration",tj).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(O.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();Q(e),S.exit(1);return[3,3];case 3:return[2]}})})()})();
|