recker 1.0.37 → 1.0.39-next.a1fa57f
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/browser/core/client.d.ts +4 -0
- package/dist/browser/core/client.js +10 -0
- package/dist/browser/version.d.ts +11 -0
- package/dist/browser/version.js +46 -0
- package/dist/cli/helpers.d.ts +1 -1
- package/dist/cli/helpers.js +1 -1
- package/dist/cli/index.js +1347 -362
- package/dist/cli/tui/shell.js +3 -1
- package/dist/core/client.d.ts +4 -0
- package/dist/core/client.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/recker.d.ts +4 -0
- package/dist/recker.js +6 -0
- package/dist/version.d.ts +11 -0
- package/dist/version.js +46 -0
- package/package.json +1 -1
package/dist/cli/tui/shell.js
CHANGED
|
@@ -18,6 +18,7 @@ import { ScrollBuffer, parseScrollKey, parseMouseScroll, disableMouseReporting }
|
|
|
18
18
|
import { analyzeSeo, SeoSpider } from '../../seo/index.js';
|
|
19
19
|
import { resolvePreset } from '../presets.js';
|
|
20
20
|
import { summarizeErrors, formatErrorSummary } from '../helpers.js';
|
|
21
|
+
import { getVersion } from '../../version.js';
|
|
21
22
|
let highlight;
|
|
22
23
|
async function initDependencies() {
|
|
23
24
|
if (!highlight) {
|
|
@@ -111,8 +112,9 @@ export class RekShell {
|
|
|
111
112
|
async start() {
|
|
112
113
|
await this.ensureInitialized();
|
|
113
114
|
this.setupScrollCapture();
|
|
115
|
+
const version = await getVersion();
|
|
114
116
|
console.clear();
|
|
115
|
-
console.log(colors.bold(colors.cyan('Rek Console')));
|
|
117
|
+
console.log(colors.bold(colors.cyan('Rek Console')) + ' ' + colors.gray(`v${version}`));
|
|
116
118
|
console.log(colors.gray('Chat with your APIs. Type "help" for magic.'));
|
|
117
119
|
console.log(colors.gray('Use Page Up/Down to view history.'));
|
|
118
120
|
console.log(colors.gray('--------------------------------------------\n'));
|
package/dist/core/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClientOptions, Middleware, ReckerRequest, ReckerResponse, RequestOptions, CacheStorage, PageResult } from '../types/index.js';
|
|
2
2
|
import type { ClientAI, ClientOptionsWithAI } from '../types/ai-client.js';
|
|
3
3
|
import { RequestPromise } from './request-promise.js';
|
|
4
|
+
import { type VersionInfo } from '../version.js';
|
|
4
5
|
import { PaginationOptions } from '../plugins/pagination.js';
|
|
5
6
|
import { RetryOptions } from '../plugins/retry.js';
|
|
6
7
|
import { CacheOptions } from '../plugins/cache.js';
|
|
@@ -20,6 +21,9 @@ export interface ExtendedClientOptions extends ClientOptions {
|
|
|
20
21
|
dedup?: DedupOptions;
|
|
21
22
|
}
|
|
22
23
|
export declare class Client {
|
|
24
|
+
static get version(): string;
|
|
25
|
+
static getVersion(): Promise<string>;
|
|
26
|
+
static getVersionInfo(): Promise<VersionInfo>;
|
|
23
27
|
private baseUrl;
|
|
24
28
|
private middlewares;
|
|
25
29
|
private hooks;
|
package/dist/core/client.js
CHANGED
|
@@ -9,6 +9,7 @@ import { AgentManager } from '../utils/agent-manager.js';
|
|
|
9
9
|
import { RequestPool } from '../utils/request-pool.js';
|
|
10
10
|
import { normalizeConcurrency } from '../utils/concurrency.js';
|
|
11
11
|
import { getDefaultUserAgent } from '../utils/user-agent.js';
|
|
12
|
+
import { getVersion, getVersionSync, getVersionInfo } from '../version.js';
|
|
12
13
|
import { paginate, streamPages } from '../plugins/pagination.js';
|
|
13
14
|
import { retryPlugin } from '../plugins/retry.js';
|
|
14
15
|
import { cachePlugin } from '../plugins/cache.js';
|
|
@@ -27,6 +28,15 @@ import { MemoryCookieJar } from '../cookies/memory-cookie-jar.js';
|
|
|
27
28
|
import { scrape as scrapeHelper } from '../plugins/scrape.js';
|
|
28
29
|
import { HlsPromise } from '../plugins/hls.js';
|
|
29
30
|
export class Client {
|
|
31
|
+
static get version() {
|
|
32
|
+
return getVersionSync();
|
|
33
|
+
}
|
|
34
|
+
static getVersion() {
|
|
35
|
+
return getVersion();
|
|
36
|
+
}
|
|
37
|
+
static getVersionInfo() {
|
|
38
|
+
return getVersionInfo();
|
|
39
|
+
}
|
|
30
40
|
baseUrl;
|
|
31
41
|
middlewares;
|
|
32
42
|
hooks;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export * as protocols from './protocols/index.js';
|
|
|
70
70
|
export * from './mcp/client.js';
|
|
71
71
|
export * from './mcp/contract.js';
|
|
72
72
|
export * from './mini.js';
|
|
73
|
+
export * from './version.js';
|
|
73
74
|
export { Client as Recker } from './core/client.js';
|
|
74
75
|
export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
|
|
75
76
|
export { default } from './recker.js';
|
package/dist/index.js
CHANGED
|
@@ -70,6 +70,7 @@ export * as protocols from './protocols/index.js';
|
|
|
70
70
|
export * from './mcp/client.js';
|
|
71
71
|
export * from './mcp/contract.js';
|
|
72
72
|
export * from './mini.js';
|
|
73
|
+
export * from './version.js';
|
|
73
74
|
export { Client as Recker } from './core/client.js';
|
|
74
75
|
export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
|
|
75
76
|
export { default } from './recker.js';
|
package/dist/recker.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Client, type ExtendedClientOptions } from './core/client.js';
|
|
2
|
+
import { getVersion, getVersionInfo } from './version.js';
|
|
2
3
|
import { type RequestPromise } from './core/request-promise.js';
|
|
3
4
|
import type { RequestOptions } from './types/index.js';
|
|
4
5
|
import { type WebSocketOptions, type ReckerWebSocket } from './websocket/client.js';
|
|
@@ -42,5 +43,8 @@ export declare const recker: {
|
|
|
42
43
|
whoisClient: typeof createWhois;
|
|
43
44
|
aiClient: (options?: AIClientConfig) => import("./types/ai.js").AIClient;
|
|
44
45
|
reset: () => void;
|
|
46
|
+
readonly version: string;
|
|
47
|
+
getVersion: typeof getVersion;
|
|
48
|
+
getVersionInfo: typeof getVersionInfo;
|
|
45
49
|
};
|
|
46
50
|
export default recker;
|
package/dist/recker.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createClient } from './core/client.js';
|
|
2
|
+
import { getVersion, getVersionSync, getVersionInfo } from './version.js';
|
|
2
3
|
import { FetchTransport } from './transport/fetch.js';
|
|
3
4
|
import { createWebSocket } from './websocket/client.js';
|
|
4
5
|
import { whois as whoisLookup, isDomainAvailable, createWhois } from './utils/whois.js';
|
|
@@ -95,5 +96,10 @@ export const recker = {
|
|
|
95
96
|
_defaultDns = null;
|
|
96
97
|
_defaultAi = null;
|
|
97
98
|
},
|
|
99
|
+
get version() {
|
|
100
|
+
return getVersionSync();
|
|
101
|
+
},
|
|
102
|
+
getVersion,
|
|
103
|
+
getVersionInfo,
|
|
98
104
|
};
|
|
99
105
|
export default recker;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function getVersion(): Promise<string>;
|
|
2
|
+
export declare function getVersionSync(): string;
|
|
3
|
+
export interface VersionInfo {
|
|
4
|
+
version: string;
|
|
5
|
+
name: string;
|
|
6
|
+
nodeVersion: string;
|
|
7
|
+
platform: string;
|
|
8
|
+
arch: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getVersionInfo(): Promise<VersionInfo>;
|
|
11
|
+
export declare function formatVersionInfo(verbose?: boolean): Promise<string>;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const VERSION = '1.0.39-next.a1fa57f';
|
|
2
|
+
let _version = null;
|
|
3
|
+
export async function getVersion() {
|
|
4
|
+
if (_version)
|
|
5
|
+
return _version;
|
|
6
|
+
if (VERSION !== '__INJECT_VERSION__') {
|
|
7
|
+
_version = VERSION;
|
|
8
|
+
return _version;
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const pkg = await import('../package.json', { with: { type: 'json' } });
|
|
12
|
+
_version = pkg.default?.version || '0.0.0-dev';
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
_version = '0.0.0-dev';
|
|
16
|
+
}
|
|
17
|
+
return _version;
|
|
18
|
+
}
|
|
19
|
+
export function getVersionSync() {
|
|
20
|
+
if (_version)
|
|
21
|
+
return _version;
|
|
22
|
+
if (VERSION !== '__INJECT_VERSION__')
|
|
23
|
+
return VERSION;
|
|
24
|
+
return '0.0.0-dev';
|
|
25
|
+
}
|
|
26
|
+
export async function getVersionInfo() {
|
|
27
|
+
const version = await getVersion();
|
|
28
|
+
return {
|
|
29
|
+
version,
|
|
30
|
+
name: 'recker',
|
|
31
|
+
nodeVersion: process.version,
|
|
32
|
+
platform: process.platform,
|
|
33
|
+
arch: process.arch,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export async function formatVersionInfo(verbose = false) {
|
|
37
|
+
const info = await getVersionInfo();
|
|
38
|
+
if (verbose) {
|
|
39
|
+
return [
|
|
40
|
+
`recker/${info.version}`,
|
|
41
|
+
`node/${info.nodeVersion.replace('v', '')}`,
|
|
42
|
+
`${info.platform}/${info.arch}`,
|
|
43
|
+
].join(' ');
|
|
44
|
+
}
|
|
45
|
+
return info.version;
|
|
46
|
+
}
|