@cyberskill/shared 1.127.0 → 1.129.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.
Files changed (201) hide show
  1. package/README.md +2 -2
  2. package/dist/_tsup-dts-rollup.d.cts +57 -44
  3. package/dist/_tsup-dts-rollup.d.ts +57 -44
  4. package/dist/configs/commitlint/index.cjs +1 -1
  5. package/dist/configs/commitlint/index.js +1 -1
  6. package/dist/configs/config.util.cjs +1 -1
  7. package/dist/configs/config.util.js +1 -1
  8. package/dist/configs/index.cjs +1 -1
  9. package/dist/configs/index.js +1 -1
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.d.cts +6 -5
  12. package/dist/index.d.ts +6 -5
  13. package/dist/index.js +1 -1
  14. package/dist/{nodejs → node}/apollo-server/apollo-server.util.cjs +1 -1
  15. package/dist/{nodejs → node}/apollo-server/apollo-server.util.js +1 -1
  16. package/dist/{nodejs → node}/apollo-server/index.cjs +1 -1
  17. package/dist/{nodejs → node}/apollo-server/index.js +1 -1
  18. package/dist/node/cli/cli.util.cjs +2 -0
  19. package/dist/node/cli/cli.util.js +2 -0
  20. package/dist/node/cli/index.cjs +1 -0
  21. package/dist/node/cli/index.js +1 -0
  22. package/dist/node/command/command.util.cjs +1 -0
  23. package/dist/node/command/command.util.js +1 -0
  24. package/dist/node/command/index.cjs +1 -0
  25. package/dist/node/command/index.js +1 -0
  26. package/dist/{nodejs → node}/express/express.util.cjs +1 -1
  27. package/dist/{nodejs → node}/express/express.util.js +1 -1
  28. package/dist/{nodejs → node}/express/index.cjs +1 -1
  29. package/dist/{nodejs → node}/express/index.js +1 -1
  30. package/dist/node/fs/fs.util.cjs +1 -0
  31. package/dist/node/fs/fs.util.js +1 -0
  32. package/dist/node/fs/index.cjs +1 -0
  33. package/dist/node/fs/index.js +1 -0
  34. package/dist/node/index.cjs +1 -0
  35. package/dist/{nodejs → node}/index.d.cts +6 -5
  36. package/dist/{nodejs → node}/index.d.ts +6 -5
  37. package/dist/node/index.js +1 -0
  38. package/dist/node/mongo/index.cjs +1 -0
  39. package/dist/node/mongo/index.js +1 -0
  40. package/dist/node/mongo/mongo.util.cjs +1 -0
  41. package/dist/node/mongo/mongo.util.js +1 -0
  42. package/dist/node/package/index.cjs +1 -0
  43. package/dist/{nodejs → node}/package/index.d.cts +5 -5
  44. package/dist/{nodejs → node}/package/index.d.ts +5 -5
  45. package/dist/node/package/index.js +1 -0
  46. package/dist/node/package/package.type.cjs +1 -0
  47. package/dist/node/package/package.type.d.cts +4 -0
  48. package/dist/node/package/package.type.d.ts +4 -0
  49. package/dist/node/package/package.type.js +1 -0
  50. package/dist/node/package/package.util.cjs +1 -0
  51. package/dist/{nodejs → node}/package/package.util.d.cts +2 -2
  52. package/dist/{nodejs → node}/package/package.util.d.ts +2 -2
  53. package/dist/node/package/package.util.js +1 -0
  54. package/dist/node/path/index.cjs +1 -0
  55. package/dist/{nodejs → node}/path/index.d.cts +1 -0
  56. package/dist/{nodejs → node}/path/index.d.ts +1 -0
  57. package/dist/node/path/index.js +1 -0
  58. package/dist/node/path/path.constant.cjs +1 -0
  59. package/dist/{nodejs → node}/path/path.constant.d.cts +1 -0
  60. package/dist/{nodejs → node}/path/path.constant.d.ts +1 -0
  61. package/dist/node/path/path.constant.js +1 -0
  62. package/dist/node/storage/index.cjs +1 -0
  63. package/dist/node/storage/index.js +1 -0
  64. package/dist/node/storage/storage.util.cjs +1 -0
  65. package/dist/node/storage/storage.util.js +1 -0
  66. package/dist/react/index.cjs +1 -1
  67. package/dist/react/index.js +1 -1
  68. package/dist/react/next-intl/index.cjs +1 -1
  69. package/dist/react/next-intl/index.js +1 -1
  70. package/dist/react/next-intl/next-intl.provider.cjs +1 -1
  71. package/dist/react/next-intl/next-intl.provider.js +1 -1
  72. package/dist/react/storage/index.cjs +1 -1
  73. package/dist/react/storage/index.js +1 -1
  74. package/dist/react/storage/storage.hook.cjs +1 -1
  75. package/dist/react/storage/storage.hook.js +1 -1
  76. package/dist/react/storage/storage.util.cjs +1 -1
  77. package/dist/react/storage/storage.util.js +1 -1
  78. package/dist/react/vitest/index.cjs +1 -1
  79. package/dist/react/vitest/index.js +1 -1
  80. package/dist/react/vitest/vitest.unit.cjs +1 -1
  81. package/dist/react/vitest/vitest.unit.js +1 -1
  82. package/package.json +75 -74
  83. package/public/wiki/convention.md +1 -1
  84. package/dist/nodejs/cli/cli.util.cjs +0 -2
  85. package/dist/nodejs/cli/cli.util.js +0 -2
  86. package/dist/nodejs/cli/index.cjs +0 -1
  87. package/dist/nodejs/cli/index.js +0 -1
  88. package/dist/nodejs/command/command.util.cjs +0 -1
  89. package/dist/nodejs/command/command.util.js +0 -1
  90. package/dist/nodejs/command/index.cjs +0 -1
  91. package/dist/nodejs/command/index.js +0 -1
  92. package/dist/nodejs/fs/fs.util.cjs +0 -1
  93. package/dist/nodejs/fs/fs.util.js +0 -1
  94. package/dist/nodejs/fs/index.cjs +0 -1
  95. package/dist/nodejs/fs/index.js +0 -1
  96. package/dist/nodejs/index.cjs +0 -1
  97. package/dist/nodejs/index.js +0 -1
  98. package/dist/nodejs/mongo/index.cjs +0 -1
  99. package/dist/nodejs/mongo/index.js +0 -1
  100. package/dist/nodejs/mongo/mongo.util.cjs +0 -1
  101. package/dist/nodejs/mongo/mongo.util.js +0 -1
  102. package/dist/nodejs/package/index.cjs +0 -1
  103. package/dist/nodejs/package/index.js +0 -1
  104. package/dist/nodejs/package/package.constant.cjs +0 -1
  105. package/dist/nodejs/package/package.constant.d.cts +0 -1
  106. package/dist/nodejs/package/package.constant.d.ts +0 -1
  107. package/dist/nodejs/package/package.constant.js +0 -1
  108. package/dist/nodejs/package/package.type.cjs +0 -1
  109. package/dist/nodejs/package/package.type.d.cts +0 -3
  110. package/dist/nodejs/package/package.type.d.ts +0 -3
  111. package/dist/nodejs/package/package.type.js +0 -0
  112. package/dist/nodejs/package/package.util.cjs +0 -1
  113. package/dist/nodejs/package/package.util.js +0 -1
  114. package/dist/nodejs/path/index.cjs +0 -1
  115. package/dist/nodejs/path/index.js +0 -1
  116. package/dist/nodejs/path/path.constant.cjs +0 -1
  117. package/dist/nodejs/path/path.constant.js +0 -1
  118. package/dist/nodejs/storage/index.cjs +0 -1
  119. package/dist/nodejs/storage/index.js +0 -1
  120. package/dist/nodejs/storage/storage.util.cjs +0 -1
  121. package/dist/nodejs/storage/storage.util.js +0 -1
  122. /package/dist/{nodejs → node}/apollo-server/apollo-server.type.cjs +0 -0
  123. /package/dist/{nodejs → node}/apollo-server/apollo-server.type.d.cts +0 -0
  124. /package/dist/{nodejs → node}/apollo-server/apollo-server.type.d.ts +0 -0
  125. /package/dist/{nodejs → node}/apollo-server/apollo-server.type.js +0 -0
  126. /package/dist/{nodejs → node}/apollo-server/apollo-server.util.d.cts +0 -0
  127. /package/dist/{nodejs → node}/apollo-server/apollo-server.util.d.ts +0 -0
  128. /package/dist/{nodejs → node}/apollo-server/index.d.cts +0 -0
  129. /package/dist/{nodejs → node}/apollo-server/index.d.ts +0 -0
  130. /package/dist/{nodejs → node}/cli/cli.util.d.cts +0 -0
  131. /package/dist/{nodejs → node}/cli/cli.util.d.ts +0 -0
  132. /package/dist/{nodejs → node}/cli/index.d.cts +0 -0
  133. /package/dist/{nodejs → node}/cli/index.d.ts +0 -0
  134. /package/dist/{nodejs → node}/command/command.type.cjs +0 -0
  135. /package/dist/{nodejs → node}/command/command.type.d.cts +0 -0
  136. /package/dist/{nodejs → node}/command/command.type.d.ts +0 -0
  137. /package/dist/{nodejs → node}/command/command.type.js +0 -0
  138. /package/dist/{nodejs → node}/command/command.util.d.cts +0 -0
  139. /package/dist/{nodejs → node}/command/command.util.d.ts +0 -0
  140. /package/dist/{nodejs → node}/command/index.d.cts +0 -0
  141. /package/dist/{nodejs → node}/command/index.d.ts +0 -0
  142. /package/dist/{nodejs → node}/express/express.type.cjs +0 -0
  143. /package/dist/{nodejs → node}/express/express.type.d.cts +0 -0
  144. /package/dist/{nodejs → node}/express/express.type.d.ts +0 -0
  145. /package/dist/{nodejs → node}/express/express.type.js +0 -0
  146. /package/dist/{nodejs → node}/express/express.util.d.cts +0 -0
  147. /package/dist/{nodejs → node}/express/express.util.d.ts +0 -0
  148. /package/dist/{nodejs → node}/express/index.d.cts +0 -0
  149. /package/dist/{nodejs → node}/express/index.d.ts +0 -0
  150. /package/dist/{nodejs → node}/fs/fs.type.cjs +0 -0
  151. /package/dist/{nodejs → node}/fs/fs.type.d.cts +0 -0
  152. /package/dist/{nodejs → node}/fs/fs.type.d.ts +0 -0
  153. /package/dist/{nodejs → node}/fs/fs.type.js +0 -0
  154. /package/dist/{nodejs → node}/fs/fs.util.d.cts +0 -0
  155. /package/dist/{nodejs → node}/fs/fs.util.d.ts +0 -0
  156. /package/dist/{nodejs → node}/fs/index.d.cts +0 -0
  157. /package/dist/{nodejs → node}/fs/index.d.ts +0 -0
  158. /package/dist/{nodejs → node}/log/index.cjs +0 -0
  159. /package/dist/{nodejs → node}/log/index.d.cts +0 -0
  160. /package/dist/{nodejs → node}/log/index.d.ts +0 -0
  161. /package/dist/{nodejs → node}/log/index.js +0 -0
  162. /package/dist/{nodejs → node}/log/log.type.cjs +0 -0
  163. /package/dist/{nodejs → node}/log/log.type.d.cts +0 -0
  164. /package/dist/{nodejs → node}/log/log.type.d.ts +0 -0
  165. /package/dist/{nodejs → node}/log/log.type.js +0 -0
  166. /package/dist/{nodejs → node}/log/log.util.cjs +0 -0
  167. /package/dist/{nodejs → node}/log/log.util.d.cts +0 -0
  168. /package/dist/{nodejs → node}/log/log.util.d.ts +0 -0
  169. /package/dist/{nodejs → node}/log/log.util.js +0 -0
  170. /package/dist/{nodejs → node}/mongo/index.d.cts +0 -0
  171. /package/dist/{nodejs → node}/mongo/index.d.ts +0 -0
  172. /package/dist/{nodejs → node}/mongo/mongo.constant.cjs +0 -0
  173. /package/dist/{nodejs → node}/mongo/mongo.constant.d.cts +0 -0
  174. /package/dist/{nodejs → node}/mongo/mongo.constant.d.ts +0 -0
  175. /package/dist/{nodejs → node}/mongo/mongo.constant.js +0 -0
  176. /package/dist/{nodejs → node}/mongo/mongo.type.cjs +0 -0
  177. /package/dist/{nodejs → node}/mongo/mongo.type.d.cts +0 -0
  178. /package/dist/{nodejs → node}/mongo/mongo.type.d.ts +0 -0
  179. /package/dist/{nodejs → node}/mongo/mongo.type.js +0 -0
  180. /package/dist/{nodejs → node}/mongo/mongo.util.d.cts +0 -0
  181. /package/dist/{nodejs → node}/mongo/mongo.util.d.ts +0 -0
  182. /package/dist/{nodejs → node}/path/path.util.cjs +0 -0
  183. /package/dist/{nodejs → node}/path/path.util.d.cts +0 -0
  184. /package/dist/{nodejs → node}/path/path.util.d.ts +0 -0
  185. /package/dist/{nodejs → node}/path/path.util.js +0 -0
  186. /package/dist/{nodejs → node}/storage/index.d.cts +0 -0
  187. /package/dist/{nodejs → node}/storage/index.d.ts +0 -0
  188. /package/dist/{nodejs → node}/storage/storage.util.d.cts +0 -0
  189. /package/dist/{nodejs → node}/storage/storage.util.d.ts +0 -0
  190. /package/dist/{nodejs → node}/ws/index.cjs +0 -0
  191. /package/dist/{nodejs → node}/ws/index.d.cts +0 -0
  192. /package/dist/{nodejs → node}/ws/index.d.ts +0 -0
  193. /package/dist/{nodejs → node}/ws/index.js +0 -0
  194. /package/dist/{nodejs → node}/ws/ts.util.cjs +0 -0
  195. /package/dist/{nodejs → node}/ws/ts.util.d.cts +0 -0
  196. /package/dist/{nodejs → node}/ws/ts.util.d.ts +0 -0
  197. /package/dist/{nodejs → node}/ws/ts.util.js +0 -0
  198. /package/dist/{nodejs → node}/ws/ws.type.cjs +0 -0
  199. /package/dist/{nodejs → node}/ws/ws.type.d.cts +0 -0
  200. /package/dist/{nodejs → node}/ws/ws.type.d.ts +0 -0
  201. /package/dist/{nodejs → node}/ws/ws.type.js +0 -0
