@settlemint/sdk-cli 2.3.2-pr2ffa9747 → 2.3.2-pr37d1321f

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 CHANGED
@@ -54139,8 +54139,8 @@ ${lanes.join(`
54139
54139
  function sysLog(s) {
54140
54140
  return curSysLog(s);
54141
54141
  }
54142
- function setSysLog(logger) {
54143
- curSysLog = logger;
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, logger) {
204836
+ constructor(host, logger3) {
204837
204837
  this.host = host;
204838
204838
  this.pendingTimeouts = /* @__PURE__ */ new Map;
204839
- this.logger = logger.hasLevel(3) ? logger : undefined;
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, logger) {
204867
+ constructor(host, delay, logger3) {
204868
204868
  this.host = host;
204869
204869
  this.delay = delay;
204870
- this.logger = 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, logger, byteLength, newLine) {
210800
- const verboseLogging = logger.hasLevel(3);
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
- logger.info(`${msg.type}:${stringifyIndented(msg)}`);
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, logger) {
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
- logger.info(`Finding references to ${position.fileName} position ${position.pos} in project ${project.getProjectName()}`);
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, logger, host, globalTypingsCacheLocation, event, maxActiveRequestCount) {
214313
+ constructor(telemetryEnabled, logger3, host, globalTypingsCacheLocation, event, maxActiveRequestCount) {
214314
214314
  this.telemetryEnabled = telemetryEnabled;
214315
- this.logger = logger;
214315
+ this.logger = logger3;
214316
214316
  this.host = host;
214317
214317
  this.globalTypingsCacheLocation = globalTypingsCacheLocation;
214318
214318
  this.event = event;
@@ -262458,7 +262458,7 @@ function pruneCurrentEnv(currentEnv, env2) {
262458
262458
  var package_default = {
262459
262459
  name: "@settlemint/sdk-cli",
262460
262460
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
262461
- version: "2.3.2-pr2ffa9747",
262461
+ version: "2.3.2-pr37d1321f",
262462
262462
  type: "module",
262463
262463
  private: false,
262464
262464
  license: "FSL-1.1-MIT",
@@ -262507,8 +262507,8 @@ var package_default = {
262507
262507
  "@inquirer/input": "4.1.10",
262508
262508
  "@inquirer/password": "4.0.13",
262509
262509
  "@inquirer/select": "4.2.1",
262510
- "@settlemint/sdk-js": "2.3.2-pr2ffa9747",
262511
- "@settlemint/sdk-utils": "2.3.2-pr2ffa9747",
262510
+ "@settlemint/sdk-js": "2.3.2-pr37d1321f",
262511
+ "@settlemint/sdk-utils": "2.3.2-pr37d1321f",
262512
262512
  "@types/node": "22.15.21",
262513
262513
  "@types/semver": "7.7.0",
262514
262514
  "@types/which": "3.0.4",
@@ -263841,24 +263841,84 @@ function table(title, data) {
263841
263841
  }
263842
263842
 
263843
263843
  // ../utils/dist/http.mjs
263844
+ var maskTokens3 = (output) => {
263845
+ return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
263846
+ };
263847
+ function createLogger(options = {}) {
263848
+ const { level = "warn", prefix = "" } = options;
263849
+ const logLevels = {
263850
+ debug: 0,
263851
+ info: 1,
263852
+ warn: 2,
263853
+ error: 3,
263854
+ none: 4
263855
+ };
263856
+ const currentLevelValue = logLevels[level];
263857
+ const formatArgs = (args) => {
263858
+ if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
263859
+ return "";
263860
+ }
263861
+ const formatted = args.map((arg) => {
263862
+ if (arg instanceof Error) {
263863
+ return `
263864
+ ${arg.stack || arg.message}`;
263865
+ }
263866
+ if (typeof arg === "object" && arg !== null) {
263867
+ return `
263868
+ ${JSON.stringify(arg, null, 2)}`;
263869
+ }
263870
+ return ` ${String(arg)}`;
263871
+ }).join("");
263872
+ return `, args:${formatted}`;
263873
+ };
263874
+ const shouldLog = (level2) => {
263875
+ return logLevels[level2] >= currentLevelValue;
263876
+ };
263877
+ return {
263878
+ debug: (message, ...args) => {
263879
+ if (shouldLog("debug")) {
263880
+ console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
263881
+ }
263882
+ },
263883
+ info: (message, ...args) => {
263884
+ if (shouldLog("info")) {
263885
+ console.info(`\x1B[34m${prefix}[INFO] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
263886
+ }
263887
+ },
263888
+ warn: (message, ...args) => {
263889
+ if (shouldLog("warn")) {
263890
+ console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
263891
+ }
263892
+ },
263893
+ error: (message, ...args) => {
263894
+ if (shouldLog("error")) {
263895
+ console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens3(message)}${maskTokens3(formatArgs(args))}\x1B[0m`);
263896
+ }
263897
+ }
263898
+ };
263899
+ }
263900
+ var logger = createLogger();
263844
263901
  async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
263845
- let attempt = 0;
263846
- while (attempt < maxRetries) {
263902
+ let retries = 0;
263903
+ const maxAttempts = maxRetries + 1;
263904
+ while (retries < maxAttempts) {
263847
263905
  try {
263848
263906
  return await fn();
263849
263907
  } catch (e) {
263908
+ const error35 = e;
263850
263909
  if (typeof stopOnError === "function") {
263851
- const error35 = e;
263852
263910
  if (stopOnError(error35)) {
263853
263911
  throw error35;
263854
263912
  }
263855
263913
  }
263856
- attempt += 1;
263857
- if (attempt >= maxRetries) {
263914
+ if (retries >= maxRetries) {
263858
263915
  throw e;
263859
263916
  }
263860
- const jitter = Math.random();
263861
- const delay = 2 ** attempt * initialSleepTime * jitter;
263917
+ const baseDelay = 2 ** retries * initialSleepTime;
263918
+ const jitterAmount = initialSleepTime * (Math.random() / 10);
263919
+ const delay = baseDelay + jitterAmount;
263920
+ retries += 1;
263921
+ logger.warn(`An error occurred ${error35.message}, retrying in ${delay.toFixed(0)}ms (retry ${retries} of ${maxRetries})...`);
263862
263922
  await new Promise((resolve) => setTimeout(resolve, delay));
263863
263923
  }
263864
263924
  }
@@ -267053,14 +267113,14 @@ async function getPackageManagerExecutable(targetDir) {
267053
267113
  function shouldPrint2() {
267054
267114
  return process.env.SETTLEMINT_DISABLE_TERMINAL !== "true";
267055
267115
  }
267056
- var maskTokens3 = (output) => {
267116
+ var maskTokens4 = (output) => {
267057
267117
  return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
267058
267118
  };
267059
267119
  var note2 = (message, level = "info") => {
267060
267120
  if (!shouldPrint2()) {
267061
267121
  return;
267062
267122
  }
267063
- const maskedMessage = maskTokens3(message);
267123
+ const maskedMessage = maskTokens4(message);
267064
267124
  console.log("");
267065
267125
  if (level === "warn") {
267066
267126
  console.warn(yellowBright(maskedMessage));
@@ -267121,24 +267181,84 @@ function extractJsonObject(value2) {
267121
267181
  }
267122
267182
  return tryParseJson3(result[0]);
267123
267183
  }
267184
+ var maskTokens5 = (output) => {
267185
+ return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
267186
+ };
267187
+ function createLogger2(options = {}) {
267188
+ const { level = "warn", prefix = "" } = options;
267189
+ const logLevels = {
267190
+ debug: 0,
267191
+ info: 1,
267192
+ warn: 2,
267193
+ error: 3,
267194
+ none: 4
267195
+ };
267196
+ const currentLevelValue = logLevels[level];
267197
+ const formatArgs = (args) => {
267198
+ if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
267199
+ return "";
267200
+ }
267201
+ const formatted = args.map((arg) => {
267202
+ if (arg instanceof Error) {
267203
+ return `
267204
+ ${arg.stack || arg.message}`;
267205
+ }
267206
+ if (typeof arg === "object" && arg !== null) {
267207
+ return `
267208
+ ${JSON.stringify(arg, null, 2)}`;
267209
+ }
267210
+ return ` ${String(arg)}`;
267211
+ }).join("");
267212
+ return `, args:${formatted}`;
267213
+ };
267214
+ const shouldLog = (level2) => {
267215
+ return logLevels[level2] >= currentLevelValue;
267216
+ };
267217
+ return {
267218
+ debug: (message, ...args) => {
267219
+ if (shouldLog("debug")) {
267220
+ console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
267221
+ }
267222
+ },
267223
+ info: (message, ...args) => {
267224
+ if (shouldLog("info")) {
267225
+ console.info(`\x1B[34m${prefix}[INFO] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
267226
+ }
267227
+ },
267228
+ warn: (message, ...args) => {
267229
+ if (shouldLog("warn")) {
267230
+ console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
267231
+ }
267232
+ },
267233
+ error: (message, ...args) => {
267234
+ if (shouldLog("error")) {
267235
+ console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens5(message)}${maskTokens5(formatArgs(args))}\x1B[0m`);
267236
+ }
267237
+ }
267238
+ };
267239
+ }
267240
+ var logger2 = createLogger2();
267124
267241
  async function retryWhenFailed2(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
267125
- let attempt = 0;
267126
- while (attempt < maxRetries) {
267242
+ let retries = 0;
267243
+ const maxAttempts = maxRetries + 1;
267244
+ while (retries < maxAttempts) {
267127
267245
  try {
267128
267246
  return await fn();
267129
267247
  } catch (e3) {
267248
+ const error36 = e3;
267130
267249
  if (typeof stopOnError === "function") {
267131
- const error36 = e3;
267132
267250
  if (stopOnError(error36)) {
267133
267251
  throw error36;
267134
267252
  }
267135
267253
  }
267136
- attempt += 1;
267137
- if (attempt >= maxRetries) {
267254
+ if (retries >= maxRetries) {
267138
267255
  throw e3;
267139
267256
  }
267140
- const jitter = Math.random();
267141
- const delay = 2 ** attempt * initialSleepTime * jitter;
267257
+ const baseDelay = 2 ** retries * initialSleepTime;
267258
+ const jitterAmount = initialSleepTime * (Math.random() / 10);
267259
+ const delay = baseDelay + jitterAmount;
267260
+ retries += 1;
267261
+ logger2.warn(`An error occurred ${error36.message}, retrying in ${delay.toFixed(0)}ms (retry ${retries} of ${maxRetries})...`);
267142
267262
  await new Promise((resolve3) => setTimeout(resolve3, delay));
267143
267263
  }
267144
267264
  }
@@ -274801,7 +274921,7 @@ async function codegenViem(env2) {
274801
274921
  }
274802
274922
  const chainId = env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID ?? await ae4({
274803
274923
  accessToken: env2.SETTLEMINT_ACCESS_TOKEN,
274804
- rpcUrl: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT
274924
+ rpcUrl: loadBalancerRpcEndpoint ?? blockchainNodeRpcEndpoint
274805
274925
  });
274806
274926
  if (!chainId) {
274807
274927
  note("[Codegen] No chain ID found, skipping Viem resources generation", "warn");
@@ -275913,10 +276033,10 @@ function getTheGraphSubgraphUrl(theGraphUrl, subgraphName) {
275913
276033
  }
275914
276034
 
275915
276035
  // ../utils/dist/logging.mjs
275916
- var maskTokens4 = (output) => {
276036
+ var maskTokens6 = (output) => {
275917
276037
  return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
275918
276038
  };
275919
- function createLogger(options = {}) {
276039
+ function createLogger3(options = {}) {
275920
276040
  const { level = "warn", prefix = "" } = options;
275921
276041
  const logLevels = {
275922
276042
  debug: 0,
@@ -275949,27 +276069,27 @@ ${JSON.stringify(arg, null, 2)}`;
275949
276069
  return {
275950
276070
  debug: (message, ...args) => {
275951
276071
  if (shouldLog("debug")) {
275952
- console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
276072
+ console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens6(message)}${maskTokens6(formatArgs(args))}\x1B[0m`);
275953
276073
  }
275954
276074
  },
275955
276075
  info: (message, ...args) => {
275956
276076
  if (shouldLog("info")) {
275957
- console.info(`\x1B[34m${prefix}[INFO] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
276077
+ console.info(`\x1B[34m${prefix}[INFO] ${maskTokens6(message)}${maskTokens6(formatArgs(args))}\x1B[0m`);
275958
276078
  }
275959
276079
  },
275960
276080
  warn: (message, ...args) => {
275961
276081
  if (shouldLog("warn")) {
275962
- console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
276082
+ console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens6(message)}${maskTokens6(formatArgs(args))}\x1B[0m`);
275963
276083
  }
275964
276084
  },
275965
276085
  error: (message, ...args) => {
275966
276086
  if (shouldLog("error")) {
275967
- console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
276087
+ console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens6(message)}${maskTokens6(formatArgs(args))}\x1B[0m`);
275968
276088
  }
275969
276089
  }
275970
276090
  };
275971
276091
  }
275972
- var logger = createLogger();
276092
+ var logger3 = createLogger3();
275973
276093
 
275974
276094
  // src/prompts/standalone/service-value.prompt.ts
275975
276095
  async function serviceValuePrompt({
@@ -276348,7 +276468,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
276348
276468
  table("Configuration", Object.values(selectedServices).filter((item) => !item.isSecret).map((item) => {
276349
276469
  return {
276350
276470
  name: item.label,
276351
- value: item.result ? maskTokens4(item.result) : undefined
276471
+ value: item.result ? maskTokens6(item.result) : undefined
276352
276472
  };
276353
276473
  }).filter(Boolean));
276354
276474
  }
@@ -280273,7 +280393,7 @@ function hasuraTrackCommand() {
280273
280393
  const env2 = await loadEnv(false, false);
280274
280394
  const selectedInstance = await instancePrompt({
280275
280395
  env: env2,
280276
- accept: true
280396
+ accept: acceptDefaults
280277
280397
  });
280278
280398
  let hasuraGraphqlEndpoint;
280279
280399
  let hasuraAdminSecret;
@@ -284338,4 +284458,4 @@ async function sdkCliCommand(argv = process.argv) {
284338
284458
  // src/cli.ts
284339
284459
  sdkCliCommand();
284340
284460
 
284341
- //# debugId=20010C3E369919A864756E2164756E21
284461
+ //# debugId=575F21B9E3C4FA2A64756E2164756E21