@atlashub/smartstack-cli 3.54.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1757 -780
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +850 -172
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +115 -115
- package/templates/skills/apex/SKILL.md +11 -9
- package/templates/skills/apex/references/agent-teams-protocol.md +32 -16
- package/templates/skills/apex/references/core-seed-data.md +1 -1
- package/templates/skills/apex/references/smartstack-api.md +6 -0
- package/templates/skills/apex/references/smartstack-layers.md +125 -118
- package/templates/skills/apex/steps/step-02-plan.md +33 -18
- package/templates/skills/apex/steps/step-03-execute.md +297 -120
- package/templates/skills/apex/steps/step-04-examine.md +15 -6
- package/templates/skills/apex/steps/step-07-tests.md +60 -40
- package/templates/skills/apex/steps/step-08-run-tests.md +5 -3
package/dist/index.js
CHANGED
|
@@ -973,8 +973,8 @@ var require_command = __commonJS({
|
|
|
973
973
|
"use strict";
|
|
974
974
|
var EventEmitter2 = require("events").EventEmitter;
|
|
975
975
|
var childProcess2 = require("child_process");
|
|
976
|
-
var
|
|
977
|
-
var
|
|
976
|
+
var path4 = require("path");
|
|
977
|
+
var fs20 = require("fs");
|
|
978
978
|
var process17 = require("process");
|
|
979
979
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
980
980
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -1906,11 +1906,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1906
1906
|
let launchWithNode = false;
|
|
1907
1907
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1908
1908
|
function findFile(baseDir, baseName) {
|
|
1909
|
-
const localBin =
|
|
1910
|
-
if (
|
|
1911
|
-
if (sourceExt.includes(
|
|
1909
|
+
const localBin = path4.resolve(baseDir, baseName);
|
|
1910
|
+
if (fs20.existsSync(localBin)) return localBin;
|
|
1911
|
+
if (sourceExt.includes(path4.extname(baseName))) return void 0;
|
|
1912
1912
|
const foundExt = sourceExt.find(
|
|
1913
|
-
(ext2) =>
|
|
1913
|
+
(ext2) => fs20.existsSync(`${localBin}${ext2}`)
|
|
1914
1914
|
);
|
|
1915
1915
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1916
1916
|
return void 0;
|
|
@@ -1922,21 +1922,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1922
1922
|
if (this._scriptPath) {
|
|
1923
1923
|
let resolvedScriptPath;
|
|
1924
1924
|
try {
|
|
1925
|
-
resolvedScriptPath =
|
|
1925
|
+
resolvedScriptPath = fs20.realpathSync(this._scriptPath);
|
|
1926
1926
|
} catch (err) {
|
|
1927
1927
|
resolvedScriptPath = this._scriptPath;
|
|
1928
1928
|
}
|
|
1929
|
-
executableDir =
|
|
1930
|
-
|
|
1929
|
+
executableDir = path4.resolve(
|
|
1930
|
+
path4.dirname(resolvedScriptPath),
|
|
1931
1931
|
executableDir
|
|
1932
1932
|
);
|
|
1933
1933
|
}
|
|
1934
1934
|
if (executableDir) {
|
|
1935
1935
|
let localFile = findFile(executableDir, executableFile);
|
|
1936
1936
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1937
|
-
const legacyName =
|
|
1937
|
+
const legacyName = path4.basename(
|
|
1938
1938
|
this._scriptPath,
|
|
1939
|
-
|
|
1939
|
+
path4.extname(this._scriptPath)
|
|
1940
1940
|
);
|
|
1941
1941
|
if (legacyName !== this._name) {
|
|
1942
1942
|
localFile = findFile(
|
|
@@ -1947,7 +1947,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1947
1947
|
}
|
|
1948
1948
|
executableFile = localFile || executableFile;
|
|
1949
1949
|
}
|
|
1950
|
-
launchWithNode = sourceExt.includes(
|
|
1950
|
+
launchWithNode = sourceExt.includes(path4.extname(executableFile));
|
|
1951
1951
|
let proc2;
|
|
1952
1952
|
if (process17.platform !== "win32") {
|
|
1953
1953
|
if (launchWithNode) {
|
|
@@ -2787,7 +2787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2787
2787
|
* @return {Command}
|
|
2788
2788
|
*/
|
|
2789
2789
|
nameFromFilename(filename) {
|
|
2790
|
-
this._name =
|
|
2790
|
+
this._name = path4.basename(filename, path4.extname(filename));
|
|
2791
2791
|
return this;
|
|
2792
2792
|
}
|
|
2793
2793
|
/**
|
|
@@ -2801,9 +2801,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2801
2801
|
* @param {string} [path]
|
|
2802
2802
|
* @return {(string|null|Command)}
|
|
2803
2803
|
*/
|
|
2804
|
-
executableDir(
|
|
2805
|
-
if (
|
|
2806
|
-
this._executableDir =
|
|
2804
|
+
executableDir(path5) {
|
|
2805
|
+
if (path5 === void 0) return this._executableDir;
|
|
2806
|
+
this._executableDir = path5;
|
|
2807
2807
|
return this;
|
|
2808
2808
|
}
|
|
2809
2809
|
/**
|
|
@@ -3069,7 +3069,7 @@ var require_polyfills = __commonJS({
|
|
|
3069
3069
|
var constants = require("constants");
|
|
3070
3070
|
var origCwd = process.cwd;
|
|
3071
3071
|
var cwd = null;
|
|
3072
|
-
var
|
|
3072
|
+
var platform4 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
3073
3073
|
process.cwd = function() {
|
|
3074
3074
|
if (!cwd)
|
|
3075
3075
|
cwd = origCwd.call(process);
|
|
@@ -3089,54 +3089,54 @@ var require_polyfills = __commonJS({
|
|
|
3089
3089
|
}
|
|
3090
3090
|
var chdir;
|
|
3091
3091
|
module2.exports = patch;
|
|
3092
|
-
function patch(
|
|
3092
|
+
function patch(fs20) {
|
|
3093
3093
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
3094
|
-
patchLchmod(
|
|
3095
|
-
}
|
|
3096
|
-
if (!
|
|
3097
|
-
patchLutimes(
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
if (
|
|
3118
|
-
|
|
3094
|
+
patchLchmod(fs20);
|
|
3095
|
+
}
|
|
3096
|
+
if (!fs20.lutimes) {
|
|
3097
|
+
patchLutimes(fs20);
|
|
3098
|
+
}
|
|
3099
|
+
fs20.chown = chownFix(fs20.chown);
|
|
3100
|
+
fs20.fchown = chownFix(fs20.fchown);
|
|
3101
|
+
fs20.lchown = chownFix(fs20.lchown);
|
|
3102
|
+
fs20.chmod = chmodFix(fs20.chmod);
|
|
3103
|
+
fs20.fchmod = chmodFix(fs20.fchmod);
|
|
3104
|
+
fs20.lchmod = chmodFix(fs20.lchmod);
|
|
3105
|
+
fs20.chownSync = chownFixSync(fs20.chownSync);
|
|
3106
|
+
fs20.fchownSync = chownFixSync(fs20.fchownSync);
|
|
3107
|
+
fs20.lchownSync = chownFixSync(fs20.lchownSync);
|
|
3108
|
+
fs20.chmodSync = chmodFixSync(fs20.chmodSync);
|
|
3109
|
+
fs20.fchmodSync = chmodFixSync(fs20.fchmodSync);
|
|
3110
|
+
fs20.lchmodSync = chmodFixSync(fs20.lchmodSync);
|
|
3111
|
+
fs20.stat = statFix(fs20.stat);
|
|
3112
|
+
fs20.fstat = statFix(fs20.fstat);
|
|
3113
|
+
fs20.lstat = statFix(fs20.lstat);
|
|
3114
|
+
fs20.statSync = statFixSync(fs20.statSync);
|
|
3115
|
+
fs20.fstatSync = statFixSync(fs20.fstatSync);
|
|
3116
|
+
fs20.lstatSync = statFixSync(fs20.lstatSync);
|
|
3117
|
+
if (fs20.chmod && !fs20.lchmod) {
|
|
3118
|
+
fs20.lchmod = function(path4, mode, cb) {
|
|
3119
3119
|
if (cb) process.nextTick(cb);
|
|
3120
3120
|
};
|
|
3121
|
-
|
|
3121
|
+
fs20.lchmodSync = function() {
|
|
3122
3122
|
};
|
|
3123
3123
|
}
|
|
3124
|
-
if (
|
|
3125
|
-
|
|
3124
|
+
if (fs20.chown && !fs20.lchown) {
|
|
3125
|
+
fs20.lchown = function(path4, uid, gid, cb) {
|
|
3126
3126
|
if (cb) process.nextTick(cb);
|
|
3127
3127
|
};
|
|
3128
|
-
|
|
3128
|
+
fs20.lchownSync = function() {
|
|
3129
3129
|
};
|
|
3130
3130
|
}
|
|
3131
|
-
if (
|
|
3132
|
-
|
|
3131
|
+
if (platform4 === "win32") {
|
|
3132
|
+
fs20.rename = typeof fs20.rename !== "function" ? fs20.rename : (function(fs$rename) {
|
|
3133
3133
|
function rename(from3, to, cb) {
|
|
3134
3134
|
var start = Date.now();
|
|
3135
3135
|
var backoff = 0;
|
|
3136
3136
|
fs$rename(from3, to, function CB(er) {
|
|
3137
3137
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
3138
3138
|
setTimeout(function() {
|
|
3139
|
-
|
|
3139
|
+
fs20.stat(to, function(stater, st) {
|
|
3140
3140
|
if (stater && stater.code === "ENOENT")
|
|
3141
3141
|
fs$rename(from3, to, CB);
|
|
3142
3142
|
else
|
|
@@ -3152,9 +3152,9 @@ var require_polyfills = __commonJS({
|
|
|
3152
3152
|
}
|
|
3153
3153
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
3154
3154
|
return rename;
|
|
3155
|
-
})(
|
|
3155
|
+
})(fs20.rename);
|
|
3156
3156
|
}
|
|
3157
|
-
|
|
3157
|
+
fs20.read = typeof fs20.read !== "function" ? fs20.read : (function(fs$read) {
|
|
3158
3158
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
3159
3159
|
var callback;
|
|
3160
3160
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -3162,22 +3162,22 @@ var require_polyfills = __commonJS({
|
|
|
3162
3162
|
callback = function(er, _3, __) {
|
|
3163
3163
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
3164
3164
|
eagCounter++;
|
|
3165
|
-
return fs$read.call(
|
|
3165
|
+
return fs$read.call(fs20, fd, buffer, offset, length, position, callback);
|
|
3166
3166
|
}
|
|
3167
3167
|
callback_.apply(this, arguments);
|
|
3168
3168
|
};
|
|
3169
3169
|
}
|
|
3170
|
-
return fs$read.call(
|
|
3170
|
+
return fs$read.call(fs20, fd, buffer, offset, length, position, callback);
|
|
3171
3171
|
}
|
|
3172
3172
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
3173
3173
|
return read;
|
|
3174
|
-
})(
|
|
3175
|
-
|
|
3174
|
+
})(fs20.read);
|
|
3175
|
+
fs20.readSync = typeof fs20.readSync !== "function" ? fs20.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
3176
3176
|
return function(fd, buffer, offset, length, position) {
|
|
3177
3177
|
var eagCounter = 0;
|
|
3178
3178
|
while (true) {
|
|
3179
3179
|
try {
|
|
3180
|
-
return fs$readSync.call(
|
|
3180
|
+
return fs$readSync.call(fs20, fd, buffer, offset, length, position);
|
|
3181
3181
|
} catch (er) {
|
|
3182
3182
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
3183
3183
|
eagCounter++;
|
|
@@ -3187,11 +3187,11 @@ var require_polyfills = __commonJS({
|
|
|
3187
3187
|
}
|
|
3188
3188
|
}
|
|
3189
3189
|
};
|
|
3190
|
-
})(
|
|
3191
|
-
function patchLchmod(
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3190
|
+
})(fs20.readSync);
|
|
3191
|
+
function patchLchmod(fs21) {
|
|
3192
|
+
fs21.lchmod = function(path4, mode, callback) {
|
|
3193
|
+
fs21.open(
|
|
3194
|
+
path4,
|
|
3195
3195
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
3196
3196
|
mode,
|
|
3197
3197
|
function(err, fd) {
|
|
@@ -3199,80 +3199,80 @@ var require_polyfills = __commonJS({
|
|
|
3199
3199
|
if (callback) callback(err);
|
|
3200
3200
|
return;
|
|
3201
3201
|
}
|
|
3202
|
-
|
|
3203
|
-
|
|
3202
|
+
fs21.fchmod(fd, mode, function(err2) {
|
|
3203
|
+
fs21.close(fd, function(err22) {
|
|
3204
3204
|
if (callback) callback(err2 || err22);
|
|
3205
3205
|
});
|
|
3206
3206
|
});
|
|
3207
3207
|
}
|
|
3208
3208
|
);
|
|
3209
3209
|
};
|
|
3210
|
-
|
|
3211
|
-
var fd =
|
|
3210
|
+
fs21.lchmodSync = function(path4, mode) {
|
|
3211
|
+
var fd = fs21.openSync(path4, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
3212
3212
|
var threw = true;
|
|
3213
3213
|
var ret;
|
|
3214
3214
|
try {
|
|
3215
|
-
ret =
|
|
3215
|
+
ret = fs21.fchmodSync(fd, mode);
|
|
3216
3216
|
threw = false;
|
|
3217
3217
|
} finally {
|
|
3218
3218
|
if (threw) {
|
|
3219
3219
|
try {
|
|
3220
|
-
|
|
3220
|
+
fs21.closeSync(fd);
|
|
3221
3221
|
} catch (er) {
|
|
3222
3222
|
}
|
|
3223
3223
|
} else {
|
|
3224
|
-
|
|
3224
|
+
fs21.closeSync(fd);
|
|
3225
3225
|
}
|
|
3226
3226
|
}
|
|
3227
3227
|
return ret;
|
|
3228
3228
|
};
|
|
3229
3229
|
}
|
|
3230
|
-
function patchLutimes(
|
|
3231
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
3232
|
-
|
|
3233
|
-
|
|
3230
|
+
function patchLutimes(fs21) {
|
|
3231
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs21.futimes) {
|
|
3232
|
+
fs21.lutimes = function(path4, at, mt, cb) {
|
|
3233
|
+
fs21.open(path4, constants.O_SYMLINK, function(er, fd) {
|
|
3234
3234
|
if (er) {
|
|
3235
3235
|
if (cb) cb(er);
|
|
3236
3236
|
return;
|
|
3237
3237
|
}
|
|
3238
|
-
|
|
3239
|
-
|
|
3238
|
+
fs21.futimes(fd, at, mt, function(er2) {
|
|
3239
|
+
fs21.close(fd, function(er22) {
|
|
3240
3240
|
if (cb) cb(er2 || er22);
|
|
3241
3241
|
});
|
|
3242
3242
|
});
|
|
3243
3243
|
});
|
|
3244
3244
|
};
|
|
3245
|
-
|
|
3246
|
-
var fd =
|
|
3245
|
+
fs21.lutimesSync = function(path4, at, mt) {
|
|
3246
|
+
var fd = fs21.openSync(path4, constants.O_SYMLINK);
|
|
3247
3247
|
var ret;
|
|
3248
3248
|
var threw = true;
|
|
3249
3249
|
try {
|
|
3250
|
-
ret =
|
|
3250
|
+
ret = fs21.futimesSync(fd, at, mt);
|
|
3251
3251
|
threw = false;
|
|
3252
3252
|
} finally {
|
|
3253
3253
|
if (threw) {
|
|
3254
3254
|
try {
|
|
3255
|
-
|
|
3255
|
+
fs21.closeSync(fd);
|
|
3256
3256
|
} catch (er) {
|
|
3257
3257
|
}
|
|
3258
3258
|
} else {
|
|
3259
|
-
|
|
3259
|
+
fs21.closeSync(fd);
|
|
3260
3260
|
}
|
|
3261
3261
|
}
|
|
3262
3262
|
return ret;
|
|
3263
3263
|
};
|
|
3264
|
-
} else if (
|
|
3265
|
-
|
|
3264
|
+
} else if (fs21.futimes) {
|
|
3265
|
+
fs21.lutimes = function(_a, _b, _c, cb) {
|
|
3266
3266
|
if (cb) process.nextTick(cb);
|
|
3267
3267
|
};
|
|
3268
|
-
|
|
3268
|
+
fs21.lutimesSync = function() {
|
|
3269
3269
|
};
|
|
3270
3270
|
}
|
|
3271
3271
|
}
|
|
3272
3272
|
function chmodFix(orig) {
|
|
3273
3273
|
if (!orig) return orig;
|
|
3274
3274
|
return function(target, mode, cb) {
|
|
3275
|
-
return orig.call(
|
|
3275
|
+
return orig.call(fs20, target, mode, function(er) {
|
|
3276
3276
|
if (chownErOk(er)) er = null;
|
|
3277
3277
|
if (cb) cb.apply(this, arguments);
|
|
3278
3278
|
});
|
|
@@ -3282,7 +3282,7 @@ var require_polyfills = __commonJS({
|
|
|
3282
3282
|
if (!orig) return orig;
|
|
3283
3283
|
return function(target, mode) {
|
|
3284
3284
|
try {
|
|
3285
|
-
return orig.call(
|
|
3285
|
+
return orig.call(fs20, target, mode);
|
|
3286
3286
|
} catch (er) {
|
|
3287
3287
|
if (!chownErOk(er)) throw er;
|
|
3288
3288
|
}
|
|
@@ -3291,7 +3291,7 @@ var require_polyfills = __commonJS({
|
|
|
3291
3291
|
function chownFix(orig) {
|
|
3292
3292
|
if (!orig) return orig;
|
|
3293
3293
|
return function(target, uid, gid, cb) {
|
|
3294
|
-
return orig.call(
|
|
3294
|
+
return orig.call(fs20, target, uid, gid, function(er) {
|
|
3295
3295
|
if (chownErOk(er)) er = null;
|
|
3296
3296
|
if (cb) cb.apply(this, arguments);
|
|
3297
3297
|
});
|
|
@@ -3301,7 +3301,7 @@ var require_polyfills = __commonJS({
|
|
|
3301
3301
|
if (!orig) return orig;
|
|
3302
3302
|
return function(target, uid, gid) {
|
|
3303
3303
|
try {
|
|
3304
|
-
return orig.call(
|
|
3304
|
+
return orig.call(fs20, target, uid, gid);
|
|
3305
3305
|
} catch (er) {
|
|
3306
3306
|
if (!chownErOk(er)) throw er;
|
|
3307
3307
|
}
|
|
@@ -3321,13 +3321,13 @@ var require_polyfills = __commonJS({
|
|
|
3321
3321
|
}
|
|
3322
3322
|
if (cb) cb.apply(this, arguments);
|
|
3323
3323
|
}
|
|
3324
|
-
return options ? orig.call(
|
|
3324
|
+
return options ? orig.call(fs20, target, options, callback) : orig.call(fs20, target, callback);
|
|
3325
3325
|
};
|
|
3326
3326
|
}
|
|
3327
3327
|
function statFixSync(orig) {
|
|
3328
3328
|
if (!orig) return orig;
|
|
3329
3329
|
return function(target, options) {
|
|
3330
|
-
var stats = options ? orig.call(
|
|
3330
|
+
var stats = options ? orig.call(fs20, target, options) : orig.call(fs20, target);
|
|
3331
3331
|
if (stats) {
|
|
3332
3332
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
3333
3333
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -3357,16 +3357,16 @@ var require_legacy_streams = __commonJS({
|
|
|
3357
3357
|
"use strict";
|
|
3358
3358
|
var Stream2 = require("stream").Stream;
|
|
3359
3359
|
module2.exports = legacy;
|
|
3360
|
-
function legacy(
|
|
3360
|
+
function legacy(fs20) {
|
|
3361
3361
|
return {
|
|
3362
3362
|
ReadStream,
|
|
3363
3363
|
WriteStream
|
|
3364
3364
|
};
|
|
3365
|
-
function ReadStream(
|
|
3366
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
3365
|
+
function ReadStream(path4, options) {
|
|
3366
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path4, options);
|
|
3367
3367
|
Stream2.call(this);
|
|
3368
3368
|
var self2 = this;
|
|
3369
|
-
this.path =
|
|
3369
|
+
this.path = path4;
|
|
3370
3370
|
this.fd = null;
|
|
3371
3371
|
this.readable = true;
|
|
3372
3372
|
this.paused = false;
|
|
@@ -3400,7 +3400,7 @@ var require_legacy_streams = __commonJS({
|
|
|
3400
3400
|
});
|
|
3401
3401
|
return;
|
|
3402
3402
|
}
|
|
3403
|
-
|
|
3403
|
+
fs20.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
3404
3404
|
if (err) {
|
|
3405
3405
|
self2.emit("error", err);
|
|
3406
3406
|
self2.readable = false;
|
|
@@ -3411,10 +3411,10 @@ var require_legacy_streams = __commonJS({
|
|
|
3411
3411
|
self2._read();
|
|
3412
3412
|
});
|
|
3413
3413
|
}
|
|
3414
|
-
function WriteStream(
|
|
3415
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
3414
|
+
function WriteStream(path4, options) {
|
|
3415
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path4, options);
|
|
3416
3416
|
Stream2.call(this);
|
|
3417
|
-
this.path =
|
|
3417
|
+
this.path = path4;
|
|
3418
3418
|
this.fd = null;
|
|
3419
3419
|
this.writable = true;
|
|
3420
3420
|
this.flags = "w";
|
|
@@ -3439,7 +3439,7 @@ var require_legacy_streams = __commonJS({
|
|
|
3439
3439
|
this.busy = false;
|
|
3440
3440
|
this._queue = [];
|
|
3441
3441
|
if (this.fd === null) {
|
|
3442
|
-
this._open =
|
|
3442
|
+
this._open = fs20.open;
|
|
3443
3443
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
3444
3444
|
this.flush();
|
|
3445
3445
|
}
|
|
@@ -3475,7 +3475,7 @@ var require_clone = __commonJS({
|
|
|
3475
3475
|
var require_graceful_fs = __commonJS({
|
|
3476
3476
|
"node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
3477
3477
|
"use strict";
|
|
3478
|
-
var
|
|
3478
|
+
var fs20 = require("fs");
|
|
3479
3479
|
var polyfills = require_polyfills();
|
|
3480
3480
|
var legacy = require_legacy_streams();
|
|
3481
3481
|
var clone = require_clone();
|
|
@@ -3507,12 +3507,12 @@ var require_graceful_fs = __commonJS({
|
|
|
3507
3507
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
3508
3508
|
console.error(m);
|
|
3509
3509
|
};
|
|
3510
|
-
if (!
|
|
3510
|
+
if (!fs20[gracefulQueue]) {
|
|
3511
3511
|
queue = global[gracefulQueue] || [];
|
|
3512
|
-
publishQueue(
|
|
3513
|
-
|
|
3512
|
+
publishQueue(fs20, queue);
|
|
3513
|
+
fs20.close = (function(fs$close) {
|
|
3514
3514
|
function close(fd, cb) {
|
|
3515
|
-
return fs$close.call(
|
|
3515
|
+
return fs$close.call(fs20, fd, function(err) {
|
|
3516
3516
|
if (!err) {
|
|
3517
3517
|
resetQueue();
|
|
3518
3518
|
}
|
|
@@ -3524,48 +3524,48 @@ var require_graceful_fs = __commonJS({
|
|
|
3524
3524
|
value: fs$close
|
|
3525
3525
|
});
|
|
3526
3526
|
return close;
|
|
3527
|
-
})(
|
|
3528
|
-
|
|
3527
|
+
})(fs20.close);
|
|
3528
|
+
fs20.closeSync = (function(fs$closeSync) {
|
|
3529
3529
|
function closeSync(fd) {
|
|
3530
|
-
fs$closeSync.apply(
|
|
3530
|
+
fs$closeSync.apply(fs20, arguments);
|
|
3531
3531
|
resetQueue();
|
|
3532
3532
|
}
|
|
3533
3533
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
3534
3534
|
value: fs$closeSync
|
|
3535
3535
|
});
|
|
3536
3536
|
return closeSync;
|
|
3537
|
-
})(
|
|
3537
|
+
})(fs20.closeSync);
|
|
3538
3538
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
3539
3539
|
process.on("exit", function() {
|
|
3540
|
-
debug(
|
|
3541
|
-
require("assert").equal(
|
|
3540
|
+
debug(fs20[gracefulQueue]);
|
|
3541
|
+
require("assert").equal(fs20[gracefulQueue].length, 0);
|
|
3542
3542
|
});
|
|
3543
3543
|
}
|
|
3544
3544
|
}
|
|
3545
3545
|
var queue;
|
|
3546
3546
|
if (!global[gracefulQueue]) {
|
|
3547
|
-
publishQueue(global,
|
|
3548
|
-
}
|
|
3549
|
-
module2.exports = patch(clone(
|
|
3550
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
3551
|
-
module2.exports = patch(
|
|
3552
|
-
|
|
3553
|
-
}
|
|
3554
|
-
function patch(
|
|
3555
|
-
polyfills(
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
var fs$readFile =
|
|
3560
|
-
|
|
3561
|
-
function
|
|
3547
|
+
publishQueue(global, fs20[gracefulQueue]);
|
|
3548
|
+
}
|
|
3549
|
+
module2.exports = patch(clone(fs20));
|
|
3550
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs20.__patched) {
|
|
3551
|
+
module2.exports = patch(fs20);
|
|
3552
|
+
fs20.__patched = true;
|
|
3553
|
+
}
|
|
3554
|
+
function patch(fs21) {
|
|
3555
|
+
polyfills(fs21);
|
|
3556
|
+
fs21.gracefulify = patch;
|
|
3557
|
+
fs21.createReadStream = createReadStream;
|
|
3558
|
+
fs21.createWriteStream = createWriteStream;
|
|
3559
|
+
var fs$readFile = fs21.readFile;
|
|
3560
|
+
fs21.readFile = readFile;
|
|
3561
|
+
function readFile(path4, options, cb) {
|
|
3562
3562
|
if (typeof options === "function")
|
|
3563
3563
|
cb = options, options = null;
|
|
3564
|
-
return go$readFile(
|
|
3565
|
-
function go$readFile(
|
|
3566
|
-
return fs$readFile(
|
|
3564
|
+
return go$readFile(path4, options, cb);
|
|
3565
|
+
function go$readFile(path5, options2, cb2, startTime) {
|
|
3566
|
+
return fs$readFile(path5, options2, function(err) {
|
|
3567
3567
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
3568
|
-
enqueue([go$readFile, [
|
|
3568
|
+
enqueue([go$readFile, [path5, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
3569
3569
|
else {
|
|
3570
3570
|
if (typeof cb2 === "function")
|
|
3571
3571
|
cb2.apply(this, arguments);
|
|
@@ -3573,16 +3573,16 @@ var require_graceful_fs = __commonJS({
|
|
|
3573
3573
|
});
|
|
3574
3574
|
}
|
|
3575
3575
|
}
|
|
3576
|
-
var fs$writeFile =
|
|
3577
|
-
|
|
3578
|
-
function
|
|
3576
|
+
var fs$writeFile = fs21.writeFile;
|
|
3577
|
+
fs21.writeFile = writeFile;
|
|
3578
|
+
function writeFile(path4, data, options, cb) {
|
|
3579
3579
|
if (typeof options === "function")
|
|
3580
3580
|
cb = options, options = null;
|
|
3581
|
-
return go$writeFile(
|
|
3582
|
-
function go$writeFile(
|
|
3583
|
-
return fs$writeFile(
|
|
3581
|
+
return go$writeFile(path4, data, options, cb);
|
|
3582
|
+
function go$writeFile(path5, data2, options2, cb2, startTime) {
|
|
3583
|
+
return fs$writeFile(path5, data2, options2, function(err) {
|
|
3584
3584
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
3585
|
-
enqueue([go$writeFile, [
|
|
3585
|
+
enqueue([go$writeFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
3586
3586
|
else {
|
|
3587
3587
|
if (typeof cb2 === "function")
|
|
3588
3588
|
cb2.apply(this, arguments);
|
|
@@ -3590,17 +3590,17 @@ var require_graceful_fs = __commonJS({
|
|
|
3590
3590
|
});
|
|
3591
3591
|
}
|
|
3592
3592
|
}
|
|
3593
|
-
var fs$appendFile =
|
|
3593
|
+
var fs$appendFile = fs21.appendFile;
|
|
3594
3594
|
if (fs$appendFile)
|
|
3595
|
-
|
|
3596
|
-
function appendFile(
|
|
3595
|
+
fs21.appendFile = appendFile;
|
|
3596
|
+
function appendFile(path4, data, options, cb) {
|
|
3597
3597
|
if (typeof options === "function")
|
|
3598
3598
|
cb = options, options = null;
|
|
3599
|
-
return go$appendFile(
|
|
3600
|
-
function go$appendFile(
|
|
3601
|
-
return fs$appendFile(
|
|
3599
|
+
return go$appendFile(path4, data, options, cb);
|
|
3600
|
+
function go$appendFile(path5, data2, options2, cb2, startTime) {
|
|
3601
|
+
return fs$appendFile(path5, data2, options2, function(err) {
|
|
3602
3602
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
3603
|
-
enqueue([go$appendFile, [
|
|
3603
|
+
enqueue([go$appendFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
3604
3604
|
else {
|
|
3605
3605
|
if (typeof cb2 === "function")
|
|
3606
3606
|
cb2.apply(this, arguments);
|
|
@@ -3608,9 +3608,9 @@ var require_graceful_fs = __commonJS({
|
|
|
3608
3608
|
});
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
var fs$copyFile =
|
|
3611
|
+
var fs$copyFile = fs21.copyFile;
|
|
3612
3612
|
if (fs$copyFile)
|
|
3613
|
-
|
|
3613
|
+
fs21.copyFile = copyFile;
|
|
3614
3614
|
function copyFile(src, dest, flags, cb) {
|
|
3615
3615
|
if (typeof flags === "function") {
|
|
3616
3616
|
cb = flags;
|
|
@@ -3628,34 +3628,34 @@ var require_graceful_fs = __commonJS({
|
|
|
3628
3628
|
});
|
|
3629
3629
|
}
|
|
3630
3630
|
}
|
|
3631
|
-
var fs$readdir =
|
|
3632
|
-
|
|
3631
|
+
var fs$readdir = fs21.readdir;
|
|
3632
|
+
fs21.readdir = readdir2;
|
|
3633
3633
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
3634
|
-
function readdir2(
|
|
3634
|
+
function readdir2(path4, options, cb) {
|
|
3635
3635
|
if (typeof options === "function")
|
|
3636
3636
|
cb = options, options = null;
|
|
3637
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
3638
|
-
return fs$readdir(
|
|
3639
|
-
|
|
3637
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path5, options2, cb2, startTime) {
|
|
3638
|
+
return fs$readdir(path5, fs$readdirCallback(
|
|
3639
|
+
path5,
|
|
3640
3640
|
options2,
|
|
3641
3641
|
cb2,
|
|
3642
3642
|
startTime
|
|
3643
3643
|
));
|
|
3644
|
-
} : function go$readdir2(
|
|
3645
|
-
return fs$readdir(
|
|
3646
|
-
|
|
3644
|
+
} : function go$readdir2(path5, options2, cb2, startTime) {
|
|
3645
|
+
return fs$readdir(path5, options2, fs$readdirCallback(
|
|
3646
|
+
path5,
|
|
3647
3647
|
options2,
|
|
3648
3648
|
cb2,
|
|
3649
3649
|
startTime
|
|
3650
3650
|
));
|
|
3651
3651
|
};
|
|
3652
|
-
return go$readdir(
|
|
3653
|
-
function fs$readdirCallback(
|
|
3652
|
+
return go$readdir(path4, options, cb);
|
|
3653
|
+
function fs$readdirCallback(path5, options2, cb2, startTime) {
|
|
3654
3654
|
return function(err, files) {
|
|
3655
3655
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
3656
3656
|
enqueue([
|
|
3657
3657
|
go$readdir,
|
|
3658
|
-
[
|
|
3658
|
+
[path5, options2, cb2],
|
|
3659
3659
|
err,
|
|
3660
3660
|
startTime || Date.now(),
|
|
3661
3661
|
Date.now()
|
|
@@ -3670,21 +3670,21 @@ var require_graceful_fs = __commonJS({
|
|
|
3670
3670
|
}
|
|
3671
3671
|
}
|
|
3672
3672
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
3673
|
-
var legStreams = legacy(
|
|
3673
|
+
var legStreams = legacy(fs21);
|
|
3674
3674
|
ReadStream = legStreams.ReadStream;
|
|
3675
3675
|
WriteStream = legStreams.WriteStream;
|
|
3676
3676
|
}
|
|
3677
|
-
var fs$ReadStream =
|
|
3677
|
+
var fs$ReadStream = fs21.ReadStream;
|
|
3678
3678
|
if (fs$ReadStream) {
|
|
3679
3679
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
3680
3680
|
ReadStream.prototype.open = ReadStream$open;
|
|
3681
3681
|
}
|
|
3682
|
-
var fs$WriteStream =
|
|
3682
|
+
var fs$WriteStream = fs21.WriteStream;
|
|
3683
3683
|
if (fs$WriteStream) {
|
|
3684
3684
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
3685
3685
|
WriteStream.prototype.open = WriteStream$open;
|
|
3686
3686
|
}
|
|
3687
|
-
Object.defineProperty(
|
|
3687
|
+
Object.defineProperty(fs21, "ReadStream", {
|
|
3688
3688
|
get: function() {
|
|
3689
3689
|
return ReadStream;
|
|
3690
3690
|
},
|
|
@@ -3694,7 +3694,7 @@ var require_graceful_fs = __commonJS({
|
|
|
3694
3694
|
enumerable: true,
|
|
3695
3695
|
configurable: true
|
|
3696
3696
|
});
|
|
3697
|
-
Object.defineProperty(
|
|
3697
|
+
Object.defineProperty(fs21, "WriteStream", {
|
|
3698
3698
|
get: function() {
|
|
3699
3699
|
return WriteStream;
|
|
3700
3700
|
},
|
|
@@ -3705,7 +3705,7 @@ var require_graceful_fs = __commonJS({
|
|
|
3705
3705
|
configurable: true
|
|
3706
3706
|
});
|
|
3707
3707
|
var FileReadStream = ReadStream;
|
|
3708
|
-
Object.defineProperty(
|
|
3708
|
+
Object.defineProperty(fs21, "FileReadStream", {
|
|
3709
3709
|
get: function() {
|
|
3710
3710
|
return FileReadStream;
|
|
3711
3711
|
},
|
|
@@ -3716,7 +3716,7 @@ var require_graceful_fs = __commonJS({
|
|
|
3716
3716
|
configurable: true
|
|
3717
3717
|
});
|
|
3718
3718
|
var FileWriteStream = WriteStream;
|
|
3719
|
-
Object.defineProperty(
|
|
3719
|
+
Object.defineProperty(fs21, "FileWriteStream", {
|
|
3720
3720
|
get: function() {
|
|
3721
3721
|
return FileWriteStream;
|
|
3722
3722
|
},
|
|
@@ -3726,7 +3726,7 @@ var require_graceful_fs = __commonJS({
|
|
|
3726
3726
|
enumerable: true,
|
|
3727
3727
|
configurable: true
|
|
3728
3728
|
});
|
|
3729
|
-
function ReadStream(
|
|
3729
|
+
function ReadStream(path4, options) {
|
|
3730
3730
|
if (this instanceof ReadStream)
|
|
3731
3731
|
return fs$ReadStream.apply(this, arguments), this;
|
|
3732
3732
|
else
|
|
@@ -3746,7 +3746,7 @@ var require_graceful_fs = __commonJS({
|
|
|
3746
3746
|
}
|
|
3747
3747
|
});
|
|
3748
3748
|
}
|
|
3749
|
-
function WriteStream(
|
|
3749
|
+
function WriteStream(path4, options) {
|
|
3750
3750
|
if (this instanceof WriteStream)
|
|
3751
3751
|
return fs$WriteStream.apply(this, arguments), this;
|
|
3752
3752
|
else
|
|
@@ -3764,22 +3764,22 @@ var require_graceful_fs = __commonJS({
|
|
|
3764
3764
|
}
|
|
3765
3765
|
});
|
|
3766
3766
|
}
|
|
3767
|
-
function createReadStream(
|
|
3768
|
-
return new
|
|
3767
|
+
function createReadStream(path4, options) {
|
|
3768
|
+
return new fs21.ReadStream(path4, options);
|
|
3769
3769
|
}
|
|
3770
|
-
function createWriteStream(
|
|
3771
|
-
return new
|
|
3770
|
+
function createWriteStream(path4, options) {
|
|
3771
|
+
return new fs21.WriteStream(path4, options);
|
|
3772
3772
|
}
|
|
3773
|
-
var fs$open =
|
|
3774
|
-
|
|
3775
|
-
function open2(
|
|
3773
|
+
var fs$open = fs21.open;
|
|
3774
|
+
fs21.open = open2;
|
|
3775
|
+
function open2(path4, flags, mode, cb) {
|
|
3776
3776
|
if (typeof mode === "function")
|
|
3777
3777
|
cb = mode, mode = null;
|
|
3778
|
-
return go$open(
|
|
3779
|
-
function go$open(
|
|
3780
|
-
return fs$open(
|
|
3778
|
+
return go$open(path4, flags, mode, cb);
|
|
3779
|
+
function go$open(path5, flags2, mode2, cb2, startTime) {
|
|
3780
|
+
return fs$open(path5, flags2, mode2, function(err, fd) {
|
|
3781
3781
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
3782
|
-
enqueue([go$open, [
|
|
3782
|
+
enqueue([go$open, [path5, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
3783
3783
|
else {
|
|
3784
3784
|
if (typeof cb2 === "function")
|
|
3785
3785
|
cb2.apply(this, arguments);
|
|
@@ -3787,20 +3787,20 @@ var require_graceful_fs = __commonJS({
|
|
|
3787
3787
|
});
|
|
3788
3788
|
}
|
|
3789
3789
|
}
|
|
3790
|
-
return
|
|
3790
|
+
return fs21;
|
|
3791
3791
|
}
|
|
3792
3792
|
function enqueue(elem) {
|
|
3793
3793
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
3794
|
-
|
|
3794
|
+
fs20[gracefulQueue].push(elem);
|
|
3795
3795
|
retry();
|
|
3796
3796
|
}
|
|
3797
3797
|
var retryTimer;
|
|
3798
3798
|
function resetQueue() {
|
|
3799
3799
|
var now = Date.now();
|
|
3800
|
-
for (var i = 0; i <
|
|
3801
|
-
if (
|
|
3802
|
-
|
|
3803
|
-
|
|
3800
|
+
for (var i = 0; i < fs20[gracefulQueue].length; ++i) {
|
|
3801
|
+
if (fs20[gracefulQueue][i].length > 2) {
|
|
3802
|
+
fs20[gracefulQueue][i][3] = now;
|
|
3803
|
+
fs20[gracefulQueue][i][4] = now;
|
|
3804
3804
|
}
|
|
3805
3805
|
}
|
|
3806
3806
|
retry();
|
|
@@ -3808,9 +3808,9 @@ var require_graceful_fs = __commonJS({
|
|
|
3808
3808
|
function retry() {
|
|
3809
3809
|
clearTimeout(retryTimer);
|
|
3810
3810
|
retryTimer = void 0;
|
|
3811
|
-
if (
|
|
3811
|
+
if (fs20[gracefulQueue].length === 0)
|
|
3812
3812
|
return;
|
|
3813
|
-
var elem =
|
|
3813
|
+
var elem = fs20[gracefulQueue].shift();
|
|
3814
3814
|
var fn = elem[0];
|
|
3815
3815
|
var args = elem[1];
|
|
3816
3816
|
var err = elem[2];
|
|
@@ -3832,7 +3832,7 @@ var require_graceful_fs = __commonJS({
|
|
|
3832
3832
|
debug("RETRY", fn.name, args);
|
|
3833
3833
|
fn.apply(null, args.concat([startTime]));
|
|
3834
3834
|
} else {
|
|
3835
|
-
|
|
3835
|
+
fs20[gracefulQueue].push(elem);
|
|
3836
3836
|
}
|
|
3837
3837
|
}
|
|
3838
3838
|
if (retryTimer === void 0) {
|
|
@@ -3847,7 +3847,7 @@ var require_fs = __commonJS({
|
|
|
3847
3847
|
"node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
3848
3848
|
"use strict";
|
|
3849
3849
|
var u = require_universalify().fromCallback;
|
|
3850
|
-
var
|
|
3850
|
+
var fs20 = require_graceful_fs();
|
|
3851
3851
|
var api = [
|
|
3852
3852
|
"access",
|
|
3853
3853
|
"appendFile",
|
|
@@ -3888,26 +3888,26 @@ var require_fs = __commonJS({
|
|
|
3888
3888
|
"utimes",
|
|
3889
3889
|
"writeFile"
|
|
3890
3890
|
].filter((key) => {
|
|
3891
|
-
return typeof
|
|
3891
|
+
return typeof fs20[key] === "function";
|
|
3892
3892
|
});
|
|
3893
|
-
Object.assign(exports2,
|
|
3893
|
+
Object.assign(exports2, fs20);
|
|
3894
3894
|
api.forEach((method) => {
|
|
3895
|
-
exports2[method] = u(
|
|
3895
|
+
exports2[method] = u(fs20[method]);
|
|
3896
3896
|
});
|
|
3897
3897
|
exports2.exists = function(filename, callback) {
|
|
3898
3898
|
if (typeof callback === "function") {
|
|
3899
|
-
return
|
|
3899
|
+
return fs20.exists(filename, callback);
|
|
3900
3900
|
}
|
|
3901
3901
|
return new Promise((resolve) => {
|
|
3902
|
-
return
|
|
3902
|
+
return fs20.exists(filename, resolve);
|
|
3903
3903
|
});
|
|
3904
3904
|
};
|
|
3905
3905
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
3906
3906
|
if (typeof callback === "function") {
|
|
3907
|
-
return
|
|
3907
|
+
return fs20.read(fd, buffer, offset, length, position, callback);
|
|
3908
3908
|
}
|
|
3909
3909
|
return new Promise((resolve, reject) => {
|
|
3910
|
-
|
|
3910
|
+
fs20.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
3911
3911
|
if (err) return reject(err);
|
|
3912
3912
|
resolve({ bytesRead, buffer: buffer2 });
|
|
3913
3913
|
});
|
|
@@ -3915,10 +3915,10 @@ var require_fs = __commonJS({
|
|
|
3915
3915
|
};
|
|
3916
3916
|
exports2.write = function(fd, buffer, ...args) {
|
|
3917
3917
|
if (typeof args[args.length - 1] === "function") {
|
|
3918
|
-
return
|
|
3918
|
+
return fs20.write(fd, buffer, ...args);
|
|
3919
3919
|
}
|
|
3920
3920
|
return new Promise((resolve, reject) => {
|
|
3921
|
-
|
|
3921
|
+
fs20.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
3922
3922
|
if (err) return reject(err);
|
|
3923
3923
|
resolve({ bytesWritten, buffer: buffer2 });
|
|
3924
3924
|
});
|
|
@@ -3926,10 +3926,10 @@ var require_fs = __commonJS({
|
|
|
3926
3926
|
};
|
|
3927
3927
|
exports2.readv = function(fd, buffers, ...args) {
|
|
3928
3928
|
if (typeof args[args.length - 1] === "function") {
|
|
3929
|
-
return
|
|
3929
|
+
return fs20.readv(fd, buffers, ...args);
|
|
3930
3930
|
}
|
|
3931
3931
|
return new Promise((resolve, reject) => {
|
|
3932
|
-
|
|
3932
|
+
fs20.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
3933
3933
|
if (err) return reject(err);
|
|
3934
3934
|
resolve({ bytesRead, buffers: buffers2 });
|
|
3935
3935
|
});
|
|
@@ -3937,17 +3937,17 @@ var require_fs = __commonJS({
|
|
|
3937
3937
|
};
|
|
3938
3938
|
exports2.writev = function(fd, buffers, ...args) {
|
|
3939
3939
|
if (typeof args[args.length - 1] === "function") {
|
|
3940
|
-
return
|
|
3940
|
+
return fs20.writev(fd, buffers, ...args);
|
|
3941
3941
|
}
|
|
3942
3942
|
return new Promise((resolve, reject) => {
|
|
3943
|
-
|
|
3943
|
+
fs20.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
3944
3944
|
if (err) return reject(err);
|
|
3945
3945
|
resolve({ bytesWritten, buffers: buffers2 });
|
|
3946
3946
|
});
|
|
3947
3947
|
});
|
|
3948
3948
|
};
|
|
3949
|
-
if (typeof
|
|
3950
|
-
exports2.realpath.native = u(
|
|
3949
|
+
if (typeof fs20.realpath.native === "function") {
|
|
3950
|
+
exports2.realpath.native = u(fs20.realpath.native);
|
|
3951
3951
|
} else {
|
|
3952
3952
|
process.emitWarning(
|
|
3953
3953
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -3962,10 +3962,10 @@ var require_fs = __commonJS({
|
|
|
3962
3962
|
var require_utils = __commonJS({
|
|
3963
3963
|
"node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
3964
3964
|
"use strict";
|
|
3965
|
-
var
|
|
3965
|
+
var path4 = require("path");
|
|
3966
3966
|
module2.exports.checkPath = function checkPath(pth) {
|
|
3967
3967
|
if (process.platform === "win32") {
|
|
3968
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
3968
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path4.parse(pth).root, ""));
|
|
3969
3969
|
if (pathHasInvalidWinCharacters) {
|
|
3970
3970
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
3971
3971
|
error.code = "EINVAL";
|
|
@@ -3980,7 +3980,7 @@ var require_utils = __commonJS({
|
|
|
3980
3980
|
var require_make_dir = __commonJS({
|
|
3981
3981
|
"node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
3982
3982
|
"use strict";
|
|
3983
|
-
var
|
|
3983
|
+
var fs20 = require_fs();
|
|
3984
3984
|
var { checkPath } = require_utils();
|
|
3985
3985
|
var getMode = (options) => {
|
|
3986
3986
|
const defaults2 = { mode: 511 };
|
|
@@ -3989,14 +3989,14 @@ var require_make_dir = __commonJS({
|
|
|
3989
3989
|
};
|
|
3990
3990
|
module2.exports.makeDir = async (dir, options) => {
|
|
3991
3991
|
checkPath(dir);
|
|
3992
|
-
return
|
|
3992
|
+
return fs20.mkdir(dir, {
|
|
3993
3993
|
mode: getMode(options),
|
|
3994
3994
|
recursive: true
|
|
3995
3995
|
});
|
|
3996
3996
|
};
|
|
3997
3997
|
module2.exports.makeDirSync = (dir, options) => {
|
|
3998
3998
|
checkPath(dir);
|
|
3999
|
-
return
|
|
3999
|
+
return fs20.mkdirSync(dir, {
|
|
4000
4000
|
mode: getMode(options),
|
|
4001
4001
|
recursive: true
|
|
4002
4002
|
});
|
|
@@ -4028,13 +4028,13 @@ var require_path_exists = __commonJS({
|
|
|
4028
4028
|
"node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
4029
4029
|
"use strict";
|
|
4030
4030
|
var u = require_universalify().fromPromise;
|
|
4031
|
-
var
|
|
4032
|
-
function
|
|
4033
|
-
return
|
|
4031
|
+
var fs20 = require_fs();
|
|
4032
|
+
function pathExists(path4) {
|
|
4033
|
+
return fs20.access(path4).then(() => true).catch(() => false);
|
|
4034
4034
|
}
|
|
4035
4035
|
module2.exports = {
|
|
4036
|
-
pathExists: u(
|
|
4037
|
-
pathExistsSync:
|
|
4036
|
+
pathExists: u(pathExists),
|
|
4037
|
+
pathExistsSync: fs20.existsSync
|
|
4038
4038
|
};
|
|
4039
4039
|
}
|
|
4040
4040
|
});
|
|
@@ -4043,16 +4043,16 @@ var require_path_exists = __commonJS({
|
|
|
4043
4043
|
var require_utimes = __commonJS({
|
|
4044
4044
|
"node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
4045
4045
|
"use strict";
|
|
4046
|
-
var
|
|
4046
|
+
var fs20 = require_fs();
|
|
4047
4047
|
var u = require_universalify().fromPromise;
|
|
4048
|
-
async function utimesMillis(
|
|
4049
|
-
const fd = await
|
|
4048
|
+
async function utimesMillis(path4, atime, mtime) {
|
|
4049
|
+
const fd = await fs20.open(path4, "r+");
|
|
4050
4050
|
let closeErr = null;
|
|
4051
4051
|
try {
|
|
4052
|
-
await
|
|
4052
|
+
await fs20.futimes(fd, atime, mtime);
|
|
4053
4053
|
} finally {
|
|
4054
4054
|
try {
|
|
4055
|
-
await
|
|
4055
|
+
await fs20.close(fd);
|
|
4056
4056
|
} catch (e) {
|
|
4057
4057
|
closeErr = e;
|
|
4058
4058
|
}
|
|
@@ -4061,10 +4061,10 @@ var require_utimes = __commonJS({
|
|
|
4061
4061
|
throw closeErr;
|
|
4062
4062
|
}
|
|
4063
4063
|
}
|
|
4064
|
-
function utimesMillisSync(
|
|
4065
|
-
const fd =
|
|
4066
|
-
|
|
4067
|
-
return
|
|
4064
|
+
function utimesMillisSync(path4, atime, mtime) {
|
|
4065
|
+
const fd = fs20.openSync(path4, "r+");
|
|
4066
|
+
fs20.futimesSync(fd, atime, mtime);
|
|
4067
|
+
return fs20.closeSync(fd);
|
|
4068
4068
|
}
|
|
4069
4069
|
module2.exports = {
|
|
4070
4070
|
utimesMillis: u(utimesMillis),
|
|
@@ -4077,11 +4077,11 @@ var require_utimes = __commonJS({
|
|
|
4077
4077
|
var require_stat = __commonJS({
|
|
4078
4078
|
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
4079
4079
|
"use strict";
|
|
4080
|
-
var
|
|
4081
|
-
var
|
|
4080
|
+
var fs20 = require_fs();
|
|
4081
|
+
var path4 = require("path");
|
|
4082
4082
|
var u = require_universalify().fromPromise;
|
|
4083
4083
|
function getStats(src, dest, opts) {
|
|
4084
|
-
const statFunc = opts.dereference ? (file) =>
|
|
4084
|
+
const statFunc = opts.dereference ? (file) => fs20.stat(file, { bigint: true }) : (file) => fs20.lstat(file, { bigint: true });
|
|
4085
4085
|
return Promise.all([
|
|
4086
4086
|
statFunc(src),
|
|
4087
4087
|
statFunc(dest).catch((err) => {
|
|
@@ -4092,7 +4092,7 @@ var require_stat = __commonJS({
|
|
|
4092
4092
|
}
|
|
4093
4093
|
function getStatsSync(src, dest, opts) {
|
|
4094
4094
|
let destStat;
|
|
4095
|
-
const statFunc = opts.dereference ? (file) =>
|
|
4095
|
+
const statFunc = opts.dereference ? (file) => fs20.statSync(file, { bigint: true }) : (file) => fs20.lstatSync(file, { bigint: true });
|
|
4096
4096
|
const srcStat = statFunc(src);
|
|
4097
4097
|
try {
|
|
4098
4098
|
destStat = statFunc(dest);
|
|
@@ -4106,8 +4106,8 @@ var require_stat = __commonJS({
|
|
|
4106
4106
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
4107
4107
|
if (destStat) {
|
|
4108
4108
|
if (areIdentical(srcStat, destStat)) {
|
|
4109
|
-
const srcBaseName =
|
|
4110
|
-
const destBaseName =
|
|
4109
|
+
const srcBaseName = path4.basename(src);
|
|
4110
|
+
const destBaseName = path4.basename(dest);
|
|
4111
4111
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
4112
4112
|
return { srcStat, destStat, isChangingCase: true };
|
|
4113
4113
|
}
|
|
@@ -4129,8 +4129,8 @@ var require_stat = __commonJS({
|
|
|
4129
4129
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
4130
4130
|
if (destStat) {
|
|
4131
4131
|
if (areIdentical(srcStat, destStat)) {
|
|
4132
|
-
const srcBaseName =
|
|
4133
|
-
const destBaseName =
|
|
4132
|
+
const srcBaseName = path4.basename(src);
|
|
4133
|
+
const destBaseName = path4.basename(dest);
|
|
4134
4134
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
4135
4135
|
return { srcStat, destStat, isChangingCase: true };
|
|
4136
4136
|
}
|
|
@@ -4149,12 +4149,12 @@ var require_stat = __commonJS({
|
|
|
4149
4149
|
return { srcStat, destStat };
|
|
4150
4150
|
}
|
|
4151
4151
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
4152
|
-
const srcParent =
|
|
4153
|
-
const destParent =
|
|
4154
|
-
if (destParent === srcParent || destParent ===
|
|
4152
|
+
const srcParent = path4.resolve(path4.dirname(src));
|
|
4153
|
+
const destParent = path4.resolve(path4.dirname(dest));
|
|
4154
|
+
if (destParent === srcParent || destParent === path4.parse(destParent).root) return;
|
|
4155
4155
|
let destStat;
|
|
4156
4156
|
try {
|
|
4157
|
-
destStat = await
|
|
4157
|
+
destStat = await fs20.stat(destParent, { bigint: true });
|
|
4158
4158
|
} catch (err) {
|
|
4159
4159
|
if (err.code === "ENOENT") return;
|
|
4160
4160
|
throw err;
|
|
@@ -4165,12 +4165,12 @@ var require_stat = __commonJS({
|
|
|
4165
4165
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
4166
4166
|
}
|
|
4167
4167
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
4168
|
-
const srcParent =
|
|
4169
|
-
const destParent =
|
|
4170
|
-
if (destParent === srcParent || destParent ===
|
|
4168
|
+
const srcParent = path4.resolve(path4.dirname(src));
|
|
4169
|
+
const destParent = path4.resolve(path4.dirname(dest));
|
|
4170
|
+
if (destParent === srcParent || destParent === path4.parse(destParent).root) return;
|
|
4171
4171
|
let destStat;
|
|
4172
4172
|
try {
|
|
4173
|
-
destStat =
|
|
4173
|
+
destStat = fs20.statSync(destParent, { bigint: true });
|
|
4174
4174
|
} catch (err) {
|
|
4175
4175
|
if (err.code === "ENOENT") return;
|
|
4176
4176
|
throw err;
|
|
@@ -4184,8 +4184,8 @@ var require_stat = __commonJS({
|
|
|
4184
4184
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
4185
4185
|
}
|
|
4186
4186
|
function isSrcSubdir(src, dest) {
|
|
4187
|
-
const srcArr =
|
|
4188
|
-
const destArr =
|
|
4187
|
+
const srcArr = path4.resolve(src).split(path4.sep).filter((i) => i);
|
|
4188
|
+
const destArr = path4.resolve(dest).split(path4.sep).filter((i) => i);
|
|
4189
4189
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
4190
4190
|
}
|
|
4191
4191
|
function errMsg(src, dest, funcName) {
|
|
@@ -4237,10 +4237,10 @@ var require_async = __commonJS({
|
|
|
4237
4237
|
var require_copy = __commonJS({
|
|
4238
4238
|
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
4239
4239
|
"use strict";
|
|
4240
|
-
var
|
|
4241
|
-
var
|
|
4240
|
+
var fs20 = require_fs();
|
|
4241
|
+
var path4 = require("path");
|
|
4242
4242
|
var { mkdirs } = require_mkdirs();
|
|
4243
|
-
var { pathExists
|
|
4243
|
+
var { pathExists } = require_path_exists();
|
|
4244
4244
|
var { utimesMillis } = require_utimes();
|
|
4245
4245
|
var stat = require_stat();
|
|
4246
4246
|
var { asyncIteratorConcurrentProcess } = require_async();
|
|
@@ -4261,8 +4261,8 @@ var require_copy = __commonJS({
|
|
|
4261
4261
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
4262
4262
|
const include = await runFilter(src, dest, opts);
|
|
4263
4263
|
if (!include) return;
|
|
4264
|
-
const destParent =
|
|
4265
|
-
const dirExists = await
|
|
4264
|
+
const destParent = path4.dirname(dest);
|
|
4265
|
+
const dirExists = await pathExists(destParent);
|
|
4266
4266
|
if (!dirExists) {
|
|
4267
4267
|
await mkdirs(destParent);
|
|
4268
4268
|
}
|
|
@@ -4273,7 +4273,7 @@ var require_copy = __commonJS({
|
|
|
4273
4273
|
return opts.filter(src, dest);
|
|
4274
4274
|
}
|
|
4275
4275
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
4276
|
-
const statFn = opts.dereference ?
|
|
4276
|
+
const statFn = opts.dereference ? fs20.stat : fs20.lstat;
|
|
4277
4277
|
const srcStat = await statFn(src);
|
|
4278
4278
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
4279
4279
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -4285,7 +4285,7 @@ var require_copy = __commonJS({
|
|
|
4285
4285
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
4286
4286
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
4287
4287
|
if (opts.overwrite) {
|
|
4288
|
-
await
|
|
4288
|
+
await fs20.unlink(dest);
|
|
4289
4289
|
return copyFile(srcStat, src, dest, opts);
|
|
4290
4290
|
}
|
|
4291
4291
|
if (opts.errorOnExist) {
|
|
@@ -4293,29 +4293,29 @@ var require_copy = __commonJS({
|
|
|
4293
4293
|
}
|
|
4294
4294
|
}
|
|
4295
4295
|
async function copyFile(srcStat, src, dest, opts) {
|
|
4296
|
-
await
|
|
4296
|
+
await fs20.copyFile(src, dest);
|
|
4297
4297
|
if (opts.preserveTimestamps) {
|
|
4298
4298
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
4299
4299
|
await makeFileWritable(dest, srcStat.mode);
|
|
4300
4300
|
}
|
|
4301
|
-
const updatedSrcStat = await
|
|
4301
|
+
const updatedSrcStat = await fs20.stat(src);
|
|
4302
4302
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
4303
4303
|
}
|
|
4304
|
-
return
|
|
4304
|
+
return fs20.chmod(dest, srcStat.mode);
|
|
4305
4305
|
}
|
|
4306
4306
|
function fileIsNotWritable(srcMode) {
|
|
4307
4307
|
return (srcMode & 128) === 0;
|
|
4308
4308
|
}
|
|
4309
4309
|
function makeFileWritable(dest, srcMode) {
|
|
4310
|
-
return
|
|
4310
|
+
return fs20.chmod(dest, srcMode | 128);
|
|
4311
4311
|
}
|
|
4312
4312
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
4313
4313
|
if (!destStat) {
|
|
4314
|
-
await
|
|
4314
|
+
await fs20.mkdir(dest);
|
|
4315
4315
|
}
|
|
4316
|
-
await asyncIteratorConcurrentProcess(await
|
|
4317
|
-
const srcItem =
|
|
4318
|
-
const destItem =
|
|
4316
|
+
await asyncIteratorConcurrentProcess(await fs20.opendir(src), async (item) => {
|
|
4317
|
+
const srcItem = path4.join(src, item.name);
|
|
4318
|
+
const destItem = path4.join(dest, item.name);
|
|
4319
4319
|
const include = await runFilter(srcItem, destItem, opts);
|
|
4320
4320
|
if (include) {
|
|
4321
4321
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -4323,26 +4323,26 @@ var require_copy = __commonJS({
|
|
|
4323
4323
|
}
|
|
4324
4324
|
});
|
|
4325
4325
|
if (!destStat) {
|
|
4326
|
-
await
|
|
4326
|
+
await fs20.chmod(dest, srcStat.mode);
|
|
4327
4327
|
}
|
|
4328
4328
|
}
|
|
4329
4329
|
async function onLink(destStat, src, dest, opts) {
|
|
4330
|
-
let resolvedSrc = await
|
|
4330
|
+
let resolvedSrc = await fs20.readlink(src);
|
|
4331
4331
|
if (opts.dereference) {
|
|
4332
|
-
resolvedSrc =
|
|
4332
|
+
resolvedSrc = path4.resolve(process.cwd(), resolvedSrc);
|
|
4333
4333
|
}
|
|
4334
4334
|
if (!destStat) {
|
|
4335
|
-
return
|
|
4335
|
+
return fs20.symlink(resolvedSrc, dest);
|
|
4336
4336
|
}
|
|
4337
4337
|
let resolvedDest = null;
|
|
4338
4338
|
try {
|
|
4339
|
-
resolvedDest = await
|
|
4339
|
+
resolvedDest = await fs20.readlink(dest);
|
|
4340
4340
|
} catch (e) {
|
|
4341
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
4341
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs20.symlink(resolvedSrc, dest);
|
|
4342
4342
|
throw e;
|
|
4343
4343
|
}
|
|
4344
4344
|
if (opts.dereference) {
|
|
4345
|
-
resolvedDest =
|
|
4345
|
+
resolvedDest = path4.resolve(process.cwd(), resolvedDest);
|
|
4346
4346
|
}
|
|
4347
4347
|
if (resolvedSrc !== resolvedDest) {
|
|
4348
4348
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -4352,8 +4352,8 @@ var require_copy = __commonJS({
|
|
|
4352
4352
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
4353
4353
|
}
|
|
4354
4354
|
}
|
|
4355
|
-
await
|
|
4356
|
-
return
|
|
4355
|
+
await fs20.unlink(dest);
|
|
4356
|
+
return fs20.symlink(resolvedSrc, dest);
|
|
4357
4357
|
}
|
|
4358
4358
|
module2.exports = copy;
|
|
4359
4359
|
}
|
|
@@ -4363,8 +4363,8 @@ var require_copy = __commonJS({
|
|
|
4363
4363
|
var require_copy_sync = __commonJS({
|
|
4364
4364
|
"node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
4365
4365
|
"use strict";
|
|
4366
|
-
var
|
|
4367
|
-
var
|
|
4366
|
+
var fs20 = require_graceful_fs();
|
|
4367
|
+
var path4 = require("path");
|
|
4368
4368
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
4369
4369
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
4370
4370
|
var stat = require_stat();
|
|
@@ -4385,12 +4385,12 @@ var require_copy_sync = __commonJS({
|
|
|
4385
4385
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
4386
4386
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
4387
4387
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
4388
|
-
const destParent =
|
|
4389
|
-
if (!
|
|
4388
|
+
const destParent = path4.dirname(dest);
|
|
4389
|
+
if (!fs20.existsSync(destParent)) mkdirsSync(destParent);
|
|
4390
4390
|
return getStats(destStat, src, dest, opts);
|
|
4391
4391
|
}
|
|
4392
4392
|
function getStats(destStat, src, dest, opts) {
|
|
4393
|
-
const statSync = opts.dereference ?
|
|
4393
|
+
const statSync = opts.dereference ? fs20.statSync : fs20.lstatSync;
|
|
4394
4394
|
const srcStat = statSync(src);
|
|
4395
4395
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
4396
4396
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -4405,14 +4405,14 @@ var require_copy_sync = __commonJS({
|
|
|
4405
4405
|
}
|
|
4406
4406
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
4407
4407
|
if (opts.overwrite) {
|
|
4408
|
-
|
|
4408
|
+
fs20.unlinkSync(dest);
|
|
4409
4409
|
return copyFile(srcStat, src, dest, opts);
|
|
4410
4410
|
} else if (opts.errorOnExist) {
|
|
4411
4411
|
throw new Error(`'${dest}' already exists`);
|
|
4412
4412
|
}
|
|
4413
4413
|
}
|
|
4414
4414
|
function copyFile(srcStat, src, dest, opts) {
|
|
4415
|
-
|
|
4415
|
+
fs20.copyFileSync(src, dest);
|
|
4416
4416
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
4417
4417
|
return setDestMode(dest, srcStat.mode);
|
|
4418
4418
|
}
|
|
@@ -4427,10 +4427,10 @@ var require_copy_sync = __commonJS({
|
|
|
4427
4427
|
return setDestMode(dest, srcMode | 128);
|
|
4428
4428
|
}
|
|
4429
4429
|
function setDestMode(dest, srcMode) {
|
|
4430
|
-
return
|
|
4430
|
+
return fs20.chmodSync(dest, srcMode);
|
|
4431
4431
|
}
|
|
4432
4432
|
function setDestTimestamps(src, dest) {
|
|
4433
|
-
const updatedSrcStat =
|
|
4433
|
+
const updatedSrcStat = fs20.statSync(src);
|
|
4434
4434
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
4435
4435
|
}
|
|
4436
4436
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -4438,12 +4438,12 @@ var require_copy_sync = __commonJS({
|
|
|
4438
4438
|
return copyDir(src, dest, opts);
|
|
4439
4439
|
}
|
|
4440
4440
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
4441
|
-
|
|
4441
|
+
fs20.mkdirSync(dest);
|
|
4442
4442
|
copyDir(src, dest, opts);
|
|
4443
4443
|
return setDestMode(dest, srcMode);
|
|
4444
4444
|
}
|
|
4445
4445
|
function copyDir(src, dest, opts) {
|
|
4446
|
-
const dir =
|
|
4446
|
+
const dir = fs20.opendirSync(src);
|
|
4447
4447
|
try {
|
|
4448
4448
|
let dirent;
|
|
4449
4449
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -4454,29 +4454,29 @@ var require_copy_sync = __commonJS({
|
|
|
4454
4454
|
}
|
|
4455
4455
|
}
|
|
4456
4456
|
function copyDirItem(item, src, dest, opts) {
|
|
4457
|
-
const srcItem =
|
|
4458
|
-
const destItem =
|
|
4457
|
+
const srcItem = path4.join(src, item);
|
|
4458
|
+
const destItem = path4.join(dest, item);
|
|
4459
4459
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
4460
4460
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
4461
4461
|
return getStats(destStat, srcItem, destItem, opts);
|
|
4462
4462
|
}
|
|
4463
4463
|
function onLink(destStat, src, dest, opts) {
|
|
4464
|
-
let resolvedSrc =
|
|
4464
|
+
let resolvedSrc = fs20.readlinkSync(src);
|
|
4465
4465
|
if (opts.dereference) {
|
|
4466
|
-
resolvedSrc =
|
|
4466
|
+
resolvedSrc = path4.resolve(process.cwd(), resolvedSrc);
|
|
4467
4467
|
}
|
|
4468
4468
|
if (!destStat) {
|
|
4469
|
-
return
|
|
4469
|
+
return fs20.symlinkSync(resolvedSrc, dest);
|
|
4470
4470
|
} else {
|
|
4471
4471
|
let resolvedDest;
|
|
4472
4472
|
try {
|
|
4473
|
-
resolvedDest =
|
|
4473
|
+
resolvedDest = fs20.readlinkSync(dest);
|
|
4474
4474
|
} catch (err) {
|
|
4475
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
4475
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs20.symlinkSync(resolvedSrc, dest);
|
|
4476
4476
|
throw err;
|
|
4477
4477
|
}
|
|
4478
4478
|
if (opts.dereference) {
|
|
4479
|
-
resolvedDest =
|
|
4479
|
+
resolvedDest = path4.resolve(process.cwd(), resolvedDest);
|
|
4480
4480
|
}
|
|
4481
4481
|
if (resolvedSrc !== resolvedDest) {
|
|
4482
4482
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -4490,8 +4490,8 @@ var require_copy_sync = __commonJS({
|
|
|
4490
4490
|
}
|
|
4491
4491
|
}
|
|
4492
4492
|
function copyLink(resolvedSrc, dest) {
|
|
4493
|
-
|
|
4494
|
-
return
|
|
4493
|
+
fs20.unlinkSync(dest);
|
|
4494
|
+
return fs20.symlinkSync(resolvedSrc, dest);
|
|
4495
4495
|
}
|
|
4496
4496
|
module2.exports = copySync;
|
|
4497
4497
|
}
|
|
@@ -4513,16 +4513,16 @@ var require_copy2 = __commonJS({
|
|
|
4513
4513
|
var require_remove = __commonJS({
|
|
4514
4514
|
"node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
4515
4515
|
"use strict";
|
|
4516
|
-
var
|
|
4516
|
+
var fs20 = require_graceful_fs();
|
|
4517
4517
|
var u = require_universalify().fromCallback;
|
|
4518
|
-
function
|
|
4519
|
-
|
|
4518
|
+
function remove(path4, callback) {
|
|
4519
|
+
fs20.rm(path4, { recursive: true, force: true }, callback);
|
|
4520
4520
|
}
|
|
4521
|
-
function removeSync(
|
|
4522
|
-
|
|
4521
|
+
function removeSync(path4) {
|
|
4522
|
+
fs20.rmSync(path4, { recursive: true, force: true });
|
|
4523
4523
|
}
|
|
4524
4524
|
module2.exports = {
|
|
4525
|
-
remove: u(
|
|
4525
|
+
remove: u(remove),
|
|
4526
4526
|
removeSync
|
|
4527
4527
|
};
|
|
4528
4528
|
}
|
|
@@ -4533,29 +4533,29 @@ var require_empty = __commonJS({
|
|
|
4533
4533
|
"node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
4534
4534
|
"use strict";
|
|
4535
4535
|
var u = require_universalify().fromPromise;
|
|
4536
|
-
var
|
|
4537
|
-
var
|
|
4536
|
+
var fs20 = require_fs();
|
|
4537
|
+
var path4 = require("path");
|
|
4538
4538
|
var mkdir = require_mkdirs();
|
|
4539
|
-
var
|
|
4539
|
+
var remove = require_remove();
|
|
4540
4540
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
4541
4541
|
let items;
|
|
4542
4542
|
try {
|
|
4543
|
-
items = await
|
|
4543
|
+
items = await fs20.readdir(dir);
|
|
4544
4544
|
} catch {
|
|
4545
4545
|
return mkdir.mkdirs(dir);
|
|
4546
4546
|
}
|
|
4547
|
-
return Promise.all(items.map((item) =>
|
|
4547
|
+
return Promise.all(items.map((item) => remove.remove(path4.join(dir, item))));
|
|
4548
4548
|
});
|
|
4549
4549
|
function emptyDirSync(dir) {
|
|
4550
4550
|
let items;
|
|
4551
4551
|
try {
|
|
4552
|
-
items =
|
|
4552
|
+
items = fs20.readdirSync(dir);
|
|
4553
4553
|
} catch {
|
|
4554
4554
|
return mkdir.mkdirsSync(dir);
|
|
4555
4555
|
}
|
|
4556
4556
|
items.forEach((item) => {
|
|
4557
|
-
item =
|
|
4558
|
-
|
|
4557
|
+
item = path4.join(dir, item);
|
|
4558
|
+
remove.removeSync(item);
|
|
4559
4559
|
});
|
|
4560
4560
|
}
|
|
4561
4561
|
module2.exports = {
|
|
@@ -4572,52 +4572,52 @@ var require_file = __commonJS({
|
|
|
4572
4572
|
"node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
4573
4573
|
"use strict";
|
|
4574
4574
|
var u = require_universalify().fromPromise;
|
|
4575
|
-
var
|
|
4576
|
-
var
|
|
4575
|
+
var path4 = require("path");
|
|
4576
|
+
var fs20 = require_fs();
|
|
4577
4577
|
var mkdir = require_mkdirs();
|
|
4578
4578
|
async function createFile(file) {
|
|
4579
4579
|
let stats;
|
|
4580
4580
|
try {
|
|
4581
|
-
stats = await
|
|
4581
|
+
stats = await fs20.stat(file);
|
|
4582
4582
|
} catch {
|
|
4583
4583
|
}
|
|
4584
4584
|
if (stats && stats.isFile()) return;
|
|
4585
|
-
const dir =
|
|
4585
|
+
const dir = path4.dirname(file);
|
|
4586
4586
|
let dirStats = null;
|
|
4587
4587
|
try {
|
|
4588
|
-
dirStats = await
|
|
4588
|
+
dirStats = await fs20.stat(dir);
|
|
4589
4589
|
} catch (err) {
|
|
4590
4590
|
if (err.code === "ENOENT") {
|
|
4591
4591
|
await mkdir.mkdirs(dir);
|
|
4592
|
-
await
|
|
4592
|
+
await fs20.writeFile(file, "");
|
|
4593
4593
|
return;
|
|
4594
4594
|
} else {
|
|
4595
4595
|
throw err;
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
4598
4598
|
if (dirStats.isDirectory()) {
|
|
4599
|
-
await
|
|
4599
|
+
await fs20.writeFile(file, "");
|
|
4600
4600
|
} else {
|
|
4601
|
-
await
|
|
4601
|
+
await fs20.readdir(dir);
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
4604
|
function createFileSync(file) {
|
|
4605
4605
|
let stats;
|
|
4606
4606
|
try {
|
|
4607
|
-
stats =
|
|
4607
|
+
stats = fs20.statSync(file);
|
|
4608
4608
|
} catch {
|
|
4609
4609
|
}
|
|
4610
4610
|
if (stats && stats.isFile()) return;
|
|
4611
|
-
const dir =
|
|
4611
|
+
const dir = path4.dirname(file);
|
|
4612
4612
|
try {
|
|
4613
|
-
if (!
|
|
4614
|
-
|
|
4613
|
+
if (!fs20.statSync(dir).isDirectory()) {
|
|
4614
|
+
fs20.readdirSync(dir);
|
|
4615
4615
|
}
|
|
4616
4616
|
} catch (err) {
|
|
4617
4617
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
4618
4618
|
else throw err;
|
|
4619
4619
|
}
|
|
4620
|
-
|
|
4620
|
+
fs20.writeFileSync(file, "");
|
|
4621
4621
|
}
|
|
4622
4622
|
module2.exports = {
|
|
4623
4623
|
createFile: u(createFile),
|
|
@@ -4631,50 +4631,50 @@ var require_link = __commonJS({
|
|
|
4631
4631
|
"node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
4632
4632
|
"use strict";
|
|
4633
4633
|
var u = require_universalify().fromPromise;
|
|
4634
|
-
var
|
|
4635
|
-
var
|
|
4634
|
+
var path4 = require("path");
|
|
4635
|
+
var fs20 = require_fs();
|
|
4636
4636
|
var mkdir = require_mkdirs();
|
|
4637
|
-
var { pathExists
|
|
4637
|
+
var { pathExists } = require_path_exists();
|
|
4638
4638
|
var { areIdentical } = require_stat();
|
|
4639
4639
|
async function createLink(srcpath, dstpath) {
|
|
4640
4640
|
let dstStat;
|
|
4641
4641
|
try {
|
|
4642
|
-
dstStat = await
|
|
4642
|
+
dstStat = await fs20.lstat(dstpath);
|
|
4643
4643
|
} catch {
|
|
4644
4644
|
}
|
|
4645
4645
|
let srcStat;
|
|
4646
4646
|
try {
|
|
4647
|
-
srcStat = await
|
|
4647
|
+
srcStat = await fs20.lstat(srcpath);
|
|
4648
4648
|
} catch (err) {
|
|
4649
4649
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
4650
4650
|
throw err;
|
|
4651
4651
|
}
|
|
4652
4652
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
4653
|
-
const dir =
|
|
4654
|
-
const dirExists = await
|
|
4653
|
+
const dir = path4.dirname(dstpath);
|
|
4654
|
+
const dirExists = await pathExists(dir);
|
|
4655
4655
|
if (!dirExists) {
|
|
4656
4656
|
await mkdir.mkdirs(dir);
|
|
4657
4657
|
}
|
|
4658
|
-
await
|
|
4658
|
+
await fs20.link(srcpath, dstpath);
|
|
4659
4659
|
}
|
|
4660
4660
|
function createLinkSync(srcpath, dstpath) {
|
|
4661
4661
|
let dstStat;
|
|
4662
4662
|
try {
|
|
4663
|
-
dstStat =
|
|
4663
|
+
dstStat = fs20.lstatSync(dstpath);
|
|
4664
4664
|
} catch {
|
|
4665
4665
|
}
|
|
4666
4666
|
try {
|
|
4667
|
-
const srcStat =
|
|
4667
|
+
const srcStat = fs20.lstatSync(srcpath);
|
|
4668
4668
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
4669
4669
|
} catch (err) {
|
|
4670
4670
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
4671
4671
|
throw err;
|
|
4672
4672
|
}
|
|
4673
|
-
const dir =
|
|
4674
|
-
const dirExists =
|
|
4675
|
-
if (dirExists) return
|
|
4673
|
+
const dir = path4.dirname(dstpath);
|
|
4674
|
+
const dirExists = fs20.existsSync(dir);
|
|
4675
|
+
if (dirExists) return fs20.linkSync(srcpath, dstpath);
|
|
4676
4676
|
mkdir.mkdirsSync(dir);
|
|
4677
|
-
return
|
|
4677
|
+
return fs20.linkSync(srcpath, dstpath);
|
|
4678
4678
|
}
|
|
4679
4679
|
module2.exports = {
|
|
4680
4680
|
createLink: u(createLink),
|
|
@@ -4687,14 +4687,14 @@ var require_link = __commonJS({
|
|
|
4687
4687
|
var require_symlink_paths = __commonJS({
|
|
4688
4688
|
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
4689
4689
|
"use strict";
|
|
4690
|
-
var
|
|
4691
|
-
var
|
|
4692
|
-
var { pathExists
|
|
4690
|
+
var path4 = require("path");
|
|
4691
|
+
var fs20 = require_fs();
|
|
4692
|
+
var { pathExists } = require_path_exists();
|
|
4693
4693
|
var u = require_universalify().fromPromise;
|
|
4694
4694
|
async function symlinkPaths(srcpath, dstpath) {
|
|
4695
|
-
if (
|
|
4695
|
+
if (path4.isAbsolute(srcpath)) {
|
|
4696
4696
|
try {
|
|
4697
|
-
await
|
|
4697
|
+
await fs20.lstat(srcpath);
|
|
4698
4698
|
} catch (err) {
|
|
4699
4699
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
4700
4700
|
throw err;
|
|
@@ -4704,9 +4704,9 @@ var require_symlink_paths = __commonJS({
|
|
|
4704
4704
|
toDst: srcpath
|
|
4705
4705
|
};
|
|
4706
4706
|
}
|
|
4707
|
-
const dstdir =
|
|
4708
|
-
const relativeToDst =
|
|
4709
|
-
const exists = await
|
|
4707
|
+
const dstdir = path4.dirname(dstpath);
|
|
4708
|
+
const relativeToDst = path4.join(dstdir, srcpath);
|
|
4709
|
+
const exists = await pathExists(relativeToDst);
|
|
4710
4710
|
if (exists) {
|
|
4711
4711
|
return {
|
|
4712
4712
|
toCwd: relativeToDst,
|
|
@@ -4714,39 +4714,39 @@ var require_symlink_paths = __commonJS({
|
|
|
4714
4714
|
};
|
|
4715
4715
|
}
|
|
4716
4716
|
try {
|
|
4717
|
-
await
|
|
4717
|
+
await fs20.lstat(srcpath);
|
|
4718
4718
|
} catch (err) {
|
|
4719
4719
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
4720
4720
|
throw err;
|
|
4721
4721
|
}
|
|
4722
4722
|
return {
|
|
4723
4723
|
toCwd: srcpath,
|
|
4724
|
-
toDst:
|
|
4724
|
+
toDst: path4.relative(dstdir, srcpath)
|
|
4725
4725
|
};
|
|
4726
4726
|
}
|
|
4727
4727
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
4728
|
-
if (
|
|
4729
|
-
const exists2 =
|
|
4728
|
+
if (path4.isAbsolute(srcpath)) {
|
|
4729
|
+
const exists2 = fs20.existsSync(srcpath);
|
|
4730
4730
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
4731
4731
|
return {
|
|
4732
4732
|
toCwd: srcpath,
|
|
4733
4733
|
toDst: srcpath
|
|
4734
4734
|
};
|
|
4735
4735
|
}
|
|
4736
|
-
const dstdir =
|
|
4737
|
-
const relativeToDst =
|
|
4738
|
-
const exists =
|
|
4736
|
+
const dstdir = path4.dirname(dstpath);
|
|
4737
|
+
const relativeToDst = path4.join(dstdir, srcpath);
|
|
4738
|
+
const exists = fs20.existsSync(relativeToDst);
|
|
4739
4739
|
if (exists) {
|
|
4740
4740
|
return {
|
|
4741
4741
|
toCwd: relativeToDst,
|
|
4742
4742
|
toDst: srcpath
|
|
4743
4743
|
};
|
|
4744
4744
|
}
|
|
4745
|
-
const srcExists =
|
|
4745
|
+
const srcExists = fs20.existsSync(srcpath);
|
|
4746
4746
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
4747
4747
|
return {
|
|
4748
4748
|
toCwd: srcpath,
|
|
4749
|
-
toDst:
|
|
4749
|
+
toDst: path4.relative(dstdir, srcpath)
|
|
4750
4750
|
};
|
|
4751
4751
|
}
|
|
4752
4752
|
module2.exports = {
|
|
@@ -4760,13 +4760,13 @@ var require_symlink_paths = __commonJS({
|
|
|
4760
4760
|
var require_symlink_type = __commonJS({
|
|
4761
4761
|
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
4762
4762
|
"use strict";
|
|
4763
|
-
var
|
|
4763
|
+
var fs20 = require_fs();
|
|
4764
4764
|
var u = require_universalify().fromPromise;
|
|
4765
4765
|
async function symlinkType(srcpath, type) {
|
|
4766
4766
|
if (type) return type;
|
|
4767
4767
|
let stats;
|
|
4768
4768
|
try {
|
|
4769
|
-
stats = await
|
|
4769
|
+
stats = await fs20.lstat(srcpath);
|
|
4770
4770
|
} catch {
|
|
4771
4771
|
return "file";
|
|
4772
4772
|
}
|
|
@@ -4776,7 +4776,7 @@ var require_symlink_type = __commonJS({
|
|
|
4776
4776
|
if (type) return type;
|
|
4777
4777
|
let stats;
|
|
4778
4778
|
try {
|
|
4779
|
-
stats =
|
|
4779
|
+
stats = fs20.lstatSync(srcpath);
|
|
4780
4780
|
} catch {
|
|
4781
4781
|
return "file";
|
|
4782
4782
|
}
|
|
@@ -4794,54 +4794,54 @@ var require_symlink = __commonJS({
|
|
|
4794
4794
|
"node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
4795
4795
|
"use strict";
|
|
4796
4796
|
var u = require_universalify().fromPromise;
|
|
4797
|
-
var
|
|
4798
|
-
var
|
|
4797
|
+
var path4 = require("path");
|
|
4798
|
+
var fs20 = require_fs();
|
|
4799
4799
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
4800
4800
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
4801
4801
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
4802
|
-
var { pathExists
|
|
4802
|
+
var { pathExists } = require_path_exists();
|
|
4803
4803
|
var { areIdentical } = require_stat();
|
|
4804
4804
|
async function createSymlink(srcpath, dstpath, type) {
|
|
4805
4805
|
let stats;
|
|
4806
4806
|
try {
|
|
4807
|
-
stats = await
|
|
4807
|
+
stats = await fs20.lstat(dstpath);
|
|
4808
4808
|
} catch {
|
|
4809
4809
|
}
|
|
4810
4810
|
if (stats && stats.isSymbolicLink()) {
|
|
4811
4811
|
const [srcStat, dstStat] = await Promise.all([
|
|
4812
|
-
|
|
4813
|
-
|
|
4812
|
+
fs20.stat(srcpath),
|
|
4813
|
+
fs20.stat(dstpath)
|
|
4814
4814
|
]);
|
|
4815
4815
|
if (areIdentical(srcStat, dstStat)) return;
|
|
4816
4816
|
}
|
|
4817
4817
|
const relative2 = await symlinkPaths(srcpath, dstpath);
|
|
4818
4818
|
srcpath = relative2.toDst;
|
|
4819
4819
|
const toType = await symlinkType(relative2.toCwd, type);
|
|
4820
|
-
const dir =
|
|
4821
|
-
if (!await
|
|
4820
|
+
const dir = path4.dirname(dstpath);
|
|
4821
|
+
if (!await pathExists(dir)) {
|
|
4822
4822
|
await mkdirs(dir);
|
|
4823
4823
|
}
|
|
4824
|
-
return
|
|
4824
|
+
return fs20.symlink(srcpath, dstpath, toType);
|
|
4825
4825
|
}
|
|
4826
4826
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
4827
4827
|
let stats;
|
|
4828
4828
|
try {
|
|
4829
|
-
stats =
|
|
4829
|
+
stats = fs20.lstatSync(dstpath);
|
|
4830
4830
|
} catch {
|
|
4831
4831
|
}
|
|
4832
4832
|
if (stats && stats.isSymbolicLink()) {
|
|
4833
|
-
const srcStat =
|
|
4834
|
-
const dstStat =
|
|
4833
|
+
const srcStat = fs20.statSync(srcpath);
|
|
4834
|
+
const dstStat = fs20.statSync(dstpath);
|
|
4835
4835
|
if (areIdentical(srcStat, dstStat)) return;
|
|
4836
4836
|
}
|
|
4837
4837
|
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
4838
4838
|
srcpath = relative2.toDst;
|
|
4839
4839
|
type = symlinkTypeSync(relative2.toCwd, type);
|
|
4840
|
-
const dir =
|
|
4841
|
-
const exists =
|
|
4842
|
-
if (exists) return
|
|
4840
|
+
const dir = path4.dirname(dstpath);
|
|
4841
|
+
const exists = fs20.existsSync(dir);
|
|
4842
|
+
if (exists) return fs20.symlinkSync(srcpath, dstpath, type);
|
|
4843
4843
|
mkdirsSync(dir);
|
|
4844
|
-
return
|
|
4844
|
+
return fs20.symlinkSync(srcpath, dstpath, type);
|
|
4845
4845
|
}
|
|
4846
4846
|
module2.exports = {
|
|
4847
4847
|
createSymlink: u(createSymlink),
|
|
@@ -4910,9 +4910,9 @@ var require_jsonfile = __commonJS({
|
|
|
4910
4910
|
if (typeof options === "string") {
|
|
4911
4911
|
options = { encoding: options };
|
|
4912
4912
|
}
|
|
4913
|
-
const
|
|
4913
|
+
const fs20 = options.fs || _fs;
|
|
4914
4914
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
4915
|
-
let data = await universalify.fromCallback(
|
|
4915
|
+
let data = await universalify.fromCallback(fs20.readFile)(file, options);
|
|
4916
4916
|
data = stripBom(data);
|
|
4917
4917
|
let obj;
|
|
4918
4918
|
try {
|
|
@@ -4927,15 +4927,15 @@ var require_jsonfile = __commonJS({
|
|
|
4927
4927
|
}
|
|
4928
4928
|
return obj;
|
|
4929
4929
|
}
|
|
4930
|
-
var
|
|
4930
|
+
var readFile = universalify.fromPromise(_readFile);
|
|
4931
4931
|
function readFileSync5(file, options = {}) {
|
|
4932
4932
|
if (typeof options === "string") {
|
|
4933
4933
|
options = { encoding: options };
|
|
4934
4934
|
}
|
|
4935
|
-
const
|
|
4935
|
+
const fs20 = options.fs || _fs;
|
|
4936
4936
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
4937
4937
|
try {
|
|
4938
|
-
let content =
|
|
4938
|
+
let content = fs20.readFileSync(file, options);
|
|
4939
4939
|
content = stripBom(content);
|
|
4940
4940
|
return JSON.parse(content, options.reviver);
|
|
4941
4941
|
} catch (err) {
|
|
@@ -4948,20 +4948,20 @@ var require_jsonfile = __commonJS({
|
|
|
4948
4948
|
}
|
|
4949
4949
|
}
|
|
4950
4950
|
async function _writeFile(file, obj, options = {}) {
|
|
4951
|
-
const
|
|
4951
|
+
const fs20 = options.fs || _fs;
|
|
4952
4952
|
const str = stringify2(obj, options);
|
|
4953
|
-
await universalify.fromCallback(
|
|
4953
|
+
await universalify.fromCallback(fs20.writeFile)(file, str, options);
|
|
4954
4954
|
}
|
|
4955
|
-
var
|
|
4955
|
+
var writeFile = universalify.fromPromise(_writeFile);
|
|
4956
4956
|
function writeFileSync3(file, obj, options = {}) {
|
|
4957
|
-
const
|
|
4957
|
+
const fs20 = options.fs || _fs;
|
|
4958
4958
|
const str = stringify2(obj, options);
|
|
4959
|
-
return
|
|
4959
|
+
return fs20.writeFileSync(file, str, options);
|
|
4960
4960
|
}
|
|
4961
4961
|
module2.exports = {
|
|
4962
|
-
readFile
|
|
4962
|
+
readFile,
|
|
4963
4963
|
readFileSync: readFileSync5,
|
|
4964
|
-
writeFile
|
|
4964
|
+
writeFile,
|
|
4965
4965
|
writeFileSync: writeFileSync3
|
|
4966
4966
|
};
|
|
4967
4967
|
}
|
|
@@ -4987,23 +4987,23 @@ var require_output_file = __commonJS({
|
|
|
4987
4987
|
"node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
4988
4988
|
"use strict";
|
|
4989
4989
|
var u = require_universalify().fromPromise;
|
|
4990
|
-
var
|
|
4991
|
-
var
|
|
4990
|
+
var fs20 = require_fs();
|
|
4991
|
+
var path4 = require("path");
|
|
4992
4992
|
var mkdir = require_mkdirs();
|
|
4993
|
-
var
|
|
4993
|
+
var pathExists = require_path_exists().pathExists;
|
|
4994
4994
|
async function outputFile(file, data, encoding = "utf-8") {
|
|
4995
|
-
const dir =
|
|
4996
|
-
if (!await
|
|
4995
|
+
const dir = path4.dirname(file);
|
|
4996
|
+
if (!await pathExists(dir)) {
|
|
4997
4997
|
await mkdir.mkdirs(dir);
|
|
4998
4998
|
}
|
|
4999
|
-
return
|
|
4999
|
+
return fs20.writeFile(file, data, encoding);
|
|
5000
5000
|
}
|
|
5001
5001
|
function outputFileSync(file, ...args) {
|
|
5002
|
-
const dir =
|
|
5003
|
-
if (!
|
|
5002
|
+
const dir = path4.dirname(file);
|
|
5003
|
+
if (!fs20.existsSync(dir)) {
|
|
5004
5004
|
mkdir.mkdirsSync(dir);
|
|
5005
5005
|
}
|
|
5006
|
-
|
|
5006
|
+
fs20.writeFileSync(file, ...args);
|
|
5007
5007
|
}
|
|
5008
5008
|
module2.exports = {
|
|
5009
5009
|
outputFile: u(outputFile),
|
|
@@ -5062,19 +5062,19 @@ var require_json = __commonJS({
|
|
|
5062
5062
|
var require_move = __commonJS({
|
|
5063
5063
|
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
5064
5064
|
"use strict";
|
|
5065
|
-
var
|
|
5066
|
-
var
|
|
5065
|
+
var fs20 = require_fs();
|
|
5066
|
+
var path4 = require("path");
|
|
5067
5067
|
var { copy } = require_copy2();
|
|
5068
|
-
var { remove
|
|
5068
|
+
var { remove } = require_remove();
|
|
5069
5069
|
var { mkdirp } = require_mkdirs();
|
|
5070
|
-
var { pathExists
|
|
5070
|
+
var { pathExists } = require_path_exists();
|
|
5071
5071
|
var stat = require_stat();
|
|
5072
5072
|
async function move(src, dest, opts = {}) {
|
|
5073
5073
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5074
5074
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
5075
5075
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
5076
|
-
const destParent =
|
|
5077
|
-
const parsedParentPath =
|
|
5076
|
+
const destParent = path4.dirname(dest);
|
|
5077
|
+
const parsedParentPath = path4.parse(destParent);
|
|
5078
5078
|
if (parsedParentPath.root !== destParent) {
|
|
5079
5079
|
await mkdirp(destParent);
|
|
5080
5080
|
}
|
|
@@ -5083,13 +5083,13 @@ var require_move = __commonJS({
|
|
|
5083
5083
|
async function doRename(src, dest, overwrite, isChangingCase) {
|
|
5084
5084
|
if (!isChangingCase) {
|
|
5085
5085
|
if (overwrite) {
|
|
5086
|
-
await
|
|
5087
|
-
} else if (await
|
|
5086
|
+
await remove(dest);
|
|
5087
|
+
} else if (await pathExists(dest)) {
|
|
5088
5088
|
throw new Error("dest already exists.");
|
|
5089
5089
|
}
|
|
5090
5090
|
}
|
|
5091
5091
|
try {
|
|
5092
|
-
await
|
|
5092
|
+
await fs20.rename(src, dest);
|
|
5093
5093
|
} catch (err) {
|
|
5094
5094
|
if (err.code !== "EXDEV") {
|
|
5095
5095
|
throw err;
|
|
@@ -5104,7 +5104,7 @@ var require_move = __commonJS({
|
|
|
5104
5104
|
preserveTimestamps: true
|
|
5105
5105
|
};
|
|
5106
5106
|
await copy(src, dest, opts);
|
|
5107
|
-
return
|
|
5107
|
+
return remove(src);
|
|
5108
5108
|
}
|
|
5109
5109
|
module2.exports = move;
|
|
5110
5110
|
}
|
|
@@ -5114,8 +5114,8 @@ var require_move = __commonJS({
|
|
|
5114
5114
|
var require_move_sync = __commonJS({
|
|
5115
5115
|
"node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
5116
5116
|
"use strict";
|
|
5117
|
-
var
|
|
5118
|
-
var
|
|
5117
|
+
var fs20 = require_graceful_fs();
|
|
5118
|
+
var path4 = require("path");
|
|
5119
5119
|
var copySync = require_copy2().copySync;
|
|
5120
5120
|
var removeSync = require_remove().removeSync;
|
|
5121
5121
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -5125,12 +5125,12 @@ var require_move_sync = __commonJS({
|
|
|
5125
5125
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5126
5126
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
5127
5127
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
5128
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
5128
|
+
if (!isParentRoot(dest)) mkdirpSync(path4.dirname(dest));
|
|
5129
5129
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
5130
5130
|
}
|
|
5131
5131
|
function isParentRoot(dest) {
|
|
5132
|
-
const parent =
|
|
5133
|
-
const parsedPath =
|
|
5132
|
+
const parent = path4.dirname(dest);
|
|
5133
|
+
const parsedPath = path4.parse(parent);
|
|
5134
5134
|
return parsedPath.root === parent;
|
|
5135
5135
|
}
|
|
5136
5136
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -5139,12 +5139,12 @@ var require_move_sync = __commonJS({
|
|
|
5139
5139
|
removeSync(dest);
|
|
5140
5140
|
return rename(src, dest, overwrite);
|
|
5141
5141
|
}
|
|
5142
|
-
if (
|
|
5142
|
+
if (fs20.existsSync(dest)) throw new Error("dest already exists.");
|
|
5143
5143
|
return rename(src, dest, overwrite);
|
|
5144
5144
|
}
|
|
5145
5145
|
function rename(src, dest, overwrite) {
|
|
5146
5146
|
try {
|
|
5147
|
-
|
|
5147
|
+
fs20.renameSync(src, dest);
|
|
5148
5148
|
} catch (err) {
|
|
5149
5149
|
if (err.code !== "EXDEV") throw err;
|
|
5150
5150
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -11555,7 +11555,7 @@ var require_fromEvent = __commonJS({
|
|
|
11555
11555
|
return function(handler) {
|
|
11556
11556
|
return target[methodName](eventName, handler, options);
|
|
11557
11557
|
};
|
|
11558
|
-
}) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0],
|
|
11558
|
+
}) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0], remove = _a[1];
|
|
11559
11559
|
if (!add) {
|
|
11560
11560
|
if (isArrayLike_1.isArrayLike(target)) {
|
|
11561
11561
|
return mergeMap_1.mergeMap(function(subTarget) {
|
|
@@ -11576,7 +11576,7 @@ var require_fromEvent = __commonJS({
|
|
|
11576
11576
|
};
|
|
11577
11577
|
add(handler);
|
|
11578
11578
|
return function() {
|
|
11579
|
-
return
|
|
11579
|
+
return remove(handler);
|
|
11580
11580
|
};
|
|
11581
11581
|
});
|
|
11582
11582
|
}
|
|
@@ -17562,15 +17562,15 @@ var require_route = __commonJS({
|
|
|
17562
17562
|
};
|
|
17563
17563
|
}
|
|
17564
17564
|
function wrapConversion(toModel, graph) {
|
|
17565
|
-
const
|
|
17565
|
+
const path4 = [graph[toModel].parent, toModel];
|
|
17566
17566
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
17567
17567
|
let cur = graph[toModel].parent;
|
|
17568
17568
|
while (graph[cur].parent) {
|
|
17569
|
-
|
|
17569
|
+
path4.unshift(graph[cur].parent);
|
|
17570
17570
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
17571
17571
|
cur = graph[cur].parent;
|
|
17572
17572
|
}
|
|
17573
|
-
fn.conversion =
|
|
17573
|
+
fn.conversion = path4;
|
|
17574
17574
|
return fn;
|
|
17575
17575
|
}
|
|
17576
17576
|
module2.exports = function(fromModel) {
|
|
@@ -17944,7 +17944,7 @@ var require_has_flag = __commonJS({
|
|
|
17944
17944
|
var require_supports_color = __commonJS({
|
|
17945
17945
|
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
17946
17946
|
"use strict";
|
|
17947
|
-
var
|
|
17947
|
+
var os4 = require("os");
|
|
17948
17948
|
var tty2 = require("tty");
|
|
17949
17949
|
var hasFlag2 = require_has_flag();
|
|
17950
17950
|
var { env: env2 } = process;
|
|
@@ -17992,7 +17992,7 @@ var require_supports_color = __commonJS({
|
|
|
17992
17992
|
return min;
|
|
17993
17993
|
}
|
|
17994
17994
|
if (process.platform === "win32") {
|
|
17995
|
-
const osRelease =
|
|
17995
|
+
const osRelease = os4.release().split(".");
|
|
17996
17996
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
17997
17997
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
17998
17998
|
}
|
|
@@ -18509,14 +18509,14 @@ var require_signal_exit = __commonJS({
|
|
|
18509
18509
|
if (opts && opts.alwaysLast) {
|
|
18510
18510
|
ev = "afterexit";
|
|
18511
18511
|
}
|
|
18512
|
-
var
|
|
18512
|
+
var remove = function() {
|
|
18513
18513
|
emitter.removeListener(ev, cb);
|
|
18514
18514
|
if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
|
|
18515
18515
|
unload2();
|
|
18516
18516
|
}
|
|
18517
18517
|
};
|
|
18518
18518
|
emitter.on(ev, cb);
|
|
18519
|
-
return
|
|
18519
|
+
return remove;
|
|
18520
18520
|
};
|
|
18521
18521
|
unload2 = function unload3() {
|
|
18522
18522
|
if (!loaded || !processOk2(global.process)) {
|
|
@@ -19200,7 +19200,7 @@ var require_buffer_list = __commonJS({
|
|
|
19200
19200
|
}
|
|
19201
19201
|
}, {
|
|
19202
19202
|
key: "join",
|
|
19203
|
-
value: function
|
|
19203
|
+
value: function join17(s) {
|
|
19204
19204
|
if (this.length === 0) return "";
|
|
19205
19205
|
var p = this.head;
|
|
19206
19206
|
var ret = "" + p.data;
|
|
@@ -28077,10 +28077,10 @@ var require_lib2 = __commonJS({
|
|
|
28077
28077
|
exports2.analyse = analyse;
|
|
28078
28078
|
var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
28079
28079
|
let fd;
|
|
28080
|
-
const
|
|
28080
|
+
const fs20 = (0, node_1.default)();
|
|
28081
28081
|
const handler = (err, buffer) => {
|
|
28082
28082
|
if (fd) {
|
|
28083
|
-
|
|
28083
|
+
fs20.closeSync(fd);
|
|
28084
28084
|
}
|
|
28085
28085
|
if (err) {
|
|
28086
28086
|
reject(err);
|
|
@@ -28092,9 +28092,9 @@ var require_lib2 = __commonJS({
|
|
|
28092
28092
|
};
|
|
28093
28093
|
const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
|
|
28094
28094
|
if (sampleSize > 0) {
|
|
28095
|
-
fd =
|
|
28095
|
+
fd = fs20.openSync(filepath, "r");
|
|
28096
28096
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
28097
|
-
|
|
28097
|
+
fs20.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
28098
28098
|
if (err) {
|
|
28099
28099
|
handler(err, null);
|
|
28100
28100
|
} else {
|
|
@@ -28106,22 +28106,22 @@ var require_lib2 = __commonJS({
|
|
|
28106
28106
|
});
|
|
28107
28107
|
return;
|
|
28108
28108
|
}
|
|
28109
|
-
|
|
28109
|
+
fs20.readFile(filepath, handler);
|
|
28110
28110
|
});
|
|
28111
28111
|
exports2.detectFile = detectFile;
|
|
28112
28112
|
var detectFileSync = (filepath, opts = {}) => {
|
|
28113
|
-
const
|
|
28113
|
+
const fs20 = (0, node_1.default)();
|
|
28114
28114
|
if (opts && opts.sampleSize) {
|
|
28115
|
-
const fd =
|
|
28115
|
+
const fd = fs20.openSync(filepath, "r");
|
|
28116
28116
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
28117
|
-
const bytesRead =
|
|
28117
|
+
const bytesRead = fs20.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
28118
28118
|
if (bytesRead < opts.sampleSize) {
|
|
28119
28119
|
sample = sample.subarray(0, bytesRead);
|
|
28120
28120
|
}
|
|
28121
|
-
|
|
28121
|
+
fs20.closeSync(fd);
|
|
28122
28122
|
return (0, exports2.detect)(sample);
|
|
28123
28123
|
}
|
|
28124
|
-
return (0, exports2.detect)(
|
|
28124
|
+
return (0, exports2.detect)(fs20.readFileSync(filepath));
|
|
28125
28125
|
};
|
|
28126
28126
|
exports2.detectFileSync = detectFileSync;
|
|
28127
28127
|
exports2.default = {
|
|
@@ -31800,7 +31800,7 @@ var require_lib3 = __commonJS({
|
|
|
31800
31800
|
var trail = encoder.end();
|
|
31801
31801
|
return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
|
|
31802
31802
|
};
|
|
31803
|
-
module2.exports.decode = function
|
|
31803
|
+
module2.exports.decode = function decode2(buf, encoding, options) {
|
|
31804
31804
|
if (typeof buf === "string") {
|
|
31805
31805
|
if (!module2.exports.skipDecodeWarning) {
|
|
31806
31806
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
@@ -32455,7 +32455,7 @@ var require_has_flag2 = __commonJS({
|
|
|
32455
32455
|
var require_supports_colors = __commonJS({
|
|
32456
32456
|
"node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
|
|
32457
32457
|
"use strict";
|
|
32458
|
-
var
|
|
32458
|
+
var os4 = require("os");
|
|
32459
32459
|
var hasFlag2 = require_has_flag2();
|
|
32460
32460
|
var env2 = process.env;
|
|
32461
32461
|
var forceColor = void 0;
|
|
@@ -32493,7 +32493,7 @@ var require_supports_colors = __commonJS({
|
|
|
32493
32493
|
}
|
|
32494
32494
|
var min = forceColor ? 1 : 0;
|
|
32495
32495
|
if (process.platform === "win32") {
|
|
32496
|
-
var osRelease =
|
|
32496
|
+
var osRelease = os4.release().split(".");
|
|
32497
32497
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
32498
32498
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
32499
32499
|
}
|
|
@@ -36709,7 +36709,7 @@ var require_verify = __commonJS({
|
|
|
36709
36709
|
var JsonWebTokenError2 = require_JsonWebTokenError();
|
|
36710
36710
|
var NotBeforeError = require_NotBeforeError();
|
|
36711
36711
|
var TokenExpiredError2 = require_TokenExpiredError();
|
|
36712
|
-
var
|
|
36712
|
+
var decode2 = require_decode();
|
|
36713
36713
|
var timespan = require_timespan();
|
|
36714
36714
|
var validateAsymmetricKey = require_validateAsymmetricKey();
|
|
36715
36715
|
var PS_SUPPORTED = require_psSupported();
|
|
@@ -36763,7 +36763,7 @@ var require_verify = __commonJS({
|
|
|
36763
36763
|
}
|
|
36764
36764
|
let decodedToken;
|
|
36765
36765
|
try {
|
|
36766
|
-
decodedToken =
|
|
36766
|
+
decodedToken = decode2(jwtString, { complete: true });
|
|
36767
36767
|
} catch (err) {
|
|
36768
36768
|
return done(err);
|
|
36769
36769
|
}
|
|
@@ -38927,7 +38927,7 @@ var require_Pool = __commonJS({
|
|
|
38927
38927
|
return resource;
|
|
38928
38928
|
}).catch((err) => {
|
|
38929
38929
|
this._executeEventHandlers("acquireFail", eventId, err);
|
|
38930
|
-
|
|
38930
|
+
remove(this.pendingAcquires, pendingAcquire);
|
|
38931
38931
|
return Promise.reject(err);
|
|
38932
38932
|
});
|
|
38933
38933
|
this._tryAcquireOrCreate();
|
|
@@ -39070,7 +39070,7 @@ var require_Pool = __commonJS({
|
|
|
39070
39070
|
this._startReaping();
|
|
39071
39071
|
pendingAcquire.resolve(free.resource);
|
|
39072
39072
|
} else {
|
|
39073
|
-
|
|
39073
|
+
remove(this.used, free);
|
|
39074
39074
|
if (!validationSuccess) {
|
|
39075
39075
|
this._destroy(free.resource);
|
|
39076
39076
|
setTimeout(() => {
|
|
@@ -39084,7 +39084,7 @@ var require_Pool = __commonJS({
|
|
|
39084
39084
|
}
|
|
39085
39085
|
}
|
|
39086
39086
|
} finally {
|
|
39087
|
-
|
|
39087
|
+
remove(this.pendingValidations, pendingAcquire);
|
|
39088
39088
|
}
|
|
39089
39089
|
});
|
|
39090
39090
|
this._validateResource(free.resource).then((validationSuccess) => {
|
|
@@ -39128,7 +39128,7 @@ var require_Pool = __commonJS({
|
|
|
39128
39128
|
this._executeEventHandlers("createRequest", eventId);
|
|
39129
39129
|
const pendingCreate = new PendingOperation_1.PendingOperation(this.createTimeoutMillis);
|
|
39130
39130
|
pendingCreate.promise = pendingCreate.promise.catch((err) => {
|
|
39131
|
-
if (
|
|
39131
|
+
if (remove(this.pendingCreates, pendingCreate)) {
|
|
39132
39132
|
this._executeEventHandlers("createFail", eventId, err);
|
|
39133
39133
|
}
|
|
39134
39134
|
throw err;
|
|
@@ -39139,7 +39139,7 @@ var require_Pool = __commonJS({
|
|
|
39139
39139
|
this.destroyer(resource);
|
|
39140
39140
|
return null;
|
|
39141
39141
|
}
|
|
39142
|
-
|
|
39142
|
+
remove(this.pendingCreates, pendingCreate);
|
|
39143
39143
|
this.free.push(new Resource_1.Resource(resource));
|
|
39144
39144
|
pendingCreate.resolve(resource);
|
|
39145
39145
|
this._executeEventHandlers("createSuccess", eventId, resource);
|
|
@@ -39148,7 +39148,7 @@ var require_Pool = __commonJS({
|
|
|
39148
39148
|
if (pendingCreate.isRejected) {
|
|
39149
39149
|
return null;
|
|
39150
39150
|
}
|
|
39151
|
-
if (
|
|
39151
|
+
if (remove(this.pendingCreates, pendingCreate)) {
|
|
39152
39152
|
this._executeEventHandlers("createFail", eventId, err);
|
|
39153
39153
|
}
|
|
39154
39154
|
pendingCreate.reject(err);
|
|
@@ -39205,7 +39205,7 @@ var require_Pool = __commonJS({
|
|
|
39205
39205
|
}
|
|
39206
39206
|
};
|
|
39207
39207
|
exports2.Pool = Pool;
|
|
39208
|
-
function
|
|
39208
|
+
function remove(arr, item) {
|
|
39209
39209
|
const idx = arr.indexOf(item);
|
|
39210
39210
|
if (idx === -1) {
|
|
39211
39211
|
return false;
|
|
@@ -39654,7 +39654,7 @@ var require_table2 = __commonJS({
|
|
|
39654
39654
|
let cursor = -1;
|
|
39655
39655
|
let buffer = "";
|
|
39656
39656
|
let escaped = false;
|
|
39657
|
-
const
|
|
39657
|
+
const path4 = [];
|
|
39658
39658
|
while (++cursor < length) {
|
|
39659
39659
|
const char = name.charAt(cursor);
|
|
39660
39660
|
if (char === "[") {
|
|
@@ -39673,7 +39673,7 @@ var require_table2 = __commonJS({
|
|
|
39673
39673
|
if (escaped) {
|
|
39674
39674
|
buffer += char;
|
|
39675
39675
|
} else {
|
|
39676
|
-
|
|
39676
|
+
path4.push(buffer);
|
|
39677
39677
|
buffer = "";
|
|
39678
39678
|
}
|
|
39679
39679
|
} else {
|
|
@@ -39681,26 +39681,26 @@ var require_table2 = __commonJS({
|
|
|
39681
39681
|
}
|
|
39682
39682
|
}
|
|
39683
39683
|
if (buffer) {
|
|
39684
|
-
|
|
39684
|
+
path4.push(buffer);
|
|
39685
39685
|
}
|
|
39686
|
-
switch (
|
|
39686
|
+
switch (path4.length) {
|
|
39687
39687
|
case 1:
|
|
39688
39688
|
return {
|
|
39689
|
-
name:
|
|
39689
|
+
name: path4[0],
|
|
39690
39690
|
schema: null,
|
|
39691
39691
|
database: null
|
|
39692
39692
|
};
|
|
39693
39693
|
case 2:
|
|
39694
39694
|
return {
|
|
39695
|
-
name:
|
|
39696
|
-
schema:
|
|
39695
|
+
name: path4[1],
|
|
39696
|
+
schema: path4[0],
|
|
39697
39697
|
database: null
|
|
39698
39698
|
};
|
|
39699
39699
|
case 3:
|
|
39700
39700
|
return {
|
|
39701
|
-
name:
|
|
39702
|
-
schema:
|
|
39703
|
-
database:
|
|
39701
|
+
name: path4[2],
|
|
39702
|
+
schema: path4[1],
|
|
39703
|
+
database: path4[0]
|
|
39704
39704
|
};
|
|
39705
39705
|
default:
|
|
39706
39706
|
throw new Error("Invalid table name.");
|
|
@@ -43384,13 +43384,13 @@ function __disposeResources(env2) {
|
|
|
43384
43384
|
}
|
|
43385
43385
|
return next();
|
|
43386
43386
|
}
|
|
43387
|
-
function __rewriteRelativeImportExtension(
|
|
43388
|
-
if (typeof
|
|
43389
|
-
return
|
|
43387
|
+
function __rewriteRelativeImportExtension(path4, preserveJsx) {
|
|
43388
|
+
if (typeof path4 === "string" && /^\.\.?\//.test(path4)) {
|
|
43389
|
+
return path4.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) {
|
|
43390
43390
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext2 || !cm) ? m : d + ext2 + "." + cm.toLowerCase() + "js";
|
|
43391
43391
|
});
|
|
43392
43392
|
}
|
|
43393
|
-
return
|
|
43393
|
+
return path4;
|
|
43394
43394
|
}
|
|
43395
43395
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
43396
43396
|
var init_tslib_es6 = __esm({
|
|
@@ -43538,8 +43538,8 @@ var require_msalPlugins = __commonJS({
|
|
|
43538
43538
|
}
|
|
43539
43539
|
};
|
|
43540
43540
|
exports2.msalNodeFlowVSCodeCredentialControl = {
|
|
43541
|
-
setVSCodeAuthRecordPath(
|
|
43542
|
-
exports2.vsCodeAuthRecordPath =
|
|
43541
|
+
setVSCodeAuthRecordPath(path4) {
|
|
43542
|
+
exports2.vsCodeAuthRecordPath = path4;
|
|
43543
43543
|
},
|
|
43544
43544
|
setVSCodeBroker(broker) {
|
|
43545
43545
|
exports2.vsCodeBrokerInfo = {
|
|
@@ -44463,16 +44463,16 @@ var require_chainedTokenCredential = __commonJS({
|
|
|
44463
44463
|
// node_modules/uuid/dist/esm-node/rng.js
|
|
44464
44464
|
function rng() {
|
|
44465
44465
|
if (poolPtr > rnds8Pool.length - 16) {
|
|
44466
|
-
|
|
44466
|
+
import_crypto5.default.randomFillSync(rnds8Pool);
|
|
44467
44467
|
poolPtr = 0;
|
|
44468
44468
|
}
|
|
44469
44469
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
44470
44470
|
}
|
|
44471
|
-
var
|
|
44471
|
+
var import_crypto5, rnds8Pool, poolPtr;
|
|
44472
44472
|
var init_rng = __esm({
|
|
44473
44473
|
"node_modules/uuid/dist/esm-node/rng.js"() {
|
|
44474
44474
|
"use strict";
|
|
44475
|
-
|
|
44475
|
+
import_crypto5 = __toESM(require("crypto"));
|
|
44476
44476
|
rnds8Pool = new Uint8Array(256);
|
|
44477
44477
|
poolPtr = rnds8Pool.length;
|
|
44478
44478
|
}
|
|
@@ -44677,13 +44677,13 @@ function md5(bytes) {
|
|
|
44677
44677
|
} else if (typeof bytes === "string") {
|
|
44678
44678
|
bytes = Buffer.from(bytes, "utf8");
|
|
44679
44679
|
}
|
|
44680
|
-
return
|
|
44680
|
+
return import_crypto6.default.createHash("md5").update(bytes).digest();
|
|
44681
44681
|
}
|
|
44682
|
-
var
|
|
44682
|
+
var import_crypto6, md5_default;
|
|
44683
44683
|
var init_md5 = __esm({
|
|
44684
44684
|
"node_modules/uuid/dist/esm-node/md5.js"() {
|
|
44685
44685
|
"use strict";
|
|
44686
|
-
|
|
44686
|
+
import_crypto6 = __toESM(require("crypto"));
|
|
44687
44687
|
md5_default = md5;
|
|
44688
44688
|
}
|
|
44689
44689
|
});
|
|
@@ -44732,13 +44732,13 @@ function sha1(bytes) {
|
|
|
44732
44732
|
} else if (typeof bytes === "string") {
|
|
44733
44733
|
bytes = Buffer.from(bytes, "utf8");
|
|
44734
44734
|
}
|
|
44735
|
-
return
|
|
44735
|
+
return import_crypto7.default.createHash("sha1").update(bytes).digest();
|
|
44736
44736
|
}
|
|
44737
|
-
var
|
|
44737
|
+
var import_crypto7, sha1_default;
|
|
44738
44738
|
var init_sha1 = __esm({
|
|
44739
44739
|
"node_modules/uuid/dist/esm-node/sha1.js"() {
|
|
44740
44740
|
"use strict";
|
|
44741
|
-
|
|
44741
|
+
import_crypto7 = __toESM(require("crypto"));
|
|
44742
44742
|
sha1_default = sha1;
|
|
44743
44743
|
}
|
|
44744
44744
|
});
|
|
@@ -45694,12 +45694,12 @@ var require_index_node_C6O_wJLi = __commonJS({
|
|
|
45694
45694
|
static queryStringToObject(query) {
|
|
45695
45695
|
const obj = {};
|
|
45696
45696
|
const params = query.split("&");
|
|
45697
|
-
const
|
|
45697
|
+
const decode2 = (s) => decodeURIComponent(s.replace(/\+/g, " "));
|
|
45698
45698
|
params.forEach((pair) => {
|
|
45699
45699
|
if (pair.trim()) {
|
|
45700
45700
|
const [key, value] = pair.split(/=(.+)/g, 2);
|
|
45701
45701
|
if (key && value) {
|
|
45702
|
-
obj[
|
|
45702
|
+
obj[decode2(key)] = decode2(value);
|
|
45703
45703
|
}
|
|
45704
45704
|
}
|
|
45705
45705
|
});
|
|
@@ -52395,8 +52395,8 @@ var require_msal_node = __commonJS({
|
|
|
52395
52395
|
var crypto5 = require("crypto");
|
|
52396
52396
|
var msalCommon = require_lib6();
|
|
52397
52397
|
var jwt2 = require_jsonwebtoken();
|
|
52398
|
-
var
|
|
52399
|
-
var
|
|
52398
|
+
var fs20 = require("fs");
|
|
52399
|
+
var path4 = require("path");
|
|
52400
52400
|
var Serializer = class {
|
|
52401
52401
|
/**
|
|
52402
52402
|
* serialize the JSON blob
|
|
@@ -53546,12 +53546,12 @@ var require_msal_node = __commonJS({
|
|
|
53546
53546
|
static queryStringToObject(query) {
|
|
53547
53547
|
const obj = {};
|
|
53548
53548
|
const params = query.split("&");
|
|
53549
|
-
const
|
|
53549
|
+
const decode2 = (s) => decodeURIComponent(s.replace(/\+/g, " "));
|
|
53550
53550
|
params.forEach((pair) => {
|
|
53551
53551
|
if (pair.trim()) {
|
|
53552
53552
|
const [key, value] = pair.split(/=(.+)/g, 2);
|
|
53553
53553
|
if (key && value) {
|
|
53554
|
-
obj[
|
|
53554
|
+
obj[decode2(key)] = decode2(value);
|
|
53555
53555
|
}
|
|
53556
53556
|
}
|
|
53557
53557
|
});
|
|
@@ -62094,7 +62094,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62094
62094
|
if (!identityEndpoint || !imdsEndpoint) {
|
|
62095
62095
|
const fileDetectionPath = AZURE_ARC_FILE_DETECTION[process.platform];
|
|
62096
62096
|
try {
|
|
62097
|
-
|
|
62097
|
+
fs20.accessSync(fileDetectionPath, fs20.constants.F_OK | fs20.constants.R_OK);
|
|
62098
62098
|
identityEndpoint = DEFAULT_AZURE_ARC_IDENTITY_ENDPOINT;
|
|
62099
62099
|
imdsEndpoint = HIMDS_EXECUTABLE_HELPER_STRING;
|
|
62100
62100
|
} catch (err) {
|
|
@@ -62197,7 +62197,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62197
62197
|
throw createManagedIdentityError(platformNotSupported);
|
|
62198
62198
|
}
|
|
62199
62199
|
const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
|
|
62200
|
-
const fileName =
|
|
62200
|
+
const fileName = path4.basename(secretFilePath);
|
|
62201
62201
|
if (!fileName.endsWith(".key")) {
|
|
62202
62202
|
throw createManagedIdentityError(invalidFileExtension);
|
|
62203
62203
|
}
|
|
@@ -62206,7 +62206,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62206
62206
|
}
|
|
62207
62207
|
let secretFileSize;
|
|
62208
62208
|
try {
|
|
62209
|
-
secretFileSize = await
|
|
62209
|
+
secretFileSize = await fs20.statSync(secretFilePath).size;
|
|
62210
62210
|
} catch (e) {
|
|
62211
62211
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
62212
62212
|
}
|
|
@@ -62215,7 +62215,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62215
62215
|
}
|
|
62216
62216
|
let secret;
|
|
62217
62217
|
try {
|
|
62218
|
-
secret =
|
|
62218
|
+
secret = fs20.readFileSync(secretFilePath, EncodingTypes.UTF8);
|
|
62219
62219
|
} catch (e) {
|
|
62220
62220
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
62221
62221
|
}
|
|
@@ -62979,8 +62979,8 @@ var require_uuidUtils = __commonJS({
|
|
|
62979
62979
|
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js"(exports2) {
|
|
62980
62980
|
"use strict";
|
|
62981
62981
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
62982
|
-
exports2.randomUUID =
|
|
62983
|
-
function
|
|
62982
|
+
exports2.randomUUID = randomUUID3;
|
|
62983
|
+
function randomUUID3() {
|
|
62984
62984
|
return crypto.randomUUID();
|
|
62985
62985
|
}
|
|
62986
62986
|
}
|
|
@@ -63421,7 +63421,7 @@ var require_commonjs4 = __commonJS({
|
|
|
63421
63421
|
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
|
|
63422
63422
|
exports2.isError = isError;
|
|
63423
63423
|
exports2.isObject = isObject;
|
|
63424
|
-
exports2.randomUUID =
|
|
63424
|
+
exports2.randomUUID = randomUUID3;
|
|
63425
63425
|
exports2.uint8ArrayToString = uint8ArrayToString;
|
|
63426
63426
|
exports2.stringToUint8Array = stringToUint8Array;
|
|
63427
63427
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
@@ -63470,7 +63470,7 @@ var require_commonjs4 = __commonJS({
|
|
|
63470
63470
|
function isObject(input) {
|
|
63471
63471
|
return tspRuntime.isObject(input);
|
|
63472
63472
|
}
|
|
63473
|
-
function
|
|
63473
|
+
function randomUUID3() {
|
|
63474
63474
|
return tspRuntime.randomUUID();
|
|
63475
63475
|
}
|
|
63476
63476
|
exports2.isBrowser = tspRuntime.isBrowser;
|
|
@@ -63513,7 +63513,7 @@ var require_utils7 = __commonJS({
|
|
|
63513
63513
|
exports2.getAuthority = getAuthority;
|
|
63514
63514
|
exports2.getKnownAuthorities = getKnownAuthorities;
|
|
63515
63515
|
exports2.getMSALLogLevel = getMSALLogLevel;
|
|
63516
|
-
exports2.randomUUID =
|
|
63516
|
+
exports2.randomUUID = randomUUID3;
|
|
63517
63517
|
exports2.handleMsalError = handleMsalError;
|
|
63518
63518
|
exports2.publicToMsal = publicToMsal;
|
|
63519
63519
|
exports2.msalToPublic = msalToPublic;
|
|
@@ -63572,22 +63572,22 @@ var require_utils7 = __commonJS({
|
|
|
63572
63572
|
}
|
|
63573
63573
|
return [];
|
|
63574
63574
|
}
|
|
63575
|
-
var defaultLoggerCallback = (credLogger,
|
|
63575
|
+
var defaultLoggerCallback = (credLogger, platform4 = core_util_1.isNode ? "Node" : "Browser") => (level, message, containsPii) => {
|
|
63576
63576
|
if (containsPii) {
|
|
63577
63577
|
return;
|
|
63578
63578
|
}
|
|
63579
63579
|
switch (level) {
|
|
63580
63580
|
case msal_js_1.msalCommon.LogLevel.Error:
|
|
63581
|
-
credLogger.info(`MSAL ${
|
|
63581
|
+
credLogger.info(`MSAL ${platform4} V2 error: ${message}`);
|
|
63582
63582
|
return;
|
|
63583
63583
|
case msal_js_1.msalCommon.LogLevel.Info:
|
|
63584
|
-
credLogger.info(`MSAL ${
|
|
63584
|
+
credLogger.info(`MSAL ${platform4} V2 info message: ${message}`);
|
|
63585
63585
|
return;
|
|
63586
63586
|
case msal_js_1.msalCommon.LogLevel.Verbose:
|
|
63587
|
-
credLogger.info(`MSAL ${
|
|
63587
|
+
credLogger.info(`MSAL ${platform4} V2 verbose message: ${message}`);
|
|
63588
63588
|
return;
|
|
63589
63589
|
case msal_js_1.msalCommon.LogLevel.Warning:
|
|
63590
|
-
credLogger.info(`MSAL ${
|
|
63590
|
+
credLogger.info(`MSAL ${platform4} V2 warning: ${message}`);
|
|
63591
63591
|
return;
|
|
63592
63592
|
}
|
|
63593
63593
|
};
|
|
@@ -63606,7 +63606,7 @@ var require_utils7 = __commonJS({
|
|
|
63606
63606
|
return msal_js_1.msalCommon.LogLevel.Info;
|
|
63607
63607
|
}
|
|
63608
63608
|
}
|
|
63609
|
-
function
|
|
63609
|
+
function randomUUID3() {
|
|
63610
63610
|
return (0, core_util_1.randomUUID)();
|
|
63611
63611
|
}
|
|
63612
63612
|
function handleMsalError(scopes, error, getTokenOptions) {
|
|
@@ -66410,8 +66410,8 @@ var require_dist3 = __commonJS({
|
|
|
66410
66410
|
setRequestProps(req, opts) {
|
|
66411
66411
|
const { proxy } = this;
|
|
66412
66412
|
const protocol = opts.secureEndpoint ? "https:" : "http:";
|
|
66413
|
-
const
|
|
66414
|
-
const base = `${protocol}//${
|
|
66413
|
+
const hostname2 = req.getHeader("host") || "localhost";
|
|
66414
|
+
const base = `${protocol}//${hostname2}`;
|
|
66415
66415
|
const url = new url_1.URL(req.path, base);
|
|
66416
66416
|
if (opts.port !== 80) {
|
|
66417
66417
|
url.port = String(opts.port);
|
|
@@ -67559,8 +67559,8 @@ var require_getClient = __commonJS({
|
|
|
67559
67559
|
}
|
|
67560
67560
|
const { allowInsecureConnection, httpClient } = clientOptions;
|
|
67561
67561
|
const endpointUrl = clientOptions.endpoint ?? endpoint;
|
|
67562
|
-
const client = (
|
|
67563
|
-
const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl,
|
|
67562
|
+
const client = (path4, ...args) => {
|
|
67563
|
+
const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path4, args, { allowInsecureConnection, ...requestOptions });
|
|
67564
67564
|
return {
|
|
67565
67565
|
get: (requestOptions = {}) => {
|
|
67566
67566
|
return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient);
|
|
@@ -69742,15 +69742,15 @@ var require_urlHelpers2 = __commonJS({
|
|
|
69742
69742
|
let isAbsolutePath = false;
|
|
69743
69743
|
let requestUrl = replaceAll(baseUri, urlReplacements);
|
|
69744
69744
|
if (operationSpec.path) {
|
|
69745
|
-
let
|
|
69746
|
-
if (operationSpec.path === "/{nextLink}" &&
|
|
69747
|
-
|
|
69745
|
+
let path4 = replaceAll(operationSpec.path, urlReplacements);
|
|
69746
|
+
if (operationSpec.path === "/{nextLink}" && path4.startsWith("/")) {
|
|
69747
|
+
path4 = path4.substring(1);
|
|
69748
69748
|
}
|
|
69749
|
-
if (isAbsoluteUrl(
|
|
69750
|
-
requestUrl =
|
|
69749
|
+
if (isAbsoluteUrl(path4)) {
|
|
69750
|
+
requestUrl = path4;
|
|
69751
69751
|
isAbsolutePath = true;
|
|
69752
69752
|
} else {
|
|
69753
|
-
requestUrl = appendPath(requestUrl,
|
|
69753
|
+
requestUrl = appendPath(requestUrl, path4);
|
|
69754
69754
|
}
|
|
69755
69755
|
}
|
|
69756
69756
|
const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
|
|
@@ -69796,9 +69796,9 @@ var require_urlHelpers2 = __commonJS({
|
|
|
69796
69796
|
}
|
|
69797
69797
|
const searchStart = pathToAppend.indexOf("?");
|
|
69798
69798
|
if (searchStart !== -1) {
|
|
69799
|
-
const
|
|
69799
|
+
const path4 = pathToAppend.substring(0, searchStart);
|
|
69800
69800
|
const search = pathToAppend.substring(searchStart + 1);
|
|
69801
|
-
newPath = newPath +
|
|
69801
|
+
newPath = newPath + path4;
|
|
69802
69802
|
if (search) {
|
|
69803
69803
|
parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
|
|
69804
69804
|
}
|
|
@@ -71098,22 +71098,22 @@ function detectArchBinary(binary) {
|
|
|
71098
71098
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
71099
71099
|
return binary;
|
|
71100
71100
|
}
|
|
71101
|
-
const { [
|
|
71101
|
+
const { [arch2]: archBinary } = binary;
|
|
71102
71102
|
if (!archBinary) {
|
|
71103
|
-
throw new Error(`${
|
|
71103
|
+
throw new Error(`${arch2} is not supported`);
|
|
71104
71104
|
}
|
|
71105
71105
|
return archBinary;
|
|
71106
71106
|
}
|
|
71107
|
-
function detectPlatformBinary({ [
|
|
71107
|
+
function detectPlatformBinary({ [platform3]: platformBinary }, { wsl }) {
|
|
71108
71108
|
if (wsl && is_wsl_default) {
|
|
71109
71109
|
return detectArchBinary(wsl);
|
|
71110
71110
|
}
|
|
71111
71111
|
if (!platformBinary) {
|
|
71112
|
-
throw new Error(`${
|
|
71112
|
+
throw new Error(`${platform3} is not supported`);
|
|
71113
71113
|
}
|
|
71114
71114
|
return detectArchBinary(platformBinary);
|
|
71115
71115
|
}
|
|
71116
|
-
var import_node_process14, import_node_buffer, import_node_path3, import_node_url3, import_node_util5, import_node_child_process5, import_promises3, import_meta, execFile5, __dirname2, localXdgOpenPath,
|
|
71116
|
+
var import_node_process14, import_node_buffer, import_node_path3, import_node_url3, import_node_util5, import_node_child_process5, import_promises3, import_meta, execFile5, __dirname2, localXdgOpenPath, platform3, arch2, pTryEach, baseOpen, open, openApp, apps, open_default;
|
|
71117
71117
|
var init_open = __esm({
|
|
71118
71118
|
"node_modules/open/index.js"() {
|
|
71119
71119
|
"use strict";
|
|
@@ -71132,7 +71132,7 @@ var init_open = __esm({
|
|
|
71132
71132
|
execFile5 = (0, import_node_util5.promisify)(import_node_child_process5.default.execFile);
|
|
71133
71133
|
__dirname2 = import_node_path3.default.dirname((0, import_node_url3.fileURLToPath)(import_meta.url));
|
|
71134
71134
|
localXdgOpenPath = import_node_path3.default.join(__dirname2, "xdg-open");
|
|
71135
|
-
({ platform:
|
|
71135
|
+
({ platform: platform3, arch: arch2 } = import_node_process14.default);
|
|
71136
71136
|
pTryEach = async (array, mapper) => {
|
|
71137
71137
|
let latestError;
|
|
71138
71138
|
for (const item of array) {
|
|
@@ -71206,7 +71206,7 @@ var init_open = __esm({
|
|
|
71206
71206
|
let command;
|
|
71207
71207
|
const cliArguments = [];
|
|
71208
71208
|
const childProcessOptions = {};
|
|
71209
|
-
if (
|
|
71209
|
+
if (platform3 === "darwin") {
|
|
71210
71210
|
command = "open";
|
|
71211
71211
|
if (options.wait) {
|
|
71212
71212
|
cliArguments.push("--wait-apps");
|
|
@@ -71220,7 +71220,7 @@ var init_open = __esm({
|
|
|
71220
71220
|
if (app) {
|
|
71221
71221
|
cliArguments.push("-a", app);
|
|
71222
71222
|
}
|
|
71223
|
-
} else if (
|
|
71223
|
+
} else if (platform3 === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
|
71224
71224
|
command = await powerShellPath();
|
|
71225
71225
|
cliArguments.push(
|
|
71226
71226
|
"-NoProfile",
|
|
@@ -71260,7 +71260,7 @@ var init_open = __esm({
|
|
|
71260
71260
|
exeLocalXdgOpen = true;
|
|
71261
71261
|
} catch {
|
|
71262
71262
|
}
|
|
71263
|
-
const useSystemXdgOpen = import_node_process14.default.versions.electron ?? (
|
|
71263
|
+
const useSystemXdgOpen = import_node_process14.default.versions.electron ?? (platform3 === "android" || isBundled || !exeLocalXdgOpen);
|
|
71264
71264
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
71265
71265
|
}
|
|
71266
71266
|
if (appArguments.length > 0) {
|
|
@@ -71271,7 +71271,7 @@ var init_open = __esm({
|
|
|
71271
71271
|
childProcessOptions.detached = true;
|
|
71272
71272
|
}
|
|
71273
71273
|
}
|
|
71274
|
-
if (
|
|
71274
|
+
if (platform3 === "darwin" && appArguments.length > 0) {
|
|
71275
71275
|
cliArguments.push("--args", ...appArguments);
|
|
71276
71276
|
}
|
|
71277
71277
|
if (options.target) {
|
|
@@ -78307,7 +78307,7 @@ var require_abort_controller = __commonJS({
|
|
|
78307
78307
|
}
|
|
78308
78308
|
};
|
|
78309
78309
|
eventTargetShim.defineEventAttribute(AbortSignal2.prototype, "abort");
|
|
78310
|
-
function
|
|
78310
|
+
function createAbortSignal2() {
|
|
78311
78311
|
const signal = Object.create(AbortSignal2.prototype);
|
|
78312
78312
|
eventTargetShim.EventTarget.call(signal);
|
|
78313
78313
|
abortedFlags.set(signal, false);
|
|
@@ -78335,7 +78335,7 @@ var require_abort_controller = __commonJS({
|
|
|
78335
78335
|
* Initialize this controller.
|
|
78336
78336
|
*/
|
|
78337
78337
|
constructor() {
|
|
78338
|
-
signals2.set(this,
|
|
78338
|
+
signals2.set(this, createAbortSignal2());
|
|
78339
78339
|
}
|
|
78340
78340
|
/**
|
|
78341
78341
|
* Returns the `AbortSignal` object associated with this object.
|
|
@@ -83981,7 +83981,7 @@ var require_message_io = __commonJS({
|
|
|
83981
83981
|
return this.outgoingMessageStream.packetSize;
|
|
83982
83982
|
}
|
|
83983
83983
|
// Negotiate TLS encryption.
|
|
83984
|
-
startTls(credentialsDetails,
|
|
83984
|
+
startTls(credentialsDetails, hostname2, trustServerCertificate) {
|
|
83985
83985
|
if (!credentialsDetails.maxVersion || !["TLSv1.2", "TLSv1.1", "TLSv1"].includes(credentialsDetails.maxVersion)) {
|
|
83986
83986
|
credentialsDetails.maxVersion = "TLSv1.2";
|
|
83987
83987
|
}
|
|
@@ -83991,7 +83991,7 @@ var require_message_io = __commonJS({
|
|
|
83991
83991
|
const securePair = this.securePair = {
|
|
83992
83992
|
cleartext: tls.connect({
|
|
83993
83993
|
socket: duplexpair.socket1,
|
|
83994
|
-
servername:
|
|
83994
|
+
servername: hostname2,
|
|
83995
83995
|
secureContext,
|
|
83996
83996
|
rejectUnauthorized: !trustServerCertificate
|
|
83997
83997
|
}),
|
|
@@ -87253,7 +87253,7 @@ var init_js_joda_esm = __esm({
|
|
|
87253
87253
|
this._map = map8;
|
|
87254
87254
|
return this;
|
|
87255
87255
|
};
|
|
87256
|
-
_proto.remove = function
|
|
87256
|
+
_proto.remove = function remove(key) {
|
|
87257
87257
|
var keyName = key.name();
|
|
87258
87258
|
var val = this._map[keyName];
|
|
87259
87259
|
this._map[keyName] = void 0;
|
|
@@ -99457,7 +99457,7 @@ var require_lib7 = __commonJS({
|
|
|
99457
99457
|
var trail = encoder.end();
|
|
99458
99458
|
return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
|
|
99459
99459
|
};
|
|
99460
|
-
iconv2.decode = function
|
|
99460
|
+
iconv2.decode = function decode2(buf, encoding, options) {
|
|
99461
99461
|
if (typeof buf === "string") {
|
|
99462
99462
|
if (!iconv2.skipDecodeWarning) {
|
|
99463
99463
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
@@ -112208,14 +112208,14 @@ var import_fs_extra = __toESM(require_lib());
|
|
|
112208
112208
|
function getVsCodeSettingsPaths() {
|
|
112209
112209
|
const paths = [];
|
|
112210
112210
|
const home = (0, import_os.homedir)();
|
|
112211
|
-
const
|
|
112212
|
-
if (
|
|
112211
|
+
const os4 = (0, import_os.platform)();
|
|
112212
|
+
if (os4 === "win32") {
|
|
112213
112213
|
const appdata = process.env.APPDATA || (0, import_path.join)(home, "AppData", "Roaming");
|
|
112214
112214
|
paths.push(
|
|
112215
112215
|
{ path: (0, import_path.join)(appdata, "Code", "User", "settings.json"), variant: "Code" },
|
|
112216
112216
|
{ path: (0, import_path.join)(appdata, "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
|
|
112217
112217
|
);
|
|
112218
|
-
} else if (
|
|
112218
|
+
} else if (os4 === "darwin") {
|
|
112219
112219
|
paths.push(
|
|
112220
112220
|
{ path: (0, import_path.join)(home, "Library", "Application Support", "Code", "User", "settings.json"), variant: "Code" },
|
|
112221
112221
|
{ path: (0, import_path.join)(home, "Library", "Application Support", "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
|
|
@@ -112787,8 +112787,8 @@ async function installCommands(options = {}) {
|
|
|
112787
112787
|
version: getPackageVersion(),
|
|
112788
112788
|
installedAt: now,
|
|
112789
112789
|
updatedAt: now,
|
|
112790
|
-
files: result.installedFiles.map((
|
|
112791
|
-
path:
|
|
112790
|
+
files: result.installedFiles.map((path4) => ({
|
|
112791
|
+
path: path4,
|
|
112792
112792
|
installedAt: now
|
|
112793
112793
|
}))
|
|
112794
112794
|
};
|
|
@@ -115625,9 +115625,9 @@ var fetchAsyncQuestionProperty = function(question, prop, answers) {
|
|
|
115625
115625
|
|
|
115626
115626
|
// node_modules/inquirer/lib/ui/prompt.js
|
|
115627
115627
|
var _ = {
|
|
115628
|
-
set: (obj,
|
|
115628
|
+
set: (obj, path4 = "", value) => {
|
|
115629
115629
|
let pointer = obj;
|
|
115630
|
-
|
|
115630
|
+
path4.split(".").forEach((key, index, arr) => {
|
|
115631
115631
|
if (key === "__proto__" || key === "constructor") return;
|
|
115632
115632
|
if (index === arr.length - 1) {
|
|
115633
115633
|
pointer[key] = value;
|
|
@@ -115637,8 +115637,8 @@ var _ = {
|
|
|
115637
115637
|
pointer = pointer[key];
|
|
115638
115638
|
});
|
|
115639
115639
|
},
|
|
115640
|
-
get: (obj,
|
|
115641
|
-
const travel = (regexp) => String.prototype.split.call(
|
|
115640
|
+
get: (obj, path4 = "", defaultValue) => {
|
|
115641
|
+
const travel = (regexp) => String.prototype.split.call(path4, regexp).filter(Boolean).reduce(
|
|
115642
115642
|
// @ts-expect-error implicit any on res[key]
|
|
115643
115643
|
(res, key) => res !== null && res !== void 0 ? res[key] : res,
|
|
115644
115644
|
obj
|
|
@@ -116825,12 +116825,12 @@ EndGlobal
|
|
|
116825
116825
|
appSettingsContent = appSettingsContent.replace(/\{\{ProjectName\}\}/g, projectName).replace(/\{\{ProjectDomain\}\}/g, `${projectName.toLowerCase()}.app`).replace(/\{\{ProjectNameLower\}\}/g, projectName.toLowerCase()).replace(/\{\{JwtSecret\}\}/g, jwtSecret);
|
|
116826
116826
|
const appSettings = JSON.parse(appSettingsContent);
|
|
116827
116827
|
appSettings.MultiTenant = {
|
|
116828
|
-
Enabled:
|
|
116829
|
-
EnableB2B:
|
|
116830
|
-
EnableB2C:
|
|
116831
|
-
SystemTenantSlug:
|
|
116832
|
-
SystemTenantName:
|
|
116833
|
-
AutoAssignUsersToSystemTenant:
|
|
116828
|
+
Enabled: true,
|
|
116829
|
+
EnableB2B: true,
|
|
116830
|
+
EnableB2C: true,
|
|
116831
|
+
SystemTenantSlug: "default",
|
|
116832
|
+
SystemTenantName: "Default Workspace",
|
|
116833
|
+
AutoAssignUsersToSystemTenant: true
|
|
116834
116834
|
};
|
|
116835
116835
|
appSettings.Email.Provider = config.email.provider;
|
|
116836
116836
|
if (config.email.provider === "Disabled") {
|
|
@@ -117601,7 +117601,7 @@ async function initializeGit(config, dryRun) {
|
|
|
117601
117601
|
execCommand('git commit -m "chore: initial SmartStack project setup"', projectDir, dryRun);
|
|
117602
117602
|
}
|
|
117603
117603
|
}
|
|
117604
|
-
var initCommand = new Command("init").description("Initialize a new SmartStack project").argument("[name]", "Project name (optional, uses current folder if not provided)").option("--dry-run", "Show what would be created without actually creating").option("-y, --yes", "Skip prompts and use defaults").option("--skip-mcp-check", "Skip MCP servers verification").option("--
|
|
117604
|
+
var initCommand = new Command("init").description("Initialize a new SmartStack project").argument("[name]", "Project name (optional, uses current folder if not provided)").option("--dry-run", "Show what would be created without actually creating").option("-y, --yes", "Skip prompts and use defaults").option("--skip-mcp-check", "Skip MCP servers verification").option("--preview", "Use preview/prerelease versions (NuGet --prerelease + npm @next)").option("--here", "Initialize in current directory (use folder name as project name)").action(async (name, options) => {
|
|
117605
117605
|
logger.header("SmartStack Project Initialization");
|
|
117606
117606
|
if (!options.skipMcpCheck) {
|
|
117607
117607
|
logger.info("Checking MCP servers...");
|
|
@@ -117839,56 +117839,12 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117839
117839
|
database: "sqlserver",
|
|
117840
117840
|
preview: options.preview ?? false,
|
|
117841
117841
|
projectDir: finalProjectDir,
|
|
117842
|
-
multiTenant: {
|
|
117843
|
-
enabled: options.multiTenant ?? true,
|
|
117844
|
-
enableB2B: options.b2b ?? true,
|
|
117845
|
-
enableB2C: options.b2c ?? true,
|
|
117846
|
-
systemTenantSlug: "default",
|
|
117847
|
-
systemTenantName: "Default Workspace",
|
|
117848
|
-
autoAssignUsersToSystemTenant: true
|
|
117849
|
-
},
|
|
117850
117842
|
email: {
|
|
117851
117843
|
provider: "Development",
|
|
117852
117844
|
setupMailPit: false
|
|
117853
117845
|
}
|
|
117854
117846
|
};
|
|
117855
117847
|
} else {
|
|
117856
|
-
const answers = await lib_default.prompt([
|
|
117857
|
-
{
|
|
117858
|
-
type: "confirm",
|
|
117859
|
-
name: "multiTenantEnabled",
|
|
117860
|
-
message: "Enable multi-tenant mode?",
|
|
117861
|
-
default: true
|
|
117862
|
-
},
|
|
117863
|
-
{
|
|
117864
|
-
type: "confirm",
|
|
117865
|
-
name: "enableB2B",
|
|
117866
|
-
message: "Enable B2B (organisation management)?",
|
|
117867
|
-
default: true,
|
|
117868
|
-
when: (answers2) => answers2.multiTenantEnabled
|
|
117869
|
-
},
|
|
117870
|
-
{
|
|
117871
|
-
type: "confirm",
|
|
117872
|
-
name: "enableB2C",
|
|
117873
|
-
message: "Enable B2C (user tenant management)?",
|
|
117874
|
-
default: true,
|
|
117875
|
-
when: (answers2) => answers2.multiTenantEnabled
|
|
117876
|
-
},
|
|
117877
|
-
{
|
|
117878
|
-
type: "input",
|
|
117879
|
-
name: "systemTenantSlug",
|
|
117880
|
-
message: "System tenant slug:",
|
|
117881
|
-
default: "default",
|
|
117882
|
-
when: (answers2) => answers2.multiTenantEnabled
|
|
117883
|
-
},
|
|
117884
|
-
{
|
|
117885
|
-
type: "input",
|
|
117886
|
-
name: "systemTenantName",
|
|
117887
|
-
message: "System tenant name:",
|
|
117888
|
-
default: "Default Workspace",
|
|
117889
|
-
when: (answers2) => answers2.multiTenantEnabled
|
|
117890
|
-
}
|
|
117891
|
-
]);
|
|
117892
117848
|
const emailAnswers = await lib_default.prompt([
|
|
117893
117849
|
{
|
|
117894
117850
|
type: "list",
|
|
@@ -117916,14 +117872,6 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117916
117872
|
database: "sqlserver",
|
|
117917
117873
|
preview: options.preview ?? false,
|
|
117918
117874
|
projectDir: finalProjectDir,
|
|
117919
|
-
multiTenant: {
|
|
117920
|
-
enabled: answers.multiTenantEnabled ?? true,
|
|
117921
|
-
enableB2B: answers.enableB2B ?? true,
|
|
117922
|
-
enableB2C: answers.enableB2C ?? true,
|
|
117923
|
-
systemTenantSlug: answers.systemTenantSlug || "default",
|
|
117924
|
-
systemTenantName: answers.systemTenantName || "Default Workspace",
|
|
117925
|
-
autoAssignUsersToSystemTenant: true
|
|
117926
|
-
},
|
|
117927
117875
|
email: {
|
|
117928
117876
|
provider: emailAnswers.emailProvider || "Development",
|
|
117929
117877
|
setupMailPit: emailAnswers.setupMailPit ?? false
|
|
@@ -117938,12 +117886,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117938
117886
|
logger.info(`Project: ${source_default.cyan(config.name)}`);
|
|
117939
117887
|
logger.info(`Database: ${source_default.cyan("SQL Server")}`);
|
|
117940
117888
|
logger.info(`Preview mode: ${config.preview ? source_default.yellow("Enabled (prerelease)") : source_default.gray("Disabled (stable)")}`);
|
|
117941
|
-
logger.info(`Multi-Tenant: ${
|
|
117942
|
-
if (config.multiTenant.enabled) {
|
|
117943
|
-
logger.info(` B2B (Organisations): ${config.multiTenant.enableB2B ? source_default.green("Enabled") : source_default.gray("Disabled")}`);
|
|
117944
|
-
logger.info(` B2C (User Tenants): ${config.multiTenant.enableB2C ? source_default.green("Enabled") : source_default.gray("Disabled")}`);
|
|
117945
|
-
logger.info(` System Tenant: ${source_default.cyan(config.multiTenant.systemTenantSlug)} (${config.multiTenant.systemTenantName})`);
|
|
117946
|
-
}
|
|
117889
|
+
logger.info(`Multi-Tenant: ${source_default.green("Enabled")} (personal tenant)`);
|
|
117947
117890
|
const emailLabel = config.email.provider === "Development" ? `${source_default.green("Development")} (MailPit - SMTP :1025, Web :8025)` : config.email.provider === "Disabled" ? source_default.gray("Disabled") : source_default.cyan(config.email.provider);
|
|
117948
117891
|
logger.info(`Email: ${emailLabel}`);
|
|
117949
117892
|
console.log();
|
|
@@ -122248,12 +122191,12 @@ var PathBase = class {
|
|
|
122248
122191
|
/**
|
|
122249
122192
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
122250
122193
|
*/
|
|
122251
|
-
resolve(
|
|
122252
|
-
if (!
|
|
122194
|
+
resolve(path4) {
|
|
122195
|
+
if (!path4) {
|
|
122253
122196
|
return this;
|
|
122254
122197
|
}
|
|
122255
|
-
const rootPath = this.getRootString(
|
|
122256
|
-
const dir =
|
|
122198
|
+
const rootPath = this.getRootString(path4);
|
|
122199
|
+
const dir = path4.substring(rootPath.length);
|
|
122257
122200
|
const dirParts = dir.split(this.splitSep);
|
|
122258
122201
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
122259
122202
|
return result;
|
|
@@ -123005,8 +122948,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
123005
122948
|
/**
|
|
123006
122949
|
* @internal
|
|
123007
122950
|
*/
|
|
123008
|
-
getRootString(
|
|
123009
|
-
return import_node_path2.win32.parse(
|
|
122951
|
+
getRootString(path4) {
|
|
122952
|
+
return import_node_path2.win32.parse(path4).root;
|
|
123010
122953
|
}
|
|
123011
122954
|
/**
|
|
123012
122955
|
* @internal
|
|
@@ -123052,8 +122995,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
123052
122995
|
/**
|
|
123053
122996
|
* @internal
|
|
123054
122997
|
*/
|
|
123055
|
-
getRootString(
|
|
123056
|
-
return
|
|
122998
|
+
getRootString(path4) {
|
|
122999
|
+
return path4.startsWith("/") ? "/" : "";
|
|
123057
123000
|
}
|
|
123058
123001
|
/**
|
|
123059
123002
|
* @internal
|
|
@@ -123102,8 +123045,8 @@ var PathScurryBase = class {
|
|
|
123102
123045
|
*
|
|
123103
123046
|
* @internal
|
|
123104
123047
|
*/
|
|
123105
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
123106
|
-
this.#fs = fsFromOption(
|
|
123048
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs20 = defaultFS } = {}) {
|
|
123049
|
+
this.#fs = fsFromOption(fs20);
|
|
123107
123050
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
123108
123051
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
123109
123052
|
}
|
|
@@ -123142,11 +123085,11 @@ var PathScurryBase = class {
|
|
|
123142
123085
|
/**
|
|
123143
123086
|
* Get the depth of a provided path, string, or the cwd
|
|
123144
123087
|
*/
|
|
123145
|
-
depth(
|
|
123146
|
-
if (typeof
|
|
123147
|
-
|
|
123088
|
+
depth(path4 = this.cwd) {
|
|
123089
|
+
if (typeof path4 === "string") {
|
|
123090
|
+
path4 = this.cwd.resolve(path4);
|
|
123148
123091
|
}
|
|
123149
|
-
return
|
|
123092
|
+
return path4.depth();
|
|
123150
123093
|
}
|
|
123151
123094
|
/**
|
|
123152
123095
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -123633,9 +123576,9 @@ var PathScurryBase = class {
|
|
|
123633
123576
|
process17();
|
|
123634
123577
|
return results;
|
|
123635
123578
|
}
|
|
123636
|
-
chdir(
|
|
123579
|
+
chdir(path4 = this.cwd) {
|
|
123637
123580
|
const oldCwd = this.cwd;
|
|
123638
|
-
this.cwd = typeof
|
|
123581
|
+
this.cwd = typeof path4 === "string" ? this.cwd.resolve(path4) : path4;
|
|
123639
123582
|
this.cwd[setAsCwd](oldCwd);
|
|
123640
123583
|
}
|
|
123641
123584
|
};
|
|
@@ -123661,8 +123604,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
123661
123604
|
/**
|
|
123662
123605
|
* @internal
|
|
123663
123606
|
*/
|
|
123664
|
-
newRoot(
|
|
123665
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
123607
|
+
newRoot(fs20) {
|
|
123608
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs20 });
|
|
123666
123609
|
}
|
|
123667
123610
|
/**
|
|
123668
123611
|
* Return true if the provided path string is an absolute path
|
|
@@ -123690,8 +123633,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
123690
123633
|
/**
|
|
123691
123634
|
* @internal
|
|
123692
123635
|
*/
|
|
123693
|
-
newRoot(
|
|
123694
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
123636
|
+
newRoot(fs20) {
|
|
123637
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs20 });
|
|
123695
123638
|
}
|
|
123696
123639
|
/**
|
|
123697
123640
|
* Return true if the provided path string is an absolute path
|
|
@@ -123724,7 +123667,7 @@ var Pattern = class _Pattern {
|
|
|
123724
123667
|
#isUNC;
|
|
123725
123668
|
#isAbsolute;
|
|
123726
123669
|
#followGlobstar = true;
|
|
123727
|
-
constructor(patternList, globList, index,
|
|
123670
|
+
constructor(patternList, globList, index, platform4) {
|
|
123728
123671
|
if (!isPatternList(patternList)) {
|
|
123729
123672
|
throw new TypeError("empty pattern list");
|
|
123730
123673
|
}
|
|
@@ -123741,7 +123684,7 @@ var Pattern = class _Pattern {
|
|
|
123741
123684
|
this.#patternList = patternList;
|
|
123742
123685
|
this.#globList = globList;
|
|
123743
123686
|
this.#index = index;
|
|
123744
|
-
this.#platform =
|
|
123687
|
+
this.#platform = platform4;
|
|
123745
123688
|
if (this.#index === 0) {
|
|
123746
123689
|
if (this.isUNC()) {
|
|
123747
123690
|
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
|
@@ -123883,12 +123826,12 @@ var Ignore = class {
|
|
|
123883
123826
|
absoluteChildren;
|
|
123884
123827
|
platform;
|
|
123885
123828
|
mmopts;
|
|
123886
|
-
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform:
|
|
123829
|
+
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform4 = defaultPlatform2 }) {
|
|
123887
123830
|
this.relative = [];
|
|
123888
123831
|
this.absolute = [];
|
|
123889
123832
|
this.relativeChildren = [];
|
|
123890
123833
|
this.absoluteChildren = [];
|
|
123891
|
-
this.platform =
|
|
123834
|
+
this.platform = platform4;
|
|
123892
123835
|
this.mmopts = {
|
|
123893
123836
|
dot: true,
|
|
123894
123837
|
nobrace,
|
|
@@ -123896,7 +123839,7 @@ var Ignore = class {
|
|
|
123896
123839
|
noext,
|
|
123897
123840
|
noglobstar,
|
|
123898
123841
|
optimizationLevel: 2,
|
|
123899
|
-
platform:
|
|
123842
|
+
platform: platform4,
|
|
123900
123843
|
nocomment: true,
|
|
123901
123844
|
nonegate: true
|
|
123902
123845
|
};
|
|
@@ -123991,8 +123934,8 @@ var MatchRecord = class {
|
|
|
123991
123934
|
}
|
|
123992
123935
|
// match, absolute, ifdir
|
|
123993
123936
|
entries() {
|
|
123994
|
-
return [...this.store.entries()].map(([
|
|
123995
|
-
|
|
123937
|
+
return [...this.store.entries()].map(([path4, n]) => [
|
|
123938
|
+
path4,
|
|
123996
123939
|
!!(n & 2),
|
|
123997
123940
|
!!(n & 1)
|
|
123998
123941
|
]);
|
|
@@ -124197,9 +124140,9 @@ var GlobUtil = class {
|
|
|
124197
124140
|
signal;
|
|
124198
124141
|
maxDepth;
|
|
124199
124142
|
includeChildMatches;
|
|
124200
|
-
constructor(patterns,
|
|
124143
|
+
constructor(patterns, path4, opts) {
|
|
124201
124144
|
this.patterns = patterns;
|
|
124202
|
-
this.path =
|
|
124145
|
+
this.path = path4;
|
|
124203
124146
|
this.opts = opts;
|
|
124204
124147
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
124205
124148
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -124218,11 +124161,11 @@ var GlobUtil = class {
|
|
|
124218
124161
|
});
|
|
124219
124162
|
}
|
|
124220
124163
|
}
|
|
124221
|
-
#ignored(
|
|
124222
|
-
return this.seen.has(
|
|
124164
|
+
#ignored(path4) {
|
|
124165
|
+
return this.seen.has(path4) || !!this.#ignore?.ignored?.(path4);
|
|
124223
124166
|
}
|
|
124224
|
-
#childrenIgnored(
|
|
124225
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
124167
|
+
#childrenIgnored(path4) {
|
|
124168
|
+
return !!this.#ignore?.childrenIgnored?.(path4);
|
|
124226
124169
|
}
|
|
124227
124170
|
// backpressure mechanism
|
|
124228
124171
|
pause() {
|
|
@@ -124437,8 +124380,8 @@ var GlobUtil = class {
|
|
|
124437
124380
|
};
|
|
124438
124381
|
var GlobWalker = class extends GlobUtil {
|
|
124439
124382
|
matches = /* @__PURE__ */ new Set();
|
|
124440
|
-
constructor(patterns,
|
|
124441
|
-
super(patterns,
|
|
124383
|
+
constructor(patterns, path4, opts) {
|
|
124384
|
+
super(patterns, path4, opts);
|
|
124442
124385
|
}
|
|
124443
124386
|
matchEmit(e) {
|
|
124444
124387
|
this.matches.add(e);
|
|
@@ -124475,8 +124418,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
124475
124418
|
};
|
|
124476
124419
|
var GlobStream = class extends GlobUtil {
|
|
124477
124420
|
results;
|
|
124478
|
-
constructor(patterns,
|
|
124479
|
-
super(patterns,
|
|
124421
|
+
constructor(patterns, path4, opts) {
|
|
124422
|
+
super(patterns, path4, opts);
|
|
124480
124423
|
this.results = new Minipass({
|
|
124481
124424
|
signal: this.signal,
|
|
124482
124425
|
objectMode: true
|
|
@@ -124774,15 +124717,15 @@ var import_crypto3 = require("crypto");
|
|
|
124774
124717
|
function addMissingKeys(target, template, prefix = "") {
|
|
124775
124718
|
const added = [];
|
|
124776
124719
|
for (const key of Object.keys(template)) {
|
|
124777
|
-
const
|
|
124720
|
+
const path4 = prefix ? `${prefix}.${key}` : key;
|
|
124778
124721
|
if (!(key in target)) {
|
|
124779
124722
|
target[key] = template[key];
|
|
124780
|
-
added.push(
|
|
124723
|
+
added.push(path4);
|
|
124781
124724
|
} else if (isPlainObject(target[key]) && isPlainObject(template[key])) {
|
|
124782
124725
|
const nested = addMissingKeys(
|
|
124783
124726
|
target[key],
|
|
124784
124727
|
template[key],
|
|
124785
|
-
|
|
124728
|
+
path4
|
|
124786
124729
|
);
|
|
124787
124730
|
added.push(...nested);
|
|
124788
124731
|
}
|
|
@@ -125502,10 +125445,381 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
125502
125445
|
|
|
125503
125446
|
// src/lib/license.ts
|
|
125504
125447
|
var jwt = __toESM(require_jsonwebtoken());
|
|
125505
|
-
var
|
|
125506
|
-
|
|
125507
|
-
|
|
125508
|
-
var
|
|
125448
|
+
var import_fs_extra11 = __toESM(require_lib());
|
|
125449
|
+
|
|
125450
|
+
// src/lib/license-paths.ts
|
|
125451
|
+
var import_path9 = require("path");
|
|
125452
|
+
var import_os4 = require("os");
|
|
125453
|
+
var SMARTSTACK_DIR2 = ".smartstack";
|
|
125454
|
+
function getSmartStackDir() {
|
|
125455
|
+
return (0, import_path9.join)((0, import_os4.homedir)(), SMARTSTACK_DIR2);
|
|
125456
|
+
}
|
|
125457
|
+
function getLicenseFilePath() {
|
|
125458
|
+
return (0, import_path9.join)(getSmartStackDir(), "license.key");
|
|
125459
|
+
}
|
|
125460
|
+
function getLicenseCachePath() {
|
|
125461
|
+
return (0, import_path9.join)(getSmartStackDir(), "license-cache.json");
|
|
125462
|
+
}
|
|
125463
|
+
function getApiKeyFilePath() {
|
|
125464
|
+
return (0, import_path9.join)(getSmartStackDir(), "api-key");
|
|
125465
|
+
}
|
|
125466
|
+
function getConfigFilePath() {
|
|
125467
|
+
return (0, import_path9.join)(getSmartStackDir(), "config.json");
|
|
125468
|
+
}
|
|
125469
|
+
|
|
125470
|
+
// src/lib/device-id.ts
|
|
125471
|
+
var import_crypto4 = require("crypto");
|
|
125472
|
+
var import_child_process7 = require("child_process");
|
|
125473
|
+
var import_os5 = require("os");
|
|
125474
|
+
var import_path10 = require("path");
|
|
125475
|
+
var import_fs_extra8 = __toESM(require_lib());
|
|
125476
|
+
function getStableMacAddresses() {
|
|
125477
|
+
const interfaces = (0, import_os5.networkInterfaces)();
|
|
125478
|
+
const macs = [];
|
|
125479
|
+
for (const [name, addrs] of Object.entries(interfaces)) {
|
|
125480
|
+
if (!addrs) continue;
|
|
125481
|
+
if (/^(veth|docker|br-|virbr|lo|vEthernet|isatap|Teredo)/i.test(name)) continue;
|
|
125482
|
+
for (const addr of addrs) {
|
|
125483
|
+
if (addr.mac && addr.mac !== "00:00:00:00:00:00" && !addr.internal) {
|
|
125484
|
+
macs.push(addr.mac);
|
|
125485
|
+
}
|
|
125486
|
+
}
|
|
125487
|
+
}
|
|
125488
|
+
return macs.sort();
|
|
125489
|
+
}
|
|
125490
|
+
function getPlatformId() {
|
|
125491
|
+
const os4 = (0, import_os5.platform)();
|
|
125492
|
+
try {
|
|
125493
|
+
if (os4 === "win32") {
|
|
125494
|
+
const output = (0, import_child_process7.execSync)("wmic csproduct get uuid", {
|
|
125495
|
+
encoding: "utf-8",
|
|
125496
|
+
timeout: 5e3,
|
|
125497
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
125498
|
+
});
|
|
125499
|
+
const uuid = output.split("\n").map((l) => l.trim()).filter((l) => l && l !== "UUID")[0];
|
|
125500
|
+
if (uuid) return uuid;
|
|
125501
|
+
} else if (os4 === "linux") {
|
|
125502
|
+
const machineId = import_fs_extra8.default.readFileSync("/etc/machine-id", "utf-8").trim();
|
|
125503
|
+
if (machineId) return machineId;
|
|
125504
|
+
} else if (os4 === "darwin") {
|
|
125505
|
+
const output = (0, import_child_process7.execSync)(
|
|
125506
|
+
"ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { print $3 }'",
|
|
125507
|
+
{ encoding: "utf-8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] }
|
|
125508
|
+
);
|
|
125509
|
+
const uuid = output.trim().replace(/"/g, "");
|
|
125510
|
+
if (uuid) return uuid;
|
|
125511
|
+
}
|
|
125512
|
+
} catch {
|
|
125513
|
+
}
|
|
125514
|
+
return "";
|
|
125515
|
+
}
|
|
125516
|
+
function generateMachineFingerprint() {
|
|
125517
|
+
const cpu = (0, import_os5.cpus)()[0];
|
|
125518
|
+
const components = [
|
|
125519
|
+
(0, import_os5.platform)(),
|
|
125520
|
+
(0, import_os5.arch)(),
|
|
125521
|
+
cpu?.model || "unknown-cpu",
|
|
125522
|
+
String((0, import_os5.totalmem)()),
|
|
125523
|
+
...getStableMacAddresses(),
|
|
125524
|
+
getPlatformId()
|
|
125525
|
+
];
|
|
125526
|
+
return (0, import_crypto4.createHash)("sha256").update(components.join("|")).digest("hex");
|
|
125527
|
+
}
|
|
125528
|
+
async function getOrCreateInstanceId() {
|
|
125529
|
+
const deviceFile = (0, import_path10.join)(getSmartStackDir(), "device.json");
|
|
125530
|
+
if (await import_fs_extra8.default.pathExists(deviceFile)) {
|
|
125531
|
+
try {
|
|
125532
|
+
const data = await import_fs_extra8.default.readJSON(deviceFile);
|
|
125533
|
+
if (data?.instanceId) return data.instanceId;
|
|
125534
|
+
} catch {
|
|
125535
|
+
}
|
|
125536
|
+
}
|
|
125537
|
+
const instanceId = (0, import_crypto4.randomUUID)();
|
|
125538
|
+
await import_fs_extra8.default.ensureDir(getSmartStackDir());
|
|
125539
|
+
await import_fs_extra8.default.writeJSON(deviceFile, { instanceId, createdAt: (/* @__PURE__ */ new Date()).toISOString() }, { spaces: 2 });
|
|
125540
|
+
return instanceId;
|
|
125541
|
+
}
|
|
125542
|
+
async function getMachineIdentity() {
|
|
125543
|
+
const [fingerprint, instanceId] = await Promise.all([
|
|
125544
|
+
Promise.resolve(generateMachineFingerprint()),
|
|
125545
|
+
getOrCreateInstanceId()
|
|
125546
|
+
]);
|
|
125547
|
+
return {
|
|
125548
|
+
fingerprint,
|
|
125549
|
+
machineName: (0, import_os5.hostname)(),
|
|
125550
|
+
instanceId
|
|
125551
|
+
};
|
|
125552
|
+
}
|
|
125553
|
+
|
|
125554
|
+
// src/lib/license-cache.ts
|
|
125555
|
+
var import_fs_extra9 = __toESM(require_lib());
|
|
125556
|
+
function createEmptyCache() {
|
|
125557
|
+
return {
|
|
125558
|
+
version: 1,
|
|
125559
|
+
lastValidation: null,
|
|
125560
|
+
lastHeartbeat: null,
|
|
125561
|
+
lastValidationResult: null,
|
|
125562
|
+
activation: null,
|
|
125563
|
+
signingKey: null
|
|
125564
|
+
};
|
|
125565
|
+
}
|
|
125566
|
+
async function loadCache() {
|
|
125567
|
+
const cachePath = getLicenseCachePath();
|
|
125568
|
+
if (!await import_fs_extra9.default.pathExists(cachePath)) {
|
|
125569
|
+
return createEmptyCache();
|
|
125570
|
+
}
|
|
125571
|
+
try {
|
|
125572
|
+
const data = await import_fs_extra9.default.readJSON(cachePath);
|
|
125573
|
+
if (data?.version === 1) return data;
|
|
125574
|
+
return createEmptyCache();
|
|
125575
|
+
} catch {
|
|
125576
|
+
return createEmptyCache();
|
|
125577
|
+
}
|
|
125578
|
+
}
|
|
125579
|
+
async function saveCache(cache) {
|
|
125580
|
+
await import_fs_extra9.default.ensureDir(getSmartStackDir());
|
|
125581
|
+
await import_fs_extra9.default.writeJSON(getLicenseCachePath(), cache, { spaces: 2 });
|
|
125582
|
+
}
|
|
125583
|
+
async function clearCache() {
|
|
125584
|
+
const cachePath = getLicenseCachePath();
|
|
125585
|
+
if (await import_fs_extra9.default.pathExists(cachePath)) {
|
|
125586
|
+
await import_fs_extra9.default.remove(cachePath);
|
|
125587
|
+
}
|
|
125588
|
+
}
|
|
125589
|
+
function isCacheValid(cache, maxAgeMinutes = 60) {
|
|
125590
|
+
if (!cache.lastValidation || !cache.lastValidationResult) return false;
|
|
125591
|
+
const lastValidation = new Date(cache.lastValidation);
|
|
125592
|
+
const ageMs = Date.now() - lastValidation.getTime();
|
|
125593
|
+
return ageMs < maxAgeMinutes * 60 * 1e3;
|
|
125594
|
+
}
|
|
125595
|
+
function isHeartbeatDue(cache) {
|
|
125596
|
+
if (!cache.activation) return false;
|
|
125597
|
+
if (!cache.lastHeartbeat) return true;
|
|
125598
|
+
const lastHeartbeat = new Date(cache.lastHeartbeat);
|
|
125599
|
+
const intervalMs = (cache.activation.heartbeatIntervalHours || 168) * 60 * 60 * 1e3;
|
|
125600
|
+
return Date.now() - lastHeartbeat.getTime() >= intervalMs;
|
|
125601
|
+
}
|
|
125602
|
+
function isInGracePeriod(expiresAt, gracePeriodDays) {
|
|
125603
|
+
const expiry = new Date(expiresAt);
|
|
125604
|
+
const now = Date.now();
|
|
125605
|
+
const graceEndMs = expiry.getTime() + gracePeriodDays * 24 * 60 * 60 * 1e3;
|
|
125606
|
+
if (now <= expiry.getTime()) {
|
|
125607
|
+
return { inGrace: false, daysLeft: gracePeriodDays };
|
|
125608
|
+
}
|
|
125609
|
+
if (now <= graceEndMs) {
|
|
125610
|
+
const daysLeft = Math.ceil((graceEndMs - now) / (24 * 60 * 60 * 1e3));
|
|
125611
|
+
return { inGrace: true, daysLeft };
|
|
125612
|
+
}
|
|
125613
|
+
return { inGrace: false, daysLeft: 0 };
|
|
125614
|
+
}
|
|
125615
|
+
function isGraceExpired(expiresAt, gracePeriodDays) {
|
|
125616
|
+
const expiry = new Date(expiresAt);
|
|
125617
|
+
const graceEndMs = expiry.getTime() + gracePeriodDays * 24 * 60 * 60 * 1e3;
|
|
125618
|
+
return Date.now() > graceEndMs;
|
|
125619
|
+
}
|
|
125620
|
+
function isSigningKeyCacheValid(cache) {
|
|
125621
|
+
if (!cache.signingKey?.pem || !cache.signingKey?.fetchedAt) return false;
|
|
125622
|
+
const fetchedAt = new Date(cache.signingKey.fetchedAt);
|
|
125623
|
+
const ageMs = Date.now() - fetchedAt.getTime();
|
|
125624
|
+
return ageMs < 24 * 60 * 60 * 1e3;
|
|
125625
|
+
}
|
|
125626
|
+
|
|
125627
|
+
// src/lib/license-client.ts
|
|
125628
|
+
var import_path11 = require("path");
|
|
125629
|
+
var import_fs_extra10 = __toESM(require_lib());
|
|
125630
|
+
var DEFAULT_LICENSE_URL = "https://license.atlashub.ch";
|
|
125631
|
+
var REQUEST_TIMEOUT_MS = 1e4;
|
|
125632
|
+
async function getLicenseServerUrl() {
|
|
125633
|
+
const envUrl = process.env.SMARTSTACK_LICENSE_URL;
|
|
125634
|
+
if (envUrl) return envUrl.replace(/\/+$/, "");
|
|
125635
|
+
try {
|
|
125636
|
+
const configPath = getConfigFilePath();
|
|
125637
|
+
if (await import_fs_extra10.default.pathExists(configPath)) {
|
|
125638
|
+
const config = await import_fs_extra10.default.readJSON(configPath);
|
|
125639
|
+
if (config?.licenseServerUrl) return config.licenseServerUrl.replace(/\/+$/, "");
|
|
125640
|
+
}
|
|
125641
|
+
} catch {
|
|
125642
|
+
}
|
|
125643
|
+
return DEFAULT_LICENSE_URL;
|
|
125644
|
+
}
|
|
125645
|
+
async function getApiKey() {
|
|
125646
|
+
const envKey = process.env.SMARTSTACK_API_KEY;
|
|
125647
|
+
if (envKey) return envKey.trim();
|
|
125648
|
+
try {
|
|
125649
|
+
const keyPath = getApiKeyFilePath();
|
|
125650
|
+
if (await import_fs_extra10.default.pathExists(keyPath)) {
|
|
125651
|
+
return (await import_fs_extra10.default.readFile(keyPath, "utf-8")).trim();
|
|
125652
|
+
}
|
|
125653
|
+
} catch {
|
|
125654
|
+
}
|
|
125655
|
+
return null;
|
|
125656
|
+
}
|
|
125657
|
+
async function saveApiKey(apiKey) {
|
|
125658
|
+
const keyPath = getApiKeyFilePath();
|
|
125659
|
+
await import_fs_extra10.default.ensureDir((0, import_path11.dirname)(keyPath));
|
|
125660
|
+
await import_fs_extra10.default.writeFile(keyPath, apiKey.trim(), "utf-8");
|
|
125661
|
+
}
|
|
125662
|
+
async function removeApiKey() {
|
|
125663
|
+
const keyPath = getApiKeyFilePath();
|
|
125664
|
+
if (await import_fs_extra10.default.pathExists(keyPath)) {
|
|
125665
|
+
await import_fs_extra10.default.remove(keyPath);
|
|
125666
|
+
}
|
|
125667
|
+
}
|
|
125668
|
+
function createAbortSignal() {
|
|
125669
|
+
return AbortSignal.timeout(REQUEST_TIMEOUT_MS);
|
|
125670
|
+
}
|
|
125671
|
+
async function handleResponse(response) {
|
|
125672
|
+
if (response.ok) {
|
|
125673
|
+
return await response.json();
|
|
125674
|
+
}
|
|
125675
|
+
let message;
|
|
125676
|
+
try {
|
|
125677
|
+
const body = await response.json();
|
|
125678
|
+
message = body.message || body.detail || response.statusText;
|
|
125679
|
+
} catch {
|
|
125680
|
+
message = response.statusText;
|
|
125681
|
+
}
|
|
125682
|
+
const error = { status: response.status, message };
|
|
125683
|
+
switch (response.status) {
|
|
125684
|
+
case 404:
|
|
125685
|
+
error.message = `License not found: ${message}`;
|
|
125686
|
+
break;
|
|
125687
|
+
case 409:
|
|
125688
|
+
error.message = `Conflict: ${message}`;
|
|
125689
|
+
break;
|
|
125690
|
+
case 410:
|
|
125691
|
+
error.message = `License revoked or expired: ${message}`;
|
|
125692
|
+
break;
|
|
125693
|
+
case 422:
|
|
125694
|
+
error.message = `Unprocessable entity: ${message}`;
|
|
125695
|
+
break;
|
|
125696
|
+
case 429:
|
|
125697
|
+
error.message = `Rate limited: ${message}`;
|
|
125698
|
+
break;
|
|
125699
|
+
}
|
|
125700
|
+
throw error;
|
|
125701
|
+
}
|
|
125702
|
+
var LicenseClient = class {
|
|
125703
|
+
constructor(baseUrl) {
|
|
125704
|
+
this.baseUrl = baseUrl;
|
|
125705
|
+
}
|
|
125706
|
+
/**
|
|
125707
|
+
* GET /api/v1/public/signing-key — fetch the RSA public key (PEM)
|
|
125708
|
+
*/
|
|
125709
|
+
async fetchSigningKey() {
|
|
125710
|
+
const response = await fetch(`${this.baseUrl}/api/v1/public/signing-key`, {
|
|
125711
|
+
signal: createAbortSignal()
|
|
125712
|
+
});
|
|
125713
|
+
if (!response.ok) {
|
|
125714
|
+
throw { status: response.status, message: "Failed to fetch signing key" };
|
|
125715
|
+
}
|
|
125716
|
+
const contentType = response.headers.get("content-type") || "";
|
|
125717
|
+
if (contentType.includes("application/json")) {
|
|
125718
|
+
const body = await response.json();
|
|
125719
|
+
return body.publicKey;
|
|
125720
|
+
}
|
|
125721
|
+
return response.text();
|
|
125722
|
+
}
|
|
125723
|
+
/**
|
|
125724
|
+
* GET /api/v1/public/health — check server availability
|
|
125725
|
+
*/
|
|
125726
|
+
async healthCheck() {
|
|
125727
|
+
try {
|
|
125728
|
+
const response = await fetch(`${this.baseUrl}/api/v1/public/health`, {
|
|
125729
|
+
signal: createAbortSignal()
|
|
125730
|
+
});
|
|
125731
|
+
return response.ok;
|
|
125732
|
+
} catch {
|
|
125733
|
+
return false;
|
|
125734
|
+
}
|
|
125735
|
+
}
|
|
125736
|
+
/**
|
|
125737
|
+
* POST /api/v1/public/trial — self-service trial registration
|
|
125738
|
+
*/
|
|
125739
|
+
async registerTrial(data) {
|
|
125740
|
+
const response = await fetch(`${this.baseUrl}/api/v1/public/trial`, {
|
|
125741
|
+
method: "POST",
|
|
125742
|
+
headers: { "Content-Type": "application/json" },
|
|
125743
|
+
body: JSON.stringify(data),
|
|
125744
|
+
signal: createAbortSignal()
|
|
125745
|
+
});
|
|
125746
|
+
return handleResponse(response);
|
|
125747
|
+
}
|
|
125748
|
+
/**
|
|
125749
|
+
* POST /api/v1/machine/activate — activate a machine (Bearer JWT auth)
|
|
125750
|
+
*/
|
|
125751
|
+
async activate(jwt2, data) {
|
|
125752
|
+
const response = await fetch(`${this.baseUrl}/api/v1/machine/activate`, {
|
|
125753
|
+
method: "POST",
|
|
125754
|
+
headers: {
|
|
125755
|
+
"Content-Type": "application/json",
|
|
125756
|
+
Authorization: `Bearer ${jwt2}`
|
|
125757
|
+
},
|
|
125758
|
+
body: JSON.stringify(data),
|
|
125759
|
+
signal: createAbortSignal()
|
|
125760
|
+
});
|
|
125761
|
+
return handleResponse(response);
|
|
125762
|
+
}
|
|
125763
|
+
/**
|
|
125764
|
+
* POST /api/v1/machine/heartbeat — send heartbeat (Bearer JWT auth)
|
|
125765
|
+
*/
|
|
125766
|
+
async heartbeat(jwt2, data) {
|
|
125767
|
+
const response = await fetch(`${this.baseUrl}/api/v1/machine/heartbeat`, {
|
|
125768
|
+
method: "POST",
|
|
125769
|
+
headers: {
|
|
125770
|
+
"Content-Type": "application/json",
|
|
125771
|
+
Authorization: `Bearer ${jwt2}`
|
|
125772
|
+
},
|
|
125773
|
+
body: JSON.stringify(data),
|
|
125774
|
+
signal: createAbortSignal()
|
|
125775
|
+
});
|
|
125776
|
+
return handleResponse(response);
|
|
125777
|
+
}
|
|
125778
|
+
/**
|
|
125779
|
+
* GET /api/v1/machine/validate — validate license status (Bearer JWT auth)
|
|
125780
|
+
*/
|
|
125781
|
+
async validate(jwt2) {
|
|
125782
|
+
const response = await fetch(`${this.baseUrl}/api/v1/machine/validate`, {
|
|
125783
|
+
headers: { Authorization: `Bearer ${jwt2}` },
|
|
125784
|
+
signal: createAbortSignal()
|
|
125785
|
+
});
|
|
125786
|
+
return handleResponse(response);
|
|
125787
|
+
}
|
|
125788
|
+
// ── API Key variants (for CI/CD) ───────────────────────────────────────
|
|
125789
|
+
/**
|
|
125790
|
+
* POST /api/v1/machine/activate/key — activate via API key
|
|
125791
|
+
*/
|
|
125792
|
+
async activateWithApiKey(apiKey, licenseJwt, data) {
|
|
125793
|
+
const response = await fetch(`${this.baseUrl}/api/v1/machine/activate/key`, {
|
|
125794
|
+
method: "POST",
|
|
125795
|
+
headers: {
|
|
125796
|
+
"Content-Type": "application/json",
|
|
125797
|
+
"X-Api-Key": apiKey
|
|
125798
|
+
},
|
|
125799
|
+
body: JSON.stringify({ licenseJwt, ...data }),
|
|
125800
|
+
signal: createAbortSignal()
|
|
125801
|
+
});
|
|
125802
|
+
return handleResponse(response);
|
|
125803
|
+
}
|
|
125804
|
+
/**
|
|
125805
|
+
* POST /api/v1/machine/heartbeat/key — heartbeat via API key
|
|
125806
|
+
*/
|
|
125807
|
+
async heartbeatWithApiKey(apiKey, licenseJwt, data) {
|
|
125808
|
+
const response = await fetch(`${this.baseUrl}/api/v1/machine/heartbeat/key`, {
|
|
125809
|
+
method: "POST",
|
|
125810
|
+
headers: {
|
|
125811
|
+
"Content-Type": "application/json",
|
|
125812
|
+
"X-Api-Key": apiKey
|
|
125813
|
+
},
|
|
125814
|
+
body: JSON.stringify({ licenseJwt, ...data }),
|
|
125815
|
+
signal: createAbortSignal()
|
|
125816
|
+
});
|
|
125817
|
+
return handleResponse(response);
|
|
125818
|
+
}
|
|
125819
|
+
};
|
|
125820
|
+
|
|
125821
|
+
// src/lib/license.ts
|
|
125822
|
+
var LEGACY_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
|
125509
125823
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3Rgy76bx4SPse6vSnduR
|
|
125510
125824
|
OSv8YOk/8lGSK6/a+1cxyppsymCR8p/+yxzLl+phbCtm4qPhrp4K8BFVyyCw0uhG
|
|
125511
125825
|
xWyHzXvlbVfEO0YG5Ug5B3NVFr9/QaAHV1lVHgahxVFCglJZj7yVbFOY4uSpWNNg
|
|
@@ -125514,86 +125828,255 @@ csxveQKoRdG8wCb3BY4//8F0qLz21lqwPIM+cGZhUM1+ycYvC7HEke5xMxy6cCAS
|
|
|
125514
125828
|
6Xwvxno/Ml8D2sXTBLNMt8JVFwoAuDohz3xdpxjfJDvzgwSH0bCLF7TOzEGRJF+s
|
|
125515
125829
|
GwIDAQAB
|
|
125516
125830
|
-----END PUBLIC KEY-----`;
|
|
125517
|
-
var
|
|
125518
|
-
var
|
|
125519
|
-
|
|
125520
|
-
|
|
125521
|
-
|
|
125831
|
+
var LEGACY_ISSUER = "atlashub.io";
|
|
125832
|
+
var NEW_ISSUER = "license.atlashub.ch";
|
|
125833
|
+
var LEGACY_PRODUCT_IDS = ["smartstack-cli", "smartstackcli"];
|
|
125834
|
+
var NEW_PRODUCT_TIERS = ["standard", "plus", "premium"];
|
|
125835
|
+
function detectJwtFormat(token) {
|
|
125836
|
+
try {
|
|
125837
|
+
const headerB64 = token.split(".")[0];
|
|
125838
|
+
const header = JSON.parse(Buffer.from(headerB64, "base64url").toString());
|
|
125839
|
+
if (header.alg === "RS512") return "new";
|
|
125840
|
+
} catch {
|
|
125841
|
+
}
|
|
125842
|
+
return "legacy";
|
|
125522
125843
|
}
|
|
125523
125844
|
async function saveLicenseKey(licenseKey) {
|
|
125524
125845
|
const licensePath = getLicenseFilePath();
|
|
125525
|
-
await
|
|
125526
|
-
|
|
125846
|
+
await import_fs_extra11.default.ensureDir(getSmartStackDir());
|
|
125847
|
+
const writeOptions = { encoding: "utf-8" };
|
|
125848
|
+
if (process.platform !== "win32") {
|
|
125849
|
+
writeOptions.mode = 384;
|
|
125850
|
+
}
|
|
125851
|
+
await import_fs_extra11.default.writeFile(licensePath, licenseKey.trim(), writeOptions);
|
|
125527
125852
|
}
|
|
125528
125853
|
async function loadLicenseKey() {
|
|
125529
125854
|
const licensePath = getLicenseFilePath();
|
|
125530
|
-
if (await
|
|
125531
|
-
return (await
|
|
125855
|
+
if (await import_fs_extra11.default.pathExists(licensePath)) {
|
|
125856
|
+
return (await import_fs_extra11.default.readFile(licensePath, "utf-8")).trim();
|
|
125532
125857
|
}
|
|
125533
125858
|
return null;
|
|
125534
125859
|
}
|
|
125535
125860
|
async function removeLicenseKey() {
|
|
125536
125861
|
const licensePath = getLicenseFilePath();
|
|
125537
|
-
if (await
|
|
125538
|
-
await
|
|
125862
|
+
if (await import_fs_extra11.default.pathExists(licensePath)) {
|
|
125863
|
+
await import_fs_extra11.default.remove(licensePath);
|
|
125539
125864
|
}
|
|
125540
125865
|
}
|
|
125541
|
-
function
|
|
125542
|
-
if (
|
|
125543
|
-
|
|
125866
|
+
function normalizeFeatures(decoded) {
|
|
125867
|
+
if (decoded.ft && Array.isArray(decoded.ft)) {
|
|
125868
|
+
const features = decoded.ft.map((scope) => ({
|
|
125869
|
+
applicationId: scope.aid || null,
|
|
125870
|
+
applicationCode: scope.app || "*",
|
|
125871
|
+
modules: (scope.modules || []).map((m) => ({
|
|
125872
|
+
moduleId: m.mid || "",
|
|
125873
|
+
moduleCode: m.mod || ""
|
|
125874
|
+
}))
|
|
125875
|
+
}));
|
|
125876
|
+
return { features };
|
|
125877
|
+
}
|
|
125878
|
+
if (decoded.features) {
|
|
125879
|
+
const raw = typeof decoded.features === "string" ? JSON.parse(decoded.features) : decoded.features;
|
|
125880
|
+
if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === "string") {
|
|
125881
|
+
return {
|
|
125882
|
+
features: [{ applicationId: null, applicationCode: "*", modules: [] }],
|
|
125883
|
+
legacyFeatures: raw
|
|
125884
|
+
};
|
|
125885
|
+
}
|
|
125886
|
+
}
|
|
125887
|
+
return {
|
|
125888
|
+
features: [{ applicationId: null, applicationCode: "*", modules: [] }],
|
|
125889
|
+
legacyFeatures: ["*"]
|
|
125890
|
+
};
|
|
125891
|
+
}
|
|
125892
|
+
function extractLicenseInfo(decoded) {
|
|
125893
|
+
const now = /* @__PURE__ */ new Date();
|
|
125894
|
+
const expiresAt = decoded.exp ? new Date(decoded.exp * 1e3) : new Date(now.getTime() + 365 * 24 * 60 * 60 * 1e3);
|
|
125895
|
+
const issuedAt = decoded.iat ? new Date(decoded.iat * 1e3) : now;
|
|
125896
|
+
const isPerpetual = (decoded.perp ?? decoded.perpetual) === true;
|
|
125897
|
+
const isExpired = !isPerpetual && expiresAt < now;
|
|
125898
|
+
const daysRemaining = isPerpetual ? Infinity : Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
|
|
125899
|
+
const { features, legacyFeatures } = normalizeFeatures(decoded);
|
|
125900
|
+
const bnd = decoded.bnd || decoded.bind;
|
|
125901
|
+
const bind = bnd ? {
|
|
125902
|
+
machineHash: bnd.mh ?? bnd.machine_hash,
|
|
125903
|
+
offline: bnd.ofl ?? bnd.offline
|
|
125904
|
+
} : void 0;
|
|
125905
|
+
return {
|
|
125906
|
+
companyId: decoded.sub || "unknown",
|
|
125907
|
+
clientName: decoded.cn ?? decoded.client_name,
|
|
125908
|
+
edition: decoded.prd ?? decoded.edition ?? "standard",
|
|
125909
|
+
product: decoded.prd ?? decoded.product ?? decoded.aud,
|
|
125910
|
+
jti: decoded.jti,
|
|
125911
|
+
environment: decoded.env ?? decoded.environment,
|
|
125912
|
+
features,
|
|
125913
|
+
legacyFeatures,
|
|
125914
|
+
maxInstances: decoded.mi ?? decoded.max_instances,
|
|
125915
|
+
maxUsers: decoded.mu ?? decoded.max_users,
|
|
125916
|
+
issuedAt,
|
|
125917
|
+
expiresAt,
|
|
125918
|
+
renewalDate: decoded.rnd ?? decoded.renewal_date,
|
|
125919
|
+
daysRemaining,
|
|
125920
|
+
isValid: !isExpired,
|
|
125921
|
+
isExpired,
|
|
125922
|
+
isPerpetual,
|
|
125923
|
+
gracePeriodDays: decoded.gp ?? decoded.grace_period_days ?? 15,
|
|
125924
|
+
bind
|
|
125925
|
+
};
|
|
125926
|
+
}
|
|
125927
|
+
function validateLegacyLicenseKey(licenseKey) {
|
|
125928
|
+
if (!licenseKey?.trim()) {
|
|
125929
|
+
return { valid: false, error: "License key is empty", warnings: [], source: "legacy" };
|
|
125544
125930
|
}
|
|
125545
125931
|
try {
|
|
125546
|
-
const decoded = jwt.verify(licenseKey,
|
|
125932
|
+
const decoded = jwt.verify(licenseKey, LEGACY_PUBLIC_KEY, {
|
|
125547
125933
|
algorithms: ["RS256"],
|
|
125548
|
-
issuer:
|
|
125934
|
+
issuer: LEGACY_ISSUER
|
|
125549
125935
|
});
|
|
125550
|
-
const productId = decoded.product_id || decoded.aud;
|
|
125551
|
-
if (productId
|
|
125936
|
+
const productId = decoded.product_id || decoded.product || decoded.aud;
|
|
125937
|
+
if (!LEGACY_PRODUCT_IDS.includes(productId)) {
|
|
125938
|
+
return {
|
|
125939
|
+
valid: false,
|
|
125940
|
+
error: `Invalid license: This license is for "${productId}", not "smartstack-cli"`,
|
|
125941
|
+
warnings: [],
|
|
125942
|
+
source: "legacy"
|
|
125943
|
+
};
|
|
125944
|
+
}
|
|
125945
|
+
const license = extractLicenseInfo(decoded);
|
|
125946
|
+
const warnings = [
|
|
125947
|
+
"This license uses the legacy format (RS256). It will continue to work but please upgrade to a new license for enhanced features."
|
|
125948
|
+
];
|
|
125949
|
+
if (license.isExpired) {
|
|
125552
125950
|
return {
|
|
125553
125951
|
valid: false,
|
|
125554
|
-
error: `
|
|
125555
|
-
|
|
125556
|
-
|
|
125557
|
-
|
|
125558
|
-
|
|
125559
|
-
|
|
125560
|
-
|
|
125561
|
-
|
|
125562
|
-
|
|
125563
|
-
|
|
125564
|
-
|
|
125565
|
-
|
|
125566
|
-
|
|
125567
|
-
|
|
125568
|
-
|
|
125569
|
-
|
|
125570
|
-
|
|
125571
|
-
|
|
125572
|
-
|
|
125573
|
-
|
|
125574
|
-
|
|
125575
|
-
|
|
125576
|
-
|
|
125577
|
-
|
|
125578
|
-
|
|
125579
|
-
|
|
125580
|
-
|
|
125581
|
-
|
|
125952
|
+
error: `License expired on ${license.expiresAt.toISOString().split("T")[0]}`,
|
|
125953
|
+
license,
|
|
125954
|
+
warnings,
|
|
125955
|
+
source: "legacy"
|
|
125956
|
+
};
|
|
125957
|
+
}
|
|
125958
|
+
return { valid: true, license, warnings, source: "legacy" };
|
|
125959
|
+
} catch (error) {
|
|
125960
|
+
if (error instanceof jwt.JsonWebTokenError) {
|
|
125961
|
+
return { valid: false, error: `Invalid license signature: ${error.message}`, warnings: [], source: "legacy" };
|
|
125962
|
+
}
|
|
125963
|
+
if (error instanceof jwt.TokenExpiredError) {
|
|
125964
|
+
return { valid: false, error: "License has expired", warnings: [], source: "legacy" };
|
|
125965
|
+
}
|
|
125966
|
+
return { valid: false, error: `License validation failed: ${error.message}`, warnings: [], source: "legacy" };
|
|
125967
|
+
}
|
|
125968
|
+
}
|
|
125969
|
+
function validateNewLicenseKey(licenseKey, signingKeyPem) {
|
|
125970
|
+
if (!licenseKey?.trim()) {
|
|
125971
|
+
return { valid: false, error: "License key is empty", warnings: [], source: "offline" };
|
|
125972
|
+
}
|
|
125973
|
+
try {
|
|
125974
|
+
const decoded = jwt.verify(licenseKey, signingKeyPem, {
|
|
125975
|
+
algorithms: ["RS512"],
|
|
125976
|
+
issuer: NEW_ISSUER
|
|
125977
|
+
});
|
|
125978
|
+
const productId = decoded.prd || decoded.product || decoded.aud;
|
|
125979
|
+
const allValid = [...NEW_PRODUCT_TIERS, ...LEGACY_PRODUCT_IDS];
|
|
125980
|
+
if (!allValid.includes(productId)) {
|
|
125582
125981
|
return {
|
|
125583
125982
|
valid: false,
|
|
125584
|
-
error: `
|
|
125585
|
-
|
|
125983
|
+
error: `Invalid license: unrecognized product "${productId}"`,
|
|
125984
|
+
warnings: [],
|
|
125985
|
+
source: "offline"
|
|
125586
125986
|
};
|
|
125587
125987
|
}
|
|
125588
|
-
|
|
125988
|
+
const license = extractLicenseInfo(decoded);
|
|
125989
|
+
if (license.isExpired && !license.isPerpetual) {
|
|
125990
|
+
const graceDays = license.gracePeriodDays ?? 15;
|
|
125991
|
+
if (isGraceExpired(license.expiresAt.toISOString(), graceDays)) {
|
|
125992
|
+
return {
|
|
125993
|
+
valid: false,
|
|
125994
|
+
error: `License expired on ${license.expiresAt.toISOString().split("T")[0]} (grace period ended)`,
|
|
125995
|
+
license,
|
|
125996
|
+
warnings: [],
|
|
125997
|
+
source: "offline"
|
|
125998
|
+
};
|
|
125999
|
+
}
|
|
126000
|
+
const grace = isInGracePeriod(license.expiresAt.toISOString(), graceDays);
|
|
126001
|
+
if (grace.inGrace) {
|
|
126002
|
+
return {
|
|
126003
|
+
valid: true,
|
|
126004
|
+
license,
|
|
126005
|
+
warnings: [`License expired but within grace period (${grace.daysLeft} day(s) remaining)`],
|
|
126006
|
+
source: "offline"
|
|
126007
|
+
};
|
|
126008
|
+
}
|
|
126009
|
+
}
|
|
126010
|
+
return { valid: true, license, warnings: [], source: "offline" };
|
|
125589
126011
|
} catch (error) {
|
|
125590
126012
|
if (error instanceof jwt.JsonWebTokenError) {
|
|
125591
|
-
return { valid: false, error: `Invalid license signature: ${error.message}
|
|
126013
|
+
return { valid: false, error: `Invalid license signature: ${error.message}`, warnings: [], source: "offline" };
|
|
125592
126014
|
}
|
|
125593
126015
|
if (error instanceof jwt.TokenExpiredError) {
|
|
125594
|
-
return { valid: false, error: "License has expired" };
|
|
126016
|
+
return { valid: false, error: "License has expired", warnings: [], source: "offline" };
|
|
126017
|
+
}
|
|
126018
|
+
return { valid: false, error: `License validation failed: ${error.message}`, warnings: [], source: "offline" };
|
|
126019
|
+
}
|
|
126020
|
+
}
|
|
126021
|
+
function validateOfflineLicense(licenseKey, signingKeyPem, fingerprint) {
|
|
126022
|
+
const result = validateNewLicenseKey(licenseKey, signingKeyPem);
|
|
126023
|
+
if (!result.valid) return result;
|
|
126024
|
+
const bind = result.license?.bind;
|
|
126025
|
+
if (bind?.machineHash && bind.machineHash !== fingerprint) {
|
|
126026
|
+
return {
|
|
126027
|
+
valid: false,
|
|
126028
|
+
error: "Machine fingerprint mismatch. This license is bound to a different machine.",
|
|
126029
|
+
warnings: [],
|
|
126030
|
+
source: "offline"
|
|
126031
|
+
};
|
|
126032
|
+
}
|
|
126033
|
+
return result;
|
|
126034
|
+
}
|
|
126035
|
+
function validateLicenseKey(licenseKey) {
|
|
126036
|
+
if (!licenseKey?.trim()) {
|
|
126037
|
+
return { valid: false, error: "License key is empty", warnings: [], source: "legacy" };
|
|
126038
|
+
}
|
|
126039
|
+
const format = detectJwtFormat(licenseKey);
|
|
126040
|
+
if (format === "legacy") {
|
|
126041
|
+
return validateLegacyLicenseKey(licenseKey);
|
|
126042
|
+
}
|
|
126043
|
+
try {
|
|
126044
|
+
const decoded = jwt.decode(licenseKey);
|
|
126045
|
+
if (!decoded) {
|
|
126046
|
+
return { valid: false, error: "Invalid JWT token", warnings: [], source: "offline" };
|
|
126047
|
+
}
|
|
126048
|
+
const productId = decoded.prd || decoded.product || decoded.aud;
|
|
126049
|
+
const allValid = [...NEW_PRODUCT_TIERS, ...LEGACY_PRODUCT_IDS];
|
|
126050
|
+
if (!allValid.includes(productId)) {
|
|
126051
|
+
return {
|
|
126052
|
+
valid: false,
|
|
126053
|
+
error: `Invalid license: unrecognized product "${productId}"`,
|
|
126054
|
+
warnings: [],
|
|
126055
|
+
source: "offline"
|
|
126056
|
+
};
|
|
125595
126057
|
}
|
|
125596
|
-
|
|
126058
|
+
const license = extractLicenseInfo(decoded);
|
|
126059
|
+
return {
|
|
126060
|
+
valid: true,
|
|
126061
|
+
license,
|
|
126062
|
+
warnings: ["License signature not verified (signing key unavailable). Run a command to trigger online validation."],
|
|
126063
|
+
source: "offline"
|
|
126064
|
+
};
|
|
126065
|
+
} catch {
|
|
126066
|
+
return { valid: false, error: "Invalid JWT token", warnings: [], source: "offline" };
|
|
126067
|
+
}
|
|
126068
|
+
}
|
|
126069
|
+
async function getSigningKey(cache, client) {
|
|
126070
|
+
if (isSigningKeyCacheValid(cache)) {
|
|
126071
|
+
return cache.signingKey.pem;
|
|
126072
|
+
}
|
|
126073
|
+
try {
|
|
126074
|
+
const pem = await client.fetchSigningKey();
|
|
126075
|
+
cache.signingKey = { pem, fetchedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
126076
|
+
await saveCache(cache);
|
|
126077
|
+
return pem;
|
|
126078
|
+
} catch {
|
|
126079
|
+
return cache.signingKey?.pem || null;
|
|
125597
126080
|
}
|
|
125598
126081
|
}
|
|
125599
126082
|
async function validateCurrentLicense() {
|
|
@@ -125601,44 +126084,361 @@ async function validateCurrentLicense() {
|
|
|
125601
126084
|
if (!licenseKey) {
|
|
125602
126085
|
return {
|
|
125603
126086
|
valid: false,
|
|
125604
|
-
error: "No license found. Please activate with: smartstack license activate <key>"
|
|
126087
|
+
error: "No license found. Please activate with: smartstack license activate <key>",
|
|
126088
|
+
warnings: [],
|
|
126089
|
+
source: "offline"
|
|
126090
|
+
};
|
|
126091
|
+
}
|
|
126092
|
+
const format = detectJwtFormat(licenseKey);
|
|
126093
|
+
if (format === "legacy") {
|
|
126094
|
+
return validateLegacyLicenseKey(licenseKey);
|
|
126095
|
+
}
|
|
126096
|
+
const cache = await loadCache();
|
|
126097
|
+
const baseUrl = await getLicenseServerUrl();
|
|
126098
|
+
const client = new LicenseClient(baseUrl);
|
|
126099
|
+
const decoded = jwt.decode(licenseKey);
|
|
126100
|
+
const bndClaim = decoded?.bnd || decoded?.bind;
|
|
126101
|
+
if (bndClaim?.ofl === true || bndClaim?.offline === true) {
|
|
126102
|
+
const signingKey = await getSigningKey(cache, client);
|
|
126103
|
+
if (!signingKey) {
|
|
126104
|
+
return {
|
|
126105
|
+
valid: false,
|
|
126106
|
+
error: "Cannot validate offline license: signing key unavailable. Connect to the internet at least once.",
|
|
126107
|
+
warnings: [],
|
|
126108
|
+
source: "offline"
|
|
126109
|
+
};
|
|
126110
|
+
}
|
|
126111
|
+
const fingerprint = generateMachineFingerprint();
|
|
126112
|
+
return validateOfflineLicense(licenseKey, signingKey, fingerprint);
|
|
126113
|
+
}
|
|
126114
|
+
if (isCacheValid(cache)) {
|
|
126115
|
+
const cached = cache.lastValidationResult;
|
|
126116
|
+
const warnings = [];
|
|
126117
|
+
if (cached.revoked) {
|
|
126118
|
+
return { valid: false, error: "License has been revoked", warnings: [], source: "cache" };
|
|
126119
|
+
}
|
|
126120
|
+
if (!cached.isPerpetual && isGraceExpired(cached.expiresAt, cached.gracePeriodDays)) {
|
|
126121
|
+
return { valid: false, error: "License expired (grace period ended)", warnings: [], source: "cache" };
|
|
126122
|
+
}
|
|
126123
|
+
if (!cached.isPerpetual) {
|
|
126124
|
+
const grace = isInGracePeriod(cached.expiresAt, cached.gracePeriodDays);
|
|
126125
|
+
if (grace.inGrace) {
|
|
126126
|
+
warnings.push(`License expired but within grace period (${grace.daysLeft} day(s) remaining)`);
|
|
126127
|
+
}
|
|
126128
|
+
}
|
|
126129
|
+
if (isHeartbeatDue(cache)) {
|
|
126130
|
+
await performHeartbeat(licenseKey, cache, client);
|
|
126131
|
+
}
|
|
126132
|
+
const license = buildLicenseInfoFromCache(cached, decoded);
|
|
126133
|
+
return { valid: true, license, warnings, source: "cache" };
|
|
126134
|
+
}
|
|
126135
|
+
try {
|
|
126136
|
+
const serverResult = await client.validate(licenseKey);
|
|
126137
|
+
return await handleOnlineValidation(serverResult, licenseKey, cache, client, decoded);
|
|
126138
|
+
} catch (err) {
|
|
126139
|
+
if (cache.lastValidationResult) {
|
|
126140
|
+
const cached = cache.lastValidationResult;
|
|
126141
|
+
const warnings = ["License server unreachable. Using cached validation result."];
|
|
126142
|
+
if (cached.revoked) {
|
|
126143
|
+
return { valid: false, error: "License has been revoked (cached)", warnings, source: "cache" };
|
|
126144
|
+
}
|
|
126145
|
+
if (!cached.isPerpetual && isGraceExpired(cached.expiresAt, cached.gracePeriodDays)) {
|
|
126146
|
+
return { valid: false, error: "License expired (cached, grace period ended)", warnings, source: "cache" };
|
|
126147
|
+
}
|
|
126148
|
+
const license = buildLicenseInfoFromCache(cached, decoded);
|
|
126149
|
+
return { valid: true, license, warnings, source: "cache" };
|
|
126150
|
+
}
|
|
126151
|
+
const signingKey = await getSigningKey(cache, client);
|
|
126152
|
+
if (signingKey) {
|
|
126153
|
+
const result = validateNewLicenseKey(licenseKey, signingKey);
|
|
126154
|
+
result.warnings.push("License server unreachable. Validated offline with cached signing key.");
|
|
126155
|
+
return result;
|
|
126156
|
+
}
|
|
126157
|
+
const apiErr = err;
|
|
126158
|
+
return {
|
|
126159
|
+
valid: false,
|
|
126160
|
+
error: apiErr?.message || "Unable to validate license: server unreachable and no cached data.",
|
|
126161
|
+
warnings: [],
|
|
126162
|
+
source: "offline"
|
|
125605
126163
|
};
|
|
125606
126164
|
}
|
|
125607
|
-
|
|
126165
|
+
}
|
|
126166
|
+
async function handleOnlineValidation(serverResult, licenseKey, cache, client, decoded) {
|
|
126167
|
+
const warnings = [];
|
|
126168
|
+
cache.lastValidation = (/* @__PURE__ */ new Date()).toISOString();
|
|
126169
|
+
const normalizedFeatures = Array.isArray(serverResult.features) ? serverResult.features.map((f) => ({
|
|
126170
|
+
applicationId: f.application_id || null,
|
|
126171
|
+
applicationCode: f.application_code || "*",
|
|
126172
|
+
modules: (f.modules || []).map((m) => ({
|
|
126173
|
+
moduleId: m.module_id || "",
|
|
126174
|
+
moduleCode: m.module_code || ""
|
|
126175
|
+
}))
|
|
126176
|
+
})) : [{ applicationId: null, applicationCode: "*", modules: [] }];
|
|
126177
|
+
cache.lastValidationResult = {
|
|
126178
|
+
valid: serverResult.valid,
|
|
126179
|
+
revoked: serverResult.revoked,
|
|
126180
|
+
environment: serverResult.environment,
|
|
126181
|
+
features: normalizedFeatures,
|
|
126182
|
+
maxInstances: serverResult.maxInstances,
|
|
126183
|
+
maxUsers: serverResult.maxUsers,
|
|
126184
|
+
expiresAt: serverResult.expiresAt,
|
|
126185
|
+
gracePeriodDays: serverResult.gracePeriodDays,
|
|
126186
|
+
isPerpetual: serverResult.isPerpetual,
|
|
126187
|
+
renewalDate: serverResult.renewalDate || null
|
|
126188
|
+
};
|
|
126189
|
+
await saveCache(cache);
|
|
126190
|
+
if (serverResult.revoked) {
|
|
126191
|
+
return { valid: false, error: "License has been revoked", warnings: [], source: "online" };
|
|
126192
|
+
}
|
|
126193
|
+
if (!serverResult.valid && !serverResult.isPerpetual) {
|
|
126194
|
+
const graceDays = serverResult.gracePeriodDays ?? 15;
|
|
126195
|
+
if (isGraceExpired(serverResult.expiresAt, graceDays)) {
|
|
126196
|
+
return {
|
|
126197
|
+
valid: false,
|
|
126198
|
+
error: `License expired on ${serverResult.expiresAt.split("T")[0]} (grace period ended)`,
|
|
126199
|
+
warnings: [],
|
|
126200
|
+
source: "online"
|
|
126201
|
+
};
|
|
126202
|
+
}
|
|
126203
|
+
const grace = isInGracePeriod(serverResult.expiresAt, graceDays);
|
|
126204
|
+
if (grace.inGrace) {
|
|
126205
|
+
warnings.push(`License expired but within grace period (${grace.daysLeft} day(s) remaining)`);
|
|
126206
|
+
}
|
|
126207
|
+
}
|
|
126208
|
+
if (isHeartbeatDue(cache)) {
|
|
126209
|
+
await performHeartbeat(licenseKey, cache, client);
|
|
126210
|
+
}
|
|
126211
|
+
const license = buildLicenseInfoFromValidateResponse(serverResult, decoded);
|
|
126212
|
+
return { valid: true, license, warnings, source: "online" };
|
|
126213
|
+
}
|
|
126214
|
+
async function performHeartbeat(licenseKey, cache, client) {
|
|
126215
|
+
try {
|
|
126216
|
+
const identity = await getMachineIdentity();
|
|
126217
|
+
const apiKey = await getApiKey();
|
|
126218
|
+
let response;
|
|
126219
|
+
if (apiKey) {
|
|
126220
|
+
response = await client.heartbeatWithApiKey(apiKey, licenseKey, {
|
|
126221
|
+
machineFingerprint: identity.fingerprint,
|
|
126222
|
+
instanceId: identity.instanceId
|
|
126223
|
+
});
|
|
126224
|
+
} else {
|
|
126225
|
+
response = await client.heartbeat(licenseKey, {
|
|
126226
|
+
machineFingerprint: identity.fingerprint,
|
|
126227
|
+
instanceId: identity.instanceId
|
|
126228
|
+
});
|
|
126229
|
+
}
|
|
126230
|
+
cache.lastHeartbeat = (/* @__PURE__ */ new Date()).toISOString();
|
|
126231
|
+
await saveCache(cache);
|
|
126232
|
+
if (response.newJwtToken) {
|
|
126233
|
+
await saveLicenseKey(response.newJwtToken);
|
|
126234
|
+
logger.debug("License JWT updated from heartbeat response");
|
|
126235
|
+
}
|
|
126236
|
+
} catch {
|
|
126237
|
+
logger.debug("Heartbeat failed (will retry later)");
|
|
126238
|
+
}
|
|
126239
|
+
}
|
|
126240
|
+
async function activateLicense(licenseKey) {
|
|
126241
|
+
if (!licenseKey?.trim()) {
|
|
126242
|
+
return { valid: false, error: "License key is empty", warnings: [], source: "offline" };
|
|
126243
|
+
}
|
|
126244
|
+
const format = detectJwtFormat(licenseKey);
|
|
126245
|
+
if (format === "legacy") {
|
|
126246
|
+
const result = validateLegacyLicenseKey(licenseKey);
|
|
126247
|
+
if (result.valid) {
|
|
126248
|
+
await saveLicenseKey(licenseKey);
|
|
126249
|
+
}
|
|
126250
|
+
return result;
|
|
126251
|
+
}
|
|
126252
|
+
const baseUrl = await getLicenseServerUrl();
|
|
126253
|
+
const client = new LicenseClient(baseUrl);
|
|
126254
|
+
const cache = await loadCache();
|
|
126255
|
+
const identity = await getMachineIdentity();
|
|
126256
|
+
const signingKey = await getSigningKey(cache, client);
|
|
126257
|
+
try {
|
|
126258
|
+
const apiKey = await getApiKey();
|
|
126259
|
+
let activation;
|
|
126260
|
+
if (apiKey) {
|
|
126261
|
+
activation = await client.activateWithApiKey(apiKey, licenseKey, {
|
|
126262
|
+
machineFingerprint: identity.fingerprint,
|
|
126263
|
+
machineName: identity.machineName,
|
|
126264
|
+
instanceId: identity.instanceId
|
|
126265
|
+
});
|
|
126266
|
+
} else {
|
|
126267
|
+
activation = await client.activate(licenseKey, {
|
|
126268
|
+
machineFingerprint: identity.fingerprint,
|
|
126269
|
+
machineName: identity.machineName,
|
|
126270
|
+
instanceId: identity.instanceId
|
|
126271
|
+
});
|
|
126272
|
+
}
|
|
126273
|
+
await saveLicenseKey(licenseKey);
|
|
126274
|
+
cache.activation = {
|
|
126275
|
+
activated: activation.activated,
|
|
126276
|
+
activatedAt: activation.activatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
126277
|
+
machineFingerprint: identity.fingerprint,
|
|
126278
|
+
instanceId: identity.instanceId,
|
|
126279
|
+
heartbeatIntervalHours: activation.heartbeatIntervalHours,
|
|
126280
|
+
gracePeriodDays: activation.gracePeriodDays
|
|
126281
|
+
};
|
|
126282
|
+
cache.lastHeartbeat = (/* @__PURE__ */ new Date()).toISOString();
|
|
126283
|
+
await saveCache(cache);
|
|
126284
|
+
if (signingKey) {
|
|
126285
|
+
const result = validateNewLicenseKey(licenseKey, signingKey);
|
|
126286
|
+
result.source = "online";
|
|
126287
|
+
return result;
|
|
126288
|
+
}
|
|
126289
|
+
const decoded = jwt.decode(licenseKey);
|
|
126290
|
+
if (decoded) {
|
|
126291
|
+
return {
|
|
126292
|
+
valid: true,
|
|
126293
|
+
license: extractLicenseInfo(decoded),
|
|
126294
|
+
warnings: [],
|
|
126295
|
+
source: "online"
|
|
126296
|
+
};
|
|
126297
|
+
}
|
|
126298
|
+
return { valid: true, warnings: ["Activated but could not decode license details"], source: "online" };
|
|
126299
|
+
} catch (err) {
|
|
126300
|
+
const apiErr = err;
|
|
126301
|
+
let error = apiErr?.message || "Activation failed";
|
|
126302
|
+
if (apiErr?.status === 409) {
|
|
126303
|
+
error = "Maximum number of machine activations reached. Deactivate another machine first.";
|
|
126304
|
+
} else if (apiErr?.status === 410) {
|
|
126305
|
+
error = "This license has been revoked or has expired.";
|
|
126306
|
+
} else if (apiErr?.status === 422) {
|
|
126307
|
+
error = "This machine fingerprint is already linked to another active license for this client.";
|
|
126308
|
+
} else if (apiErr?.status === 404) {
|
|
126309
|
+
error = "License not found on the server.";
|
|
126310
|
+
}
|
|
126311
|
+
return { valid: false, error, warnings: [], source: "online" };
|
|
126312
|
+
}
|
|
126313
|
+
}
|
|
126314
|
+
async function deactivateLicense() {
|
|
126315
|
+
try {
|
|
126316
|
+
const cache = await loadCache();
|
|
126317
|
+
if (cache.activation) {
|
|
126318
|
+
logger.debug("Clearing local license activation");
|
|
126319
|
+
}
|
|
126320
|
+
} catch {
|
|
126321
|
+
}
|
|
126322
|
+
await removeLicenseKey();
|
|
126323
|
+
await clearCache();
|
|
126324
|
+
}
|
|
126325
|
+
function buildLicenseInfoFromCache(cached, decoded) {
|
|
126326
|
+
const expiresAt = new Date(cached.expiresAt);
|
|
126327
|
+
const now = /* @__PURE__ */ new Date();
|
|
126328
|
+
const daysRemaining = cached.isPerpetual ? Infinity : Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
|
|
126329
|
+
return {
|
|
126330
|
+
companyId: decoded?.sub || "unknown",
|
|
126331
|
+
clientName: decoded?.cn ?? decoded?.client_name,
|
|
126332
|
+
edition: decoded?.prd ?? decoded?.edition ?? "standard",
|
|
126333
|
+
product: decoded?.prd ?? decoded?.product,
|
|
126334
|
+
jti: decoded?.jti,
|
|
126335
|
+
environment: cached.environment,
|
|
126336
|
+
features: cached.features,
|
|
126337
|
+
maxInstances: cached.maxInstances,
|
|
126338
|
+
maxUsers: cached.maxUsers,
|
|
126339
|
+
issuedAt: decoded?.iat ? new Date(decoded.iat * 1e3) : now,
|
|
126340
|
+
expiresAt,
|
|
126341
|
+
renewalDate: cached.renewalDate ?? void 0,
|
|
126342
|
+
daysRemaining,
|
|
126343
|
+
isValid: cached.valid && !cached.revoked,
|
|
126344
|
+
isExpired: !cached.isPerpetual && expiresAt < now,
|
|
126345
|
+
isPerpetual: cached.isPerpetual,
|
|
126346
|
+
gracePeriodDays: cached.gracePeriodDays
|
|
126347
|
+
};
|
|
126348
|
+
}
|
|
126349
|
+
function buildLicenseInfoFromValidateResponse(response, decoded) {
|
|
126350
|
+
const expiresAt = new Date(response.expiresAt);
|
|
126351
|
+
const now = /* @__PURE__ */ new Date();
|
|
126352
|
+
const daysRemaining = response.isPerpetual ? Infinity : Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
|
|
126353
|
+
const features = Array.isArray(response.features) ? response.features.map((f) => ({
|
|
126354
|
+
applicationId: f.application_id || null,
|
|
126355
|
+
applicationCode: f.application_code || "*",
|
|
126356
|
+
modules: (f.modules || []).map((m) => ({
|
|
126357
|
+
moduleId: m.module_id || "",
|
|
126358
|
+
moduleCode: m.module_code || ""
|
|
126359
|
+
}))
|
|
126360
|
+
})) : [{ applicationId: null, applicationCode: "*", modules: [] }];
|
|
126361
|
+
return {
|
|
126362
|
+
companyId: response.clientId,
|
|
126363
|
+
clientName: response.clientName,
|
|
126364
|
+
edition: response.product || decoded?.prd || "standard",
|
|
126365
|
+
product: response.product,
|
|
126366
|
+
jti: decoded?.jti,
|
|
126367
|
+
environment: response.environment,
|
|
126368
|
+
features,
|
|
126369
|
+
maxInstances: response.maxInstances,
|
|
126370
|
+
maxUsers: response.maxUsers,
|
|
126371
|
+
issuedAt: decoded?.iat ? new Date(decoded.iat * 1e3) : now,
|
|
126372
|
+
expiresAt,
|
|
126373
|
+
renewalDate: response.renewalDate ?? void 0,
|
|
126374
|
+
daysRemaining,
|
|
126375
|
+
isValid: response.valid && !response.revoked,
|
|
126376
|
+
isExpired: !response.isPerpetual && expiresAt < now,
|
|
126377
|
+
isPerpetual: response.isPerpetual,
|
|
126378
|
+
gracePeriodDays: response.gracePeriodDays
|
|
126379
|
+
};
|
|
125608
126380
|
}
|
|
125609
126381
|
async function getLicenseInfo() {
|
|
125610
126382
|
const result = await validateCurrentLicense();
|
|
125611
126383
|
return result.valid ? result.license : null;
|
|
125612
126384
|
}
|
|
125613
|
-
function formatLicenseInfo(license) {
|
|
125614
|
-
const status = license.isExpired ? "\u{1F534} EXPIRED" : license.daysRemaining <= 30 ? `\u{1F7E1} ${license.daysRemaining} days remaining` : `\u{1F7E2} Valid (${license.daysRemaining} days)`;
|
|
126385
|
+
function formatLicenseInfo(license, source) {
|
|
126386
|
+
const status = license.isExpired ? "\u{1F534} EXPIRED" : license.daysRemaining <= 30 ? `\u{1F7E1} ${license.daysRemaining} days remaining` : license.isPerpetual ? "\u{1F7E2} Perpetual" : `\u{1F7E2} Valid (${license.daysRemaining} days)`;
|
|
126387
|
+
const edition = license.edition.toUpperCase();
|
|
126388
|
+
const env2 = license.environment ? ` (${license.environment})` : "";
|
|
126389
|
+
const sourceLabel = source ? ` [${source}]` : "";
|
|
126390
|
+
let featuresDisplay;
|
|
126391
|
+
if (license.legacyFeatures) {
|
|
126392
|
+
featuresDisplay = license.legacyFeatures.join(", ");
|
|
126393
|
+
} else {
|
|
126394
|
+
const parts = [];
|
|
126395
|
+
for (const scope of license.features) {
|
|
126396
|
+
if (scope.applicationCode === "*") {
|
|
126397
|
+
parts.push("All applications");
|
|
126398
|
+
} else if (scope.modules.length > 0) {
|
|
126399
|
+
const mods = scope.modules.map((m) => m.moduleCode).join(", ");
|
|
126400
|
+
parts.push(`${scope.applicationCode} (${mods})`);
|
|
126401
|
+
} else {
|
|
126402
|
+
parts.push(scope.applicationCode);
|
|
126403
|
+
}
|
|
126404
|
+
}
|
|
126405
|
+
featuresDisplay = parts.join(", ") || "N/A";
|
|
126406
|
+
}
|
|
126407
|
+
const limitsLine = license.maxInstances || license.maxUsers ? `\u2551 Limits: ${`${license.maxInstances ?? "\u221E"} instances, ${license.maxUsers ?? "\u221E"} users`.padEnd(45)}\u2551
|
|
126408
|
+
` : "";
|
|
125615
126409
|
return `
|
|
125616
126410
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
125617
126411
|
\u2551 SMARTSTACK CLI LICENSE \u2551
|
|
125618
126412
|
\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
|
|
125619
|
-
\u2551 Status: ${status.padEnd(45)}\u2551
|
|
125620
|
-
\u2551 Company: ${license.companyId.padEnd(45)}\u2551
|
|
125621
|
-
\u2551 Edition: ${
|
|
125622
|
-
\u2551 Expires: ${license.expiresAt.toISOString().split("T")[0].padEnd(45)}\u2551
|
|
126413
|
+
\u2551 Status: ${(status + sourceLabel).padEnd(45)}\u2551
|
|
126414
|
+
\u2551 Company: ${(license.clientName || license.companyId).padEnd(45)}\u2551
|
|
126415
|
+
\u2551 Edition: ${(edition + env2).padEnd(45)}\u2551
|
|
126416
|
+
\u2551 Expires: ${(license.isPerpetual ? "Never" : license.expiresAt.toISOString().split("T")[0]).padEnd(45)}\u2551
|
|
125623
126417
|
\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
|
|
125624
|
-
\u2551 Features: ${
|
|
125625
|
-
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
126418
|
+
\u2551 Features: ${featuresDisplay.padEnd(45)}\u2551
|
|
126419
|
+
${limitsLine}\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
125626
126420
|
`;
|
|
125627
126421
|
}
|
|
125628
126422
|
|
|
125629
126423
|
// src/commands/license.ts
|
|
125630
126424
|
function createLicenseCommand() {
|
|
125631
126425
|
const license = new Command("license").description("Manage SmartStack CLI license");
|
|
125632
|
-
license.command("activate <key>").description("Activate a license key").action(async (key) => {
|
|
125633
|
-
logger.info("
|
|
125634
|
-
const result =
|
|
126426
|
+
license.command("activate <key>").description("Activate a license key on this machine").action(async (key) => {
|
|
126427
|
+
logger.info("Activating license...\n");
|
|
126428
|
+
const result = await activateLicense(key);
|
|
125635
126429
|
if (!result.valid) {
|
|
125636
|
-
logger.error(`
|
|
126430
|
+
logger.error(`Activation Failed: ${result.error || "Invalid license"}`);
|
|
125637
126431
|
process.exit(1);
|
|
125638
126432
|
}
|
|
125639
|
-
await saveLicenseKey(key);
|
|
125640
126433
|
logger.success("License activated successfully!");
|
|
125641
|
-
console.log(formatLicenseInfo(result.license));
|
|
126434
|
+
console.log(formatLicenseInfo(result.license, result.source));
|
|
126435
|
+
const identity = await getMachineIdentity();
|
|
126436
|
+
console.log(source_default.gray(` Machine: ${identity.machineName}`));
|
|
126437
|
+
console.log(source_default.gray(` Fingerprint: ${identity.fingerprint.substring(0, 12)}...`));
|
|
126438
|
+
console.log(source_default.gray(` Instance: ${identity.instanceId}`));
|
|
126439
|
+
for (const warning of result.warnings) {
|
|
126440
|
+
logger.warning(warning);
|
|
126441
|
+
}
|
|
125642
126442
|
});
|
|
125643
126443
|
license.command("status").description("Show current license status").action(async () => {
|
|
125644
126444
|
const result = await validateCurrentLicense();
|
|
@@ -125646,34 +126446,162 @@ function createLicenseCommand() {
|
|
|
125646
126446
|
logger.error(`No Valid License: ${result.error || "License not found"}`);
|
|
125647
126447
|
logger.info("\nTo activate a license:");
|
|
125648
126448
|
logger.info(" smartstack license activate <your-license-key>");
|
|
126449
|
+
logger.info("\nTo request a trial:");
|
|
126450
|
+
logger.info(" smartstack license trial");
|
|
125649
126451
|
logger.info("\nTo purchase a license:");
|
|
125650
126452
|
logger.info(" https://atlashub.io/products/smartstack-cli");
|
|
125651
126453
|
process.exit(1);
|
|
125652
126454
|
}
|
|
125653
|
-
console.log(formatLicenseInfo(result.license));
|
|
125654
|
-
|
|
126455
|
+
console.log(formatLicenseInfo(result.license, result.source));
|
|
126456
|
+
const licenseKey = await loadLicenseKey();
|
|
126457
|
+
const format = licenseKey ? detectJwtFormat(licenseKey) : "unknown";
|
|
126458
|
+
const cache = await loadCache();
|
|
126459
|
+
console.log(source_default.cyan(" Extended Info:"));
|
|
126460
|
+
console.log(source_default.gray(` Format: ${format === "legacy" ? "Legacy (RS256)" : "New (RS512)"}`));
|
|
126461
|
+
console.log(source_default.gray(` Environment: ${result.license.environment || "N/A"}`));
|
|
126462
|
+
console.log(source_default.gray(` Source: ${result.source}`));
|
|
126463
|
+
if (cache.activation) {
|
|
126464
|
+
console.log(source_default.gray(` Activated: ${cache.activation.activatedAt?.split("T")[0] || "N/A"}`));
|
|
126465
|
+
console.log(source_default.gray(` Heartbeat: every ${cache.activation.heartbeatIntervalHours}h`));
|
|
126466
|
+
console.log(source_default.gray(` Grace Period: ${cache.activation.gracePeriodDays} days`));
|
|
126467
|
+
}
|
|
126468
|
+
if (cache.lastHeartbeat) {
|
|
126469
|
+
console.log(source_default.gray(` Last Beat: ${cache.lastHeartbeat}`));
|
|
126470
|
+
}
|
|
126471
|
+
console.log();
|
|
126472
|
+
for (const warning of result.warnings) {
|
|
126473
|
+
logger.warning(warning);
|
|
126474
|
+
}
|
|
126475
|
+
if (result.license.daysRemaining <= 30 && !result.license.isPerpetual) {
|
|
125655
126476
|
logger.warning(`License expires in ${result.license.daysRemaining} days`);
|
|
125656
126477
|
logger.info("Renew at: https://atlashub.io/products/smartstack-cli");
|
|
125657
126478
|
}
|
|
125658
126479
|
});
|
|
125659
|
-
license.command("deactivate").description("Remove the current license").action(async () => {
|
|
126480
|
+
license.command("deactivate").description("Remove the current license from this machine").action(async () => {
|
|
125660
126481
|
const key = await loadLicenseKey();
|
|
125661
126482
|
if (!key) {
|
|
125662
126483
|
logger.warning("No license is currently active");
|
|
125663
126484
|
return;
|
|
125664
126485
|
}
|
|
125665
|
-
await
|
|
126486
|
+
const { confirm } = await lib_default.prompt([
|
|
126487
|
+
{
|
|
126488
|
+
type: "confirm",
|
|
126489
|
+
name: "confirm",
|
|
126490
|
+
message: "Are you sure you want to deactivate the license on this machine?",
|
|
126491
|
+
default: false
|
|
126492
|
+
}
|
|
126493
|
+
]);
|
|
126494
|
+
if (!confirm) {
|
|
126495
|
+
logger.info("Deactivation cancelled");
|
|
126496
|
+
return;
|
|
126497
|
+
}
|
|
126498
|
+
await deactivateLicense();
|
|
125666
126499
|
logger.success("License deactivated successfully");
|
|
125667
126500
|
});
|
|
125668
126501
|
license.command("verify <key>").description("Verify a license key without activating it").action(async (key) => {
|
|
125669
126502
|
logger.info("Verifying license key...\n");
|
|
126503
|
+
const format = detectJwtFormat(key);
|
|
125670
126504
|
const result = validateLicenseKey(key);
|
|
125671
126505
|
if (!result.valid) {
|
|
125672
126506
|
logger.error(`License Invalid: ${result.error || "Unknown error"}`);
|
|
125673
126507
|
process.exit(1);
|
|
125674
126508
|
}
|
|
125675
|
-
logger.success(
|
|
125676
|
-
console.log(formatLicenseInfo(result.license));
|
|
126509
|
+
logger.success(`License is valid! (format: ${format === "legacy" ? "Legacy RS256" : "New RS512"})`);
|
|
126510
|
+
console.log(formatLicenseInfo(result.license, result.source));
|
|
126511
|
+
for (const warning of result.warnings) {
|
|
126512
|
+
logger.warning(warning);
|
|
126513
|
+
}
|
|
126514
|
+
});
|
|
126515
|
+
license.command("trial").description("Request a free trial license").action(async () => {
|
|
126516
|
+
logger.info("SmartStack CLI Trial Registration\n");
|
|
126517
|
+
const answers = await lib_default.prompt([
|
|
126518
|
+
{
|
|
126519
|
+
type: "input",
|
|
126520
|
+
name: "fullName",
|
|
126521
|
+
message: "Your full name:",
|
|
126522
|
+
validate: (v) => v.trim().length > 0 || "Name is required"
|
|
126523
|
+
},
|
|
126524
|
+
{
|
|
126525
|
+
type: "input",
|
|
126526
|
+
name: "email",
|
|
126527
|
+
message: "Your email address:",
|
|
126528
|
+
validate: (v) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) || "Valid email required"
|
|
126529
|
+
},
|
|
126530
|
+
{
|
|
126531
|
+
type: "input",
|
|
126532
|
+
name: "company",
|
|
126533
|
+
message: "Company name:",
|
|
126534
|
+
validate: (v) => v.trim().length > 0 || "Company is required"
|
|
126535
|
+
},
|
|
126536
|
+
{
|
|
126537
|
+
type: "list",
|
|
126538
|
+
name: "teamSize",
|
|
126539
|
+
message: "Team size:",
|
|
126540
|
+
choices: ["1-5", "6-20", "21-50", "51-200", "200+"]
|
|
126541
|
+
}
|
|
126542
|
+
]);
|
|
126543
|
+
const spinner = logger.spinner("Registering trial...");
|
|
126544
|
+
try {
|
|
126545
|
+
const baseUrl = await getLicenseServerUrl();
|
|
126546
|
+
const client = new LicenseClient(baseUrl);
|
|
126547
|
+
const response = await client.registerTrial(answers);
|
|
126548
|
+
spinner.succeed("Trial registered!");
|
|
126549
|
+
const cliLicense = response.licenses.find(
|
|
126550
|
+
(l) => ["smartstack-cli", "smartstackcli", "SmartStackCli", "standard", "Standard"].includes(l.product)
|
|
126551
|
+
);
|
|
126552
|
+
if (!cliLicense) {
|
|
126553
|
+
logger.error("No CLI license found in trial response");
|
|
126554
|
+
process.exit(1);
|
|
126555
|
+
}
|
|
126556
|
+
logger.info("\nActivating trial license...");
|
|
126557
|
+
const activationResult = await activateLicense(cliLicense.token);
|
|
126558
|
+
if (activationResult.valid) {
|
|
126559
|
+
logger.success("Trial license activated!");
|
|
126560
|
+
console.log(formatLicenseInfo(activationResult.license, activationResult.source));
|
|
126561
|
+
console.log(source_default.gray(` Trial expires: ${response.expiresAt.split("T")[0]}`));
|
|
126562
|
+
} else {
|
|
126563
|
+
await saveLicenseKey(cliLicense.token);
|
|
126564
|
+
logger.warning(`Trial created but activation failed: ${activationResult.error}`);
|
|
126565
|
+
logger.info("The license key has been saved. Try running any command to trigger online validation.");
|
|
126566
|
+
}
|
|
126567
|
+
} catch (err) {
|
|
126568
|
+
spinner.fail("Trial registration failed");
|
|
126569
|
+
const apiErr = err;
|
|
126570
|
+
if (apiErr?.status === 429) {
|
|
126571
|
+
logger.error("Rate limited. A trial has already been created for this email or IP.");
|
|
126572
|
+
} else {
|
|
126573
|
+
logger.error(apiErr?.message || "Unknown error");
|
|
126574
|
+
}
|
|
126575
|
+
process.exit(1);
|
|
126576
|
+
}
|
|
126577
|
+
});
|
|
126578
|
+
const apiKeyCmd = license.command("api-key").description("Manage API key for CI/CD authentication");
|
|
126579
|
+
apiKeyCmd.command("set <key>").description("Configure an API key for machine-to-machine authentication").action(async (key) => {
|
|
126580
|
+
if (!key.startsWith("sslk_")) {
|
|
126581
|
+
logger.error('Invalid API key format. Keys should start with "sslk_"');
|
|
126582
|
+
process.exit(1);
|
|
126583
|
+
}
|
|
126584
|
+
await saveApiKey(key);
|
|
126585
|
+
logger.success("API key configured successfully");
|
|
126586
|
+
console.log(source_default.gray(` Key prefix: ${key.substring(0, 12)}...`));
|
|
126587
|
+
});
|
|
126588
|
+
apiKeyCmd.command("remove").description("Remove the stored API key").action(async () => {
|
|
126589
|
+
const existing = await getApiKey();
|
|
126590
|
+
if (!existing) {
|
|
126591
|
+
logger.warning("No API key is currently configured");
|
|
126592
|
+
return;
|
|
126593
|
+
}
|
|
126594
|
+
await removeApiKey();
|
|
126595
|
+
logger.success("API key removed");
|
|
126596
|
+
});
|
|
126597
|
+
apiKeyCmd.command("status").description("Check if an API key is configured").action(async () => {
|
|
126598
|
+
const existing = await getApiKey();
|
|
126599
|
+
if (existing) {
|
|
126600
|
+
logger.success(`API key configured: ${existing.substring(0, 10)}...`);
|
|
126601
|
+
} else {
|
|
126602
|
+
logger.info("No API key configured");
|
|
126603
|
+
logger.info(" Set one with: smartstack license api-key set <key>");
|
|
126604
|
+
}
|
|
125677
126605
|
});
|
|
125678
126606
|
return license;
|
|
125679
126607
|
}
|
|
@@ -125784,24 +126712,24 @@ var checkMcpCommand = new Command("check-mcp").description("Check MCP servers st
|
|
|
125784
126712
|
|
|
125785
126713
|
// src/commands/ralph.ts
|
|
125786
126714
|
var import_cli_table33 = __toESM(require_cli_table3());
|
|
125787
|
-
var
|
|
125788
|
-
var
|
|
126715
|
+
var import_fs_extra12 = __toESM(require_lib());
|
|
126716
|
+
var import_path12 = require("path");
|
|
125789
126717
|
function getRalphDir() {
|
|
125790
|
-
return (0,
|
|
126718
|
+
return (0, import_path12.join)(process.cwd(), ".ralph");
|
|
125791
126719
|
}
|
|
125792
126720
|
async function readRalphLogs(limit = 50) {
|
|
125793
|
-
const logsDir = (0,
|
|
125794
|
-
if (!await
|
|
126721
|
+
const logsDir = (0, import_path12.join)(getRalphDir(), "logs");
|
|
126722
|
+
if (!await import_fs_extra12.default.pathExists(logsDir)) {
|
|
125795
126723
|
return [];
|
|
125796
126724
|
}
|
|
125797
126725
|
try {
|
|
125798
|
-
const files = await
|
|
126726
|
+
const files = await import_fs_extra12.default.readdir(logsDir);
|
|
125799
126727
|
const logFiles = files.filter((f) => f.endsWith(".log")).sort().reverse();
|
|
125800
126728
|
if (logFiles.length === 0) {
|
|
125801
126729
|
return [];
|
|
125802
126730
|
}
|
|
125803
|
-
const latestLog = (0,
|
|
125804
|
-
const content = await
|
|
126731
|
+
const latestLog = (0, import_path12.join)(logsDir, logFiles[0]);
|
|
126732
|
+
const content = await import_fs_extra12.default.readFile(latestLog, "utf-8");
|
|
125805
126733
|
const lines = content.split("\n");
|
|
125806
126734
|
return lines.slice(-limit);
|
|
125807
126735
|
} catch {
|
|
@@ -125809,17 +126737,17 @@ async function readRalphLogs(limit = 50) {
|
|
|
125809
126737
|
}
|
|
125810
126738
|
}
|
|
125811
126739
|
async function listReports() {
|
|
125812
|
-
const reportsDir = (0,
|
|
125813
|
-
if (!await
|
|
126740
|
+
const reportsDir = (0, import_path12.join)(getRalphDir(), "reports");
|
|
126741
|
+
if (!await import_fs_extra12.default.pathExists(reportsDir)) {
|
|
125814
126742
|
return [];
|
|
125815
126743
|
}
|
|
125816
126744
|
try {
|
|
125817
|
-
const files = await
|
|
126745
|
+
const files = await import_fs_extra12.default.readdir(reportsDir);
|
|
125818
126746
|
const reports = [];
|
|
125819
126747
|
for (const file of files) {
|
|
125820
126748
|
if (file.endsWith(".md") || file.endsWith(".json")) {
|
|
125821
|
-
const filePath = (0,
|
|
125822
|
-
const stat = await
|
|
126749
|
+
const filePath = (0, import_path12.join)(reportsDir, file);
|
|
126750
|
+
const stat = await import_fs_extra12.default.stat(filePath);
|
|
125823
126751
|
reports.push({
|
|
125824
126752
|
name: file,
|
|
125825
126753
|
date: stat.mtime,
|
|
@@ -125904,19 +126832,19 @@ ralphCommand.command("start").description("Verify prerequisites and prepare Ralp
|
|
|
125904
126832
|
}
|
|
125905
126833
|
}
|
|
125906
126834
|
logger.step(4, 5, "Checking logs directory...");
|
|
125907
|
-
const logsDir = (0,
|
|
125908
|
-
if (await
|
|
126835
|
+
const logsDir = (0, import_path12.join)(getRalphDir(), "logs");
|
|
126836
|
+
if (await import_fs_extra12.default.pathExists(logsDir)) {
|
|
125909
126837
|
logger.success("Logs directory ready");
|
|
125910
126838
|
} else {
|
|
125911
|
-
await
|
|
126839
|
+
await import_fs_extra12.default.ensureDir(logsDir);
|
|
125912
126840
|
logger.success("Logs directory created");
|
|
125913
126841
|
}
|
|
125914
126842
|
logger.step(5, 5, "Checking reports directory...");
|
|
125915
|
-
const reportsDir = (0,
|
|
125916
|
-
if (await
|
|
126843
|
+
const reportsDir = (0, import_path12.join)(getRalphDir(), "reports");
|
|
126844
|
+
if (await import_fs_extra12.default.pathExists(reportsDir)) {
|
|
125917
126845
|
logger.success("Reports directory ready");
|
|
125918
126846
|
} else {
|
|
125919
|
-
await
|
|
126847
|
+
await import_fs_extra12.default.ensureDir(reportsDir);
|
|
125920
126848
|
logger.success("Reports directory created");
|
|
125921
126849
|
}
|
|
125922
126850
|
console.log();
|
|
@@ -125972,9 +126900,9 @@ ralphCommand.command("status").description("Show Ralph status and configuration"
|
|
|
125972
126900
|
}
|
|
125973
126901
|
console.log();
|
|
125974
126902
|
}
|
|
125975
|
-
const logsDir = (0,
|
|
125976
|
-
if (await
|
|
125977
|
-
const logFiles = (await
|
|
126903
|
+
const logsDir = (0, import_path12.join)(getRalphDir(), "logs");
|
|
126904
|
+
if (await import_fs_extra12.default.pathExists(logsDir)) {
|
|
126905
|
+
const logFiles = (await import_fs_extra12.default.readdir(logsDir)).filter((f) => f.endsWith(".log"));
|
|
125978
126906
|
if (logFiles.length > 0) {
|
|
125979
126907
|
console.log(source_default.bold("Logs:"));
|
|
125980
126908
|
console.log(` ${logFiles.length} log file(s)`);
|
|
@@ -126051,7 +126979,7 @@ ralphCommand.command("report").description("List or view feature reports").optio
|
|
|
126051
126979
|
logger.header(`Report: ${reportToShow.name}`);
|
|
126052
126980
|
console.log(source_default.gray(`Date: ${reportToShow.date.toLocaleString()}`));
|
|
126053
126981
|
console.log(source_default.gray("\u2500".repeat(60)));
|
|
126054
|
-
const content = await
|
|
126982
|
+
const content = await import_fs_extra12.default.readFile(reportToShow.path, "utf-8");
|
|
126055
126983
|
console.log(content);
|
|
126056
126984
|
});
|
|
126057
126985
|
ralphCommand.command("init").description("Initialize Ralph in the current project").option("-f, --force", "Overwrite existing configuration").action(async (options) => {
|
|
@@ -126083,15 +127011,15 @@ ralphCommand.command("init").description("Initialize Ralph in the current projec
|
|
|
126083
127011
|
|
|
126084
127012
|
// src/commands/doctor.ts
|
|
126085
127013
|
var import_cli_table34 = __toESM(require_cli_table3());
|
|
126086
|
-
var
|
|
126087
|
-
var
|
|
126088
|
-
var
|
|
127014
|
+
var import_child_process8 = require("child_process");
|
|
127015
|
+
var import_fs_extra13 = __toESM(require_lib());
|
|
127016
|
+
var import_path13 = require("path");
|
|
126089
127017
|
function getNodeVersion() {
|
|
126090
127018
|
return process.version;
|
|
126091
127019
|
}
|
|
126092
127020
|
function getDotNetVersion() {
|
|
126093
127021
|
try {
|
|
126094
|
-
const output = (0,
|
|
127022
|
+
const output = (0, import_child_process8.execSync)("dotnet --version", {
|
|
126095
127023
|
encoding: "utf-8",
|
|
126096
127024
|
timeout: 5e3,
|
|
126097
127025
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -126103,7 +127031,7 @@ function getDotNetVersion() {
|
|
|
126103
127031
|
}
|
|
126104
127032
|
function getGitVersion() {
|
|
126105
127033
|
try {
|
|
126106
|
-
const output = (0,
|
|
127034
|
+
const output = (0, import_child_process8.execSync)("git --version", {
|
|
126107
127035
|
encoding: "utf-8",
|
|
126108
127036
|
timeout: 5e3,
|
|
126109
127037
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -126115,7 +127043,7 @@ function getGitVersion() {
|
|
|
126115
127043
|
}
|
|
126116
127044
|
function getNpmVersion() {
|
|
126117
127045
|
try {
|
|
126118
|
-
const output = (0,
|
|
127046
|
+
const output = (0, import_child_process8.execSync)("npm --version", {
|
|
126119
127047
|
encoding: "utf-8",
|
|
126120
127048
|
timeout: 5e3,
|
|
126121
127049
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -126127,7 +127055,7 @@ function getNpmVersion() {
|
|
|
126127
127055
|
}
|
|
126128
127056
|
var doctorCommand = new Command("doctor").description("Run diagnostics and check SmartStack health").option("--json", "Output as JSON").option("-v, --verbose", "Show detailed information").action(async (options) => {
|
|
126129
127057
|
const diagnostics = [];
|
|
126130
|
-
const pkg2 = JSON.parse(await
|
|
127058
|
+
const pkg2 = JSON.parse(await import_fs_extra13.default.readFile((0, import_path13.join)(__dirname, "..", "package.json"), "utf-8"));
|
|
126131
127059
|
if (!options.json) {
|
|
126132
127060
|
console.log(source_default.cyan(`
|
|
126133
127061
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
@@ -126155,6 +127083,47 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
|
|
|
126155
127083
|
fix: "smartstack license activate <key>"
|
|
126156
127084
|
});
|
|
126157
127085
|
}
|
|
127086
|
+
try {
|
|
127087
|
+
const baseUrl = await getLicenseServerUrl();
|
|
127088
|
+
const client = new LicenseClient(baseUrl);
|
|
127089
|
+
const healthy = await client.healthCheck();
|
|
127090
|
+
diagnostics.push({
|
|
127091
|
+
name: "License Server",
|
|
127092
|
+
status: healthy ? "ok" : "warning",
|
|
127093
|
+
message: healthy ? `Reachable (${baseUrl})` : "Unreachable",
|
|
127094
|
+
details: !healthy ? "License server is not responding. Online validation will use cache." : void 0
|
|
127095
|
+
});
|
|
127096
|
+
} catch {
|
|
127097
|
+
diagnostics.push({
|
|
127098
|
+
name: "License Server",
|
|
127099
|
+
status: "warning",
|
|
127100
|
+
message: "Could not check server health"
|
|
127101
|
+
});
|
|
127102
|
+
}
|
|
127103
|
+
const cache = await loadCache();
|
|
127104
|
+
if (cache.activation) {
|
|
127105
|
+
diagnostics.push({
|
|
127106
|
+
name: "Activation",
|
|
127107
|
+
status: "ok",
|
|
127108
|
+
message: `Active since ${cache.activation.activatedAt?.split("T")[0] || "unknown"}`,
|
|
127109
|
+
details: `Fingerprint: ${cache.activation.machineFingerprint?.substring(0, 12)}...`
|
|
127110
|
+
});
|
|
127111
|
+
const heartbeatDue = isHeartbeatDue(cache);
|
|
127112
|
+
diagnostics.push({
|
|
127113
|
+
name: "Heartbeat",
|
|
127114
|
+
status: heartbeatDue ? "warning" : "ok",
|
|
127115
|
+
message: heartbeatDue ? `Overdue (last: ${cache.lastHeartbeat || "never"})` : `OK (last: ${cache.lastHeartbeat?.split("T")[0] || "N/A"})`,
|
|
127116
|
+
details: `Interval: ${cache.activation.heartbeatIntervalHours}h`,
|
|
127117
|
+
fix: heartbeatDue ? "Run any command to trigger a heartbeat" : void 0
|
|
127118
|
+
});
|
|
127119
|
+
} else {
|
|
127120
|
+
diagnostics.push({
|
|
127121
|
+
name: "Activation",
|
|
127122
|
+
status: licenseResult.valid ? "warning" : "info",
|
|
127123
|
+
message: "Not activated on this machine",
|
|
127124
|
+
fix: "smartstack license activate <key>"
|
|
127125
|
+
});
|
|
127126
|
+
}
|
|
126158
127127
|
const nodeVersion = getNodeVersion();
|
|
126159
127128
|
const nodeVersionNum = parseInt(nodeVersion.replace("v", "").split(".")[0], 10);
|
|
126160
127129
|
diagnostics.push({
|
|
@@ -126233,8 +127202,8 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
|
|
|
126233
127202
|
status: installation.gitflow.configExists ? "ok" : "info",
|
|
126234
127203
|
message: installation.gitflow.configExists ? "Configured" : "Not configured"
|
|
126235
127204
|
});
|
|
126236
|
-
const ralphSkillPath = (0,
|
|
126237
|
-
const ralphSkillExists = await
|
|
127205
|
+
const ralphSkillPath = (0, import_path13.join)(installation.location, "skills", "ralph-loop", "SKILL.md");
|
|
127206
|
+
const ralphSkillExists = await import_fs_extra13.default.pathExists(ralphSkillPath);
|
|
126238
127207
|
diagnostics.push({
|
|
126239
127208
|
name: "Ralph Skill",
|
|
126240
127209
|
status: ralphSkillExists ? "ok" : "warning",
|
|
@@ -126243,7 +127212,7 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
|
|
|
126243
127212
|
fix: !ralphSkillExists ? "smartstack install" : void 0
|
|
126244
127213
|
});
|
|
126245
127214
|
const ralphStatus = await checkRalphInstallation();
|
|
126246
|
-
const isSmartStackProject = await
|
|
127215
|
+
const isSmartStackProject = await import_fs_extra13.default.pathExists((0, import_path13.join)(process.cwd(), ".smartstack", "config.json"));
|
|
126247
127216
|
const ralphConfigStatus = ralphStatus.configExists ? "ok" : isSmartStackProject ? "warning" : "info";
|
|
126248
127217
|
diagnostics.push({
|
|
126249
127218
|
name: "Ralph Config",
|
|
@@ -126345,8 +127314,8 @@ ${source_default.gray(item.details)}`;
|
|
|
126345
127314
|
var import_mssql = __toESM(require_mssql());
|
|
126346
127315
|
var import_bcryptjs = __toESM(require_bcryptjs());
|
|
126347
127316
|
var import_fs4 = require("fs");
|
|
126348
|
-
var
|
|
126349
|
-
var
|
|
127317
|
+
var import_path14 = require("path");
|
|
127318
|
+
var import_child_process9 = require("child_process");
|
|
126350
127319
|
function tryLoadNativeDriver() {
|
|
126351
127320
|
try {
|
|
126352
127321
|
return require("mssql/msnodesqlv8");
|
|
@@ -126373,7 +127342,7 @@ function findAppSettings(apiFolder) {
|
|
|
126373
127342
|
return [];
|
|
126374
127343
|
}
|
|
126375
127344
|
const files = (0, import_fs4.readdirSync)(apiFolder);
|
|
126376
|
-
return files.filter((f) => f.startsWith("appsettings") && f.endsWith(".json")).map((f) => (0,
|
|
127345
|
+
return files.filter((f) => f.startsWith("appsettings") && f.endsWith(".json")).map((f) => (0, import_path14.join)(apiFolder, f));
|
|
126377
127346
|
}
|
|
126378
127347
|
function extractConnectionString(filePath) {
|
|
126379
127348
|
try {
|
|
@@ -126402,7 +127371,7 @@ function executeSqlCmd(server, database, query, sqlAuth) {
|
|
|
126402
127371
|
const sqlServer = server === "(local)" ? "." : server;
|
|
126403
127372
|
const authFlag = sqlAuth ? `-U "${sqlAuth.user}" -P "${sqlAuth.password}"` : "-E";
|
|
126404
127373
|
const cmd = `sqlcmd -S "${sqlServer}" -d "${database}" ${authFlag} -I -C -Q "${query.replace(/"/g, '\\"')}" -h -1 -W`;
|
|
126405
|
-
return (0,
|
|
127374
|
+
return (0, import_child_process9.execSync)(cmd, { encoding: "utf-8", timeout: 15e3 }).trim();
|
|
126406
127375
|
}
|
|
126407
127376
|
function isLoginFailure(error) {
|
|
126408
127377
|
const msg = error instanceof Error ? error.message : String(error);
|
|
@@ -126442,12 +127411,12 @@ async function promptSqlCredentials() {
|
|
|
126442
127411
|
}
|
|
126443
127412
|
function detectSmartStackApp() {
|
|
126444
127413
|
const cwd = process.cwd();
|
|
126445
|
-
const srcDir = (0,
|
|
127414
|
+
const srcDir = (0, import_path14.join)(cwd, "src");
|
|
126446
127415
|
if ((0, import_fs4.existsSync)(srcDir)) {
|
|
126447
127416
|
const folders = (0, import_fs4.readdirSync)(srcDir);
|
|
126448
127417
|
const apiFolder = folders.find((f) => f.endsWith(".Api"));
|
|
126449
127418
|
if (apiFolder) {
|
|
126450
|
-
return (0,
|
|
127419
|
+
return (0, import_path14.join)(srcDir, apiFolder);
|
|
126451
127420
|
}
|
|
126452
127421
|
}
|
|
126453
127422
|
const possiblePaths = [
|
|
@@ -126482,14 +127451,14 @@ adminCommand.command("reset").description("Reset the localAdmin account password
|
|
|
126482
127451
|
process.exit(1);
|
|
126483
127452
|
}
|
|
126484
127453
|
let selectedFile;
|
|
126485
|
-
const localFile = appSettingsFiles.find((f) => (0,
|
|
127454
|
+
const localFile = appSettingsFiles.find((f) => (0, import_path14.basename)(f) === "appsettings.Local.json");
|
|
126486
127455
|
if (localFile && extractConnectionString(localFile)) {
|
|
126487
127456
|
selectedFile = localFile;
|
|
126488
127457
|
} else if (appSettingsFiles.length === 1) {
|
|
126489
127458
|
selectedFile = appSettingsFiles[0];
|
|
126490
127459
|
} else {
|
|
126491
127460
|
const choices = appSettingsFiles.map((f) => ({
|
|
126492
|
-
name: (0,
|
|
127461
|
+
name: (0, import_path14.basename)(f),
|
|
126493
127462
|
value: f
|
|
126494
127463
|
}));
|
|
126495
127464
|
const { file } = await lib_default.prompt([
|
|
@@ -126505,7 +127474,7 @@ adminCommand.command("reset").description("Reset the localAdmin account password
|
|
|
126505
127474
|
}
|
|
126506
127475
|
connectionString = extractConnectionString(selectedFile);
|
|
126507
127476
|
if (!connectionString) {
|
|
126508
|
-
logger.error(`No connection string found in ${(0,
|
|
127477
|
+
logger.error(`No connection string found in ${(0, import_path14.basename)(selectedFile)}`);
|
|
126509
127478
|
process.exit(1);
|
|
126510
127479
|
}
|
|
126511
127480
|
}
|
|
@@ -126681,8 +127650,8 @@ adminCommand.command("reset").description("Reset the localAdmin account password
|
|
|
126681
127650
|
|
|
126682
127651
|
// src/commands/mcp.ts
|
|
126683
127652
|
var import_cli_table35 = __toESM(require_cli_table3());
|
|
126684
|
-
var
|
|
126685
|
-
var
|
|
127653
|
+
var import_child_process10 = require("child_process");
|
|
127654
|
+
var import_os6 = require("os");
|
|
126686
127655
|
var mcpCommand = new Command("mcp").description("MCP server management (CLI + VS Code)").action(() => {
|
|
126687
127656
|
console.log(source_default.cyan(`
|
|
126688
127657
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
@@ -126712,7 +127681,7 @@ mcpCommand.command("install").description("Register MCP servers in Claude Code C
|
|
|
126712
127681
|
}));
|
|
126713
127682
|
currentStep++;
|
|
126714
127683
|
logger.step(currentStep, totalSteps, "Registering in ~/.claude/settings.json...");
|
|
126715
|
-
logger.debug(`Home directory: ${(0,
|
|
127684
|
+
logger.debug(`Home directory: ${(0, import_os6.homedir)()}`);
|
|
126716
127685
|
logger.debug(`Target: ${getClaudeSettingsPath()}`);
|
|
126717
127686
|
const claudeResult = await registerMcpInClaudeSettings(servers);
|
|
126718
127687
|
if (claudeResult.success) {
|
|
@@ -126746,7 +127715,7 @@ mcpCommand.command("install").description("Register MCP servers in Claude Code C
|
|
|
126746
127715
|
const serversToInstall = options.force ? REQUIRED_MCP_SERVERS : REQUIRED_MCP_SERVERS.filter((s) => cliResult.missingServers.includes(s.name));
|
|
126747
127716
|
for (const server of serversToInstall) {
|
|
126748
127717
|
const spinner = logger.spinner(`Registering ${server.name} in CLI...`);
|
|
126749
|
-
const result = (0,
|
|
127718
|
+
const result = (0, import_child_process10.spawnSync)(
|
|
126750
127719
|
"claude",
|
|
126751
127720
|
["mcp", "add", "--scope", "user", server.name, "--", server.command, ...server.args],
|
|
126752
127721
|
{ encoding: "utf-8", shell: true, timeout: 15e3 }
|
|
@@ -126904,7 +127873,7 @@ mcpCommand.command("remove").description("Unregister MCP servers from CLI and VS
|
|
|
126904
127873
|
if (!options.vscodeOnly) {
|
|
126905
127874
|
logger.info("Removing from Claude Code CLI...");
|
|
126906
127875
|
for (const server of REQUIRED_MCP_SERVERS) {
|
|
126907
|
-
const result = (0,
|
|
127876
|
+
const result = (0, import_child_process10.spawnSync)("claude", ["mcp", "remove", server.name], {
|
|
126908
127877
|
encoding: "utf-8",
|
|
126909
127878
|
shell: true,
|
|
126910
127879
|
timeout: 1e4
|
|
@@ -126936,8 +127905,8 @@ mcpCommand.command("remove").description("Unregister MCP servers from CLI and VS
|
|
|
126936
127905
|
});
|
|
126937
127906
|
|
|
126938
127907
|
// src/commands/derive-prd.ts
|
|
126939
|
-
var
|
|
126940
|
-
var
|
|
127908
|
+
var import_fs_extra14 = __toESM(require_lib());
|
|
127909
|
+
var import_path15 = require("path");
|
|
126941
127910
|
|
|
126942
127911
|
// src/utils/task-generator.ts
|
|
126943
127912
|
var LAYER_ORDER = [
|
|
@@ -127516,9 +128485,9 @@ function getPrdFileCounts(prd) {
|
|
|
127516
128485
|
// src/commands/derive-prd.ts
|
|
127517
128486
|
function readSmartStackNamespace() {
|
|
127518
128487
|
try {
|
|
127519
|
-
const configPath = (0,
|
|
127520
|
-
if (
|
|
127521
|
-
const config =
|
|
128488
|
+
const configPath = (0, import_path15.join)(process.cwd(), ".smartstack", "config.json");
|
|
128489
|
+
if (import_fs_extra14.default.existsSync(configPath)) {
|
|
128490
|
+
const config = import_fs_extra14.default.readJsonSync(configPath);
|
|
127522
128491
|
return config.baseNamespace;
|
|
127523
128492
|
}
|
|
127524
128493
|
} catch {
|
|
@@ -127526,14 +128495,14 @@ function readSmartStackNamespace() {
|
|
|
127526
128495
|
return void 0;
|
|
127527
128496
|
}
|
|
127528
128497
|
async function findModuleFeatureFiles(masterPath) {
|
|
127529
|
-
const master = await
|
|
127530
|
-
const masterDir = (0,
|
|
128498
|
+
const master = await import_fs_extra14.default.readJson(masterPath);
|
|
128499
|
+
const masterDir = (0, import_path15.dirname)(masterPath);
|
|
127531
128500
|
const paths = [];
|
|
127532
128501
|
if (master.modules) {
|
|
127533
128502
|
for (const mod of master.modules) {
|
|
127534
128503
|
if (mod.featureJsonPath) {
|
|
127535
|
-
const fullPath = (0,
|
|
127536
|
-
if (await
|
|
128504
|
+
const fullPath = (0, import_path15.join)(masterDir, "..", "..", mod.featureJsonPath);
|
|
128505
|
+
if (await import_fs_extra14.default.pathExists(fullPath)) {
|
|
127537
128506
|
paths.push(fullPath);
|
|
127538
128507
|
}
|
|
127539
128508
|
}
|
|
@@ -127547,12 +128516,12 @@ var derivePrdCommand = new Command("derive-prd").description("Extract prd.json p
|
|
|
127547
128516
|
process.exit(1);
|
|
127548
128517
|
}
|
|
127549
128518
|
const namespace = readSmartStackNamespace();
|
|
127550
|
-
const ralphDir = (0,
|
|
127551
|
-
await
|
|
128519
|
+
const ralphDir = (0, import_path15.join)(process.cwd(), ".ralph");
|
|
128520
|
+
await import_fs_extra14.default.ensureDir(ralphDir);
|
|
127552
128521
|
let featurePaths = [];
|
|
127553
128522
|
if (options.application) {
|
|
127554
|
-
const appPath = (0,
|
|
127555
|
-
if (!await
|
|
128523
|
+
const appPath = (0, import_path15.join)(process.cwd(), options.application);
|
|
128524
|
+
if (!await import_fs_extra14.default.pathExists(appPath)) {
|
|
127556
128525
|
console.log(source_default.red(`Application feature.json not found: ${appPath}`));
|
|
127557
128526
|
process.exit(1);
|
|
127558
128527
|
}
|
|
@@ -127564,8 +128533,8 @@ var derivePrdCommand = new Command("derive-prd").description("Extract prd.json p
|
|
|
127564
128533
|
featurePaths = modulePaths.map((p) => ({ path: p, isApplicationMode: true }));
|
|
127565
128534
|
console.log(source_default.cyan(`Found ${featurePaths.length} module(s) to process`));
|
|
127566
128535
|
} else if (options.feature) {
|
|
127567
|
-
const featurePath = (0,
|
|
127568
|
-
if (!await
|
|
128536
|
+
const featurePath = (0, import_path15.join)(process.cwd(), options.feature);
|
|
128537
|
+
if (!await import_fs_extra14.default.pathExists(featurePath)) {
|
|
127569
128538
|
console.log(source_default.red(`Feature.json not found: ${featurePath}`));
|
|
127570
128539
|
process.exit(1);
|
|
127571
128540
|
}
|
|
@@ -127574,7 +128543,7 @@ var derivePrdCommand = new Command("derive-prd").description("Extract prd.json p
|
|
|
127574
128543
|
let totalGenerated = 0;
|
|
127575
128544
|
let totalErrors = 0;
|
|
127576
128545
|
for (const entry of featurePaths) {
|
|
127577
|
-
const featureJson = await
|
|
128546
|
+
const featureJson = await import_fs_extra14.default.readJson(entry.path);
|
|
127578
128547
|
const moduleName = featureJson.metadata?.module ?? "unknown";
|
|
127579
128548
|
console.log(source_default.cyan(`
|
|
127580
128549
|
Processing module: ${source_default.bold(moduleName)}`));
|
|
@@ -127592,20 +128561,20 @@ Processing module: ${source_default.bold(moduleName)}`));
|
|
|
127592
128561
|
}
|
|
127593
128562
|
let cliVersion = "unknown";
|
|
127594
128563
|
try {
|
|
127595
|
-
const pkg2 =
|
|
128564
|
+
const pkg2 = import_fs_extra14.default.readJsonSync((0, import_path15.join)(__dirname, "..", "..", "package.json"));
|
|
127596
128565
|
cliVersion = pkg2.version ?? "unknown";
|
|
127597
128566
|
} catch {
|
|
127598
128567
|
}
|
|
127599
|
-
const relativePath = (0,
|
|
128568
|
+
const relativePath = (0, import_path15.relative)(process.cwd(), entry.path);
|
|
127600
128569
|
const unified = extractUnifiedPrd(featureJson, relativePath, namespace, cliVersion);
|
|
127601
128570
|
const prd = extractPrd(featureJson, relativePath, namespace);
|
|
127602
128571
|
let outputPath;
|
|
127603
128572
|
if (options.output && !entry.isApplicationMode) {
|
|
127604
|
-
outputPath = (0,
|
|
128573
|
+
outputPath = (0, import_path15.join)(process.cwd(), options.output);
|
|
127605
128574
|
} else {
|
|
127606
|
-
outputPath = (0,
|
|
128575
|
+
outputPath = (0, import_path15.join)(ralphDir, `prd-${moduleName}.json`);
|
|
127607
128576
|
}
|
|
127608
|
-
await
|
|
128577
|
+
await import_fs_extra14.default.writeJson(outputPath, unified, { spaces: 2 });
|
|
127609
128578
|
totalGenerated++;
|
|
127610
128579
|
const completenessWarnings = validatePrdCompleteness(prd, featureJson);
|
|
127611
128580
|
if (completenessWarnings.length > 0) {
|
|
@@ -127626,7 +128595,7 @@ Processing module: ${source_default.bold(moduleName)}`));
|
|
|
127626
128595
|
console.log(source_default.yellow(` - ${te}`));
|
|
127627
128596
|
}
|
|
127628
128597
|
}
|
|
127629
|
-
const relOutput = (0,
|
|
128598
|
+
const relOutput = (0, import_path15.relative)(process.cwd(), outputPath);
|
|
127630
128599
|
console.log(source_default.green(` Generated: ${relOutput} (unified v3)`));
|
|
127631
128600
|
console.log(source_default.gray(` UCs: ${prd.requirements.useCases.length} | FRs: ${prd.requirements.functionalRequirements.length} | BRs: ${prd.businessRules.length}`));
|
|
127632
128601
|
console.log(source_default.gray(` Endpoints: ${prd.architecture.apiEndpoints.length} | Sections: ${prd.architecture.sections.length}`));
|
|
@@ -127654,12 +128623,12 @@ Processing module: ${source_default.bold(moduleName)}`));
|
|
|
127654
128623
|
var import_cli_table36 = __toESM(require_cli_table3());
|
|
127655
128624
|
|
|
127656
128625
|
// src/lib/wsl-provisioner.ts
|
|
127657
|
-
var
|
|
128626
|
+
var import_child_process11 = require("child_process");
|
|
127658
128627
|
var import_fs5 = require("fs");
|
|
127659
|
-
var
|
|
128628
|
+
var import_path16 = require("path");
|
|
127660
128629
|
function wslExec(command, timeout = 1e4) {
|
|
127661
128630
|
try {
|
|
127662
|
-
const output = (0,
|
|
128631
|
+
const output = (0, import_child_process11.execSync)(`wsl -e bash -c "${command.replace(/"/g, '\\"')}"`, {
|
|
127663
128632
|
encoding: "utf-8",
|
|
127664
128633
|
timeout,
|
|
127665
128634
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -127671,7 +128640,7 @@ function wslExec(command, timeout = 1e4) {
|
|
|
127671
128640
|
}
|
|
127672
128641
|
function wslInstall(command, timeout = 12e4) {
|
|
127673
128642
|
try {
|
|
127674
|
-
const output = (0,
|
|
128643
|
+
const output = (0, import_child_process11.execSync)(`wsl -e bash -c "${command.replace(/"/g, '\\"')}"`, {
|
|
127675
128644
|
encoding: "utf-8",
|
|
127676
128645
|
timeout,
|
|
127677
128646
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -127688,7 +128657,7 @@ function parseWslList(raw) {
|
|
|
127688
128657
|
}
|
|
127689
128658
|
function checkWsl() {
|
|
127690
128659
|
try {
|
|
127691
|
-
const statusRaw = (0,
|
|
128660
|
+
const statusRaw = (0, import_child_process11.execSync)("wsl --status", {
|
|
127692
128661
|
encoding: "utf-8",
|
|
127693
128662
|
timeout: 1e4,
|
|
127694
128663
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -127698,7 +128667,7 @@ function checkWsl() {
|
|
|
127698
128667
|
if (versionMatch) version2 = parseInt(versionMatch[1], 10);
|
|
127699
128668
|
let defaultDistro = null;
|
|
127700
128669
|
try {
|
|
127701
|
-
const listRaw = (0,
|
|
128670
|
+
const listRaw = (0, import_child_process11.execSync)("wsl --list --verbose", {
|
|
127702
128671
|
encoding: "utf-8",
|
|
127703
128672
|
timeout: 1e4,
|
|
127704
128673
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -127949,7 +128918,7 @@ var SMARTSTACK_PROFILE_NAME = "SmartStack Dev";
|
|
|
127949
128918
|
var SMARTSTACK_PROFILE_GUID = "{17ce5bfe-17ed-5f3a-ab15-5cd5baafed5b}";
|
|
127950
128919
|
function checkWindowsTerminal() {
|
|
127951
128920
|
try {
|
|
127952
|
-
(0,
|
|
128921
|
+
(0, import_child_process11.execSync)("where wt", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 5e3 });
|
|
127953
128922
|
return { installed: true, version: "installed" };
|
|
127954
128923
|
} catch {
|
|
127955
128924
|
return { installed: false, version: null };
|
|
@@ -127960,7 +128929,7 @@ async function installWindowsTerminal() {
|
|
|
127960
128929
|
if (status.installed) return { success: true, version: "installed", skipped: true };
|
|
127961
128930
|
const spinner = logger.spinner("Installing Windows Terminal via winget...");
|
|
127962
128931
|
try {
|
|
127963
|
-
(0,
|
|
128932
|
+
(0, import_child_process11.execSync)("winget install Microsoft.WindowsTerminal --accept-source-agreements --accept-package-agreements", {
|
|
127964
128933
|
encoding: "utf-8",
|
|
127965
128934
|
timeout: 12e4,
|
|
127966
128935
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -127985,11 +128954,11 @@ async function installWindowsTerminal() {
|
|
|
127985
128954
|
function getWtSettingsPath() {
|
|
127986
128955
|
const localAppData = process.env.LOCALAPPDATA;
|
|
127987
128956
|
if (!localAppData) return null;
|
|
127988
|
-
const standardPath = (0,
|
|
128957
|
+
const standardPath = (0, import_path16.join)(localAppData, "Packages", "Microsoft.WindowsTerminal_8wekyb3d8bbwe", "LocalState", "settings.json");
|
|
127989
128958
|
if ((0, import_fs5.existsSync)(standardPath)) return standardPath;
|
|
127990
|
-
const previewPath = (0,
|
|
128959
|
+
const previewPath = (0, import_path16.join)(localAppData, "Packages", "Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe", "LocalState", "settings.json");
|
|
127991
128960
|
if ((0, import_fs5.existsSync)(previewPath)) return previewPath;
|
|
127992
|
-
const unpackagedPath = (0,
|
|
128961
|
+
const unpackagedPath = (0, import_path16.join)(localAppData, "Microsoft", "Windows Terminal", "settings.json");
|
|
127993
128962
|
if ((0, import_fs5.existsSync)(unpackagedPath)) return unpackagedPath;
|
|
127994
128963
|
return null;
|
|
127995
128964
|
}
|
|
@@ -128030,7 +128999,7 @@ function configureWindowsTerminal() {
|
|
|
128030
128999
|
}
|
|
128031
129000
|
function launchWindowsTerminal() {
|
|
128032
129001
|
try {
|
|
128033
|
-
(0,
|
|
129002
|
+
(0, import_child_process11.spawn)("wt", ["-p", SMARTSTACK_PROFILE_NAME], {
|
|
128034
129003
|
detached: true,
|
|
128035
129004
|
stdio: "ignore"
|
|
128036
129005
|
}).unref();
|
|
@@ -128302,9 +129271,9 @@ tmuxCommand.command("status").description("Show WSL development environment stat
|
|
|
128302
129271
|
|
|
128303
129272
|
// src/index.ts
|
|
128304
129273
|
var import_fs6 = require("fs");
|
|
128305
|
-
var
|
|
128306
|
-
var pkg = JSON.parse((0, import_fs6.readFileSync)((0,
|
|
128307
|
-
var LICENSE_FREE_COMMANDS = ["license", "help", "--help", "-h", "--version", "-v"];
|
|
129274
|
+
var import_path17 = require("path");
|
|
129275
|
+
var pkg = JSON.parse((0, import_fs6.readFileSync)((0, import_path17.join)(__dirname, "..", "package.json"), "utf-8"));
|
|
129276
|
+
var LICENSE_FREE_COMMANDS = ["license", "doctor", "help", "--help", "-h", "--version", "-v"];
|
|
128308
129277
|
async function main2() {
|
|
128309
129278
|
const program2 = new Command();
|
|
128310
129279
|
program2.name("smartstack").description(source_default.cyan("SmartStack Claude Code automation toolkit")).version(pkg.version, "-v, --version");
|
|
@@ -128341,6 +129310,9 @@ async function main2() {
|
|
|
128341
129310
|
\u2551 To activate a license: \u2551
|
|
128342
129311
|
\u2551 ${source_default.cyan("smartstack license activate <your-key>")} \u2551
|
|
128343
129312
|
\u2551 \u2551
|
|
129313
|
+
\u2551 To request a free trial: \u2551
|
|
129314
|
+
\u2551 ${source_default.cyan("smartstack license trial")} \u2551
|
|
129315
|
+
\u2551 \u2551
|
|
128344
129316
|
\u2551 To purchase a license: \u2551
|
|
128345
129317
|
\u2551 ${source_default.cyan("https://atlashub.io/products/smartstack-cli")} \u2551
|
|
128346
129318
|
\u2551 \u2551
|
|
@@ -128348,6 +129320,11 @@ async function main2() {
|
|
|
128348
129320
|
`));
|
|
128349
129321
|
process.exit(1);
|
|
128350
129322
|
}
|
|
129323
|
+
if (result.warnings?.length) {
|
|
129324
|
+
for (const warning of result.warnings) {
|
|
129325
|
+
console.log(source_default.yellow(`\u26A0 ${warning}`));
|
|
129326
|
+
}
|
|
129327
|
+
}
|
|
128351
129328
|
}
|
|
128352
129329
|
program2.action(() => {
|
|
128353
129330
|
console.log(source_default.cyan(`
|