@@ -1 +0,0 @@
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(t){if(Array.isArray(t))return e(t)}function n(e,t,n,r,o,a,c){try{var i=e[a](c);var s=i.value}catch(e){n(e);return}if(i.done){t(s)}else{Promise.resolve(s).then(r,o)}}function r(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var c=e.apply(t,r);function i(e){n(c,o,a,i,s,"next",e)}function s(e){n(c,o,a,i,s,"throw",e)}i(undefined)})}}function o(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 a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(){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 i(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){o(e,t,n[t])})}return e}function s(e){return t(e)||a(e)||l(e)||c()}function u(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function l(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 f(e,t){var n,r,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(t){return s([e,t])}}function s(i){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)try{if(n=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var d=Object.defineProperty;var p=function(e,t){return d(e,"name",{value:t,configurable:!0})};var m=".cyberskill-storage";import g from"@dotenvx/dotenvx";import{bool as v,cleanEnv as I,str as E}from"envalid";import h from"node:os";import _ from"node:path";import y from"node:process";var C=!1;function O(){C||(g.config(),C=!0)}p(O,"loadEnvFile");function T(){O();var e=I(y.env,{CWD:E({default:y.cwd()}),DEBUG:v({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:E({default:_.join(h.homedir(),m)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}p(T,"getEnv");var S=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as G}from"node:child_process";import N from"node:process";import*as L from"node:util";var b=function(e){return e.Error="error",e.Warning="warning",e}({});import A from"chalk";import w from"consola";import{GraphQLError as R}from"graphql";var M=T();M.DEBUG||(w.level=4);function P(e){var t=A[e];return typeof t=="function"?t:A.green}p(P,"chalkKeyword");var D={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(A.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,o=e.rule,a=e.message;w.log("".concat(A.gray("File:")," ").concat(A.blue("".concat(t).concat(r?":".concat(r):"")))),o&&w.log(" ".concat(P(n)("Rule:")," ").concat(o)),w.log(" ".concat(P(n)("Message:")," ").concat(a))}),w.box(P(n)("".concat(e," : ").concat(t.length))),w.log(A.gray("─".repeat(40)))}};var k={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import K from"node-fetch";import j from"fs-extra";import x from"node:path";var F=T(),U=x;function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).resolve.apply(r,[F.CWD].concat(s(t)))}p(Y,"resolveWorkingPath");function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).join.apply(r,s(t))}p(B,"join");var W=j.lstatSync,H=j.readdirSync,J=j.mkdirSync,$=j.readFileSync,V=j.unlinkSync,X=j.statSync,q=j.readJsonSync;function Q(e,t,n){j.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}p(Q,"writeFileSync");function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return j.pathExistsSync(e)})}p(z,"pathExistsSync");var Z=T();function ee(e){var t=B(Z.CWD,eS);if(!z(t))return!1;try{var n=q(t),r=n.name,o=n.dependencies,a=o===void 0?{}:o,c=n.devDependencies,i=c===void 0?{}:c,s=r===e,u=e in a,l=e in i;return s||u||l?{path:t,file:n,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return D.warn("Failed to read package.json: ".concat(e.message)),!1}}p(ee,"getPackage");function et(e){return r(function(){var t,n,r,o;return f(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,K("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.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=a.sent(),r=n.version;return[2,r];case 3:o=a.sent();throw D.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})})()}p(et,"getLatestPackageVersion");function en(e,t){return r(function(){var n,r,o,a,c,s,u,l,d,p,m,g,v,I,E,h,_,y,C,O,T;return f(this,function(f){switch(f.label){case 0:f.trys.push([0,4,,5]);n=ee(e);if(!n)return[2,i({},k)];u=n.path,l=n.file,d=n.isCurrentProject,p=n.isDepend,m=n.isDevDepend,g=(r=l.dependencies)!==null&&r!==void 0?r:{},v=(o=l.devDependencies)!==null&&o!==void 0?o:{},I=d?(a=l.version)!==null&&a!==void 0?a:"0.0.0":p?(c=g[e])!==null&&c!==void 0?c:"0.0.0":m?(s=v[e])!==null&&s!==void 0?s:"0.0.0":"0.0.0";if(!d)return[3,1];_=I;return[3,3];case 1:return[4,et(e)];case 2:_=f.sent();f.label=3;case 3:E=_,h=d||I===E;if(!h&&(t===null||t===void 0?void 0:t.update)){;C=p?"dependencies":m?"devDependencies":null;C&&((y=l[C])===null||y===void 0?void 0:y[e])!==E&&(l[C]=(O=l[C])!==null&&O!==void 0?O:{},l[C][e]=E,Q(u,JSON.stringify(l,null,4)),D.info('Updated "'.concat(e,'" to version ').concat(E)))}return[2,{isCurrentProject:d,installedPath:u,file:l,isUpToDate:h}];case 4:T=f.sent();return[2,(D.error('Error checking package "'.concat(e,'": ').concat(T.message)),i({},k))];case 5:return[2]}})})()}p(en,"checkPackage");function er(){return r(function(){var e,t,n,r,o,a,c,i,s,u,l,d;return f(this,function(f){switch(f.label){case 0:e=[{command:p(function(){return te.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:p(function(){return te.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:p(function(){return te.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]);o=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];c=a.value,i=c.command,s=c.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,i()];case 4:u=f.sent();return[4,eh("".concat(s," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();D.warn("Installation attempt failed: ".concat(s)),D.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&&o.return!=null){o.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}p(er,"installDependencies");function eo(e,t){return r(function(){var n,r,o,a,c,u,l,d,p,m,g;return f(this,function(f){switch(f.label){case 0:if(!z(e6.PACKAGE_JSON)){D.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,13,,14]);n=s(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return en(e,i({},(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,er()];case 3:r=f.sent();f.label=4;case 4:r;a=true,c=false,u=undefined;f.label=5;case 5:f.trys.push([5,10,11,12]);l=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();f.label=6;case 6:if(!!(a=(d=l.next()).done))return[3,9];p=d.value;return[4,p()];case 7:f.sent();f.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:m=f.sent();c=true;u=m;return[3,12];case 11:try{if(!a&&l.return!=null){l.return()}}finally{if(c){throw u}}return[7];case 12:return[3,14];case 13:g=f.sent();throw D.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}p(eo,"setupPackages");import ea from"node-persist";var ec=T();function ei(){return r(function(){var e;return f(this,function(t){switch(t.label){case 0:e=ea.defaultInstance;if(e)return[3,2];return[4,ea.init({dir:ec.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}p(ei,"initNodePersist");var es={get:function e(e){return r(function(){var t,n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ei()];case 1:r.sent();return[4,ea.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(D.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return r(function(){var n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ei()];case 1:r.sent();return[4,ea.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();D.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ei()];case 1:n.sent();return[4,ea.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();D.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ei()];case 1:n.sent();return[4,ea.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(D.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(D.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return f(this,function(t){try{return[2,"".concat(ec.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(D.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eu=T(),el=L.promisify(G);function ef(e){return"error_list:".concat(e)}p(ef,"getErrorListKey");function ed(e){return r(function(){var t,n,o;return f(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ef(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,es.set(n,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(function(){return r(function(){var e;return f(this,function(t){switch(t.label){case 0:return[4,es.getLogLink(n)];case 1:e=t.sent();e&&D.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:o=a.sent();D.error("Failed to save errors: ".concat(o.message));return[3,4];case 4:return[2]}})})()}p(ed,"saveErrorListToStorage");function ep(e){var t=[],n=[],r="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,a=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,c=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var i,s,u,l,f;var d=o.exec(e)||[],p=a.exec(e)||[],m=c.exec(e)||[];var g,v,I,E,h,_;d.length&&r?t.push({file:r,position:"".concat(d[1],":").concat(d[2]),type:d[3]===b.Error?b.Error:b.Warning,message:(g=d===null||d===void 0?void 0:(i=d[4])===null||i===void 0?void 0:i.trim())!==null&&g!==void 0?g:"",rule:(v=d===null||d===void 0?void 0:(s=d[5])===null||s===void 0?void 0:s.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(I=p===null||p===void 0?void 0:p[1])!==null&&I!==void 0?I:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===b.Error?b.Error:b.Warning,message:(E=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&E!==void 0?E:""}):m.length?t.push({file:"commitlint",type:b.Error,message:(h=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&h!==void 0?h:"",rule:(_=m===null||m===void 0?void 0:(f=m[2])===null||f===void 0?void 0:f.trim())!==null&&_!==void 0?_:""}):n.push(e.trim())}}),t.length&&ed(t),eu.DEBUG&&n.length&&(D.warn("Unmatched lines:"),n.forEach(function(e){return D.info(" ".concat(e))}))}p(ep,"parseTextErrors");function em(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,o=e.line,a=e.column,c=e.ruleId,i=e.message;n.push({type:r===2?b.Error:b.Warning,file:t,position:"".concat(o,":").concat(a),rule:c,message:i})})}),n.length&&ed(n)}catch(t){ep(e)}}p(em,"parseCommandOutput");function eg(e){return r(function(e){var t,n,r,o,a,c,i,s,u;var l=arguments;return f(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:em;n=new AbortController;N.on("SIGINT",function(){D.warn("Process interrupted. Terminating..."),n.abort(),N.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,el(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),o=r.stdout,a=r.stderr;[o,a].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:c=f.sent();i=c.stdout,s=c.stderr,u=c.message;[i,s].forEach(function(e){return e&&t(e)}),!s&&!i&&D.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}p(eg,"executeCommand");function ev(e){return{raw:!0,cmd:e}}p(ev,"rawCommand");function eI(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eQ," ").concat(eC," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eQ," ").concat(eV," ").concat(ek," ").concat(e):"".concat(eQ," ").concat(eD," ").concat(e)}p(eI,"formatCLI");function eE(e,t){return typeof e=="function"?eI(e(t),t):(typeof e==="undefined"?"undefined":u(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eI(e,t):e}p(eE,"formatCommand");function eh(e,t){return r(function(){var n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);D.start("".concat(e)),eu.DEBUG&&D.info("→ ".concat(t));return[4,eg(t)];case 1:r.sent(),D.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw D.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}p(eh,"runCommand");var e_=T(),ey=e_.CWD,eC="@cyberskill/shared",eO="node_modules",eT="dist",eS="package.json",eG="package-lock.json",eN="tsconfig.json",eL=".gitignore",eb=".simple-git-hooks.json",eA="pnpm-lock.yaml",ew=".git/hooks/",eR=".git/COMMIT_EDITMSG",eM=".migrate-mongo.config.js",eP=B(ey,eO,eC,eT),eD="cyberskill",ek="src/nodejs/cli/index.ts",eK="eslint",ej="eslint",ex="vitest",eF="playwright",eU="vitest",eY="@commitlint/cli",eB="commitlint",eW="lint-staged",eH="lint-staged",eJ="typescript",e$="tsc",eV="tsx",eX="git",eq="pnpm",eQ="pnpm exec",ez="simple-git-hooks",eZ="simple-git-hooks",e0="@eslint/config-inspector",e1="eslint-config-inspector",e2="node-modules-inspector",e3="node-modules-inspector",e4="migrate-mongo",e5="./node_modules/migrate-mongo/bin/migrate-mongo",e6={CYBERSKILL_DIRECTORY:eP,WORKING_DIRECTORY:ey,TS_CONFIG:Y(eN),GIT_IGNORE:Y(eL),GIT_HOOK:Y(ew),GIT_COMMIT_MSG:Y(eR),SIMPLE_GIT_HOOKS_JSON:Y(eb),PACKAGE_JSON:Y(eS),PACKAGE_LOCK_JSON:Y(eG),PNPM_LOCK_YAML:Y(eA),NODE_MODULES:Y(eO),MIGRATE_MONGO_CONFIG:Y(eM),LINT_STAGED_CONFIG:Y("".concat(eP,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:Y("".concat(eP,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:Y("".concat(eP,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:Y("".concat(eP,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:Y("".concat(eP,"/react/vitest/vitest.e2e.js"))};function e8(e){var t=e.isCurrentProject;return i({"pre-commit":eH,"commit-msg":eB},t&&{"pre-push":ev("".concat(eX," pull"))})}p(e8,"createGitHooksConfig");function e7(e,t,n){return r(function(){return f(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case S.CLI:return[3,1];case S.STRING:return[3,3]}return[3,4];case 1:return[4,eo(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),eE(ev("".concat(eQ," ").concat(n))))];case 3:return[2,eE(ev(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}p(e7,"buildCommand");function e9(e,t,n){return function(){return r(function(){return f(this,function(r){return[2,e7(e,t,n)]})})()}}p(e9,"commandFactory");var te={simpleGitHooks:e9(S.CLI,ez,eZ),eslintInspect:e9(S.CLI,e0,e1),nodeModulesInspect:e9(S.CLI,e2,e3),eslintCheck:e9(S.CLI,eK,"".concat(ej," ").concat(e6.WORKING_DIRECTORY," --no-cache")),eslintFix:e9(S.CLI,eK,"".concat(ej," ").concat(e6.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:e9(S.CLI,eJ,"".concat(e$," -p ").concat(e6.TS_CONFIG," --noEmit")),configureGitHook:e9(S.STRING,"".concat(eX," config core.hooksPath ").concat(e6.GIT_HOOK)),testUnit:e9(S.CLI,ex,"".concat(eU," --config ").concat(e6.UNIT_TEST_CONFIG)),testE2e:e9(S.CLI,"".concat(ex," ").concat(eF),"".concat(eU," --config ").concat(e6.E2E_TEST_CONFIG)),mongoMigrateCreate:p(function(e){return e9(S.CLI,e4,"".concat(eV," ").concat(e5," create ").concat(e," -f ").concat(e6.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e9(S.CLI,e4,"".concat(eV," ").concat(e5," up -f ").concat(e6.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e9(S.CLI,e4,"".concat(eV," ").concat(e5," down -f ").concat(e6.MIGRATE_MONGO_CONFIG)),commitLint:e9(S.CLI,eY,"".concat(eB," --edit ").concat(e6.GIT_COMMIT_MSG," --config ").concat(e6.COMMITLINT_CONFIG)),lintStaged:e9(S.CLI,eW,"".concat(eH," --config ").concat(e6.LINT_STAGED_CONFIG)),stageBuildDirectory:e9(S.STRING,"".concat(eX," add ").concat(eT)),build:e9(S.STRING,"".concat(eq," run build")),pnpmInstallStandard:e9(S.STRING,"".concat(eq," install")),pnpmInstallLegacy:e9(S.STRING,"".concat(eq," install --legacy-peer-deps")),pnpmInstallForce:e9(S.STRING,"".concat(eq," install --force"))};export{eT as BUILD_DIRECTORY,eB as COMMIT_LINT_CLI,eY as COMMIT_LINT_PACKAGE_NAME,eD as CYBERSKILL_CLI,ek as CYBERSKILL_CLI_PATH,eP as CYBERSKILL_DIRECTORY,eC as CYBERSKILL_PACKAGE_NAME,ej as ESLINT_CLI,e1 as ESLINT_INSPECT_CLI,e0 as ESLINT_INSPECT_PACKAGE_NAME,eK as ESLINT_PACKAGE_NAME,eX as GIT_CLI,eR as GIT_COMMIT_EDITMSG,ew as GIT_HOOK,eL as GIT_IGNORE,eH as LINT_STAGED_CLI,eW as LINT_STAGED_PACKAGE_NAME,e5 as MIGRATE_MONGO_CLI,eM as MIGRATE_MONGO_CONFIG,e4 as MIGRATE_MONGO_PACKAGE_NAME,eO as NODE_MODULES,e3 as NODE_MODULES_INSPECT_CLI,e2 as NODE_MODULES_INSPECT_PACKAGE_NAME,eS as PACKAGE_JSON,eG as PACKAGE_LOCK_JSON,e6 as PATH,eF as PLAYWRIGHT_PACKAGE_NAME,eq as PNPM_CLI,eQ as PNPM_EXEC_CLI,eA as PNPM_LOCK_YAML,ez as SIMPLE_GIT_HOOKS_PACKAGE_NAME,eZ as SIMPLE_GIT_HOOK_CLI,eb as SIMPLE_GIT_HOOK_JSON,eN as TSCONFIG_JSON,e$ as TSC_CLI,eJ as TSC_PACKAGE_NAME,eV as TSX_CLI,eU as VITEST_CLI,ex as VITEST_PACKAGE_NAME,ey as WORKING_DIRECTORY,te as command,e8 as createGitHooksConfig};
@@ -1 +0,0 @@
1
- "use strict";function e(e,r,t,n,a,u,o){try{var l=e[u](o);var c=l.value}catch(e){t(e);return}if(l.done){r(c)}else{Promise.resolve(c).then(n,a)}}function r(r){return function(){var t=this,n=arguments;return new Promise(function(a,u){var o=r.apply(t,n);function l(r){e(o,a,u,l,c,"next",r)}function c(r){e(o,a,u,l,c,"throw",r)}l(undefined)})}}function t(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function n(e,r){var t,n,a,u={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=l(0),o["throw"]=l(1),o["return"]=l(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(e){return function(r){return c([e,r])}}function c(l){if(t)throw new TypeError("Generator is already executing.");while(o&&(o=0,l[0]&&(u=0)),u)try{if(t=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:u.label++;return{value:l[1],done:false};case 5:u.label++;n=l[1];l=[0];continue;case 7:l=u.ops.pop();u.trys.pop();continue;default:if(!(a=u.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){u=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){u.label=l[1];break}if(l[0]===6&&u.label<a[1]){u.label=a[1];a=l;break}if(a&&u.label<a[2]){u.label=a[2];u.ops.push(l);break}if(a[2])u.ops.pop();u.trys.pop();continue}l=r.call(e,u)}catch(e){l=[6,e];n=0}finally{t=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}var a=Object.create;var u=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty;var s=function(e,r){return u(e,"name",{value:r,configurable:!0})};var f=function(e,r){for(var t in r)u(e,t,{get:r[t],enumerable:!0})},d=function(e,r,n,a){var c=true,s=false,f=undefined;if(r&&(typeof r==="undefined"?"undefined":t(r))=="object"||typeof r=="function")try{var d=function(){var t=g.value;!i.call(e,t)&&t!==n&&u(e,t,{get:function(){return r[t]},enumerable:!(a=o(r,t))||a.enumerable})};for(var v=l(r)[Symbol.iterator](),g;!(c=(g=v.next()).done);c=true)d()}catch(e){s=true;f=e}finally{try{if(!c&&v.return!=null){v.return()}}finally{if(s){throw f}}}return e};var v=function(e,r,t){return t=e!=null?a(c(e)):{},d(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e)},g=function(e){return d(u({},"__esModule",{value:!0}),e)};var y={};f(y,{storageNodeJS:function(){return q}});module.exports=g(y);var p=v(require("node-persist"),1);var b=".cyberskill-storage";var h=v(require("@dotenvx/dotenvx"),1),E=require("envalid"),S=v(require("os"),1),m=v(require("path"),1),w=v(require("process"),1);var O=!1;function R(){O||(h.default.config(),O=!0)}s(R,"loadEnvFile");function k(){R();var e=(0,E.cleanEnv)(w.default.env,{CWD:(0,E.str)({default:w.default.cwd()}),DEBUG:(0,E.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,E.str)({default:m.default.join(S.default.homedir(),b)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}s(k,"getEnv");var I=v(require("chalk"),1),L=v(require("consola"),1),x=require("graphql");var _=k();_.DEBUG||(L.default.level=4);function C(e){var r=I.default[e];return typeof r=="function"?r:I.default.green}s(C,"chalkKeyword");var D={silent:L.default.silent,level:L.default.level,fatal:L.default.fatal,error:L.default.error,warn:L.default.warn,log:L.default.log,info:L.default.info,success:L.default.success,ready:L.default.ready,start:L.default.start,box:L.default.box,debug:L.default.debug,trace:L.default.trace,verbose:L.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){L.default.box(I.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,a=e.rule,u=e.message;L.default.log("".concat(I.default.gray("File:")," ").concat(I.default.blue("".concat(r).concat(n?":".concat(n):"")))),a&&L.default.log(" ".concat(C(t)("Rule:")," ").concat(a)),L.default.log(" ".concat(C(t)("Message:")," ").concat(u))}),L.default.box(C(t)("".concat(e," : ").concat(r.length))),L.default.log(I.default.gray("─".repeat(40)))}};var T=k();function j(){return r(function(){var e;return n(this,function(r){switch(r.label){case 0:e=p.default.defaultInstance;if(e)return[3,2];return[4,p.default.init({dir:T.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=r.sent();r.label=2;case 2:e;return[2]}})})()}s(j,"initNodePersist");var q={get:function e(e){return r(function(){var r,t;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,j()];case 1:n.sent();return[4,p.default.getItem(e)];case 2:return[2,(r=n.sent())!==null&&r!==void 0?r:null];case 3:t=n.sent();return[2,(D.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 4:return[2]}})})()},set:function e(e,t){return r(function(){var r;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,j()];case 1:n.sent();return[4,p.default.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();D.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,j()];case 1:t.sent();return[4,p.default.removeItem(e)];case 2:t.sent();return[3,4];case 3:r=t.sent();D.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,j()];case 1:t.sent();return[4,p.default.keys()];case 2:e=t.sent();return[2,Array.isArray(e)?e:(D.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:r=t.sent();return[2,(D.error("[Storage:keys] Error getting keys:",r),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return n(this,function(r){try{return[2,"".concat(T.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(D.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};0&&(module.exports={storageNodeJS:storageNodeJS});
@@ -1 +0,0 @@
1
- function e(e,r,t,n,o,a,c){try{var i=e[a](c);var s=i.value}catch(e){t(e);return}if(i.done){r(s)}else{Promise.resolve(s).then(n,o)}}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,a){var c=r.apply(t,n);function i(r){e(c,o,a,i,s,"next",r)}function s(r){e(c,o,a,i,s,"throw",r)}i(undefined)})}}function t(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(r){return s([e,r])}}function s(i){if(t)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var n=Object.defineProperty;var o=function(e,r){return n(e,"name",{value:r,configurable:!0})};import a from"node-persist";var c=".cyberskill-storage";import i from"@dotenvx/dotenvx";import{bool as s,cleanEnv as u,str as l}from"envalid";import f from"node:os";import g from"node:path";import v from"node:process";var p=!1;function h(){p||(i.config(),p=!0)}o(h,"loadEnvFile");function y(){h();var e=u(v.env,{CWD:l({default:v.cwd()}),DEBUG:s({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:l({default:g.join(f.homedir(),c)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}o(y,"getEnv");import d from"chalk";import b from"consola";import{GraphQLError as m}from"graphql";var E=y();E.DEBUG||(b.level=4);function R(e){var r=d[e];return typeof r=="function"?r:d.green}o(R,"chalkKeyword");var S={silent:b.silent,level:b.level,fatal:b.fatal,error:b.error,warn:b.warn,log:b.log,info:b.info,success:b.success,ready:b.ready,start:b.start,box:b.box,debug:b.debug,trace:b.trace,verbose:b.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){b.box(d.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;b.log("".concat(d.gray("File:")," ").concat(d.blue("".concat(r).concat(n?":".concat(n):"")))),o&&b.log(" ".concat(R(t)("Rule:")," ").concat(o)),b.log(" ".concat(R(t)("Message:")," ").concat(a))}),b.box(R(t)("".concat(e," : ").concat(r.length))),b.log(d.gray("─".repeat(40)))}};var k=y();function w(){return r(function(){var e;return t(this,function(r){switch(r.label){case 0:e=a.defaultInstance;if(e)return[3,2];return[4,a.init({dir:k.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=r.sent();r.label=2;case 2:e;return[2]}})})()}o(w,"initNodePersist");var I={get:function e(e){return r(function(){var r,n;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.getItem(e)];case 2:return[2,(r=t.sent())!==null&&r!==void 0?r:null];case 3:n=t.sent();return[2,(S.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,n){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.setItem(e,n)];case 2:t.sent();return[3,4];case 3:r=t.sent();S.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.removeItem(e)];case 2:t.sent();return[3,4];case 3:r=t.sent();S.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.keys()];case 2:e=t.sent();return[2,Array.isArray(e)?e:(S.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:r=t.sent();return[2,(S.error("[Storage:keys] Error getting keys:",r),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return t(this,function(r){try{return[2,"".concat(k.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(S.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};export{I as storageNodeJS};
@@ -1 +0,0 @@
1
- "use strict";function e(e,r,t,n,a,u,o){try{var l=e[u](o);var c=l.value}catch(e){t(e);return}if(l.done){r(c)}else{Promise.resolve(c).then(n,a)}}function r(r){return function(){var t=this,n=arguments;return new Promise(function(a,u){var o=r.apply(t,n);function l(r){e(o,a,u,l,c,"next",r)}function c(r){e(o,a,u,l,c,"throw",r)}l(undefined)})}}function t(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function n(e,r){var t,n,a,u={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=l(0),o["throw"]=l(1),o["return"]=l(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(e){return function(r){return c([e,r])}}function c(l){if(t)throw new TypeError("Generator is already executing.");while(o&&(o=0,l[0]&&(u=0)),u)try{if(t=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:u.label++;return{value:l[1],done:false};case 5:u.label++;n=l[1];l=[0];continue;case 7:l=u.ops.pop();u.trys.pop();continue;default:if(!(a=u.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){u=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){u.label=l[1];break}if(l[0]===6&&u.label<a[1]){u.label=a[1];a=l;break}if(a&&u.label<a[2]){u.label=a[2];u.ops.push(l);break}if(a[2])u.ops.pop();u.trys.pop();continue}l=r.call(e,u)}catch(e){l=[6,e];n=0}finally{t=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}var a=Object.create;var u=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty;var s=function(e,r){return u(e,"name",{value:r,configurable:!0})};var f=function(e,r){for(var t in r)u(e,t,{get:r[t],enumerable:!0})},d=function(e,r,n,a){var c=true,s=false,f=undefined;if(r&&(typeof r==="undefined"?"undefined":t(r))=="object"||typeof r=="function")try{var d=function(){var t=g.value;!i.call(e,t)&&t!==n&&u(e,t,{get:function(){return r[t]},enumerable:!(a=o(r,t))||a.enumerable})};for(var v=l(r)[Symbol.iterator](),g;!(c=(g=v.next()).done);c=true)d()}catch(e){s=true;f=e}finally{try{if(!c&&v.return!=null){v.return()}}finally{if(s){throw f}}}return e};var v=function(e,r,t){return t=e!=null?a(c(e)):{},d(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e)},g=function(e){return d(u({},"__esModule",{value:!0}),e)};var y={};f(y,{storageNodeJS:function(){return q}});module.exports=g(y);var p=v(require("node-persist"),1);var b=".cyberskill-storage";var h=v(require("@dotenvx/dotenvx"),1),E=require("envalid"),S=v(require("os"),1),m=v(require("path"),1),w=v(require("process"),1);var O=!1;function R(){O||(h.default.config(),O=!0)}s(R,"loadEnvFile");function k(){R();var e=(0,E.cleanEnv)(w.default.env,{CWD:(0,E.str)({default:w.default.cwd()}),DEBUG:(0,E.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,E.str)({default:m.default.join(S.default.homedir(),b)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}s(k,"getEnv");var I=v(require("chalk"),1),L=v(require("consola"),1),x=require("graphql");var _=k();_.DEBUG||(L.default.level=4);function C(e){var r=I.default[e];return typeof r=="function"?r:I.default.green}s(C,"chalkKeyword");var D={silent:L.default.silent,level:L.default.level,fatal:L.default.fatal,error:L.default.error,warn:L.default.warn,log:L.default.log,info:L.default.info,success:L.default.success,ready:L.default.ready,start:L.default.start,box:L.default.box,debug:L.default.debug,trace:L.default.trace,verbose:L.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){L.default.box(I.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,a=e.rule,u=e.message;L.default.log("".concat(I.default.gray("File:")," ").concat(I.default.blue("".concat(r).concat(n?":".concat(n):"")))),a&&L.default.log(" ".concat(C(t)("Rule:")," ").concat(a)),L.default.log(" ".concat(C(t)("Message:")," ").concat(u))}),L.default.box(C(t)("".concat(e," : ").concat(r.length))),L.default.log(I.default.gray("─".repeat(40)))}};var T=k();function j(){return r(function(){var e;return n(this,function(r){switch(r.label){case 0:e=p.default.defaultInstance;if(e)return[3,2];return[4,p.default.init({dir:T.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=r.sent();r.label=2;case 2:e;return[2]}})})()}s(j,"initNodePersist");var q={get:function e(e){return r(function(){var r,t;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,j()];case 1:n.sent();return[4,p.default.getItem(e)];case 2:return[2,(r=n.sent())!==null&&r!==void 0?r:null];case 3:t=n.sent();return[2,(D.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 4:return[2]}})})()},set:function e(e,t){return r(function(){var r;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,j()];case 1:n.sent();return[4,p.default.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();D.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,j()];case 1:t.sent();return[4,p.default.removeItem(e)];case 2:t.sent();return[3,4];case 3:r=t.sent();D.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,j()];case 1:t.sent();return[4,p.default.keys()];case 2:e=t.sent();return[2,Array.isArray(e)?e:(D.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:r=t.sent();return[2,(D.error("[Storage:keys] Error getting keys:",r),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return n(this,function(r){try{return[2,"".concat(T.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(D.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};0&&(module.exports={storageNodeJS:storageNodeJS});
@@ -1 +0,0 @@
1
- function e(e,r,t,n,o,a,c){try{var i=e[a](c);var s=i.value}catch(e){t(e);return}if(i.done){r(s)}else{Promise.resolve(s).then(n,o)}}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,a){var c=r.apply(t,n);function i(r){e(c,o,a,i,s,"next",r)}function s(r){e(c,o,a,i,s,"throw",r)}i(undefined)})}}function t(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(r){return s([e,r])}}function s(i){if(t)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var n=Object.defineProperty;var o=function(e,r){return n(e,"name",{value:r,configurable:!0})};import a from"node-persist";var c=".cyberskill-storage";import i from"@dotenvx/dotenvx";import{bool as s,cleanEnv as u,str as l}from"envalid";import f from"node:os";import g from"node:path";import v from"node:process";var p=!1;function h(){p||(i.config(),p=!0)}o(h,"loadEnvFile");function y(){h();var e=u(v.env,{CWD:l({default:v.cwd()}),DEBUG:s({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:l({default:g.join(f.homedir(),c)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}o(y,"getEnv");import d from"chalk";import b from"consola";import{GraphQLError as m}from"graphql";var E=y();E.DEBUG||(b.level=4);function R(e){var r=d[e];return typeof r=="function"?r:d.green}o(R,"chalkKeyword");var S={silent:b.silent,level:b.level,fatal:b.fatal,error:b.error,warn:b.warn,log:b.log,info:b.info,success:b.success,ready:b.ready,start:b.start,box:b.box,debug:b.debug,trace:b.trace,verbose:b.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){b.box(d.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;b.log("".concat(d.gray("File:")," ").concat(d.blue("".concat(r).concat(n?":".concat(n):"")))),o&&b.log(" ".concat(R(t)("Rule:")," ").concat(o)),b.log(" ".concat(R(t)("Message:")," ").concat(a))}),b.box(R(t)("".concat(e," : ").concat(r.length))),b.log(d.gray("─".repeat(40)))}};var k=y();function w(){return r(function(){var e;return t(this,function(r){switch(r.label){case 0:e=a.defaultInstance;if(e)return[3,2];return[4,a.init({dir:k.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=r.sent();r.label=2;case 2:e;return[2]}})})()}o(w,"initNodePersist");var I={get:function e(e){return r(function(){var r,n;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.getItem(e)];case 2:return[2,(r=t.sent())!==null&&r!==void 0?r:null];case 3:n=t.sent();return[2,(S.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,n){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.setItem(e,n)];case 2:t.sent();return[3,4];case 3:r=t.sent();S.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.removeItem(e)];case 2:t.sent();return[3,4];case 3:r=t.sent();S.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,w()];case 1:t.sent();return[4,a.keys()];case 2:e=t.sent();return[2,Array.isArray(e)?e:(S.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:r=t.sent();return[2,(S.error("[Storage:keys] Error getting keys:",r),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return t(this,function(r){try{return[2,"".concat(k.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(S.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};export{I as storageNodeJS};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes