@withgateway/sdk 0.2.2 → 0.2.3

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.
@@ -1341,7 +1341,7 @@ async function push(dir, opts = {}) {
1341
1341
  const pyproject = readPyproject(dir);
1342
1342
  const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
1343
1343
  if (contractVersion) pyproject.version = contractVersion;
1344
- const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
1344
+ const slug = opts.slug ?? localMeta.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
1345
1345
  const resolve6 = await apiRequest(
1346
1346
  options,
1347
1347
  "POST",
@@ -3470,6 +3470,7 @@ var init_ingest = __esm({
3470
3470
  // src/worlds/index.ts
3471
3471
  var worlds_exports = {};
3472
3472
  __export(worlds_exports, {
3473
+ ApiError: () => ApiError2,
3473
3474
  BrowserActionRecorder: () => BrowserActionRecorder,
3474
3475
  COMPUTER_USE_SPECS: () => COMPUTER_USE_SPECS,
3475
3476
  DEFAULT_BRANCH: () => DEFAULT_BRANCH,
@@ -3578,11 +3579,7 @@ async function apiRequest(options, method, path8, body) {
3578
3579
  ...body === void 0 ? {} : { body: JSON.stringify(body) }
3579
3580
  });
3580
3581
  const text2 = await res.text();
3581
- if (!res.ok) {
3582
- throw new Error(
3583
- `${method} ${path8} -> ${res.status}: ${text2.slice(0, 400)}`
3584
- );
3585
- }
3582
+ if (!res.ok) throw new ApiError2(res.status, method, path8, text2.slice(0, 400));
3586
3583
  return JSON.parse(text2);
3587
3584
  }
3588
3585
  async function setEnvSecret(slug, key, value, options = {}) {
@@ -3734,7 +3731,7 @@ async function openWorld(slugRef, options = {}) {
3734
3731
  }
3735
3732
  return world;
3736
3733
  }
3737
- var WorldTask, WorldSet;
3734
+ var ApiError2, WorldTask, WorldSet;
3738
3735
  var init_worlds = __esm({
3739
3736
  "src/worlds/index.ts"() {
3740
3737
  init_session();
@@ -3748,6 +3745,13 @@ var init_worlds = __esm({
3748
3745
  init_query();
3749
3746
  init_migrate();
3750
3747
  init_ingest();
3748
+ ApiError2 = class extends Error {
3749
+ constructor(status, method, path8, body) {
3750
+ super(`${method} ${path8} -> ${status}: ${body}`);
3751
+ this.status = status;
3752
+ this.name = "ApiError";
3753
+ }
3754
+ };
3751
3755
  WorldTask = class {
3752
3756
  constructor(world, name, variant) {
3753
3757
  this.world = world;
@@ -3814,6 +3818,7 @@ var init_worlds = __esm({
3814
3818
  });
3815
3819
  init_worlds();
3816
3820
  export {
3821
+ ApiError2 as ApiError,
3817
3822
  BrowserActionRecorder,
3818
3823
  COMPUTER_USE_SPECS,
3819
3824
  DEFAULT_BRANCH,