@knowledgesdk/node 0.1.0
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/LICENSE +21 -0
- package/README.md +495 -0
- package/dist/api/classify.d.ts +24 -0
- package/dist/api/classify.js +19 -0
- package/dist/api/classify.js.map +1 -0
- package/dist/api/extract.d.ts +118 -0
- package/dist/api/extract.js +60 -0
- package/dist/api/extract.js.map +1 -0
- package/dist/api/jobs.d.ts +35 -0
- package/dist/api/jobs.js +43 -0
- package/dist/api/jobs.js.map +1 -0
- package/dist/api/scrape.d.ts +18 -0
- package/dist/api/scrape.js +18 -0
- package/dist/api/scrape.js.map +1 -0
- package/dist/api/screenshot.d.ts +15 -0
- package/dist/api/screenshot.js +18 -0
- package/dist/api/screenshot.js.map +1 -0
- package/dist/api/search.d.ts +29 -0
- package/dist/api/search.js +22 -0
- package/dist/api/search.js.map +1 -0
- package/dist/api/sitemap.d.ts +17 -0
- package/dist/api/sitemap.js +19 -0
- package/dist/api/sitemap.js.map +1 -0
- package/dist/api/webhooks.d.ts +40 -0
- package/dist/api/webhooks.js +39 -0
- package/dist/api/webhooks.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.js +52 -0
- package/dist/errors.js.map +1 -0
- package/dist/esm/api/classify.d.ts +24 -0
- package/dist/esm/api/classify.js +15 -0
- package/dist/esm/api/classify.js.map +1 -0
- package/dist/esm/api/extract.d.ts +118 -0
- package/dist/esm/api/extract.js +56 -0
- package/dist/esm/api/extract.js.map +1 -0
- package/dist/esm/api/jobs.d.ts +35 -0
- package/dist/esm/api/jobs.js +39 -0
- package/dist/esm/api/jobs.js.map +1 -0
- package/dist/esm/api/scrape.d.ts +18 -0
- package/dist/esm/api/scrape.js +14 -0
- package/dist/esm/api/scrape.js.map +1 -0
- package/dist/esm/api/screenshot.d.ts +15 -0
- package/dist/esm/api/screenshot.js +14 -0
- package/dist/esm/api/screenshot.js.map +1 -0
- package/dist/esm/api/search.d.ts +29 -0
- package/dist/esm/api/search.js +18 -0
- package/dist/esm/api/search.js.map +1 -0
- package/dist/esm/api/sitemap.d.ts +17 -0
- package/dist/esm/api/sitemap.js +15 -0
- package/dist/esm/api/sitemap.js.map +1 -0
- package/dist/esm/api/webhooks.d.ts +40 -0
- package/dist/esm/api/webhooks.js +35 -0
- package/dist/esm/api/webhooks.js.map +1 -0
- package/dist/esm/constants.d.ts +5 -0
- package/dist/esm/constants.js +6 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/errors.d.ts +32 -0
- package/dist/esm/errors.js +43 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/index.d.ts +100 -0
- package/dist/esm/index.js +91 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/utils/http-client.d.ts +62 -0
- package/dist/esm/utils/http-client.js +354 -0
- package/dist/esm/utils/http-client.js.map +1 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils/http-client.d.ts +62 -0
- package/dist/utils/http-client.js +361 -0
- package/dist/utils/http-client.js.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HttpClient = void 0;
|
|
7
|
+
const errors_1 = require("../errors");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
10
|
+
const fetch_event_source_1 = require("@microsoft/fetch-event-source");
|
|
11
|
+
class HttpClient {
|
|
12
|
+
constructor(apiKey, baseUrl = 'https://api.knowledgesdk.com', maxRetries = 3, timeout = 30000, apiVersion = 'v1') {
|
|
13
|
+
this.customHeaders = {};
|
|
14
|
+
this.debugMode = false;
|
|
15
|
+
this.apiKey = apiKey;
|
|
16
|
+
this.baseUrl = baseUrl;
|
|
17
|
+
this.defaultMaxRetries = maxRetries;
|
|
18
|
+
this.defaultTimeout = timeout;
|
|
19
|
+
this.apiVersion = apiVersion;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Set custom headers to be included with every request
|
|
23
|
+
* @param headers Record of header names and values
|
|
24
|
+
* @returns The HttpClient instance for chaining
|
|
25
|
+
*/
|
|
26
|
+
setHeaders(headers) {
|
|
27
|
+
this.customHeaders = { ...this.customHeaders, ...headers };
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Set a specific custom header
|
|
32
|
+
* @param name Header name
|
|
33
|
+
* @param value Header value
|
|
34
|
+
* @returns The HttpClient instance for chaining
|
|
35
|
+
*/
|
|
36
|
+
setHeader(name, value) {
|
|
37
|
+
this.customHeaders[name] = value;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Enable or disable debug mode
|
|
42
|
+
* When enabled, requests and responses will be logged to console
|
|
43
|
+
* @param enabled Whether debug mode should be enabled
|
|
44
|
+
* @returns The HttpClient instance for chaining
|
|
45
|
+
*/
|
|
46
|
+
setDebugMode(enabled) {
|
|
47
|
+
this.debugMode = enabled;
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Set the API version to use for requests
|
|
52
|
+
* @param version API version string (e.g., 'v1', 'v2', etc.)
|
|
53
|
+
* @returns The HttpClient instance for chaining
|
|
54
|
+
*/
|
|
55
|
+
setApiVersion(version) {
|
|
56
|
+
this.apiVersion = version;
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
createUrl(path, params) {
|
|
60
|
+
// Add version prefix to the path if it doesn't already have it
|
|
61
|
+
const versionedPath = path.startsWith('/')
|
|
62
|
+
? `/${this.apiVersion}${path}`
|
|
63
|
+
: `/${this.apiVersion}/${path}`;
|
|
64
|
+
const url = new URL(versionedPath, this.baseUrl);
|
|
65
|
+
if (params) {
|
|
66
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
67
|
+
if (Array.isArray(value)) {
|
|
68
|
+
value.forEach((v) => url.searchParams.append(key, v));
|
|
69
|
+
}
|
|
70
|
+
else if (value !== undefined && value !== null) {
|
|
71
|
+
url.searchParams.append(key, String(value));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return url.toString();
|
|
76
|
+
}
|
|
77
|
+
getHeaders() {
|
|
78
|
+
return {
|
|
79
|
+
'x-api-key': this.apiKey,
|
|
80
|
+
'Content-Type': 'application/json',
|
|
81
|
+
'User-Agent': `KnowledgeSDK Node SDK v${constants_1.VERSION}`,
|
|
82
|
+
Accept: 'application/json',
|
|
83
|
+
...this.customHeaders,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
calculateBackoff(retryCount, retryDelay) {
|
|
87
|
+
// Use a more aggressive factor (4 instead of 2)
|
|
88
|
+
const exponentialPart = retryDelay * Math.pow(4, retryCount);
|
|
89
|
+
// Add jitter (between 80-120% of calculated time)
|
|
90
|
+
const withJitter = exponentialPart * (0.8 + 0.4 * Math.random());
|
|
91
|
+
// Cap at 30 seconds maximum backoff
|
|
92
|
+
return Math.min(withJitter, 30000);
|
|
93
|
+
}
|
|
94
|
+
async request(path, options = {}) {
|
|
95
|
+
const { method = 'GET', headers = {}, params, data, maxRetries = this.defaultMaxRetries, retryCount = 0, retryDelay = 100, timeout = this.defaultTimeout, } = options;
|
|
96
|
+
const url = this.createUrl(path, params);
|
|
97
|
+
// Create a timeout promise instead of using AbortController for timeout
|
|
98
|
+
let timeoutId;
|
|
99
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
100
|
+
timeoutId = setTimeout(() => {
|
|
101
|
+
reject(new errors_1.TimeoutError(`Request timed out after ${timeout}ms`, { code: 'timeout' }));
|
|
102
|
+
}, timeout);
|
|
103
|
+
});
|
|
104
|
+
try {
|
|
105
|
+
const requestHeaders = {
|
|
106
|
+
...this.getHeaders(),
|
|
107
|
+
...headers,
|
|
108
|
+
};
|
|
109
|
+
const requestOptions = {
|
|
110
|
+
method,
|
|
111
|
+
headers: requestHeaders,
|
|
112
|
+
};
|
|
113
|
+
// Add body for non-GET requests
|
|
114
|
+
if (method !== 'GET' && data !== undefined) {
|
|
115
|
+
requestOptions.body = JSON.stringify(data);
|
|
116
|
+
}
|
|
117
|
+
// Log request in debug mode
|
|
118
|
+
if (this.debugMode) {
|
|
119
|
+
console.log(`[KNOWLEDGESDK] Request: ${method} ${url}`);
|
|
120
|
+
console.log('[KNOWLEDGESDK] Headers:', requestHeaders);
|
|
121
|
+
if (data)
|
|
122
|
+
console.log('[KNOWLEDGESDK] Body:', JSON.stringify(data, null, 2));
|
|
123
|
+
}
|
|
124
|
+
// Use Promise.race to implement timeout
|
|
125
|
+
const response = (await Promise.race([
|
|
126
|
+
(0, cross_fetch_1.default)(url, requestOptions),
|
|
127
|
+
timeoutPromise,
|
|
128
|
+
]));
|
|
129
|
+
if (timeoutId) {
|
|
130
|
+
clearTimeout(timeoutId);
|
|
131
|
+
}
|
|
132
|
+
// Extract request ID from headers
|
|
133
|
+
const requestId = response.headers.get('x-request-id');
|
|
134
|
+
// Try to parse the response as JSON
|
|
135
|
+
let responseData;
|
|
136
|
+
const contentType = response.headers.get('content-type');
|
|
137
|
+
if (contentType && contentType.includes('application/json')) {
|
|
138
|
+
responseData = await response.json();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
responseData = await response.text();
|
|
142
|
+
}
|
|
143
|
+
// Log response in debug mode
|
|
144
|
+
if (this.debugMode) {
|
|
145
|
+
console.log(`[KNOWLEDGESDK] Response: ${response.status}`);
|
|
146
|
+
console.log('[KNOWLEDGESDK] Response body:', typeof responseData === 'string' ? responseData : JSON.stringify(responseData, null, 2));
|
|
147
|
+
}
|
|
148
|
+
// Handle different status codes
|
|
149
|
+
if (response.status === 429) {
|
|
150
|
+
if (retryCount < maxRetries) {
|
|
151
|
+
const nextDelay = this.calculateBackoff(retryCount, retryDelay);
|
|
152
|
+
if (this.debugMode) {
|
|
153
|
+
console.log(`[KNOWLEDGESDK] Rate limited, retrying in ${nextDelay}ms (attempt ${retryCount + 1}/${maxRetries})`);
|
|
154
|
+
}
|
|
155
|
+
await new Promise((resolve) => setTimeout(resolve, nextDelay));
|
|
156
|
+
return this.request(path, {
|
|
157
|
+
method,
|
|
158
|
+
headers,
|
|
159
|
+
params,
|
|
160
|
+
data,
|
|
161
|
+
maxRetries,
|
|
162
|
+
retryCount: retryCount + 1,
|
|
163
|
+
retryDelay,
|
|
164
|
+
timeout,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
throw new errors_1.RateLimitError('Rate limit exceeded', {
|
|
168
|
+
statusCode: response.status,
|
|
169
|
+
requestId: requestId || undefined,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (response.status === 401) {
|
|
173
|
+
throw new errors_1.AuthenticationError('Invalid API key', {
|
|
174
|
+
statusCode: response.status,
|
|
175
|
+
code: 'invalid_api_key',
|
|
176
|
+
requestId: requestId || undefined,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
// Handle server errors (5xx)
|
|
180
|
+
if (response.status >= 500) {
|
|
181
|
+
if (retryCount < maxRetries) {
|
|
182
|
+
const nextDelay = this.calculateBackoff(retryCount, retryDelay);
|
|
183
|
+
if (this.debugMode) {
|
|
184
|
+
console.log(`[KNOWLEDGESDK] Server error, retrying in ${nextDelay}ms (attempt ${retryCount + 1}/${maxRetries})`);
|
|
185
|
+
}
|
|
186
|
+
await new Promise((resolve) => setTimeout(resolve, nextDelay));
|
|
187
|
+
return this.request(path, {
|
|
188
|
+
method,
|
|
189
|
+
headers,
|
|
190
|
+
params,
|
|
191
|
+
data,
|
|
192
|
+
maxRetries,
|
|
193
|
+
retryCount: retryCount + 1,
|
|
194
|
+
retryDelay,
|
|
195
|
+
timeout,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
throw new errors_1.APIError(`Server error: ${response.status}`, {
|
|
199
|
+
statusCode: response.status,
|
|
200
|
+
code: 'server_error',
|
|
201
|
+
requestId: requestId || undefined,
|
|
202
|
+
data: responseData,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
// Handle other errors (4xx)
|
|
206
|
+
if (!response.ok) {
|
|
207
|
+
let errorMessage = `API error: ${response.status}`;
|
|
208
|
+
let errorCode = 'api_error';
|
|
209
|
+
if (responseData && typeof responseData === 'object') {
|
|
210
|
+
// Parse Hapi error format: { error: string, statusCode: number }
|
|
211
|
+
errorMessage = responseData.message || responseData.error || errorMessage;
|
|
212
|
+
errorCode = responseData.code || errorCode;
|
|
213
|
+
}
|
|
214
|
+
throw new errors_1.APIError(errorMessage, {
|
|
215
|
+
statusCode: response.status,
|
|
216
|
+
code: errorCode,
|
|
217
|
+
requestId: requestId || undefined,
|
|
218
|
+
data: responseData,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return responseData;
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
if (timeoutId) {
|
|
225
|
+
clearTimeout(timeoutId);
|
|
226
|
+
}
|
|
227
|
+
// Re-throw KnowledgeSDKError instances
|
|
228
|
+
if (error instanceof errors_1.KnowledgeSDKError) {
|
|
229
|
+
throw error;
|
|
230
|
+
}
|
|
231
|
+
// Handle timeout errors from our Promise.race
|
|
232
|
+
if (error instanceof errors_1.TimeoutError) {
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
// Handle network errors
|
|
236
|
+
if (error.name === 'TypeError' && error.message.includes('fetch')) {
|
|
237
|
+
throw new errors_1.NetworkError('Network error', {
|
|
238
|
+
code: 'network_error',
|
|
239
|
+
data: error.message,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
// Handle other errors
|
|
243
|
+
throw new errors_1.KnowledgeSDKError('Unexpected error', {
|
|
244
|
+
code: 'unexpected_error',
|
|
245
|
+
data: error,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
async get(path, options) {
|
|
250
|
+
return this.request(path, {
|
|
251
|
+
method: 'GET',
|
|
252
|
+
...options,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
async post(path, data, options) {
|
|
256
|
+
return this.request(path, {
|
|
257
|
+
method: 'POST',
|
|
258
|
+
data,
|
|
259
|
+
...options,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
async put(path, data, options) {
|
|
263
|
+
return this.request(path, {
|
|
264
|
+
method: 'PUT',
|
|
265
|
+
data,
|
|
266
|
+
...options,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
async patch(path, data, options) {
|
|
270
|
+
return this.request(path, {
|
|
271
|
+
method: 'PATCH',
|
|
272
|
+
data,
|
|
273
|
+
...options,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
async delete(path, options) {
|
|
277
|
+
return this.request(path, {
|
|
278
|
+
method: 'DELETE',
|
|
279
|
+
...options,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* POST to a server-sent events endpoint and yield typed events as an async generator.
|
|
284
|
+
* Requires Node.js 18+ (or a runtime with native fetch support).
|
|
285
|
+
*/
|
|
286
|
+
async *streamPost(path, data) {
|
|
287
|
+
const url = this.createUrl(path);
|
|
288
|
+
const headers = { ...this.getHeaders(), Accept: 'text/event-stream', 'Content-Type': 'application/json' };
|
|
289
|
+
const queue = [];
|
|
290
|
+
let waitResolve = null;
|
|
291
|
+
let done = false;
|
|
292
|
+
let streamError = null;
|
|
293
|
+
const controller = new AbortController();
|
|
294
|
+
const enqueue = (item) => {
|
|
295
|
+
queue.push(item);
|
|
296
|
+
waitResolve === null || waitResolve === void 0 ? void 0 : waitResolve();
|
|
297
|
+
waitResolve = null;
|
|
298
|
+
};
|
|
299
|
+
const finish = (err) => {
|
|
300
|
+
done = true;
|
|
301
|
+
streamError = err !== null && err !== void 0 ? err : null;
|
|
302
|
+
waitResolve === null || waitResolve === void 0 ? void 0 : waitResolve();
|
|
303
|
+
waitResolve = null;
|
|
304
|
+
};
|
|
305
|
+
(0, fetch_event_source_1.fetchEventSource)(url, {
|
|
306
|
+
method: 'POST',
|
|
307
|
+
headers,
|
|
308
|
+
body: JSON.stringify(data),
|
|
309
|
+
signal: controller.signal,
|
|
310
|
+
async onopen(response) {
|
|
311
|
+
if (!response.ok) {
|
|
312
|
+
const text = await response.text().catch(() => '');
|
|
313
|
+
let body = {};
|
|
314
|
+
try {
|
|
315
|
+
body = JSON.parse(text);
|
|
316
|
+
}
|
|
317
|
+
catch { }
|
|
318
|
+
throw new errors_1.APIError(body.message || `Stream failed: ${response.status}`, {
|
|
319
|
+
statusCode: response.status,
|
|
320
|
+
code: 'stream_error',
|
|
321
|
+
data: body,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
onmessage(ev) {
|
|
326
|
+
if (!ev.data)
|
|
327
|
+
return;
|
|
328
|
+
try {
|
|
329
|
+
const parsed = JSON.parse(ev.data);
|
|
330
|
+
enqueue({ type: ev.event || 'message', ...parsed });
|
|
331
|
+
}
|
|
332
|
+
catch { }
|
|
333
|
+
},
|
|
334
|
+
onclose() { finish(); },
|
|
335
|
+
onerror(err) {
|
|
336
|
+
finish(err instanceof Error ? err : new Error(String(err)));
|
|
337
|
+
throw err; // prevent automatic retry
|
|
338
|
+
},
|
|
339
|
+
}).catch((err) => {
|
|
340
|
+
if (!done)
|
|
341
|
+
finish(err instanceof Error ? err : new Error(String(err)));
|
|
342
|
+
});
|
|
343
|
+
try {
|
|
344
|
+
while (!done || queue.length > 0) {
|
|
345
|
+
if (queue.length > 0) {
|
|
346
|
+
yield queue.shift();
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
await new Promise((r) => { waitResolve = r; });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
finally {
|
|
354
|
+
controller.abort();
|
|
355
|
+
}
|
|
356
|
+
if (streamError)
|
|
357
|
+
throw streamError;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
exports.HttpClient = HttpClient;
|
|
361
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../../src/utils/http-client.ts"],"names":[],"mappings":";;;;;;AAAA,sCAOmB;AACnB,4CAAuC;AACvC,8DAAgC;AAChC,sEAAiE;AAejE,MAAa,UAAU;IASrB,YACE,MAAc,EACd,UAAkB,8BAA8B,EAChD,aAAqB,CAAC,EACtB,UAAkB,KAAK,EACvB,aAAqB,IAAI;QARnB,kBAAa,GAA2B,EAAE,CAAC;QAC3C,cAAS,GAAY,KAAK,CAAC;QASjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC;QACpC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,OAA+B;QACxC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,IAAY,EAAE,KAAa;QACnC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,OAAgB;QAC3B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;QACzB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AC;QACH,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;QAED,IAAI,WAAW;YAAE,MAAM,WAAW,CAAC;IACrC,CAAC;CACF;AAhbD,gCAgbC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@knowledgesdk/node",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "KnowledgeSDK Node.js SDK - Official Node.js client for the KnowledgeSDK API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=16"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "npm run clean && npm run build:cjs && npm run build:esm",
|
|
25
|
+
"build:cjs": "tsc --module commonjs --outDir dist",
|
|
26
|
+
"build:esm": "tsc --module es2020 --outDir dist/esm && npm run bundle",
|
|
27
|
+
"bundle": "rollup -c rollup.config.js",
|
|
28
|
+
"build:watch": "tsc --watch",
|
|
29
|
+
"clean": "rm -rf dist",
|
|
30
|
+
"format": "prettier --write 'src/**/*.{ts,tsx}'",
|
|
31
|
+
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
32
|
+
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
|
|
33
|
+
"test": "jest",
|
|
34
|
+
"test:watch": "jest --watch",
|
|
35
|
+
"prepare": "npm run build",
|
|
36
|
+
"publish-beta": "npm run build && npm publish --tag beta",
|
|
37
|
+
"publish-stable": "npm run build && npm publish",
|
|
38
|
+
"release": "npm run clean && npm run build && npm publish",
|
|
39
|
+
"release:patch": "npm version patch && npm run release",
|
|
40
|
+
"release:minor": "npm version minor && npm run release",
|
|
41
|
+
"release:major": "npm version major && npm run release"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"knowledgesdk",
|
|
45
|
+
"knowledge",
|
|
46
|
+
"extract",
|
|
47
|
+
"scrape",
|
|
48
|
+
"classify",
|
|
49
|
+
"screenshot",
|
|
50
|
+
"sitemap",
|
|
51
|
+
"search",
|
|
52
|
+
"api",
|
|
53
|
+
"sdk",
|
|
54
|
+
"node",
|
|
55
|
+
"typescript"
|
|
56
|
+
],
|
|
57
|
+
"author": "KnowledgeSDK",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"homepage": "https://knowledgesdk.com",
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "https://github.com/knowledgesdk/knowledgesdk-node.git"
|
|
63
|
+
},
|
|
64
|
+
"bugs": {
|
|
65
|
+
"url": "https://github.com/knowledgesdk/knowledgesdk-node/issues"
|
|
66
|
+
},
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public",
|
|
69
|
+
"registry": "https://registry.npmjs.org/"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
73
|
+
"cross-fetch": "^4.0.0"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@rollup/plugin-commonjs": "^25.0.4",
|
|
77
|
+
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
78
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
79
|
+
"@rollup/plugin-typescript": "^11.1.4",
|
|
80
|
+
"@types/jest": "^29.5.12",
|
|
81
|
+
"@types/node": "^20.11.29",
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
83
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
84
|
+
"eslint": "^8.57.0",
|
|
85
|
+
"eslint-config-prettier": "^9.1.0",
|
|
86
|
+
"jest": "^29.7.0",
|
|
87
|
+
"prettier": "^3.2.5",
|
|
88
|
+
"rollup": "^3.29.4",
|
|
89
|
+
"ts-jest": "^29.1.2",
|
|
90
|
+
"tslib": "^2.8.1",
|
|
91
|
+
"typescript": "^5.3.3"
|
|
92
|
+
}
|
|
93
|
+
}
|