@spider-cloud/spider-client 0.0.60 → 0.0.61

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.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ChunkCallbackFunction, Collection, QueryRequest, SpiderCoreResponse, SpiderParams } from "./config";
2
- export declare const baseUrl: string;
3
2
  /**
4
3
  * Generic params for core request.
5
4
  */
package/dist/client.js CHANGED
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Spider = exports.baseUrl = void 0;
3
+ exports.Spider = void 0;
4
4
  const config_1 = require("./config");
5
5
  const package_json_1 = require("../package.json");
6
6
  const supabase_1 = require("./supabase");
7
7
  const stream_reader_1 = require("./utils/stream-reader");
8
- exports.baseUrl = config_1.APISchema["url"];
9
8
  /**
10
9
  * A class to interact with the Spider API.
11
10
  */
@@ -43,7 +42,7 @@ class Spider {
43
42
  */
44
43
  async _apiPost(endpoint, data, stream, jsonl) {
45
44
  const headers = jsonl ? this.prepareHeadersJsonL : this.prepareHeaders;
46
- const response = await fetch(`${exports.baseUrl}/v1/${endpoint}`, {
45
+ const response = await fetch(`${config_1.APISchema["url"]}/${config_1.ApiVersion.V1}/${endpoint}`, {
47
46
  method: "POST",
48
47
  headers: headers,
49
48
  body: JSON.stringify(data),
@@ -65,7 +64,7 @@ class Spider {
65
64
  */
66
65
  async _apiGet(endpoint) {
67
66
  const headers = this.prepareHeaders;
68
- const response = await fetch(`${exports.baseUrl}/v1/${endpoint}`, {
67
+ const response = await fetch(`${config_1.APISchema["url"]}/${config_1.ApiVersion.V1}/${endpoint}`, {
69
68
  method: "GET",
70
69
  headers: headers,
71
70
  });
@@ -83,7 +82,7 @@ class Spider {
83
82
  */
84
83
  async _apiDelete(endpoint) {
85
84
  const headers = this.prepareHeaders;
86
- const response = await fetch(`${exports.baseUrl}/v1/${endpoint}`, {
85
+ const response = await fetch(`${config_1.APISchema["url"]}/${config_1.ApiVersion.V1}/${endpoint}`, {
87
86
  method: "DELETE",
88
87
  headers,
89
88
  });
@@ -203,7 +202,7 @@ class Spider {
203
202
  ...(limit && { limit: limit.toString() }),
204
203
  ...(expiresIn && { expiresIn: expiresIn.toString() }),
205
204
  });
206
- const endpoint = `${exports.baseUrl}/${config_1.APIRoutes.DataSignUrl}?${params.toString()}`;
205
+ const endpoint = `${config_1.APISchema["url"]}/${config_1.APIRoutes.DataSignUrl}?${params.toString()}`;
207
206
  const headers = this.prepareHeaders;
208
207
  const response = await fetch(endpoint, {
209
208
  method: "GET",
@@ -249,7 +248,7 @@ class Spider {
249
248
  async download(query, output) {
250
249
  const headers = this.prepareHeaders;
251
250
  const endpoint = `${config_1.APIRoutes.DataDownload}?${new URLSearchParams(query).toString()}`;
252
- const response = await fetch(`${exports.baseUrl}/v1/${endpoint}`, {
251
+ const response = await fetch(`${config_1.APISchema["url"]}/${config_1.ApiVersion.V1}/${endpoint}`, {
253
252
  method: "GET",
254
253
  headers,
255
254
  });
package/dist/config.d.ts CHANGED
@@ -272,7 +272,7 @@ export declare enum Collection {
272
272
  Webhooks = "webhooks",
273
273
  APIKeys = "api_keys"
274
274
  }
275
- declare enum ApiVersion {
275
+ export declare enum ApiVersion {
276
276
  V1 = "v1"
277
277
  }
278
278
  export declare enum APIRoutes {
package/dist/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setBaseUrl = exports.APISchema = exports.APIRoutes = exports.Collection = void 0;
3
+ exports.setBaseUrl = exports.APISchema = exports.APIRoutes = exports.ApiVersion = exports.Collection = void 0;
4
4
  // records that you can query
5
5
  var Collection;
6
6
  (function (Collection) {
@@ -20,7 +20,7 @@ var Collection;
20
20
  var ApiVersion;
21
21
  (function (ApiVersion) {
22
22
  ApiVersion["V1"] = "v1";
23
- })(ApiVersion || (ApiVersion = {}));
23
+ })(ApiVersion || (exports.ApiVersion = ApiVersion = {}));
24
24
  // The API routes paths.
25
25
  var APIRoutes;
26
26
  (function (APIRoutes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spider-cloud/spider-client",
3
- "version": "0.0.60",
3
+ "version": "0.0.61",
4
4
  "description": "Isomorphic Javascript SDK for Spider Cloud services",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test __tests__/*test.ts",