@superblocksteam/sdk 1.14.2 → 1.14.4

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/client.js CHANGED
@@ -68,7 +68,7 @@ const BASE_SERVER_PUBLIC_API_URL_V1 = "api/v1/public";
68
68
  const BASE_SERVER_PUBLIC_API_URL_v2 = "api/v2/public";
69
69
  const BASE_SERVER_API_URL_V2 = "api/v2";
70
70
  const BASE_SERVER_API_URL_V3 = "api/v3";
71
- const SUPERBLOCKS_MAX_FILE_SIZE_MB = 10;
71
+ const SUPERBLOCKS_MAX_FILE_SIZE_MB = 30;
72
72
  const CLI_VERSION_HEADER = "x-superblocks-cli-version";
73
73
  const SUPERBLOCKS_URL_HEADER = "x-superblocks-url";
74
74
  var ResourceType;
@@ -291,7 +291,6 @@ async function fetchApis(cliVersion, token, superblocksBaseUrl) {
291
291
  }
292
292
  }
293
293
  async function validateGitSetup(cliVersion, resourceId, resourceType, event, localGitRepoState, token, superblocksBaseUrl, injectedHeaders) {
294
- let resourceName;
295
294
  try {
296
295
  const requestBody = {
297
296
  event,
@@ -323,9 +322,6 @@ async function validateGitSetup(cliVersion, resourceId, resourceType, event, loc
323
322
  const response = await (0, axios_1.default)(config);
324
323
  const { validationResult } = response.data.data;
325
324
  if (validationResult.errors.length > 0) {
326
- if (validationResult.resourceName) {
327
- resourceName = validationResult.resourceName;
328
- }
329
325
  throw new Error(validationResult.errors.join("\n"));
330
326
  }
331
327
  return {
@@ -344,14 +340,15 @@ async function validateGitSetup(cliVersion, resourceId, resourceType, event, loc
344
340
  else {
345
341
  message = `${e?.message ? e.message : e}`;
346
342
  }
347
- const errorMessage = `Could not validate your git setup against Superblocks for ${resourceType.toLowerCase()} ${resourceName ?? resourceId}${message ? "\n" + message : ""}`;
348
343
  // TODO(@taha-au @gpoulios-sb) Replace this check with a more robust one that uses error codes once
349
344
  // the backend starts returning them as part of the response body
350
- if (message.includes("Please initialize git locally")) {
351
- throw new errors_1.ValidateGitSetupError(errorMessage);
345
+ if (message.includes("Please initialize git locally") ||
346
+ message.includes("Superblocks does not have a reference to") ||
347
+ message.includes("Branching is not enabled")) {
348
+ throw new errors_1.ValidateGitSetupError(message);
352
349
  }
353
350
  else {
354
- throw new Error(errorMessage);
351
+ throw new Error(message);
355
352
  }
356
353
  }
357
354
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superblocksteam/sdk",
3
- "version": "1.14.2",
3
+ "version": "1.14.4",
4
4
  "description": "Superblocks JS SDK",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -29,7 +29,7 @@
29
29
  "form-data": "^4.0.0",
30
30
  "lodash": "^4.17.21",
31
31
  "ws": "^8.17.0",
32
- "@superblocksteam/util": "1.14.2"
32
+ "@superblocksteam/util": "1.14.4"
33
33
  },
34
34
  "homepage": "https://www.superblocks.com",
35
35
  "engines": {
package/src/client.ts CHANGED
@@ -40,7 +40,7 @@ const BASE_SERVER_PUBLIC_API_URL_v2 = "api/v2/public";
40
40
  const BASE_SERVER_API_URL_V2 = "api/v2";
41
41
  const BASE_SERVER_API_URL_V3 = "api/v3";
42
42
 
43
- const SUPERBLOCKS_MAX_FILE_SIZE_MB = 10;
43
+ const SUPERBLOCKS_MAX_FILE_SIZE_MB = 30;
44
44
 
45
45
  const CLI_VERSION_HEADER = "x-superblocks-cli-version";
46
46
  const SUPERBLOCKS_URL_HEADER = "x-superblocks-url";
@@ -481,7 +481,6 @@ export async function validateGitSetup(
481
481
  superblocksBaseUrl: string,
482
482
  injectedHeaders?: Record<string, string>,
483
483
  ) {
484
- let resourceName: string | undefined;
485
484
  try {
486
485
  const requestBody: ValidateGitSetupRequestBody = {
487
486
  event,
@@ -516,9 +515,6 @@ export async function validateGitSetup(
516
515
  const response = await axios(config);
517
516
  const { validationResult } = response.data.data;
518
517
  if (validationResult.errors.length > 0) {
519
- if (validationResult.resourceName) {
520
- resourceName = validationResult.resourceName;
521
- }
522
518
  throw new Error(validationResult.errors.join("\n"));
523
519
  }
524
520
  return {
@@ -536,16 +532,16 @@ export async function validateGitSetup(
536
532
  message = `${e?.message ? e.message : e}`;
537
533
  }
538
534
 
539
- const errorMessage = `Could not validate your git setup against Superblocks for ${resourceType.toLowerCase()} ${
540
- resourceName ?? resourceId
541
- }${message ? "\n" + message : ""}`;
542
-
543
535
  // TODO(@taha-au @gpoulios-sb) Replace this check with a more robust one that uses error codes once
544
536
  // the backend starts returning them as part of the response body
545
- if (message.includes("Please initialize git locally")) {
546
- throw new ValidateGitSetupError(errorMessage);
537
+ if (
538
+ message.includes("Please initialize git locally") ||
539
+ message.includes("Superblocks does not have a reference to") ||
540
+ message.includes("Branching is not enabled")
541
+ ) {
542
+ throw new ValidateGitSetupError(message);
547
543
  } else {
548
- throw new Error(errorMessage);
544
+ throw new Error(message);
549
545
  }
550
546
  }
551
547
  }
@@ -1 +1 @@
1
- {"root":["./src/client.ts","./src/errors.ts","./src/flag.ts","./src/index.ts","./src/sdk.ts","./src/utils.ts","./src/socket/handlers.ts","./src/socket/index.ts","./src/socket/signing.ts","./src/socket/socket.ts","./src/types/common.ts","./src/types/index.ts","./src/types/plugin.ts","./src/types/signing.ts","./src/types/socket.ts"],"version":"5.7.3"}
1
+ {"root":["./src/client.ts","./src/errors.ts","./src/flag.ts","./src/index.ts","./src/sdk.ts","./src/utils.ts","./src/socket/handlers.ts","./src/socket/index.ts","./src/socket/signing.ts","./src/socket/socket.ts","./src/types/common.ts","./src/types/index.ts","./src/types/plugin.ts","./src/types/signing.ts","./src/types/socket.ts"],"version":"5.8.3"}