@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 +0 -1
- package/dist/client.js +6 -7
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Spider =
|
|
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(`${
|
|
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(`${
|
|
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(`${
|
|
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 = `${
|
|
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(`${
|
|
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
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) {
|