@settlemint/sdk-cli 2.4.1-mainaf0c377c → 2.4.1-pr31b55309

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
@@ -265083,7 +265083,7 @@ function pruneCurrentEnv(currentEnv, env2) {
265083
265083
  var package_default = {
265084
265084
  name: "@settlemint/sdk-cli",
265085
265085
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
265086
- version: "2.4.1-mainaf0c377c",
265086
+ version: "2.4.1-pr31b55309",
265087
265087
  type: "module",
265088
265088
  private: false,
265089
265089
  license: "FSL-1.1-MIT",
@@ -265134,10 +265134,10 @@ var package_default = {
265134
265134
  "@inquirer/input": "4.2.0",
265135
265135
  "@inquirer/password": "4.0.16",
265136
265136
  "@inquirer/select": "4.2.4",
265137
- "@settlemint/sdk-hasura": "2.4.1-mainaf0c377c",
265138
- "@settlemint/sdk-js": "2.4.1-mainaf0c377c",
265139
- "@settlemint/sdk-utils": "2.4.1-mainaf0c377c",
265140
- "@settlemint/sdk-viem": "2.4.1-mainaf0c377c",
265137
+ "@settlemint/sdk-hasura": "2.4.1-pr31b55309",
265138
+ "@settlemint/sdk-js": "2.4.1-pr31b55309",
265139
+ "@settlemint/sdk-utils": "2.4.1-pr31b55309",
265140
+ "@settlemint/sdk-viem": "2.4.1-pr31b55309",
265141
265141
  "@types/node": "24.0.12",
265142
265142
  "@types/semver": "7.7.0",
265143
265143
  "@types/which": "3.0.4",
@@ -302081,11 +302081,6 @@ function camelCaseToWords2(s6) {
302081
302081
  function replaceUnderscoresAndHyphensWithSpaces(s6) {
302082
302082
  return s6.replace(/[-_]/g, " ");
302083
302083
  }
302084
- function extractBaseUrlBeforeSegment(baseUrl, pathSegment) {
302085
- const url4 = new URL(baseUrl);
302086
- const segmentIndex = url4.pathname.indexOf(pathSegment);
302087
- return url4.origin + (segmentIndex >= 0 ? url4.pathname.substring(0, segmentIndex) : url4.pathname);
302088
- }
302089
302084
 
302090
302085
  // src/commands/codegen/codegen-the-graph.ts
302091
302086
  var PACKAGE_NAME3 = "@settlemint/sdk-thegraph";
@@ -321706,7 +321701,7 @@ function getHdPrivateKeyEnv(service) {
321706
321701
  }
321707
321702
 
321708
321703
  // ../utils/dist/url.js
321709
- function extractBaseUrlBeforeSegment2(baseUrl, pathSegment) {
321704
+ function extractBaseUrlBeforeSegment(baseUrl, pathSegment) {
321710
321705
  const url5 = new URL(baseUrl);
321711
321706
  const segmentIndex = url5.pathname.indexOf(pathSegment);
321712
321707
  return url5.origin + (segmentIndex >= 0 ? url5.pathname.substring(0, segmentIndex) : url5.pathname);
@@ -321738,7 +321733,7 @@ function getUpdatedSubgraphEndpoints({
321738
321733
  }
321739
321734
  function getTheGraphUrl(subgraphUrls) {
321740
321735
  if (Array.isArray(subgraphUrls) && subgraphUrls.length > 0) {
321741
- return extractBaseUrlBeforeSegment2(subgraphUrls[0], "/subgraphs");
321736
+ return extractBaseUrlBeforeSegment(subgraphUrls[0], "/subgraphs");
321742
321737
  }
321743
321738
  return;
321744
321739
  }
@@ -321815,59 +321810,6 @@ ${JSON.stringify(arg, null, 2)}`;
321815
321810
  };
321816
321811
  }
321817
321812
  var logger4 = createLogger4();
321818
- function truncate(value4, maxLength) {
321819
- if (value4.length <= maxLength) {
321820
- return value4;
321821
- }
321822
- return `${value4.slice(0, maxLength)}...`;
321823
- }
321824
- var WARNING_THRESHOLD = 500;
321825
- var TRUNCATE_LENGTH = 50;
321826
- function requestLogger(logger$1, name3, fn) {
321827
- return async (...args) => {
321828
- const start3 = Date.now();
321829
- try {
321830
- return await fn(...args);
321831
- } finally {
321832
- const end = Date.now();
321833
- const duration6 = end - start3;
321834
- const body = extractInfoFromBody(args[1]?.body ?? "{}");
321835
- const message = `${name3} path: ${args[0]}, took ${formatDuration(duration6)}`;
321836
- if (duration6 > WARNING_THRESHOLD) {
321837
- logger$1.warn(message, body);
321838
- } else {
321839
- logger$1.info(message, body);
321840
- }
321841
- }
321842
- };
321843
- }
321844
- function formatDuration(duration6) {
321845
- return duration6 < 1000 ? `${duration6}ms` : `${(duration6 / 1000).toFixed(3)}s`;
321846
- }
321847
- function extractInfoFromBody(body) {
321848
- try {
321849
- const parsedBody = typeof body === "string" ? JSON.parse(body) : body;
321850
- if (parsedBody === null || parsedBody === undefined || Object.keys(parsedBody).length === 0) {
321851
- return null;
321852
- }
321853
- const dataToKeep = {};
321854
- if ("query" in parsedBody) {
321855
- dataToKeep.query = truncate(parsedBody.query, TRUNCATE_LENGTH);
321856
- }
321857
- if ("variables" in parsedBody) {
321858
- dataToKeep.variables = truncate(JSON.stringify(parsedBody.variables), TRUNCATE_LENGTH);
321859
- }
321860
- if ("operationName" in parsedBody) {
321861
- dataToKeep.operationName = truncate(parsedBody.operationName, TRUNCATE_LENGTH);
321862
- }
321863
- if (Object.keys(dataToKeep).length > 0) {
321864
- return JSON.stringify(dataToKeep);
321865
- }
321866
- return truncate(JSON.stringify(parsedBody || "{}"), TRUNCATE_LENGTH);
321867
- } catch {
321868
- return "{}";
321869
- }
321870
- }
321871
321813
 
321872
321814
  // src/prompts/standalone/service-value.prompt.ts
321873
321815
  async function serviceValuePrompt({
@@ -326185,33 +326127,6 @@ var ClientOptionsSchema3 = exports_external.object({
326185
326127
  "reload"
326186
326128
  ]).optional()
326187
326129
  });
326188
- function createHasuraMetadataClient(options, logger5) {
326189
- ensureServer();
326190
- const validatedOptions = validate2(ClientOptionsSchema3, options);
326191
- const baseUrl = extractBaseUrlBeforeSegment(options.instance, "/v1/graphql");
326192
- const queryEndpoint = new URL(`${baseUrl}/v1/metadata`).toString();
326193
- const fetchInstance = logger5 ? requestLogger(logger5, "hasura", fetch) : fetch;
326194
- return async (query) => {
326195
- const response = await fetchInstance(queryEndpoint, {
326196
- method: "POST",
326197
- headers: appendHeaders({ "Content-Type": "application/json" }, {
326198
- "x-auth-token": validatedOptions.accessToken,
326199
- "x-hasura-admin-secret": validatedOptions.adminSecret
326200
- }),
326201
- body: JSON.stringify(query)
326202
- });
326203
- if (!response.ok) {
326204
- return {
326205
- ok: false,
326206
- data: await response.json()
326207
- };
326208
- }
326209
- return {
326210
- ok: true,
326211
- data: await response.json()
326212
- };
326213
- };
326214
- }
326215
326130
 
326216
326131
  // src/constants/resource-type.ts
326217
326132
  var SETTLEMINT_CLIENT_MAP = {
@@ -326316,12 +326231,11 @@ function hasuraTrackCommand() {
326316
326231
  if (!hasuraGraphqlEndpoint || !hasuraAdminSecret) {
326317
326232
  return note("Could not retrieve Hasura endpoint or admin secret. Please check your configuration.");
326318
326233
  }
326319
- const hasuraMetadataClient = createHasuraMetadataClient({
326234
+ const { result, messages } = await trackAllTables(database, {
326320
326235
  instance: hasuraGraphqlEndpoint,
326321
326236
  accessToken,
326322
326237
  adminSecret: hasuraAdminSecret
326323
326238
  });
326324
- const { result, messages } = await trackAllTables(database, hasuraMetadataClient);
326325
326239
  for (const message of messages) {
326326
326240
  note(message);
326327
326241
  }
@@ -330898,4 +330812,4 @@ async function sdkCliCommand(argv = process.argv) {
330898
330812
  // src/cli.ts
330899
330813
  sdkCliCommand();
330900
330814
 
330901
- //# debugId=A0FC03AE5EC04ECC64756E2164756E21
330815
+ //# debugId=5741BE39990C452264756E2164756E21