@fileverse/api 0.0.18 → 0.0.19

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/index.js CHANGED
@@ -366,14 +366,6 @@ var init_file_utils = __esm({
366
366
  }
367
367
  });
368
368
 
369
- // src/sdk/dom-globals.ts
370
- var init_dom_globals = __esm({
371
- "src/sdk/dom-globals.ts"() {
372
- "use strict";
373
- init_esm_shims();
374
- }
375
- });
376
-
377
369
  // src/sdk/file-manager.ts
378
370
  import { fromUint8Array as fromUint8Array2, toUint8Array as toUint8Array4 } from "js-base64";
379
371
  import { generateAESKey, exportAESKey } from "@fileverse/crypto/webcrypto";
@@ -385,7 +377,6 @@ var init_file_manager = __esm({
385
377
  init_file_utils();
386
378
  init_constants();
387
379
  init_constants2();
388
- init_dom_globals();
389
380
  init_infra();
390
381
  }
391
382
  });
@@ -1201,30 +1192,17 @@ import { Command } from "commander";
1201
1192
  // src/cli/fetch-api-key.ts
1202
1193
  init_esm_shims();
1203
1194
  init_constants();
1204
- import axios from "axios";
1205
1195
  import { toUint8Array } from "js-base64";
1206
1196
  import { sha256 } from "viem";
1207
1197
  var fetchApiKeyData = async (apiKey) => {
1208
1198
  try {
1209
1199
  const keyHash = sha256(toUint8Array(apiKey));
1210
1200
  const fullUrl = BASE_CONFIG.API_URL + `api-access/${keyHash}`;
1211
- const response = await axios.get(fullUrl);
1212
- const { encryptedKeyMaterial, encryptedAppMaterial, id } = response.data;
1201
+ const response = await fetch(fullUrl);
1202
+ const { encryptedKeyMaterial, encryptedAppMaterial, id } = await response.json();
1213
1203
  return { encryptedKeyMaterial, encryptedAppMaterial, id };
1214
1204
  } catch (error) {
1215
- if (axios.isAxiosError(error)) {
1216
- if (error.response?.status === 401) {
1217
- throw new Error("Invalid API key");
1218
- }
1219
- if (error.response?.status === 404) {
1220
- throw new Error("API key not found");
1221
- }
1222
- if (error.code === "ECONNREFUSED") {
1223
- throw new Error(`Cannot connect to server at ${BASE_CONFIG.API_URL}`);
1224
- }
1225
- throw new Error(`Server error: ${error.response?.data?.message || error.message}`);
1226
- }
1227
- throw error;
1205
+ throw new Error(`Server error: ${error.message}`);
1228
1206
  }
1229
1207
  };
1230
1208