@settlemint/sdk-cli 2.3.2-pr8b8551fc → 2.3.2-pr8d084a79
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/cli.js +153 -33
- package/dist/cli.js.map +4 -4
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -54139,8 +54139,8 @@ ${lanes.join(`
|
|
54139
54139
|
function sysLog(s) {
|
54140
54140
|
return curSysLog(s);
|
54141
54141
|
}
|
54142
|
-
function setSysLog(
|
54143
|
-
curSysLog =
|
54142
|
+
function setSysLog(logger3) {
|
54143
|
+
curSysLog = logger3;
|
54144
54144
|
}
|
54145
54145
|
function createDirectoryWatcherSupportingRecursive({
|
54146
54146
|
watchDirectory,
|
@@ -204833,10 +204833,10 @@ ${options.prefix}` : `
|
|
204833
204833
|
return [];
|
204834
204834
|
}
|
204835
204835
|
var ThrottledOperations = class _ThrottledOperations {
|
204836
|
-
constructor(host,
|
204836
|
+
constructor(host, logger3) {
|
204837
204837
|
this.host = host;
|
204838
204838
|
this.pendingTimeouts = /* @__PURE__ */ new Map;
|
204839
|
-
this.logger =
|
204839
|
+
this.logger = logger3.hasLevel(3) ? logger3 : undefined;
|
204840
204840
|
}
|
204841
204841
|
schedule(operationId, delay, cb) {
|
204842
204842
|
const pendingTimeout = this.pendingTimeouts.get(operationId);
|
@@ -204864,10 +204864,10 @@ ${options.prefix}` : `
|
|
204864
204864
|
}
|
204865
204865
|
};
|
204866
204866
|
var GcTimer = class _GcTimer {
|
204867
|
-
constructor(host, delay,
|
204867
|
+
constructor(host, delay, logger3) {
|
204868
204868
|
this.host = host;
|
204869
204869
|
this.delay = delay;
|
204870
|
-
this.logger =
|
204870
|
+
this.logger = logger3;
|
204871
204871
|
}
|
204872
204872
|
scheduleCollect() {
|
204873
204873
|
if (!this.host.gc || this.timerId !== undefined) {
|
@@ -210796,11 +210796,11 @@ Dynamic files must always be opened with service's current directory or service
|
|
210796
210796
|
return edits.every((edit) => textSpanEnd(edit.span) < pos);
|
210797
210797
|
}
|
210798
210798
|
var CommandNames = CommandTypes;
|
210799
|
-
function formatMessage2(msg,
|
210800
|
-
const verboseLogging =
|
210799
|
+
function formatMessage2(msg, logger3, byteLength, newLine) {
|
210800
|
+
const verboseLogging = logger3.hasLevel(3);
|
210801
210801
|
const json2 = JSON.stringify(msg);
|
210802
210802
|
if (verboseLogging) {
|
210803
|
-
|
210803
|
+
logger3.info(`${msg.type}:${stringifyIndented(msg)}`);
|
210804
210804
|
}
|
210805
210805
|
const len = byteLength(json2, "utf8");
|
210806
210806
|
return `Content-Length: ${1 + len}\r
|
@@ -210927,10 +210927,10 @@ ${json2}${newLine}`;
|
|
210927
210927
|
const info = infos && firstOrUndefined(infos);
|
210928
210928
|
return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : undefined;
|
210929
210929
|
}
|
210930
|
-
function getReferencesWorker(projects, defaultProject, initialLocation, useCaseSensitiveFileNames2,
|
210930
|
+
function getReferencesWorker(projects, defaultProject, initialLocation, useCaseSensitiveFileNames2, logger3) {
|
210931
210931
|
var _a, _b;
|
210932
210932
|
const perProjectResults = getPerProjectReferences(projects, defaultProject, initialLocation, getDefinitionLocation(defaultProject, initialLocation, false), mapDefinitionInProject, (project, position) => {
|
210933
|
-
|
210933
|
+
logger3.info(`Finding references to ${position.fileName} position ${position.pos} in project ${project.getProjectName()}`);
|
210934
210934
|
return project.getLanguageService().findReferences(position.fileName, position.pos);
|
210935
210935
|
}, (referencedSymbol, cb) => {
|
210936
210936
|
cb(documentSpanLocation(referencedSymbol.definition));
|
@@ -214310,9 +214310,9 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
214310
214310
|
}
|
214311
214311
|
};
|
214312
214312
|
var _TypingsInstallerAdapter = class _TypingsInstallerAdapter2 {
|
214313
|
-
constructor(telemetryEnabled,
|
214313
|
+
constructor(telemetryEnabled, logger3, host, globalTypingsCacheLocation, event, maxActiveRequestCount) {
|
214314
214314
|
this.telemetryEnabled = telemetryEnabled;
|
214315
|
-
this.logger =
|
214315
|
+
this.logger = logger3;
|
214316
214316
|
this.host = host;
|
214317
214317
|
this.globalTypingsCacheLocation = globalTypingsCacheLocation;
|
214318
214318
|
this.event = event;
|
@@ -254078,7 +254078,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
254078
254078
|
var package_default = {
|
254079
254079
|
name: "@settlemint/sdk-cli",
|
254080
254080
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
254081
|
-
version: "2.3.2-
|
254081
|
+
version: "2.3.2-pr8d084a79",
|
254082
254082
|
type: "module",
|
254083
254083
|
private: false,
|
254084
254084
|
license: "FSL-1.1-MIT",
|
@@ -254127,8 +254127,8 @@ var package_default = {
|
|
254127
254127
|
"@inquirer/input": "4.1.10",
|
254128
254128
|
"@inquirer/password": "4.0.13",
|
254129
254129
|
"@inquirer/select": "4.2.1",
|
254130
|
-
"@settlemint/sdk-js": "2.3.2-
|
254131
|
-
"@settlemint/sdk-utils": "2.3.2-
|
254130
|
+
"@settlemint/sdk-js": "2.3.2-pr8d084a79",
|
254131
|
+
"@settlemint/sdk-utils": "2.3.2-pr8d084a79",
|
254132
254132
|
"@types/node": "22.15.21",
|
254133
254133
|
"@types/semver": "7.7.0",
|
254134
254134
|
"@types/which": "3.0.4",
|
@@ -255460,24 +255460,84 @@ function table(title, data) {
|
|
255460
255460
|
}
|
255461
255461
|
|
255462
255462
|
// ../utils/dist/http.mjs
|
255463
|
+
var maskTokens3 = (output) => {
|
255464
|
+
return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
|
255465
|
+
};
|
255466
|
+
function createLogger(options = {}) {
|
255467
|
+
const { level = "warn", prefix = "" } = options;
|
255468
|
+
const logLevels = {
|
255469
|
+
debug: 0,
|
255470
|
+
info: 1,
|
255471
|
+
warn: 2,
|
255472
|
+
error: 3,
|
255473
|
+
none: 4
|
255474
|
+
};
|
255475
|
+
const currentLevelValue = logLevels[level];
|
255476
|
+
const formatArgs = (args) => {
|
255477
|
+
if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
|
255478
|
+
return "";
|
255479
|
+
}
|
255480
|
+
const formatted = args.map((arg) => {
|
255481
|
+
if (arg instanceof Error) {
|
255482
|
+
return `
|
255483
|
+
${arg.stack || arg.message}`;
|
255484
|
+
}
|
255485
|
+
if (typeof arg === "object" && arg !== null) {
|
255486
|
+
return `
|
255487
|
+
${JSON.stringify(arg, null, 2)}`;
|
255488
|
+
}
|
255489
|
+
return ` ${String(arg)}`;
|
255490
|
+
}).join("");
|
255491
|
+
return `, args:${formatted}`;
|
255492
|
+
};
|
255493
|
+
const shouldLog = (level2) => {
|
255494
|
+
return logLevels[level2] >= currentLevelValue;
|
255495
|
+
};
|
255496
|
+
return {
|
255497
|
+
debug: (message, ...args) => {
|
255498
|
+
if (shouldLog("debug")) {
|
255499
|
+
console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
|
255500
|
+
}
|
255501
|
+
},
|
255502
|
+
info: (message, ...args) => {
|
255503
|
+
if (shouldLog("info")) {
|
255504
|
+
console.info(`\x1B[34m${prefix}[INFO] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
|
255505
|
+
}
|
255506
|
+
},
|
255507
|
+
warn: (message, ...args) => {
|
255508
|
+
if (shouldLog("warn")) {
|
255509
|
+
console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
|
255510
|
+
}
|
255511
|
+
},
|
255512
|
+
error: (message, ...args) => {
|
255513
|
+
if (shouldLog("error")) {
|
255514
|
+
console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
|
255515
|
+
}
|
255516
|
+
}
|
255517
|
+
};
|
255518
|
+
}
|
255519
|
+
var logger = createLogger();
|
255463
255520
|
async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
|
255464
|
-
let
|
255465
|
-
|
255521
|
+
let retries = 0;
|
255522
|
+
const maxAttempts = maxRetries + 1;
|
255523
|
+
while (retries < maxAttempts) {
|
255466
255524
|
try {
|
255467
255525
|
return await fn();
|
255468
255526
|
} catch (e) {
|
255527
|
+
const error35 = e;
|
255469
255528
|
if (typeof stopOnError === "function") {
|
255470
|
-
const error35 = e;
|
255471
255529
|
if (stopOnError(error35)) {
|
255472
255530
|
throw error35;
|
255473
255531
|
}
|
255474
255532
|
}
|
255475
|
-
|
255476
|
-
if (attempt >= maxRetries) {
|
255533
|
+
if (retries >= maxRetries) {
|
255477
255534
|
throw e;
|
255478
255535
|
}
|
255479
|
-
const
|
255480
|
-
const
|
255536
|
+
const baseDelay = 2 ** retries * initialSleepTime;
|
255537
|
+
const jitterAmount = initialSleepTime * (Math.random() / 10);
|
255538
|
+
const delay = baseDelay + jitterAmount;
|
255539
|
+
retries += 1;
|
255540
|
+
logger.warn(`An error occurred ${error35.message}, retrying in ${delay.toFixed(0)}ms (retry ${retries} of ${maxRetries})...`);
|
255481
255541
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
255482
255542
|
}
|
255483
255543
|
}
|
@@ -258650,14 +258710,14 @@ async function getPackageManagerExecutable(targetDir) {
|
|
258650
258710
|
function shouldPrint2() {
|
258651
258711
|
return process.env.SETTLEMINT_DISABLE_TERMINAL !== "true";
|
258652
258712
|
}
|
258653
|
-
var
|
258713
|
+
var maskTokens4 = (output) => {
|
258654
258714
|
return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
|
258655
258715
|
};
|
258656
258716
|
var note2 = (message, level = "info") => {
|
258657
258717
|
if (!shouldPrint2()) {
|
258658
258718
|
return;
|
258659
258719
|
}
|
258660
|
-
const maskedMessage =
|
258720
|
+
const maskedMessage = maskTokens4(message);
|
258661
258721
|
console.log("");
|
258662
258722
|
if (level === "warn") {
|
258663
258723
|
console.warn(yellowBright(maskedMessage));
|
@@ -258718,24 +258778,84 @@ function extractJsonObject(value2) {
|
|
258718
258778
|
}
|
258719
258779
|
return tryParseJson3(result[0]);
|
258720
258780
|
}
|
258781
|
+
var maskTokens5 = (output) => {
|
258782
|
+
return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
|
258783
|
+
};
|
258784
|
+
function createLogger2(options = {}) {
|
258785
|
+
const { level = "warn", prefix = "" } = options;
|
258786
|
+
const logLevels = {
|
258787
|
+
debug: 0,
|
258788
|
+
info: 1,
|
258789
|
+
warn: 2,
|
258790
|
+
error: 3,
|
258791
|
+
none: 4
|
258792
|
+
};
|
258793
|
+
const currentLevelValue = logLevels[level];
|
258794
|
+
const formatArgs = (args) => {
|
258795
|
+
if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
|
258796
|
+
return "";
|
258797
|
+
}
|
258798
|
+
const formatted = args.map((arg) => {
|
258799
|
+
if (arg instanceof Error) {
|
258800
|
+
return `
|
258801
|
+
${arg.stack || arg.message}`;
|
258802
|
+
}
|
258803
|
+
if (typeof arg === "object" && arg !== null) {
|
258804
|
+
return `
|
258805
|
+
${JSON.stringify(arg, null, 2)}`;
|
258806
|
+
}
|
258807
|
+
return ` ${String(arg)}`;
|
258808
|
+
}).join("");
|
258809
|
+
return `, args:${formatted}`;
|
258810
|
+
};
|
258811
|
+
const shouldLog = (level2) => {
|
258812
|
+
return logLevels[level2] >= currentLevelValue;
|
258813
|
+
};
|
258814
|
+
return {
|
258815
|
+
debug: (message, ...args) => {
|
258816
|
+
if (shouldLog("debug")) {
|
258817
|
+
console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
|
258818
|
+
}
|
258819
|
+
},
|
258820
|
+
info: (message, ...args) => {
|
258821
|
+
if (shouldLog("info")) {
|
258822
|
+
console.info(`\x1B[34m${prefix}[INFO] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
|
258823
|
+
}
|
258824
|
+
},
|
258825
|
+
warn: (message, ...args) => {
|
258826
|
+
if (shouldLog("warn")) {
|
258827
|
+
console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
|
258828
|
+
}
|
258829
|
+
},
|
258830
|
+
error: (message, ...args) => {
|
258831
|
+
if (shouldLog("error")) {
|
258832
|
+
console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
|
258833
|
+
}
|
258834
|
+
}
|
258835
|
+
};
|
258836
|
+
}
|
258837
|
+
var logger2 = createLogger2();
|
258721
258838
|
async function retryWhenFailed2(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
|
258722
|
-
let
|
258723
|
-
|
258839
|
+
let retries = 0;
|
258840
|
+
const maxAttempts = maxRetries + 1;
|
258841
|
+
while (retries < maxAttempts) {
|
258724
258842
|
try {
|
258725
258843
|
return await fn();
|
258726
258844
|
} catch (e3) {
|
258845
|
+
const error36 = e3;
|
258727
258846
|
if (typeof stopOnError === "function") {
|
258728
|
-
const error36 = e3;
|
258729
258847
|
if (stopOnError(error36)) {
|
258730
258848
|
throw error36;
|
258731
258849
|
}
|
258732
258850
|
}
|
258733
|
-
|
258734
|
-
if (attempt >= maxRetries) {
|
258851
|
+
if (retries >= maxRetries) {
|
258735
258852
|
throw e3;
|
258736
258853
|
}
|
258737
|
-
const
|
258738
|
-
const
|
258854
|
+
const baseDelay = 2 ** retries * initialSleepTime;
|
258855
|
+
const jitterAmount = initialSleepTime * (Math.random() / 10);
|
258856
|
+
const delay = baseDelay + jitterAmount;
|
258857
|
+
retries += 1;
|
258858
|
+
logger2.warn(`An error occurred ${error36.message}, retrying in ${delay.toFixed(0)}ms (retry ${retries} of ${maxRetries})...`);
|
258739
258859
|
await new Promise((resolve3) => setTimeout(resolve3, delay));
|
258740
258860
|
}
|
258741
258861
|
}
|
@@ -269849,4 +269969,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
269849
269969
|
// src/cli.ts
|
269850
269970
|
sdkCliCommand();
|
269851
269971
|
|
269852
|
-
//# debugId=
|
269972
|
+
//# debugId=B292C5A057E1069964756E2164756E21
|