@cyberskill/shared 1.92.0 → 1.94.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 +89 -0
- package/dist/_tsup-dts-rollup.d.ts +89 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/nodejs/apollo-server/apollo-server.type.cjs +1 -0
- package/dist/nodejs/apollo-server/apollo-server.type.d.cts +1 -0
- package/dist/nodejs/apollo-server/apollo-server.type.d.ts +1 -0
- package/dist/nodejs/apollo-server/apollo-server.type.js +0 -0
- package/dist/nodejs/apollo-server/apollo-server.util.cjs +1 -0
- package/dist/nodejs/apollo-server/apollo-server.util.d.cts +1 -0
- package/dist/nodejs/apollo-server/apollo-server.util.d.ts +1 -0
- package/dist/nodejs/apollo-server/apollo-server.util.js +1 -0
- package/dist/nodejs/apollo-server/index.cjs +1 -0
- package/dist/nodejs/apollo-server/index.d.cts +2 -0
- package/dist/nodejs/apollo-server/index.d.ts +2 -0
- package/dist/nodejs/apollo-server/index.js +1 -0
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/express/express.d.cjs +1 -0
- package/dist/nodejs/express/express.d.d.cts +1 -0
- package/dist/nodejs/express/express.d.d.ts +1 -0
- package/dist/nodejs/express/express.d.js +0 -0
- package/dist/nodejs/express/express.type.cjs +1 -0
- package/dist/nodejs/express/express.type.d.cts +2 -0
- package/dist/nodejs/express/express.type.d.ts +2 -0
- package/dist/nodejs/express/express.type.js +0 -0
- package/dist/nodejs/express/express.util.cjs +1 -0
- package/dist/nodejs/express/express.util.d.cts +2 -0
- package/dist/nodejs/express/express.util.d.ts +2 -0
- package/dist/nodejs/express/express.util.js +1 -0
- package/dist/nodejs/express/index.cjs +1 -0
- package/dist/nodejs/express/index.d.cts +4 -0
- package/dist/nodejs/express/index.d.ts +4 -0
- package/dist/nodejs/express/index.js +1 -0
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +10 -0
- package/dist/nodejs/index.d.ts +10 -0
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/ws/index.cjs +1 -0
- package/dist/nodejs/ws/index.d.cts +4 -0
- package/dist/nodejs/ws/index.d.ts +4 -0
- package/dist/nodejs/ws/index.js +1 -0
- package/dist/nodejs/ws/ts.util.cjs +1 -0
- package/dist/nodejs/ws/ts.util.d.cts +2 -0
- package/dist/nodejs/ws/ts.util.d.ts +2 -0
- package/dist/nodejs/ws/ts.util.js +1 -0
- package/dist/nodejs/ws/ws.type.cjs +1 -0
- package/dist/nodejs/ws/ws.type.d.cts +2 -0
- package/dist/nodejs/ws/ws.type.d.ts +2 -0
- package/dist/nodejs/ws/ws.type.js +0 -0
- package/package.json +35 -8
package/dist/nodejs/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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return R(e,N()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)C(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function E(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function g(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function h(){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 m(){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 v(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){l(e,t,n[t])})}return e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=_(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function _(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function R(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return r(e)}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function A(e,n){return t(e)||g(e,n)||b(e,n)||h()}function I(e){return n(e)||E(e)||b(e)||m()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function b(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 N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function D(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[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]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var w=Object.defineProperty;var x=function(e,t,n){return t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var j=function(e,t){return w(e,"name",{value:t,configurable:!0})};var M=function(e,t,n){return x(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,n)};import P from"node:process";import{hideBin as L}from"yargs/helpers";import G from"yargs/yargs";var k={name:"@cyberskill/shared",type:"module",version:"1.91.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"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/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/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.7","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.2","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.3.0","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.3.0","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.51.1","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.0",vitest:"3.1.1","vitest-browser-react":"0.1.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var U=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as F}from"node:child_process";import q from"node:process";import*as K from"node:util";import H from"node:process";var Y=H.env.DEBUG==="true";var B=function(e){return e.Error="error",e.Warning="warning",e}({});import V from"chalk";import W from"consola";import{GraphQLError as Q}from"graphql";var J={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"}};function $(e){var t=e.message,n=e.status,r=n===void 0?J.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new Q(a,{extensions:{code:r.CODE}}):new Error(a)}j($,"throwError");Y||(W.level=4);function X(e){var t=V[e];return typeof t=="function"?t:V.green}j(X,"chalkKeyword");var z={silent:W.silent,level:W.level,fatal:W.fatal,error:W.error,warn:W.warn,log:W.log,info:W.info,success:W.success,ready:W.ready,start:W.start,box:W.box,debug:W.debug,trace:W.trace,verbose:W.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.box(V.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;W.log("".concat(V.gray("File:")," ").concat(V.blue("".concat(t).concat(r?":".concat(r):"")))),s&&W.log(" ".concat(X(n)("Rule:")," ").concat(s)),W.log(" ".concat(X(n)("Message:")," ").concat(i))}),W.box(X(n)("".concat(e," : ").concat(t.length))),W.log(V.gray("─".repeat(40)))}};var Z={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import ee from"node-fetch";import*as et from"node:fs";function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return et.existsSync(e)})}j(en,"existsSync");function er(e,t){var n=et.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":T(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}j(er,"readFileSync");function es(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);et.writeFileSync(e,i,"utf-8")}j(es,"writeFileSync");function ei(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);et.appendFileSync(e,i,"utf-8")}j(ei,"appendFileSync");function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){en(e)&&et.rmSync(e,{recursive:!0,force:!0})})}j(eo,"rmSync");import ea from"node:process";import*as ec from"node:path";function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ec).resolve.apply(r,[ef].concat(I(t)))}j(eu,"resolveWorkingPath");function el(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ec).resolve.apply(r,I(t))}j(el,"resolve");function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ec).join.apply(r,I(t))}j(ed,"join");var ef=ea.env.INIT_CWD||ea.cwd(),ep="@cyberskill/shared",eE=".cyberskill-storage",eg="node_modules",eh="dist",em="package.json",ev="package-lock.json",ey="tsconfig.json",eS=".gitignore",eO=".simple-git-hooks.json",e_="pnpm-lock.yaml",eR=".git/hooks/",eC=".git/COMMIT_EDITMSG",eA=ed(ef,eg,ep,eh),eI="cyberskill",eT="src/nodejs/cli/index.ts",eb="eslint",eN="eslint",eD="vitest",ew="playwright",ex="vitest",ej="@commitlint/cli",eM="commitlint",eP="lint-staged",eL="lint-staged",eG="typescript",ek="tsc",eU="tsx",eF="git",eq="pnpm",eK="pnpm exec",eH="simple-git-hooks",eY="simple-git-hooks",eB="@eslint/config-inspector",eV="eslint-config-inspector",eW="node-modules-inspector",eQ="node-modules-inspector",eJ={CYBERSKILL_DIRECTORY:eA,WORKING_DIRECTORY:ef,TS_CONFIG:eu(ey),GIT_IGNORE:eu(eS),GIT_HOOK:eu(eR),GIT_COMMIT_MSG:eu(eC),SIMPLE_GIT_HOOKS_JSON:eu(eO),PACKAGE_JSON:eu(em),PACKAGE_LOCK_JSON:eu(ev),PNPM_LOCK_YAML:eu(e_),NODE_MODULES:eu(eg),LINT_STAGED_CONFIG:eu("".concat(eA,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eu("".concat(eA,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eu("".concat(eA,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eu("".concat(eA,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eu("".concat(eA,"/react/vitest/vitest.e2e.js"))};function e$(e){var t=e.isCurrentProject;return v({"pre-commit":eL,"commit-msg":eM},t&&{"pre-push":ty("".concat(eF," pull"))})}j(e$,"HOOK");function eX(e){return ez.apply(this,arguments)}function ez(){ez=i(function(e){var t,n,r,s,i,o;var a=arguments;return D(this,function(c){switch(c.label){case 0:for(t=a.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=a[r]}s=A(n,2),i=s[0],o=s[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case U.CLI:return[3,1];case U.RAW:return[3,3]}return[3,4];case 1:return[4,e9(i.split(" "),{update:!0})];case 2:return[2,(c.sent(),tO(ty("".concat(eK," ").concat(o))))];case 3:return[2,tO(ty(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ez.apply(this,arguments)}j(eX,"buildCommand");function eZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return D(this,function(t){return[2,eX.apply(void 0,[e].concat(I(n)))]})})}j(eZ,"commandFactory");var e0={simpleGitHooks:eZ(U.CLI,eH,eY),eslintInspect:eZ(U.CLI,eB,eV),nodeModulesInspect:eZ(U.CLI,eW,eQ),eslintCheck:eZ(U.CLI,eb,"".concat(eN," ").concat(eJ.WORKING_DIRECTORY)),eslintFix:eZ(U.CLI,eb,"".concat(eN," ").concat(eJ.WORKING_DIRECTORY," --fix")),typescriptCheck:eZ(U.CLI,eG,"".concat(ek," -p ").concat(eJ.TS_CONFIG," --noEmit")),configureGitHook:eZ(U.RAW,"".concat(eF," config core.hooksPath ").concat(eJ.GIT_HOOK)),testUnit:eZ(U.CLI,eD,"".concat(ex," --config ").concat(eJ.UNIT_TEST_CONFIG)),testE2e:eZ(U.CLI,"".concat(eD," ").concat(ew),"".concat(ex," --config ").concat(eJ.E2E_TEST_CONFIG)),commitLint:eZ(U.CLI,ej,"".concat(eM," --edit ").concat(eJ.GIT_COMMIT_MSG," --config ").concat(eJ.COMMITLINT_CONFIG)),lintStaged:eZ(U.CLI,eP,"".concat(eL," --config ").concat(eJ.LINT_STAGED_CONFIG)),stageBuildDirectory:eZ(U.RAW,"".concat(eF," add ").concat(eh)),build:eZ(U.RAW,"".concat(eq," run build")),pnpmInstallStandard:eZ(U.RAW,"".concat(eq," install")),pnpmInstallLegacy:eZ(U.RAW,"".concat(eq," install --legacy-peer-deps")),pnpmInstallForce:eZ(U.RAW,"".concat(eq," install --force"))};function e1(e){var t=ed(ef,em);if(!en(t))return!1;try{var n=er(t,{asJson:!0}),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return z.warn("Failed to read package.json: ".concat(e.message)),!1}}j(e1,"getPackage");function e2(e){return e4.apply(this,arguments)}function e4(){e4=i(function(e){var t,n,r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,ee("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.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=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw z.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e4.apply(this,arguments)}j(e2,"getLatestPackageVersion");function e3(e,t){return e5.apply(this,arguments)}function e5(){e5=i(function(e,t){var n,r,s,i,o,a,c,u,l,d,f,p,E,g,h,m,y,S,O,_,R;return D(this,function(C){switch(C.label){case 0:C.trys.push([0,4,,5]);n=e1(e);if(!n)return[2,v({},Z)];c=n.path,u=n.file,l=n.isCurrentProject,d=n.isDepend,f=n.isDevDepend,p=(r=u.dependencies)!==null&&r!==void 0?r:{},E=(s=u.devDependencies)!==null&&s!==void 0?s:{},g=l?(i=u.version)!==null&&i!==void 0?i:"0.0.0":d?(o=p[e])!==null&&o!==void 0?o:"0.0.0":f?(a=E[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!l)return[3,1];y=g;return[3,3];case 1:return[4,e2(e)];case 2:y=C.sent();C.label=3;case 3:h=y,m=l||g===h;if(!m&&(t===null||t===void 0?void 0:t.update)){;O=d?"dependencies":f?"devDependencies":null;O&&((S=u[O])===null||S===void 0?void 0:S[e])!==h&&(u[O]=(_=u[O])!==null&&_!==void 0?_:{},u[O][e]=h,es(c,u,{isJson:!0}),z.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:l,installedPath:c,file:u,isUpToDate:m}];case 4:R=C.sent();return[2,(z.error('Error checking package "'.concat(e,'": ').concat(R.message)),v({},Z))];case 5:return[2]}})});return e5.apply(this,arguments)}j(e3,"checkPackage");function e8(){return e6.apply(this,arguments)}function e6(){e6=i(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return D(this,function(f){switch(f.label){case 0:e=[{command:j(function(){return e0.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:j(function(){return e0.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:j(function(){return e0.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tC("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();z.warn("Installation attempt failed: ".concat(c)),z.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return e6.apply(this,arguments)}j(e8,"installDependencies");function e9(e,t){return e7.apply(this,arguments)}function e7(){e7=i(function(e,t){var n,r,s,i,o,a,c,u,l,d,f;return D(this,function(p){switch(p.label){case 0:if(!en(eJ.PACKAGE_JSON)){z.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,13,,14]);n=I(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e3(e,v({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=p.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e8()];case 3:r=p.sent();p.label=4;case 4:r;i=true,o=false,a=undefined;p.label=5;case 5:p.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];l=u.value;return[4,l()];case 7:p.sent();p.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:d=p.sent();o=true;a=d;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:f=p.sent();throw z.error('Failed to setup "'.concat(e.join(", "),'": ').concat(f.message)),f;case 14:return[2]}})});return e7.apply(this,arguments)}j(e9,"setupPackages");import te from"node-persist";import tt from"node:os";import tn from"node:process";function tr(){return tn.env.CYBERSKILL_STORAGE_DIR||ed(tt.homedir(),eE)}j(tr,"getStorageDir");function ts(){return ti.apply(this,arguments)}function ti(){ti=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=te.defaultInstance;if(e)return[3,2];return[4,te.init({dir:tr(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return ti.apply(this,arguments)}j(ts,"initNodePersist");var to={get:function e(e){return i(function(){var t,n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,te.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(z.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,te.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();z.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return D(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,te.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();z.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return D(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,te.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,(z.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return D(this,function(t){try{return[2,"".concat(tr()," (key: ").concat(e,")")]}catch(e){return[2,(z.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ta=K.promisify(F);function tc(e){return"error_list:".concat(e)}j(tc,"getErrorListKey");function tu(e){return tl.apply(this,arguments)}function tl(){tl=i(function(e){var t,n,r;return D(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tc(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,to.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,to.getLogLink(n)];case 1:e=t.sent();e&&z.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=s.sent();z.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tl.apply(this,arguments)}j(tu,"saveErrorListToStorage");function td(){return tf.apply(this,arguments)}function tf(){tf=i(function(){var e,t,n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,to.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return D(this,function(n){switch(n.label){case 0:return[4,to.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(z.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return tf.apply(this,arguments)}j(td,"getStoredErrorLists");function tp(){return tE.apply(this,arguments)}function tE(){tE=i(function(){var e,t,n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,to.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return to.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();z.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tE.apply(this,arguments)}j(tp,"clearAllErrorLists");function tg(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\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 f=s.exec(e)||[],p=i.exec(e)||[],E=o.exec(e)||[];var g,h,m,v,y,S;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===B.Error?B.Error:B.Warning,message:(g=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&g!==void 0?g:"",rule:(h=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&h!==void 0?h:""}):p.length?t.push({file:(m=p===null||p===void 0?void 0:p[1])!==null&&m!==void 0?m:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===B.Error?B.Error:B.Warning,message:(v=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):E.length?t.push({file:"commitlint",type:B.Error,message:(y=E===null||E===void 0?void 0:(l=E[1])===null||l===void 0?void 0:l.trim())!==null&&y!==void 0?y:"",rule:(S=E===null||E===void 0?void 0:(d=E[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tu(t),Y&&n.length&&(z.warn("Unmatched lines:"),n.forEach(function(e){return z.info(" ".concat(e))}))}j(tg,"parseTextErrors");function th(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,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?B.Error:B.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tu(n)}catch(t){tg(e)}}j(th,"parseCommandOutput");function tm(e){return tv.apply(this,arguments)}function tv(){tv=i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return D(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:th;n=new AbortController;q.on("SIGINT",function(){z.warn("Process interrupted. Terminating..."),n.abort(),q.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,ta(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});return[3,4];case 3: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,4];case 4:return[2]}})});return tv.apply(this,arguments)}j(tm,"executeCommand");function ty(e){return{raw:!0,cmd:e}}j(ty,"rawCommand");function tS(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eK," ").concat(ep," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eK," ").concat(eU," ").concat(eT," ").concat(e):"".concat(eK," ").concat(eI," ").concat(e)}j(tS,"formatCLI");function tO(e,t){return typeof e=="function"?tS(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tS(e,t):e}j(tO,"formatCommand");function t_(e){return tR.apply(this,arguments)}function tR(){tR=i(function(e){var t,n,r,s,i,o,a;var c=arguments;return D(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e3(ep)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=A(e,2),n=t[0],r=t[1];return[n,tO(r,i)]}))]}})});return tR.apply(this,arguments)}j(t_,"resolveCommands");function tC(e,t){return tA.apply(this,arguments)}function tA(){tA=i(function(e,t){var n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);z.start("".concat(e)),Y&&z.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),z.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw z.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tA.apply(this,arguments)}j(tC,"runCommand");function tI(){return tT.apply(this,arguments)}function tT(){tT=i(function(){var e,t;return D(this,function(n){switch(n.label){case 0:if(!en(eJ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e0.typescriptCheck()];case 1:return[4,tC.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]}})});return tT.apply(this,arguments)}j(tI,"checkTypescript");function tb(){return tN.apply(this,arguments)}function tN(){tN=i(function(){var e,t,n,r;var s=arguments;return D(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e0.eslintFix()];case 1:return[4,tC.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e0.eslintCheck()];case 4:return[4,tC.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tN.apply(this,arguments)}j(tb,"checkEslint");function tD(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";z.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}j(tD,"printIssues");function tw(){return tx.apply(this,arguments)}function tx(){tx=i(function(){var e,t,n;return D(this,function(r){switch(r.label){case 0:return[4,td()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===B.Error}),n=e.filter(function(e){return e.type===B.Warning});!t.length&&!n.length?z.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tD("Warnings",n),tD("Errors",t),(t.length>0||n.length>0)&&P.exit(1));return[2]}})});return tx.apply(this,arguments)}j(tw,"showCheckResult");function tj(){return tM.apply(this,arguments)}function tM(){tM=i(function(){var e,t,n,r,s,i;return D(this,function(o){switch(o.label){case 0:return[4,tp()];case 1:o.sent();return[4,e3(ep)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ep)];return[4,e0.build()];case 4:return[4,tC.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e0.stageBuildDirectory()];case 6:return[4,tC.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw z.error("Error building and staging ".concat(ep,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e0.lintStaged()];case 10:return[4,tC.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tw();return[2]}})});return tM.apply(this,arguments)}j(tj,"lintStaged");function tP(){return tL.apply(this,arguments)}function tL(){tL=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e0.eslintInspect()];case 1:return[4,tC.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tL.apply(this,arguments)}j(tP,"inspectLint");function tG(){return tk.apply(this,arguments)}function tk(){tk=i(function(){return D(this,function(e){switch(e.label){case 0:return[4,tp()];case 1:e.sent();return[4,Promise.all([tI(),tb()])];case 2:e.sent(),tw();return[2]}})});return tk.apply(this,arguments)}j(tG,"lintCheck");function tU(){return tF.apply(this,arguments)}function tF(){tF=i(function(){return D(this,function(e){switch(e.label){case 0:return[4,tp()];case 1:e.sent();return[4,Promise.all([tI(),tb(!0)])];case 2:e.sent(),tw();return[2]}})});return tF.apply(this,arguments)}j(tU,"lintFix");function tq(){return tK.apply(this,arguments)}function tK(){tK=i(function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,tp()];case 1:t.sent();e=["Validating commit message"];return[4,e0.commitLint()];case 2:return[4,tC.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tw();return[2]}})});return tK.apply(this,arguments)}j(tq,"commitLint");function tH(){return tY.apply(this,arguments)}function tY(){tY=i(function(){var e,t,n,r;return D(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e0.configureGitHook()];case 1:return[4,tC.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eo(eJ.GIT_HOOK);return[4,t_(e$)];case 3:t=s.sent();es(eJ.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(eO,"\n");en(eJ.GIT_IGNORE)?er(eJ.GIT_IGNORE).split("\n").includes(eO)||ei(eJ.GIT_IGNORE,n):es(eJ.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e0.simpleGitHooks()];case 4:return[4,tC.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tY.apply(this,arguments)}j(tH,"setupGitHook");function tB(){return tV.apply(this,arguments)}function tV(){tV=i(function(){return D(this,function(e){switch(e.label){case 0:return[4,e9([ep],{update:!0,postInstallActions:[tH]})];case 1:e.sent();return[2]}})});return tV.apply(this,arguments)}j(tB,"setup");function tW(){return tQ.apply(this,arguments)}function tQ(){tQ=i(function(){return D(this,function(e){switch(e.label){case 0:eo(eJ.NODE_MODULES,eJ.PNPM_LOCK_YAML);return[4,e8()];case 1:e.sent();return[4,tH()];case 2:e.sent();return[2]}})});return tQ.apply(this,arguments)}j(tW,"reset");function tJ(){return t$.apply(this,arguments)}function t$(){t$=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e0.nodeModulesInspect()];case 1:return[4,tC.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t$.apply(this,arguments)}j(tJ,"inspect");function tX(){return tz.apply(this,arguments)}function tz(){tz=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e0.testUnit()];case 1:return[4,tC.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tz.apply(this,arguments)}j(tX,"testUnit");function tZ(){return t0.apply(this,arguments)}function t0(){t0=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e0.testE2e()];case 1:return[4,tC.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t0.apply(this,arguments)}j(tZ,"testE2E");i(function(){var e;return D(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,G(L(P.argv)).scriptName(eI).usage("$0 <command> [options]").command("lint","Check code for linting issues",tG).command("lint:fix","Fix linting issues automatically",tU).command("lint:inspect","View active ESLint configuration",tP).command("lint-staged","Run lint checks on staged files",tj).command("commitlint","Validate commit message format",tq).command("setup","Initialize project setup and dependencies",tB).command("reset","Reset the project and reinstall dependencies",tW).command("inspect","Analyze installed project dependencies",tJ).command("test:unit","Run unit test suite",tX).command("test:e2e","Run end-to-end test suite",tZ).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(k.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();z.error("Fatal: ".concat(e.message)),P.exit(1);return[3,3];case 3:return[2]}})})();import{format as t1}from"date-fns";import{Document as t2}from"mongoose";import t4 from"mongoose-aggregate-paginate-v2";import t3 from"mongoose-paginate-v2";import{v4 as t5}from"uuid";import t8 from"crypto-js";import t6 from"slugify";var t9=t6.default||t6;function t7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var n=t||{},r=n.lower,s=r===void 0?!0:r,i=n.locale,o=i===void 0?"vi":i,a=O(n,["lower","locale"]);return t9(e,v({lower:s,locale:o},a))}j(t7,"generateSlug");function ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return t8.SHA256(e).toString(t8.enc.Hex).slice(0,t)}j(ne,"generateShortId");var nt={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":T(e))=="object"?p(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var nn={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return t1(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?nn.getDateTime():new Date;return{id:t5(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:t5,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n,{strict:!0});return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(nn.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var f=nn.createSchema({mongoose:t,schema:r,virtuals:u});return nn.applyPlugins(f,[i&&t3,a&&t4]),nn.applyMiddlewares(f,d),t.model(n,f)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return S(v({},t,n&&{id:{$ne:n}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=i(function(e){return D(this,function(t){return[2,!nt.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=i(function(t){var n;return D(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(n)];case 1:return[2,!r.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=i(function(t){return D(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!p(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})});return function(e){return t.apply(this,arguments)}}()}}},nr=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);M(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){var t=this;return i(function(){var n,r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n=v({},nn.createGenericFields(),e);r={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(n)];case 1:return[2,(r.result=i.sent(),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return i(function(){var n,r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n=e.map(function(e){return v({},nn.createGenericFields(),e)});return[4,t.collection.insertMany(n)];case 1:r=i.sent();return[2,r.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(r.insertedCount," documents created successfully"),result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:n=s.sent();return[2,n?{success:!0,message:"Document found",result:n}:{success:!1,message:"Document not found"}];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.collection.updateOne(e,{$set:t})];case 1:r=i.sent();return[2,r.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.collection.updateMany(e,{$set:t})];case 1:r=i.sent();return[2,r.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:n=s.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:n}];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:n=s.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:n}];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}}]);return e}();j(nr,"MongoController");var ns=nr,ni=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);M(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;var s=this;return i(function(){var i,o,a;return D(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);i=s.model.findOne(e,t,n);r&&i.populate(r);return[4,i.exec()];case 1:o=c.sent();return[2,o?{success:!0,result:o}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:J.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;var s=this;return i(function(){var i,o,a;return D(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);i=s.model.find(e,t,n);r&&i.populate(r);o={success:!0};return[4,i.exec()];case 1:return[2,(o.result=c.sent(),o)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r={success:!0};return[4,n.model.paginate(e,t)];case 1:return[2,(r.result=i.sent(),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r={success:!0};return[4,n.model.aggregatePaginate(n.model.aggregate(e),t)];case 1:return[2,(r.result=i.sent(),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0};return[4,t.model.create(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r={success:!0};return[4,n.model.insertMany(e,t)];case 1:return[2,(r.result=i.sent().map(function(e){return p(e,t2)?e.toObject():null}).filter(function(e){return e!==null}),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=this;return i(function(){var s,i;return D(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.findOneAndUpdate(e,t,v({new:!0},n)).exec()];case 1:s=o.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(r.getModelName(),"."),code:J.NOT_FOUND.CODE}];case 2:i=o.sent();return[2,{success:!1,message:i.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=this;return i(function(){var s,i;return D(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);s={success:!0};return[4,r.model.updateMany(e,t,n).exec()];case 1:return[2,(s.result=o.sent(),s)];case 2:i=o.sent();return[2,{success:!1,message:i.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.findOneAndDelete(e,t).exec()];case 1:r=i.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"No ".concat(n.getModelName()," found to delete."),code:J.NOT_FOUND.CODE}];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.deleteMany(e,t).exec()];case 1:r=i.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents found to delete.",code:J.NOT_FOUND.CODE}:{success:!0,result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var n=this;return i(function(){var r,s,i,o;return D(this,function(a){switch(a.label){case 0:r=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];i=ne(e,s+t);o=!r.has(i);if(!o)return[3,3];r.add(i);return[4,n.model.exists({shortId:i})];case 2:o=!a.sent();a.label=3;case 3:if(o)return[2,{success:!0,result:i}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:J.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=this;return i(function(){var s,o,a,c,u,l,d,f,p,E,g;return D(this,function(h){switch(h.label){case 0:h.trys.push([0,8,,9]);s=t[e],o=j(/*#__PURE__*/function(){var e=i(function(e){var s,i,o;return D(this,function(a){switch(a.label){case 0:return[4,r.model.findOne(nn.createSlugQuery(e,n,t.id))];case 1:s=a.sent();if(!s)return[2,e];i=1;a.label=2;case 2:o="".concat(e,"-").concat(i);return[4,r.model.findOne(nn.createSlugQuery(o,n,t.id))];case 3:s=a.sent(),i++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,o]}})});return function(t){return e.apply(this,arguments)}}(),"createUniqueSlug");if(!((typeof s==="undefined"?"undefined":T(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;h.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];f=t7(s[d]);return[4,o(f)];case 2:a[d]=h.sent();h.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:p=t7(s);E={success:!0};return[4,o(p)];case 6:return[2,(E.result=h.sent(),E)];case 7:return[3,9];case 8:g=h.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(g.message),code:J.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message,code:J.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();j(ni,"MongooseController");var no=ni;import{Collection as na,Db as nc}from"mongodb";import{Document as nu,Model as nl}from"mongoose";var nd=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nc);j(nd,"C_Db");var nf=nd,np=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nu);j(np,"C_Document");var nE=np,ng=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nl);j(ng,"C_Model");var nh=ng,nm=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(na);j(nm,"C_Collection");var nv=nm;export{eh as BUILD_DIRECTORY,Z as CHECK_PACKAGE_EMPTY_RESULT,eM as COMMIT_LINT_CLI,ej as COMMIT_LINT_PACKAGE_NAME,eI as CYBERSKILL_CLI,eT as CYBERSKILL_CLI_PATH,eA as CYBERSKILL_DIRECTORY,ep as CYBERSKILL_PACKAGE_NAME,eE as CYBERSKILL_STORAGE,nv as C_Collection,nf as C_Db,nE as C_Document,nh as C_Model,eN as ESLINT_CLI,eV as ESLINT_INSPECT_CLI,eB as ESLINT_INSPECT_PACKAGE_NAME,eb as ESLINT_PACKAGE_NAME,U as E_CommandType,B as E_IssueType,eF as GIT_CLI,eC as GIT_COMMIT_EDITMSG,eR as GIT_HOOK,eS as GIT_IGNORE,e$ as HOOK,eL as LINT_STAGED_CLI,eP as LINT_STAGED_PACKAGE_NAME,ns as MongoController,no as MongooseController,eg as NODE_MODULES,eQ as NODE_MODULES_INSPECT_CLI,eW as NODE_MODULES_INSPECT_PACKAGE_NAME,em as PACKAGE_JSON,ev as PACKAGE_LOCK_JSON,eJ as PATH,ew as PLAYWRIGHT_PACKAGE_NAME,eq as PNPM_CLI,eK as PNPM_EXEC_CLI,e_ as PNPM_LOCK_YAML,eH as SIMPLE_GIT_HOOKS_PACKAGE_NAME,eY as SIMPLE_GIT_HOOK_CLI,eO as SIMPLE_GIT_HOOK_JSON,ey as TSCONFIG_JSON,ek as TSC_CLI,eG as TSC_PACKAGE_NAME,eU as TSX_CLI,ex as VITEST_CLI,eD as VITEST_PACKAGE_NAME,ef as WORKING_DIRECTORY,t4 as aggregatePaginate,ei as appendFileSync,e3 as checkPackage,tp as clearAllErrorLists,e0 as command,en as existsSync,tO as formatCommand,e2 as getLatestPackageVersion,e1 as getPackage,td as getStoredErrorLists,e8 as installDependencies,ed as join,z as logNodeJS,nn as mongo,t3 as mongoosePaginate,ty as rawCommand,er as readFileSync,el as resolve,t_ as resolveCommands,eu as resolveWorkingPath,eo as rmSync,tC as runCommand,e9 as setupPackages,to as storageNodeJS,$ as throwError,es as writeFileSync};
|
|
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return R(e,N()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)A(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function E(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function g(){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 h(){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 v(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){l(e,t,n[t])})}return e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=_(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function _(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function R(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return r(e)}function A(e,t){A=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return A(e,t)}function C(e,n){return t(e)||m(e,n)||b(e,n)||g()}function I(e){return n(e)||E(e)||b(e)||h()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function b(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 N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function D(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[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]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var x=Object.defineProperty;var w=function(e,t,n){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var j=function(e,t){return x(e,"name",{value:t,configurable:!0})};var P=function(e,t,n){return w(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,n)};import{ApolloServer as L}from"@apollo/server";import{ApolloServerPluginDrainHttpServer as M}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as G,ApolloServerPluginLandingPageProductionDefault as k}from"@apollo/server/plugin/landingPage/default";var U=function(e){return e.Error="error",e.Warning="warning",e}({});import F from"chalk";import q from"consola";import{GraphQLError as K}from"graphql";import H from"node:process";var W=H.env.DEBUG==="true";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"}};function V(e){var t=e.message,n=e.status,r=n===void 0?Y.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new K(a,{extensions:{code:r.CODE}}):new Error(a)}j(V,"throwError");W||(q.level=4);function B(e){var t=F[e];return typeof t=="function"?t:F.green}j(B,"chalkKeyword");var Q={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,s=e.rule,i=e.message;q.log("".concat(F.gray("File:")," ").concat(F.blue("".concat(t).concat(r?":".concat(r):"")))),s&&q.log(" ".concat(B(n)("Rule:")," ").concat(s)),q.log(" ".concat(B(n)("Message:")," ").concat(i))}),q.box(B(n)("".concat(e," : ").concat(t.length))),q.log(F.gray("─".repeat(40)))}};function J(e){return new L(v({schema:e.schema,plugins:[e.isDev?G():k(),M({httpServer:e.server})].concat(I(e.drainServer?[{serverWillStart:function t(){return i(function(){return D(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return D(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),Q.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}j(J,"createApolloServer");import $ from"node:process";import{hideBin as X}from"yargs/helpers";import z from"yargs/yargs";var Z={name:"@cyberskill/shared",type:"module",version:"1.93.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"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/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/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.3","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.4","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.1","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var ee=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as et}from"node:child_process";import en from"node:process";import*as er from"node:util";var es={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import ei from"node-fetch";import*as eo from"node:fs";function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return eo.existsSync(e)})}j(ea,"existsSync");function ec(e,t){var n=eo.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":T(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}j(ec,"readFileSync");function eu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);eo.writeFileSync(e,i,"utf-8")}j(eu,"writeFileSync");function el(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);eo.appendFileSync(e,i,"utf-8")}j(el,"appendFileSync");function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ea(e)&&eo.rmSync(e,{recursive:!0,force:!0})})}j(ed,"rmSync");import ep from"node:process";import*as ef from"node:path";function eE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ef).resolve.apply(r,[eh].concat(I(t)))}j(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=ef).resolve.apply(r,I(t))}j(em,"resolve");function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ef).join.apply(r,I(t))}j(eg,"join");var eh=ep.env.INIT_CWD||ep.cwd(),ev="@cyberskill/shared",ey=".cyberskill-storage",eS="node_modules",eO="dist",e_="package.json",eR="package-lock.json",eA="tsconfig.json",eC=".gitignore",eI=".simple-git-hooks.json",eT="pnpm-lock.yaml",eb=".git/hooks/",eN=".git/COMMIT_EDITMSG",eD=eg(eh,eS,ev,eO),ex="cyberskill",ew="src/nodejs/cli/index.ts",ej="eslint",eP="eslint",eL="vitest",eM="playwright",eG="vitest",ek="@commitlint/cli",eU="commitlint",eF="lint-staged",eq="lint-staged",eK="typescript",eH="tsc",eW="tsx",eY="git",eV="pnpm",eB="pnpm exec",eQ="simple-git-hooks",eJ="simple-git-hooks",e$="@eslint/config-inspector",eX="eslint-config-inspector",ez="node-modules-inspector",eZ="node-modules-inspector",e0={CYBERSKILL_DIRECTORY:eD,WORKING_DIRECTORY:eh,TS_CONFIG:eE(eA),GIT_IGNORE:eE(eC),GIT_HOOK:eE(eb),GIT_COMMIT_MSG:eE(eN),SIMPLE_GIT_HOOKS_JSON:eE(eI),PACKAGE_JSON:eE(e_),PACKAGE_LOCK_JSON:eE(eR),PNPM_LOCK_YAML:eE(eT),NODE_MODULES:eE(eS),LINT_STAGED_CONFIG:eE("".concat(eD,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eE("".concat(eD,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eE("".concat(eD,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eE("".concat(eD,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eE("".concat(eD,"/react/vitest/vitest.e2e.js"))};function e1(e){var t=e.isCurrentProject;return v({"pre-commit":eq,"commit-msg":eU},t&&{"pre-push":tA("".concat(eY," pull"))})}j(e1,"HOOK");function e2(e){return e4.apply(this,arguments)}function e4(){e4=i(function(e){var t,n,r,s,i,o;var a=arguments;return D(this,function(c){switch(c.label){case 0:for(t=a.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=a[r]}s=C(n,2),i=s[0],o=s[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case ee.CLI:return[3,1];case ee.RAW:return[3,3]}return[3,4];case 1:return[4,tr(i.split(" "),{update:!0})];case 2:return[2,(c.sent(),tI(tA("".concat(eB," ").concat(o))))];case 3:return[2,tI(tA(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return e4.apply(this,arguments)}j(e2,"buildCommand");function e3(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return D(this,function(t){return[2,e2.apply(void 0,[e].concat(I(n)))]})})}j(e3,"commandFactory");var e5={simpleGitHooks:e3(ee.CLI,eQ,eJ),eslintInspect:e3(ee.CLI,e$,eX),nodeModulesInspect:e3(ee.CLI,ez,eZ),eslintCheck:e3(ee.CLI,ej,"".concat(eP," ").concat(e0.WORKING_DIRECTORY)),eslintFix:e3(ee.CLI,ej,"".concat(eP," ").concat(e0.WORKING_DIRECTORY," --fix")),typescriptCheck:e3(ee.CLI,eK,"".concat(eH," -p ").concat(e0.TS_CONFIG," --noEmit")),configureGitHook:e3(ee.RAW,"".concat(eY," config core.hooksPath ").concat(e0.GIT_HOOK)),testUnit:e3(ee.CLI,eL,"".concat(eG," --config ").concat(e0.UNIT_TEST_CONFIG)),testE2e:e3(ee.CLI,"".concat(eL," ").concat(eM),"".concat(eG," --config ").concat(e0.E2E_TEST_CONFIG)),commitLint:e3(ee.CLI,ek,"".concat(eU," --edit ").concat(e0.GIT_COMMIT_MSG," --config ").concat(e0.COMMITLINT_CONFIG)),lintStaged:e3(ee.CLI,eF,"".concat(eq," --config ").concat(e0.LINT_STAGED_CONFIG)),stageBuildDirectory:e3(ee.RAW,"".concat(eY," add ").concat(eO)),build:e3(ee.RAW,"".concat(eV," run build")),pnpmInstallStandard:e3(ee.RAW,"".concat(eV," install")),pnpmInstallLegacy:e3(ee.RAW,"".concat(eV," install --legacy-peer-deps")),pnpmInstallForce:e3(ee.RAW,"".concat(eV," install --force"))};function e8(e){var t=eg(eh,e_);if(!ea(t))return!1;try{var n=ec(t,{asJson:!0}),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return Q.warn("Failed to read package.json: ".concat(e.message)),!1}}j(e8,"getPackage");function e6(e){return e9.apply(this,arguments)}function e9(){e9=i(function(e){var t,n,r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,ei("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.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=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw Q.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e9.apply(this,arguments)}j(e6,"getLatestPackageVersion");function e7(e,t){return te.apply(this,arguments)}function te(){te=i(function(e,t){var n,r,s,i,o,a,c,u,l,d,p,f,E,m,g,h,y,S,O,_,R;return D(this,function(A){switch(A.label){case 0:A.trys.push([0,4,,5]);n=e8(e);if(!n)return[2,v({},es)];c=n.path,u=n.file,l=n.isCurrentProject,d=n.isDepend,p=n.isDevDepend,f=(r=u.dependencies)!==null&&r!==void 0?r:{},E=(s=u.devDependencies)!==null&&s!==void 0?s:{},m=l?(i=u.version)!==null&&i!==void 0?i:"0.0.0":d?(o=f[e])!==null&&o!==void 0?o:"0.0.0":p?(a=E[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!l)return[3,1];y=m;return[3,3];case 1:return[4,e6(e)];case 2:y=A.sent();A.label=3;case 3:g=y,h=l||m===g;if(!h&&(t===null||t===void 0?void 0:t.update)){;O=d?"dependencies":p?"devDependencies":null;O&&((S=u[O])===null||S===void 0?void 0:S[e])!==g&&(u[O]=(_=u[O])!==null&&_!==void 0?_:{},u[O][e]=g,eu(c,u,{isJson:!0}),Q.info('Updated "'.concat(e,'" to version ').concat(g)))}return[2,{isCurrentProject:l,installedPath:c,file:u,isUpToDate:h}];case 4:R=A.sent();return[2,(Q.error('Error checking package "'.concat(e,'": ').concat(R.message)),v({},es))];case 5:return[2]}})});return te.apply(this,arguments)}j(e7,"checkPackage");function tt(){return tn.apply(this,arguments)}function tn(){tn=i(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return D(this,function(p){switch(p.label){case 0:e=[{command:j(function(){return e5.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:j(function(){return e5.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:j(function(){return e5.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,a()];case 4:u=p.sent();return[4,tN("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();Q.warn("Installation attempt failed: ".concat(c)),Q.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tn.apply(this,arguments)}j(tt,"installDependencies");function tr(e,t){return ts.apply(this,arguments)}function ts(){ts=i(function(e,t){var n,r,s,i,o,a,c,u,l,d,p;return D(this,function(f){switch(f.label){case 0:if(!ea(e0.PACKAGE_JSON)){Q.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,13,,14]);n=I(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e7(e,v({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=f.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,tt()];case 3:r=f.sent();f.label=4;case 4:r;i=true,o=false,a=undefined;f.label=5;case 5:f.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();f.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];l=u.value;return[4,l()];case 7:f.sent();f.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:d=f.sent();o=true;a=d;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:p=f.sent();throw Q.error('Failed to setup "'.concat(e.join(", "),'": ').concat(p.message)),p;case 14:return[2]}})});return ts.apply(this,arguments)}j(tr,"setupPackages");import ti from"node-persist";import to from"node:os";import ta from"node:process";function tc(){return ta.env.CYBERSKILL_STORAGE_DIR||eg(to.homedir(),ey)}j(tc,"getStorageDir");function tu(){return tl.apply(this,arguments)}function tl(){tl=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=ti.defaultInstance;if(e)return[3,2];return[4,ti.init({dir:tc(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return tl.apply(this,arguments)}j(tu,"initNodePersist");var td={get:function e(e){return i(function(){var t,n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu()];case 1:r.sent();return[4,ti.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(Q.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu()];case 1:r.sent();return[4,ti.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();Q.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return D(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tu()];case 1:n.sent();return[4,ti.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Q.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return D(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tu()];case 1:n.sent();return[4,ti.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(Q.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(Q.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return D(this,function(t){try{return[2,"".concat(tc()," (key: ").concat(e,")")]}catch(e){return[2,(Q.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tp=er.promisify(et);function tf(e){return"error_list:".concat(e)}j(tf,"getErrorListKey");function tE(e){return tm.apply(this,arguments)}function tm(){tm=i(function(e){var t,n,r;return D(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tf(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,td.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,td.getLogLink(n)];case 1:e=t.sent();e&&Q.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=s.sent();Q.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tm.apply(this,arguments)}j(tE,"saveErrorListToStorage");function tg(){return th.apply(this,arguments)}function th(){th=i(function(){var e,t,n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,td.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return D(this,function(n){switch(n.label){case 0:return[4,td.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(Q.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return th.apply(this,arguments)}j(tg,"getStoredErrorLists");function tv(){return ty.apply(this,arguments)}function ty(){ty=i(function(){var e,t,n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,td.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return td.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();Q.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return ty.apply(this,arguments)}j(tv,"clearAllErrorLists");function tS(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\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=s.exec(e)||[],f=i.exec(e)||[],E=o.exec(e)||[];var m,g,h,v,y,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===U.Error?U.Error:U.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:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===U.Error?U.Error:U.Warning,message:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):E.length?t.push({file:"commitlint",type:U.Error,message:(y=E===null||E===void 0?void 0:(l=E[1])===null||l===void 0?void 0:l.trim())!==null&&y!==void 0?y:"",rule:(S=E===null||E===void 0?void 0:(d=E[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tE(t),W&&n.length&&(Q.warn("Unmatched lines:"),n.forEach(function(e){return Q.info(" ".concat(e))}))}j(tS,"parseTextErrors");function tO(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,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?U.Error:U.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tE(n)}catch(t){tS(e)}}j(tO,"parseCommandOutput");function t_(e){return tR.apply(this,arguments)}function tR(){tR=i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return D(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tO;n=new AbortController;en.on("SIGINT",function(){Q.warn("Process interrupted. Terminating..."),n.abort(),en.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,tp(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&Q.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return tR.apply(this,arguments)}j(t_,"executeCommand");function tA(e){return{raw:!0,cmd:e}}j(tA,"rawCommand");function tC(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eB," ").concat(ev," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eB," ").concat(eW," ").concat(ew," ").concat(e):"".concat(eB," ").concat(ex," ").concat(e)}j(tC,"formatCLI");function tI(e,t){return typeof e=="function"?tC(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tC(e,t):e}j(tI,"formatCommand");function tT(e){return tb.apply(this,arguments)}function tb(){tb=i(function(e){var t,n,r,s,i,o,a;var c=arguments;return D(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e7(ev)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=C(e,2),n=t[0],r=t[1];return[n,tI(r,i)]}))]}})});return tb.apply(this,arguments)}j(tT,"resolveCommands");function tN(e,t){return tD.apply(this,arguments)}function tD(){tD=i(function(e,t){var n;return D(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);Q.start("".concat(e)),W&&Q.info("→ ".concat(t));return[4,t_(t)];case 1:r.sent(),Q.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw Q.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tD.apply(this,arguments)}j(tN,"runCommand");function tx(){return tw.apply(this,arguments)}function tw(){tw=i(function(){var e,t;return D(this,function(n){switch(n.label){case 0:if(!ea(e0.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e5.typescriptCheck()];case 1:return[4,tN.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=Q.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tw.apply(this,arguments)}j(tx,"checkTypescript");function tj(){return tP.apply(this,arguments)}function tP(){tP=i(function(){var e,t,n,r;var s=arguments;return D(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 1:return[4,tN.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e5.eslintCheck()];case 4:return[4,tN.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tP.apply(this,arguments)}j(tj,"checkEslint");function tL(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";Q.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}j(tL,"printIssues");function tM(){return tG.apply(this,arguments)}function tG(){tG=i(function(){var e,t,n;return D(this,function(r){switch(r.label){case 0:return[4,tg()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===U.Error}),n=e.filter(function(e){return e.type===U.Warning});!t.length&&!n.length?Q.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tL("Warnings",n),tL("Errors",t),(t.length>0||n.length>0)&&$.exit(1));return[2]}})});return tG.apply(this,arguments)}j(tM,"showCheckResult");function tk(){return tU.apply(this,arguments)}function tU(){tU=i(function(){var e,t,n,r,s,i;return D(this,function(o){switch(o.label){case 0:return[4,tv()];case 1:o.sent();return[4,e7(ev)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ev)];return[4,e5.build()];case 4:return[4,tN.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e5.stageBuildDirectory()];case 6:return[4,tN.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw Q.error("Error building and staging ".concat(ev,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e5.lintStaged()];case 10:return[4,tN.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tM();return[2]}})});return tU.apply(this,arguments)}j(tk,"lintStaged");function tF(){return tq.apply(this,arguments)}function tq(){tq=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e5.eslintInspect()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tq.apply(this,arguments)}j(tF,"inspectLint");function tK(){return tH.apply(this,arguments)}function tH(){tH=i(function(){return D(this,function(e){switch(e.label){case 0:return[4,tv()];case 1:e.sent();return[4,Promise.all([tx(),tj()])];case 2:e.sent(),tM();return[2]}})});return tH.apply(this,arguments)}j(tK,"lintCheck");function tW(){return tY.apply(this,arguments)}function tY(){tY=i(function(){return D(this,function(e){switch(e.label){case 0:return[4,tv()];case 1:e.sent();return[4,Promise.all([tx(),tj(!0)])];case 2:e.sent(),tM();return[2]}})});return tY.apply(this,arguments)}j(tW,"lintFix");function tV(){return tB.apply(this,arguments)}function tB(){tB=i(function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,tv()];case 1:t.sent();e=["Validating commit message"];return[4,e5.commitLint()];case 2:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tM();return[2]}})});return tB.apply(this,arguments)}j(tV,"commitLint");function tQ(){return tJ.apply(this,arguments)}function tJ(){tJ=i(function(){var e,t,n,r;return D(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e5.configureGitHook()];case 1:return[4,tN.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ed(e0.GIT_HOOK);return[4,tT(e1)];case 3:t=s.sent();eu(e0.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(eI,"\n");ea(e0.GIT_IGNORE)?ec(e0.GIT_IGNORE).split("\n").includes(eI)||el(e0.GIT_IGNORE,n):eu(e0.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e5.simpleGitHooks()];case 4:return[4,tN.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tJ.apply(this,arguments)}j(tQ,"setupGitHook");function t$(){return tX.apply(this,arguments)}function tX(){tX=i(function(){return D(this,function(e){switch(e.label){case 0:return[4,tr([ev],{update:!0,postInstallActions:[tQ]})];case 1:e.sent();return[2]}})});return tX.apply(this,arguments)}j(t$,"setup");function tz(){return tZ.apply(this,arguments)}function tZ(){tZ=i(function(){return D(this,function(e){switch(e.label){case 0:ed(e0.NODE_MODULES,e0.PNPM_LOCK_YAML);return[4,tt()];case 1:e.sent();return[4,tQ()];case 2:e.sent();return[2]}})});return tZ.apply(this,arguments)}j(tz,"reset");function t0(){return t1.apply(this,arguments)}function t1(){t1=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e5.nodeModulesInspect()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t1.apply(this,arguments)}j(t0,"inspect");function t2(){return t4.apply(this,arguments)}function t4(){t4=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e5.testUnit()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t4.apply(this,arguments)}j(t2,"testUnit");function t3(){return t5.apply(this,arguments)}function t5(){t5=i(function(){var e;return D(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e5.testE2e()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t5.apply(this,arguments)}j(t3,"testE2E");i(function(){var e;return D(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,z(X($.argv)).scriptName(ex).usage("$0 <command> [options]").command("lint","Check code for linting issues",tK).command("lint:fix","Fix linting issues automatically",tW).command("lint:inspect","View active ESLint configuration",tF).command("lint-staged","Run lint checks on staged files",tk).command("commitlint","Validate commit message format",tV).command("setup","Initialize project setup and dependencies",t$).command("reset","Reset the project and reinstall dependencies",tz).command("inspect","Analyze installed project dependencies",t0).command("test:unit","Run unit test suite",t2).command("test:e2e","Run end-to-end test suite",t3).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(Z.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.error("Fatal: ".concat(e.message)),$.exit(1);return[3,3];case 3:return[2]}})})();import t8 from"compression";import t6 from"cors";import t9 from"express";import t7 from"express-device";import ne from"express-session";function nt(e){return t6({origin:j(function(t,n){var r;e.isDev||((r=e.corsWhitelist)===null||r===void 0?void 0:r.includes(t!==null&&t!==void 0?t:""))?n(null,!0):n(null,!1)},"origin"),credentials:!0})}j(nt,"createCors");function nn(e){var t=t9();return t.set("trust proxy",1),t.use(t9.urlencoded({extended:!0})),t.use(t8()),t.use(t7.capture()),e.staticFolder&&t.use(t9.static(e.staticFolder)),e.sessionOptions&&t.use(ne(e.sessionOptions)),t}j(nn,"createExpress");import{format as nr}from"date-fns";import{Document as ns}from"mongoose";import ni from"mongoose-aggregate-paginate-v2";import no from"mongoose-paginate-v2";import{v4 as na}from"uuid";import nc from"crypto-js";import nu from"slugify";var nl=nu.default||nu;function nd(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var n=t||{},r=n.lower,s=r===void 0?!0:r,i=n.locale,o=i===void 0?"vi":i,a=O(n,["lower","locale"]);return nl(e,v({lower:s,locale:o},a))}j(nd,"generateSlug");function np(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nc.SHA256(e).toString(nc.enc.Hex).slice(0,t)}j(np,"generateShortId");var nf={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":T(e))=="object"?f(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var nE={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nr(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?nE.getDateTime():new Date;return{id:na(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:na,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n,{strict:!0});return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(nE.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var p=nE.createSchema({mongoose:t,schema:r,virtuals:u});return nE.applyPlugins(p,[i&&no,a&&ni]),nE.applyMiddlewares(p,d),t.model(n,p)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return S(v({},t,n&&{id:{$ne:n}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=i(function(e){return D(this,function(t){return[2,!nf.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=i(function(t){var n;return D(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(n)];case 1:return[2,!r.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=i(function(t){return D(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!f(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})});return function(e){return t.apply(this,arguments)}}()}}},nm=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);P(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){var t=this;return i(function(){var n,r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n=v({},nE.createGenericFields(),e);r={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(n)];case 1:return[2,(r.result=i.sent(),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return i(function(){var n,r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n=e.map(function(e){return v({},nE.createGenericFields(),e)});return[4,t.collection.insertMany(n)];case 1:r=i.sent();return[2,r.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(r.insertedCount," documents created successfully"),result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:n=s.sent();return[2,n?{success:!0,message:"Document found",result:n}:{success:!1,message:"Document not found"}];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.collection.updateOne(e,{$set:t})];case 1:r=i.sent();return[2,r.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.collection.updateMany(e,{$set:t})];case 1:r=i.sent();return[2,r.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:n=s.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:n}];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:n=s.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:n}];case 2:r=s.sent();return[2,{success:!1,message:r.message}];case 3:return[2]}})})()}}]);return e}();j(nm,"MongoController");var ng=nm,nh=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);P(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;var s=this;return i(function(){var i,o,a;return D(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);i=s.model.findOne(e,t,n);r&&i.populate(r);return[4,i.exec()];case 1:o=c.sent();return[2,o?{success:!0,result:o}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:Y.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;var s=this;return i(function(){var i,o,a;return D(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);i=s.model.find(e,t,n);r&&i.populate(r);o={success:!0};return[4,i.exec()];case 1:return[2,(o.result=c.sent(),o)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r={success:!0};return[4,n.model.paginate(e,t)];case 1:return[2,(r.result=i.sent(),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r={success:!0};return[4,n.model.aggregatePaginate(n.model.aggregate(e),t)];case 1:return[2,(r.result=i.sent(),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0};return[4,t.model.create(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r={success:!0};return[4,n.model.insertMany(e,t)];case 1:return[2,(r.result=i.sent().map(function(e){return f(e,ns)?e.toObject():null}).filter(function(e){return e!==null}),r)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=this;return i(function(){var s,i;return D(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.findOneAndUpdate(e,t,v({new:!0},n)).exec()];case 1:s=o.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(r.getModelName(),"."),code:Y.NOT_FOUND.CODE}];case 2:i=o.sent();return[2,{success:!1,message:i.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=this;return i(function(){var s,i;return D(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);s={success:!0};return[4,r.model.updateMany(e,t,n).exec()];case 1:return[2,(s.result=o.sent(),s)];case 2:i=o.sent();return[2,{success:!1,message:i.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.findOneAndDelete(e,t).exec()];case 1:r=i.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"No ".concat(n.getModelName()," found to delete."),code:Y.NOT_FOUND.CODE}];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=this;return i(function(){var r,s;return D(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.deleteMany(e,t).exec()];case 1:r=i.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents found to delete.",code:Y.NOT_FOUND.CODE}:{success:!0,result:r}];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var n=this;return i(function(){var r,s,i,o;return D(this,function(a){switch(a.label){case 0:r=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];i=np(e,s+t);o=!r.has(i);if(!o)return[3,3];r.add(i);return[4,n.model.exists({shortId:i})];case 2:o=!a.sent();a.label=3;case 3:if(o)return[2,{success:!0,result:i}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:Y.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=this;return i(function(){var s,o,a,c,u,l,d,p,f,E,m;return D(this,function(g){switch(g.label){case 0:g.trys.push([0,8,,9]);s=t[e],o=j(/*#__PURE__*/function(){var e=i(function(e){var s,i,o;return D(this,function(a){switch(a.label){case 0:return[4,r.model.findOne(nE.createSlugQuery(e,n,t.id))];case 1:s=a.sent();if(!s)return[2,e];i=1;a.label=2;case 2:o="".concat(e,"-").concat(i);return[4,r.model.findOne(nE.createSlugQuery(o,n,t.id))];case 3:s=a.sent(),i++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,o]}})});return function(t){return e.apply(this,arguments)}}(),"createUniqueSlug");if(!((typeof s==="undefined"?"undefined":T(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;g.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];p=nd(s[d]);return[4,o(p)];case 2:a[d]=g.sent();g.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:f=nd(s);E={success:!0};return[4,o(f)];case 6:return[2,(E.result=g.sent(),E)];case 7:return[3,9];case 8:m=g.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(m.message),code:Y.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return i(function(){var n,r;return D(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,{success:!1,message:r.message,code:Y.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();j(nh,"MongooseController");var nv=nh;import{Collection as ny,Db as nS}from"mongodb";import{Document as nO,Model as n_}from"mongoose";var nR=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nS);j(nR,"C_Db");var nA=nR,nC=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nO);j(nC,"C_Document");var nI=nC,nT=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(n_);j(nT,"C_Model");var nb=nT,nN=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(ny);j(nN,"C_Collection");var nD=nN;import{useServer as nx}from"graphql-ws/use/ws";import{WebSocketServer as nw}from"ws";function nj(e){return new nw({server:e.server,path:e.path})}j(nj,"createWSServer");function nP(e){return nx({schema:e.schema},e.server)}j(nP,"initGraphQLWS");export{eO as BUILD_DIRECTORY,es as CHECK_PACKAGE_EMPTY_RESULT,eU as COMMIT_LINT_CLI,ek as COMMIT_LINT_PACKAGE_NAME,ex as CYBERSKILL_CLI,ew as CYBERSKILL_CLI_PATH,eD as CYBERSKILL_DIRECTORY,ev as CYBERSKILL_PACKAGE_NAME,ey as CYBERSKILL_STORAGE,nD as C_Collection,nA as C_Db,nI as C_Document,nb as C_Model,eP as ESLINT_CLI,eX as ESLINT_INSPECT_CLI,e$ as ESLINT_INSPECT_PACKAGE_NAME,ej as ESLINT_PACKAGE_NAME,ee as E_CommandType,U as E_IssueType,eY as GIT_CLI,eN as GIT_COMMIT_EDITMSG,eb as GIT_HOOK,eC as GIT_IGNORE,e1 as HOOK,eq as LINT_STAGED_CLI,eF as LINT_STAGED_PACKAGE_NAME,ng as MongoController,nv as MongooseController,eS as NODE_MODULES,eZ as NODE_MODULES_INSPECT_CLI,ez as NODE_MODULES_INSPECT_PACKAGE_NAME,e_ as PACKAGE_JSON,eR as PACKAGE_LOCK_JSON,e0 as PATH,eM as PLAYWRIGHT_PACKAGE_NAME,eV as PNPM_CLI,eB as PNPM_EXEC_CLI,eT as PNPM_LOCK_YAML,eQ as SIMPLE_GIT_HOOKS_PACKAGE_NAME,eJ as SIMPLE_GIT_HOOK_CLI,eI as SIMPLE_GIT_HOOK_JSON,eA as TSCONFIG_JSON,eH as TSC_CLI,eK as TSC_PACKAGE_NAME,eW as TSX_CLI,eG as VITEST_CLI,eL as VITEST_PACKAGE_NAME,eh as WORKING_DIRECTORY,ni as aggregatePaginate,el as appendFileSync,e7 as checkPackage,tv as clearAllErrorLists,e5 as command,J as createApolloServer,nt as createCors,nn as createExpress,nj as createWSServer,ea as existsSync,tI as formatCommand,e6 as getLatestPackageVersion,e8 as getPackage,tg as getStoredErrorLists,nP as initGraphQLWS,tt as installDependencies,eg as join,Q as logNodeJS,nE as mongo,no as mongoosePaginate,tA as rawCommand,ec as readFileSync,em as resolve,tT as resolveCommands,eE as resolveWorkingPath,ed as rmSync,tN as runCommand,tr as setupPackages,td as storageNodeJS,V as throwError,eu as writeFileSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var a=function(e,t){return r(e,"name",{value:t,configurable:!0})};var o=function(e,t){for(var n in t)r(e,n,{get:t[n],enumerable:!0})},i=function(a,o,i,c){var f=true,v=false,l=undefined;if(o&&(typeof o==="undefined"?"undefined":e(o))=="object"||typeof o=="function")try{var s=function(){var e=y.value;!u.call(a,e)&&e!==i&&r(a,e,{get:function(){return o[e]},enumerable:!(c=t(o,e))||c.enumerable})};for(var p=n(o)[Symbol.iterator](),y;!(f=(y=p.next()).done);f=true)s()}catch(e){v=true;l=e}finally{try{if(!f&&p.return!=null){p.return()}}finally{if(v){throw l}}}return a};var c=function(e){return i(r({},"__esModule",{value:!0}),e)};var f={};o(f,{createWSServer:function(){return s},initGraphQLWS:function(){return p}});module.exports=c(f);var v=require("graphql-ws/use/ws"),l=require("ws");function s(e){return new l.WebSocketServer({server:e.server,path:e.path})}a(s,"createWSServer");function p(e){return(0,v.useServer)({schema:e.schema},e.server)}a(p,"initGraphQLWS");0&&(module.exports={createWSServer:createWSServer,initGraphQLWS:initGraphQLWS});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createWSServer_alias_2 as createWSServer } from '../../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { initGraphQLWS_alias_2 as initGraphQLWS } from '../../_tsup-dts-rollup.cjs';
|
|
3
|
+
export { I_WSOptions_alias_2 as I_WSOptions } from '../../_tsup-dts-rollup.cjs';
|
|
4
|
+
export { I_GraphqlWSOptions_alias_2 as I_GraphqlWSOptions } from '../../_tsup-dts-rollup.cjs';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createWSServer_alias_2 as createWSServer } from '../../_tsup-dts-rollup.js';
|
|
2
|
+
export { initGraphQLWS_alias_2 as initGraphQLWS } from '../../_tsup-dts-rollup.js';
|
|
3
|
+
export { I_WSOptions_alias_2 as I_WSOptions } from '../../_tsup-dts-rollup.js';
|
|
4
|
+
export { I_GraphqlWSOptions_alias_2 as I_GraphqlWSOptions } from '../../_tsup-dts-rollup.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var r=function(r,a){return e(r,"name",{value:a,configurable:!0})};import{useServer as a}from"graphql-ws/use/ws";import{WebSocketServer as t}from"ws";function n(e){return new t({server:e.server,path:e.path})}r(n,"createWSServer");function s(e){return a({schema:e.schema},e.server)}r(s,"initGraphQLWS");export{n as createWSServer,s as initGraphQLWS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var a=function(e,t){return r(e,"name",{value:t,configurable:!0})};var o=function(e,t){for(var n in t)r(e,n,{get:t[n],enumerable:!0})},i=function(a,o,i,c){var f=true,v=false,l=undefined;if(o&&(typeof o==="undefined"?"undefined":e(o))=="object"||typeof o=="function")try{var s=function(){var e=y.value;!u.call(a,e)&&e!==i&&r(a,e,{get:function(){return o[e]},enumerable:!(c=t(o,e))||c.enumerable})};for(var p=n(o)[Symbol.iterator](),y;!(f=(y=p.next()).done);f=true)s()}catch(e){v=true;l=e}finally{try{if(!f&&p.return!=null){p.return()}}finally{if(v){throw l}}}return a};var c=function(e){return i(r({},"__esModule",{value:!0}),e)};var f={};o(f,{createWSServer:function(){return s},initGraphQLWS:function(){return p}});module.exports=c(f);var v=require("graphql-ws/use/ws"),l=require("ws");function s(e){return new l.WebSocketServer({server:e.server,path:e.path})}a(s,"createWSServer");function p(e){return(0,v.useServer)({schema:e.schema},e.server)}a(p,"initGraphQLWS");0&&(module.exports={createWSServer:createWSServer,initGraphQLWS:initGraphQLWS});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var r=function(r,a){return e(r,"name",{value:a,configurable:!0})};import{useServer as a}from"graphql-ws/use/ws";import{WebSocketServer as t}from"ws";function n(e){return new t({server:e.server,path:e.path})}r(n,"createWSServer");function s(e){return a({schema:e.schema},e.server)}r(s,"initGraphQLWS");export{n as createWSServer,s as initGraphQLWS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(u,a,f,l){var c=true,i=false,y=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var p=function(){var e=d.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(l=t(a,e))||l.enumerable})};for(var v=n(a)[Symbol.iterator](),d;!(c=(d=v.next()).done);c=true)p()}catch(e){i=true;y=e}finally{try{if(!c&&v.return!=null){v.return()}}finally{if(i){throw y}}}return u};var a=function(e){return u(r({},"__esModule",{value:!0}),e)};var f={};module.exports=a(f);
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberskill/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.94.0",
|
|
5
5
|
"description": "CyberSkill Shared",
|
|
6
6
|
"author": "Stephen Cheng",
|
|
7
7
|
"license": "MIT",
|
|
@@ -54,6 +54,11 @@
|
|
|
54
54
|
"import": "./dist/nodejs/index.js",
|
|
55
55
|
"require": "./dist/nodejs/index.cjs"
|
|
56
56
|
},
|
|
57
|
+
"./nodejs/apollo-server": {
|
|
58
|
+
"types": "./dist/nodejs/apollo-server/index.d.ts",
|
|
59
|
+
"import": "./dist/nodejs/apollo-server/index.js",
|
|
60
|
+
"require": "./dist/nodejs/apollo-server/index.cjs"
|
|
61
|
+
},
|
|
57
62
|
"./nodejs/cli": {
|
|
58
63
|
"types": "./dist/nodejs/cli/index.d.ts",
|
|
59
64
|
"import": "./dist/nodejs/cli/index.js",
|
|
@@ -64,6 +69,11 @@
|
|
|
64
69
|
"import": "./dist/nodejs/command/index.js",
|
|
65
70
|
"require": "./dist/nodejs/command/index.cjs"
|
|
66
71
|
},
|
|
72
|
+
"./nodejs/express": {
|
|
73
|
+
"types": "./dist/nodejs/express/index.d.ts",
|
|
74
|
+
"import": "./dist/nodejs/express/index.js",
|
|
75
|
+
"require": "./dist/nodejs/express/index.cjs"
|
|
76
|
+
},
|
|
67
77
|
"./nodejs/fs": {
|
|
68
78
|
"types": "./dist/nodejs/fs/index.d.ts",
|
|
69
79
|
"import": "./dist/nodejs/fs/index.js",
|
|
@@ -94,6 +104,11 @@
|
|
|
94
104
|
"import": "./dist/nodejs/storage/index.js",
|
|
95
105
|
"require": "./dist/nodejs/storage/index.cjs"
|
|
96
106
|
},
|
|
107
|
+
"./nodejs/ws": {
|
|
108
|
+
"types": "./dist/nodejs/ws/index.d.ts",
|
|
109
|
+
"import": "./dist/nodejs/ws/index.js",
|
|
110
|
+
"require": "./dist/nodejs/ws/index.cjs"
|
|
111
|
+
},
|
|
97
112
|
"./react": {
|
|
98
113
|
"types": "./dist/react/index.d.ts",
|
|
99
114
|
"import": "./dist/react/index.js",
|
|
@@ -185,13 +200,14 @@
|
|
|
185
200
|
},
|
|
186
201
|
"dependencies": {
|
|
187
202
|
"@antfu/eslint-config": "4.12.0",
|
|
188
|
-
"@apollo/client": "3.13.
|
|
203
|
+
"@apollo/client": "3.13.8",
|
|
204
|
+
"@apollo/server": "4.12.0",
|
|
189
205
|
"@eddeee888/gcg-typescript-resolver-files": "0.12.0",
|
|
190
|
-
"@eslint-react/eslint-plugin": "1.48.
|
|
206
|
+
"@eslint-react/eslint-plugin": "1.48.3",
|
|
191
207
|
"@graphql-codegen/cli": "5.0.5",
|
|
192
208
|
"@graphql-codegen/client-preset": "4.8.0",
|
|
193
|
-
"@microsoft/api-extractor": "7.52.
|
|
194
|
-
"@next/eslint-plugin-next": "15.3.
|
|
209
|
+
"@microsoft/api-extractor": "7.52.4",
|
|
210
|
+
"@next/eslint-plugin-next": "15.3.1",
|
|
195
211
|
"@swc/core": "1.11.21",
|
|
196
212
|
"@testing-library/jest-dom": "6.6.3",
|
|
197
213
|
"@testing-library/react": "16.3.0",
|
|
@@ -199,14 +215,19 @@
|
|
|
199
215
|
"@vitest/browser": "3.1.1",
|
|
200
216
|
"chalk": "5.4.1",
|
|
201
217
|
"classnames": "2.5.1",
|
|
218
|
+
"compression": "1.8.0",
|
|
202
219
|
"consola": "3.4.2",
|
|
220
|
+
"cors": "2.8.5",
|
|
203
221
|
"crypto-js": "4.2.0",
|
|
204
222
|
"date-fns": "4.1.0",
|
|
205
223
|
"dotenv-cli": "8.0.0",
|
|
206
|
-
"eslint-config-next": "15.3.
|
|
224
|
+
"eslint-config-next": "15.3.1",
|
|
207
225
|
"eslint-plugin-format": "1.0.1",
|
|
208
226
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
209
227
|
"eslint-plugin-react-refresh": "0.4.19",
|
|
228
|
+
"express": "4.21.2",
|
|
229
|
+
"express-device": "0.4.2",
|
|
230
|
+
"express-session": "1.18.1",
|
|
210
231
|
"globals": "16.0.0",
|
|
211
232
|
"graphql": "16.10.0",
|
|
212
233
|
"graphql-ws": "6.0.4",
|
|
@@ -222,7 +243,7 @@
|
|
|
222
243
|
"node-fetch": "3.3.2",
|
|
223
244
|
"node-persist": "4.0.4",
|
|
224
245
|
"ora": "8.2.0",
|
|
225
|
-
"playwright": "1.
|
|
246
|
+
"playwright": "1.52.0",
|
|
226
247
|
"postcss-modules": "6.0.1",
|
|
227
248
|
"qs": "6.14.0",
|
|
228
249
|
"react": "19.1.0",
|
|
@@ -237,9 +258,10 @@
|
|
|
237
258
|
"typescript": "5.8.3",
|
|
238
259
|
"unorm": "1.6.0",
|
|
239
260
|
"uuid": "11.1.0",
|
|
240
|
-
"vite": "6.3.
|
|
261
|
+
"vite": "6.3.2",
|
|
241
262
|
"vitest": "3.1.1",
|
|
242
263
|
"vitest-browser-react": "0.1.1",
|
|
264
|
+
"ws": "8.18.1",
|
|
243
265
|
"yargs": "17.7.2"
|
|
244
266
|
},
|
|
245
267
|
"publishConfig": {
|
|
@@ -249,13 +271,18 @@
|
|
|
249
271
|
"devDependencies": {
|
|
250
272
|
"@commitlint/cli": "19.8.0",
|
|
251
273
|
"@eslint/config-inspector": "1.0.2",
|
|
274
|
+
"@types/compression": "1.7.5",
|
|
275
|
+
"@types/cors": "2.8.17",
|
|
252
276
|
"@types/crypto-js": "4.2.2",
|
|
277
|
+
"@types/express": "4.17.21",
|
|
278
|
+
"@types/express-session": "1.18.1",
|
|
253
279
|
"@types/mongoose-aggregate-paginate-v2": "1.0.12",
|
|
254
280
|
"@types/node-persist": "3.1.8",
|
|
255
281
|
"@types/react": "19.1.2",
|
|
256
282
|
"@types/react-dom": "19.1.2",
|
|
257
283
|
"@types/unorm": "1.3.31",
|
|
258
284
|
"@types/uuid": "10.0.0",
|
|
285
|
+
"@types/ws": "8.18.1",
|
|
259
286
|
"@types/yargs": "17.0.33",
|
|
260
287
|
"eslint": "9.24.0",
|
|
261
288
|
"lint-staged": "15.5.1",
|