@qjp88995/provider-client 0.2.0 → 0.4.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/dist/direct-resolver.d.ts.map +1 -1
- package/dist/direct-resolver.js +2 -0
- package/dist/direct-resolver.js.map +1 -1
- package/dist/image/http.d.ts +16 -0
- package/dist/image/http.d.ts.map +1 -0
- package/dist/image/http.js +62 -0
- package/dist/image/http.js.map +1 -0
- package/dist/image/index.d.ts +32 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +39 -0
- package/dist/image/index.js.map +1 -0
- package/dist/image/types.d.ts +94 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +44 -0
- package/dist/image/types.js.map +1 -0
- package/dist/image/volcengine.adapter.d.ts +8 -0
- package/dist/image/volcengine.adapter.d.ts.map +1 -0
- package/dist/image/volcengine.adapter.js +85 -0
- package/dist/image/volcengine.adapter.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/justone/client.d.ts +101 -0
- package/dist/justone/client.d.ts.map +1 -0
- package/dist/justone/client.js +272 -0
- package/dist/justone/client.js.map +1 -0
- package/dist/justone/endpoint-spec.d.ts +49 -0
- package/dist/justone/endpoint-spec.d.ts.map +1 -0
- package/dist/justone/endpoint-spec.js +2 -0
- package/dist/justone/endpoint-spec.js.map +1 -0
- package/dist/justone/endpoints.generated.d.ts +7927 -0
- package/dist/justone/endpoints.generated.d.ts.map +1 -0
- package/dist/justone/endpoints.generated.js +8508 -0
- package/dist/justone/endpoints.generated.js.map +1 -0
- package/dist/justone/errors.d.ts +52 -0
- package/dist/justone/errors.d.ts.map +1 -0
- package/dist/justone/errors.js +73 -0
- package/dist/justone/errors.js.map +1 -0
- package/dist/justone/index.d.ts +8 -0
- package/dist/justone/index.d.ts.map +1 -0
- package/dist/justone/index.js +7 -0
- package/dist/justone/index.js.map +1 -0
- package/dist/justone/params.d.ts +17 -0
- package/dist/justone/params.d.ts.map +1 -0
- package/dist/justone/params.js +72 -0
- package/dist/justone/params.js.map +1 -0
- package/dist/justone/pricing.d.ts +6 -0
- package/dist/justone/pricing.d.ts.map +1 -0
- package/dist/justone/pricing.generated.d.ts +303 -0
- package/dist/justone/pricing.generated.d.ts.map +1 -0
- package/dist/justone/pricing.generated.js +305 -0
- package/dist/justone/pricing.generated.js.map +1 -0
- package/dist/justone/pricing.js +11 -0
- package/dist/justone/pricing.js.map +1 -0
- package/dist/media/bibigpt.adapter.d.ts +43 -0
- package/dist/media/bibigpt.adapter.d.ts.map +1 -0
- package/dist/media/bibigpt.adapter.js +302 -0
- package/dist/media/bibigpt.adapter.js.map +1 -0
- package/dist/media/http.d.ts +21 -0
- package/dist/media/http.d.ts.map +1 -0
- package/dist/media/http.js +39 -0
- package/dist/media/http.js.map +1 -0
- package/dist/media/index.d.ts +44 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +47 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/types.d.ts +207 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/media/types.js +21 -0
- package/dist/media/types.js.map +1 -0
- package/dist/media/zhipu-parser-package.d.ts +37 -0
- package/dist/media/zhipu-parser-package.d.ts.map +1 -0
- package/dist/media/zhipu-parser-package.js +108 -0
- package/dist/media/zhipu-parser-package.js.map +1 -0
- package/dist/media/zhipu.adapter.d.ts +37 -0
- package/dist/media/zhipu.adapter.d.ts.map +1 -0
- package/dist/media/zhipu.adapter.js +361 -0
- package/dist/media/zhipu.adapter.js.map +1 -0
- package/dist/provider-client.d.ts +62 -0
- package/dist/provider-client.d.ts.map +1 -1
- package/dist/provider-client.js +176 -0
- package/dist/provider-client.js.map +1 -1
- package/dist/types.d.ts +23 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -2
- package/dist/types.js.map +1 -1
- package/dist/web-search/deepseek.adapter.d.ts +19 -0
- package/dist/web-search/deepseek.adapter.d.ts.map +1 -0
- package/dist/web-search/deepseek.adapter.js +82 -0
- package/dist/web-search/deepseek.adapter.js.map +1 -0
- package/dist/web-search/http.d.ts +28 -0
- package/dist/web-search/http.d.ts.map +1 -0
- package/dist/web-search/http.js +95 -0
- package/dist/web-search/http.js.map +1 -0
- package/dist/web-search/index.d.ts +27 -0
- package/dist/web-search/index.d.ts.map +1 -0
- package/dist/web-search/index.js +36 -0
- package/dist/web-search/index.js.map +1 -0
- package/dist/web-search/minimax.adapter.d.ts +13 -0
- package/dist/web-search/minimax.adapter.d.ts.map +1 -0
- package/dist/web-search/minimax.adapter.js +82 -0
- package/dist/web-search/minimax.adapter.js.map +1 -0
- package/dist/web-search/moonshotai.adapter.d.ts +19 -0
- package/dist/web-search/moonshotai.adapter.d.ts.map +1 -0
- package/dist/web-search/moonshotai.adapter.js +151 -0
- package/dist/web-search/moonshotai.adapter.js.map +1 -0
- package/dist/web-search/types.d.ts +120 -0
- package/dist/web-search/types.d.ts.map +1 -0
- package/dist/web-search/types.js +60 -0
- package/dist/web-search/types.js.map +1 -0
- package/dist/web-search/zhipu.adapter.d.ts +14 -0
- package/dist/web-search/zhipu.adapter.d.ts.map +1 -0
- package/dist/web-search/zhipu.adapter.js +98 -0
- package/dist/web-search/zhipu.adapter.js.map +1 -0
- package/package.json +4 -3
- package/src/direct-resolver.ts +2 -0
- package/src/image/http.ts +68 -0
- package/src/image/index.ts +87 -0
- package/src/image/types.ts +134 -0
- package/src/image/volcengine.adapter.ts +133 -0
- package/src/index.ts +126 -0
- package/src/justone/client.ts +462 -0
- package/src/justone/endpoint-spec.ts +66 -0
- package/src/justone/endpoints.generated.ts +9258 -0
- package/src/justone/errors.ts +97 -0
- package/src/justone/index.ts +34 -0
- package/src/justone/params.ts +91 -0
- package/src/justone/pricing.generated.ts +308 -0
- package/src/justone/pricing.ts +11 -0
- package/src/media/bibigpt.adapter.ts +372 -0
- package/src/media/http.ts +43 -0
- package/src/media/index.ts +114 -0
- package/src/media/types.ts +233 -0
- package/src/media/zhipu-parser-package.ts +149 -0
- package/src/media/zhipu.adapter.ts +510 -0
- package/src/provider-client.ts +303 -1
- package/src/types.ts +31 -2
- package/src/web-search/deepseek.adapter.ts +149 -0
- package/src/web-search/http.ts +108 -0
- package/src/web-search/index.ts +70 -0
- package/src/web-search/minimax.adapter.ts +148 -0
- package/src/web-search/moonshotai.adapter.ts +228 -0
- package/src/web-search/types.ts +172 -0
- package/src/web-search/zhipu.adapter.ts +184 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 失败的大类,调用方按它决定怎么跟人说、要不要重试:
|
|
3
|
+
* auth token 无效 / 权限不足 · balance 余额不足 · quota 配额用完 · rate-limit 速率超限 ·
|
|
4
|
+
* bad-request 服务端判参数错 · upstream 采集失败 / 服务端错误 · network 连接失败(含中心连不上 JustOne)·
|
|
5
|
+
* timeout 超时 · invalid-response 响应不成形 · aborted 调用方中途取消(请求已发出,只出现在调用记录里)。
|
|
6
|
+
*/
|
|
7
|
+
export const JUSTONE_FAILURE_KINDS = [
|
|
8
|
+
'auth',
|
|
9
|
+
'balance',
|
|
10
|
+
'quota',
|
|
11
|
+
'rate-limit',
|
|
12
|
+
'bad-request',
|
|
13
|
+
'upstream',
|
|
14
|
+
'network',
|
|
15
|
+
'timeout',
|
|
16
|
+
'invalid-response',
|
|
17
|
+
'aborted',
|
|
18
|
+
] as const;
|
|
19
|
+
export type JustOneFailureKind = (typeof JUSTONE_FAILURE_KINDS)[number];
|
|
20
|
+
|
|
21
|
+
/** `JustOneUpstreamError.kind`:`aborted` 时客户端原样抛出取消原因,不包成本错误。 */
|
|
22
|
+
export type JustOneUpstreamFailureKind = Exclude<JustOneFailureKind, 'aborted'>;
|
|
23
|
+
|
|
24
|
+
/** 请求还没发出去就被拦下:接口不存在、参数缺了 / 多了 / 取值不对。调用方的错,重试没用。 */
|
|
25
|
+
export class JustOneParamsError extends Error {
|
|
26
|
+
override readonly name = 'JustOneParamsError';
|
|
27
|
+
constructor(
|
|
28
|
+
readonly endpoint: string,
|
|
29
|
+
readonly problems: readonly string[]
|
|
30
|
+
) {
|
|
31
|
+
super(`JustOne ${endpoint}:${problems.join(';')}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** JustOne 调用失败。**message 里绝不带请求 URL**——直连时 GET 的 token 就在 query 里。 */
|
|
36
|
+
export class JustOneUpstreamError extends Error {
|
|
37
|
+
override readonly name = 'JustOneUpstreamError';
|
|
38
|
+
|
|
39
|
+
constructor(
|
|
40
|
+
readonly endpoint: string,
|
|
41
|
+
readonly kind: JustOneUpstreamFailureKind,
|
|
42
|
+
reason: string,
|
|
43
|
+
readonly detail: {
|
|
44
|
+
/** 业务码(信封里的 `code`);没拿到信封就是 null。 */
|
|
45
|
+
code: number | null;
|
|
46
|
+
httpStatus: number | null;
|
|
47
|
+
requestId: string | null;
|
|
48
|
+
/** 这类失败值不值得再试一次。判据只在 `classifyCode` 与客户端的抛出处。 */
|
|
49
|
+
retryable: boolean;
|
|
50
|
+
/** 一共试了几次(含首次)。 */
|
|
51
|
+
attempts: number;
|
|
52
|
+
}
|
|
53
|
+
) {
|
|
54
|
+
super(`JustOne ${endpoint} 失败(${kind}):${reason}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get code(): number | null {
|
|
58
|
+
return this.detail.code;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get retryable(): boolean {
|
|
62
|
+
return this.detail.retryable;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** 文档列出的业务码(每个接口页的「业务码说明」)。 */
|
|
67
|
+
const KNOWN_CODES: Record<
|
|
68
|
+
number,
|
|
69
|
+
{ kind: JustOneUpstreamFailureKind; text: string }
|
|
70
|
+
> = {
|
|
71
|
+
100: { kind: 'auth', text: 'Token 无效或已失效' },
|
|
72
|
+
301: { kind: 'upstream', text: '采集失败,请重试' },
|
|
73
|
+
302: { kind: 'rate-limit', text: '超出速率限制' },
|
|
74
|
+
303: { kind: 'quota', text: '超出每日配额' },
|
|
75
|
+
400: { kind: 'bad-request', text: '参数错误' },
|
|
76
|
+
500: { kind: 'upstream', text: '内部服务器错误' },
|
|
77
|
+
600: { kind: 'auth', text: '权限不足' },
|
|
78
|
+
601: { kind: 'balance', text: '账户余额不足' },
|
|
79
|
+
602: { kind: 'quota', text: 'TOKEN 限额超限' },
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** 会再试一次的业务码:官方明说「请重试」的 301,和服务端的 500 / 503。 */
|
|
83
|
+
const RETRYABLE_CODES = new Set([301, 500, 503]);
|
|
84
|
+
|
|
85
|
+
/** 非 0 业务码 → 失败大类 + 一句中文原因 + 值不值得重试。 */
|
|
86
|
+
export function classifyCode(
|
|
87
|
+
code: number,
|
|
88
|
+
message: string | null
|
|
89
|
+
): { kind: JustOneUpstreamFailureKind; reason: string; retryable: boolean } {
|
|
90
|
+
const known = KNOWN_CODES[code];
|
|
91
|
+
const vendorSays = message ? `:${message}` : '';
|
|
92
|
+
return {
|
|
93
|
+
kind: known?.kind ?? 'upstream',
|
|
94
|
+
reason: `业务码 ${code}(${known?.text ?? '文档未列出'})${vendorSays}`,
|
|
95
|
+
retryable: RETRYABLE_CODES.has(code),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export {
|
|
2
|
+
createJustOne,
|
|
3
|
+
type JustOne,
|
|
4
|
+
JUSTONE_BASE_URL,
|
|
5
|
+
JUSTONE_TIMEOUT_MS,
|
|
6
|
+
type JustOneAttemptRecord,
|
|
7
|
+
type JustOneCallOptions,
|
|
8
|
+
type JustOneConnection,
|
|
9
|
+
type JustOneEndpointKey,
|
|
10
|
+
justOneEndpointSpec,
|
|
11
|
+
type JustOneOptions,
|
|
12
|
+
type JustOneParams,
|
|
13
|
+
type JustOneResult,
|
|
14
|
+
} from './client.js';
|
|
15
|
+
export type {
|
|
16
|
+
JustOneEndpointSpec,
|
|
17
|
+
JustOneParamsOf,
|
|
18
|
+
JustOneParamSpec,
|
|
19
|
+
} from './endpoint-spec.js';
|
|
20
|
+
export { JUSTONE_ENDPOINTS } from './endpoints.generated.js';
|
|
21
|
+
export {
|
|
22
|
+
classifyCode,
|
|
23
|
+
JUSTONE_FAILURE_KINDS,
|
|
24
|
+
type JustOneFailureKind,
|
|
25
|
+
JustOneParamsError,
|
|
26
|
+
JustOneUpstreamError,
|
|
27
|
+
type JustOneUpstreamFailureKind,
|
|
28
|
+
} from './errors.js';
|
|
29
|
+
export { type NormalizedParams, normalizeParams } from './params.js';
|
|
30
|
+
export {
|
|
31
|
+
JUSTONE_PRICE_FEN,
|
|
32
|
+
JUSTONE_PRICING_EXPORTED_AT,
|
|
33
|
+
} from './pricing.generated.js';
|
|
34
|
+
export { justOnePriceFen } from './pricing.js';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { JustOneEndpointSpec } from './endpoint-spec.js';
|
|
2
|
+
|
|
3
|
+
export type NormalizedParams =
|
|
4
|
+
| { ok: true; values: Record<string, string> }
|
|
5
|
+
| { ok: false; problems: string[] };
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 入参 → 线上的字符串表单。按登记表逐个核对:多余的参数、缺必填、类型不对、
|
|
9
|
+
* 不在枚举里,一次性全部列出来(给模型用时它能一次改对)。
|
|
10
|
+
*
|
|
11
|
+
* 宽进:值是 `undefined` / `null` / 空串的当作没给;数字与布尔也接受字符串写法
|
|
12
|
+
* (`"20"`、`"true"`)——模型给的参数常是字符串,类型化的调用方本来就传对了。
|
|
13
|
+
*/
|
|
14
|
+
export function normalizeParams(
|
|
15
|
+
spec: JustOneEndpointSpec,
|
|
16
|
+
raw: Readonly<Record<string, unknown>>
|
|
17
|
+
): NormalizedParams {
|
|
18
|
+
const problems: string[] = [];
|
|
19
|
+
const values: Record<string, string> = {};
|
|
20
|
+
|
|
21
|
+
for (const name of Object.keys(raw)) {
|
|
22
|
+
if (!(name in spec.params)) {
|
|
23
|
+
problems.push(
|
|
24
|
+
name === 'token'
|
|
25
|
+
? 'token 由客户端统一放,不要放进参数'
|
|
26
|
+
: `没有参数 ${name}`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const [name, p] of Object.entries(spec.params)) {
|
|
32
|
+
const v = raw[name];
|
|
33
|
+
if (v === undefined || v === null || v === '') {
|
|
34
|
+
if (p.required) problems.push(`缺少必填参数 ${name}`);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const text = toWire(v, p.type);
|
|
38
|
+
if (text === null) {
|
|
39
|
+
problems.push(`参数 ${name} 应为 ${TYPE_LABEL[p.type]},收到 ${show(v)}`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (p.enum && !p.enum.includes(text)) {
|
|
43
|
+
problems.push(
|
|
44
|
+
`参数 ${name} 只能取 ${p.enum.join(' / ')},收到 ${show(v)}`
|
|
45
|
+
);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
values[name] = text;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return problems.length ? { ok: false, problems } : { ok: true, values };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const TYPE_LABEL = {
|
|
55
|
+
string: '字符串',
|
|
56
|
+
integer: '整数',
|
|
57
|
+
number: '数字',
|
|
58
|
+
boolean: '布尔值',
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
function toWire(
|
|
62
|
+
v: unknown,
|
|
63
|
+
type: JustOneEndpointSpec['params'][string]['type']
|
|
64
|
+
): string | null {
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 'string':
|
|
67
|
+
return typeof v === 'string'
|
|
68
|
+
? v
|
|
69
|
+
: typeof v === 'number' && Number.isFinite(v)
|
|
70
|
+
? String(v)
|
|
71
|
+
: null;
|
|
72
|
+
case 'integer': {
|
|
73
|
+
const n = typeof v === 'string' ? Number(v.trim()) : v;
|
|
74
|
+
return typeof n === 'number' && Number.isSafeInteger(n)
|
|
75
|
+
? String(n)
|
|
76
|
+
: null;
|
|
77
|
+
}
|
|
78
|
+
case 'number': {
|
|
79
|
+
const n = typeof v === 'string' ? Number(v.trim()) : v;
|
|
80
|
+
return typeof n === 'number' && Number.isFinite(n) ? String(n) : null;
|
|
81
|
+
}
|
|
82
|
+
case 'boolean':
|
|
83
|
+
if (typeof v === 'boolean') return String(v);
|
|
84
|
+
return v === 'true' || v === 'false' ? v : null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function show(v: unknown): string {
|
|
89
|
+
const s = JSON.stringify(v) ?? String(v);
|
|
90
|
+
return s.length > 60 ? `${s.slice(0, 60)}…` : s;
|
|
91
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
// 生成物,别手改:node packages/client/scripts/generate-justone-pricing.mjs <控制台导出的定价 xlsx>
|
|
2
|
+
// 来源:JustOne 控制台「定价」导出(2026/10/27 01:10:47 UTC+8),共 294 个接口有价。
|
|
3
|
+
|
|
4
|
+
import type { JUSTONE_ENDPOINTS } from './endpoints.generated.js';
|
|
5
|
+
|
|
6
|
+
/** 定价表的导出时间。价格可能已经变了,展示时带上它。 */
|
|
7
|
+
export const JUSTONE_PRICING_EXPORTED_AT = '2026/10/27 01:10:47 UTC+8';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 每次请求的单价,单位:分(人民币)。登记表里有、这里没有的接口是导出里没有
|
|
11
|
+
* (当前账号看不到价或没有权限),按「价格未知」处理,别当成免费。
|
|
12
|
+
*/
|
|
13
|
+
export const JUSTONE_PRICE_FEN = {
|
|
14
|
+
'1688/get-item-detail/v1': 10,
|
|
15
|
+
'1688/search-item-list/v1': 10,
|
|
16
|
+
'aliexpress/get-product-detail/v1': 10,
|
|
17
|
+
'aliexpress/search-products/v1': 10,
|
|
18
|
+
'amazon/get-best-sellers/v1': 10,
|
|
19
|
+
'amazon/get-category-products/v1': 10,
|
|
20
|
+
'amazon/get-product-detail/v1': 10,
|
|
21
|
+
'amazon/get-product-top-reviews/v1': 10,
|
|
22
|
+
'amazon/search-products/v1': 10,
|
|
23
|
+
'bilibili/get-user-detail/v2': 10,
|
|
24
|
+
'bilibili/get-user-relation-stat/v1': 10,
|
|
25
|
+
'bilibili/get-user-video-list/v2': 10,
|
|
26
|
+
'bilibili/get-video-caption/v2': 10,
|
|
27
|
+
'bilibili/get-video-comment/v2': 10,
|
|
28
|
+
'bilibili/get-video-danmu/v2': 10,
|
|
29
|
+
'bilibili/get-video-detail/v2': 10,
|
|
30
|
+
'bilibili/search-video/v2': 10,
|
|
31
|
+
'bilibili/share-url-transfer/v1': 10,
|
|
32
|
+
'douban/get-movie-comments/v1': 10,
|
|
33
|
+
'douban/get-movie-review-detail/v1': 10,
|
|
34
|
+
'douban/get-movie-reviews/v1': 10,
|
|
35
|
+
'douban/get-recent-hot-movie/v1': 10,
|
|
36
|
+
'douban/get-recent-hot-tv/v1': 10,
|
|
37
|
+
'douban/get-subject-detail/v1': 10,
|
|
38
|
+
'douyin-ec/get-item-comments/v1': 18,
|
|
39
|
+
'douyin-ec/get-item-detail/v2': 18,
|
|
40
|
+
'douyin-ec/get-item-sku-info/v1': 30,
|
|
41
|
+
'douyin-ec/get-item-sku-info/v2': 25,
|
|
42
|
+
'douyin-ec/get-shop-item-list/v1': 20,
|
|
43
|
+
'douyin-ec/search-item-list/v1': 25,
|
|
44
|
+
'douyin-xingtu/gw/api/aggregator/get_author_commerce_seed_base_info/v1': 15,
|
|
45
|
+
'douyin-xingtu/gw/api/aggregator/get_author_commerce_spread_info/v1': 15,
|
|
46
|
+
'douyin-xingtu/gw/api/aggregator/get_author_contract_base_info': 15,
|
|
47
|
+
'douyin-xingtu/gw/api/aggregator/get_author_homepage_videos/v1': 50,
|
|
48
|
+
'douyin-xingtu/gw/api/aggregator/get_author_live_statistics/v1': 15,
|
|
49
|
+
'douyin-xingtu/gw/api/aggregator/get_author_live_watch_distribution/v1': 15,
|
|
50
|
+
'douyin-xingtu/gw/api/aggregator/get_author_order_experience/v1': 15,
|
|
51
|
+
'douyin-xingtu/gw/api/aggregator/get_author_side_base_info/v1': 15,
|
|
52
|
+
'douyin-xingtu/gw/api/aggregator/get_author_tags/v1': 15,
|
|
53
|
+
'douyin-xingtu/gw/api/author/get_author_base_info/v1': 15,
|
|
54
|
+
'douyin-xingtu/gw/api/author/get_author_marketing_info/v1': 15,
|
|
55
|
+
'douyin-xingtu/gw/api/author/get_author_platform_channel_info_v2/v1': 15,
|
|
56
|
+
'douyin-xingtu/gw/api/author/get_author_show_items_v2/v1': 15,
|
|
57
|
+
'douyin-xingtu/gw/api/data_sp/author_audience_distribution/v1': 15,
|
|
58
|
+
'douyin-xingtu/gw/api/data_sp/author_cp_info/v1': 15,
|
|
59
|
+
'douyin-xingtu/gw/api/data_sp/author_link_struct/v1': 15,
|
|
60
|
+
'douyin-xingtu/gw/api/data_sp/author_rec_videos_v2/v1': 15,
|
|
61
|
+
'douyin-xingtu/gw/api/data_sp/author_touch_distribution/v1': 15,
|
|
62
|
+
'douyin-xingtu/gw/api/data_sp/author_video_distribution/v1': 15,
|
|
63
|
+
'douyin-xingtu/gw/api/data_sp/check_author_display/v1': 15,
|
|
64
|
+
'douyin-xingtu/gw/api/data_sp/get_author_convert_ability/v1': 15,
|
|
65
|
+
'douyin-xingtu/gw/api/data_sp/get_author_convert_videos_or_products/v1': 15,
|
|
66
|
+
'douyin-xingtu/gw/api/data_sp/get_author_daily_fans/v1': 15,
|
|
67
|
+
'douyin-xingtu/gw/api/data_sp/get_author_fans_distribution/v1': 15,
|
|
68
|
+
'douyin-xingtu/gw/api/data_sp/get_author_link_info/v1': 15,
|
|
69
|
+
'douyin-xingtu/gw/api/data_sp/get_author_spread_info/v1': 50,
|
|
70
|
+
'douyin-xingtu/gw/api/data_sp/item_report_detail/v1': 15,
|
|
71
|
+
'douyin-xingtu/gw/api/data_sp/item_report_th_analysis/v1': 15,
|
|
72
|
+
'douyin-xingtu/gw/api/data_sp/item_report_trend/v1': 15,
|
|
73
|
+
'douyin-xingtu/gw/api/data/get_author_hot_comment_tokens/v1': 15,
|
|
74
|
+
'douyin-xingtu/gw/api/gauthor/author_get_business_card_info/v1': 15,
|
|
75
|
+
'douyin-xingtu/gw/api/gauthor/get_author_content_hot_keywords/v1': 15,
|
|
76
|
+
'douyin-xingtu/gw/api/gsearch/search_for_author_square/v1': 50,
|
|
77
|
+
'douyin/get-user-detail/v3': 10,
|
|
78
|
+
'douyin/get-user-video-list/v1': 10,
|
|
79
|
+
'douyin/get-user-video-list/v3': 10,
|
|
80
|
+
'douyin/get-video-comment/v1': 10,
|
|
81
|
+
'douyin/get-video-detail/v2': 10,
|
|
82
|
+
'douyin/get-video-sub-comment/v1': 10,
|
|
83
|
+
'douyin/hot-search/v1': 20,
|
|
84
|
+
'douyin/search-image/v1': 20,
|
|
85
|
+
'douyin/search-user/v2': 10,
|
|
86
|
+
'douyin/search-video/v4': 10,
|
|
87
|
+
'douyin/share-url-transfer/v1': 10,
|
|
88
|
+
'facebook/get-comment-replies/v1': 20,
|
|
89
|
+
'facebook/get-post-comments/v1': 20,
|
|
90
|
+
'facebook/get-profile-id/v1': 20,
|
|
91
|
+
'facebook/get-profile-posts/v1': 20,
|
|
92
|
+
'facebook/search-post/v1': 20,
|
|
93
|
+
'imdb/news-by-category-query/v1': 5,
|
|
94
|
+
'imdb/streaming-picks-query/v1': 5,
|
|
95
|
+
'imdb/title-awards-summary-query/v1': 5,
|
|
96
|
+
'imdb/title-base-query/v1': 5,
|
|
97
|
+
'imdb/title-box-office-summary/v1': 5,
|
|
98
|
+
'imdb/title-chart-rankings/v1': 5,
|
|
99
|
+
'imdb/title-contribution-questions/v1': 5,
|
|
100
|
+
'imdb/title-countries-of-origin/v1': 5,
|
|
101
|
+
'imdb/title-critics-review-summary-query/v1': 5,
|
|
102
|
+
'imdb/title-details-query/v1': 5,
|
|
103
|
+
'imdb/title-did-you-know-query/v1': 5,
|
|
104
|
+
'imdb/title-extended-details-query/v1': 5,
|
|
105
|
+
'imdb/title-more-like-this-query/v1': 5,
|
|
106
|
+
'imdb/title-plot-query/v1': 5,
|
|
107
|
+
'imdb/title-redux-overview-query/v1': 5,
|
|
108
|
+
'imdb/title-release-expectation-query/v1': 5,
|
|
109
|
+
'imdb/title-top-cast-and-crew/v1': 5,
|
|
110
|
+
'imdb/title-user-reviews-summary-query/v1': 5,
|
|
111
|
+
'instagram/general-search/v1': 10,
|
|
112
|
+
'instagram/get-comment-replies/v1': 10,
|
|
113
|
+
'instagram/get-post-comments/v1': 10,
|
|
114
|
+
'instagram/get-post-detail/v1': 10,
|
|
115
|
+
'instagram/get-user-detail/v1': 10,
|
|
116
|
+
'instagram/get-user-detail/v2': 10,
|
|
117
|
+
'instagram/get-user-posts/v1': 10,
|
|
118
|
+
'instagram/search-hashtag-posts/v1': 10,
|
|
119
|
+
'instagram/search-reels/v1': 10,
|
|
120
|
+
'jd/get-item-comments/v1': 20,
|
|
121
|
+
'jd/get-item-description-images/v1': 15,
|
|
122
|
+
'jd/get-item-detail/v1': 20,
|
|
123
|
+
'jd/get-item-detail/v3': 40,
|
|
124
|
+
'jd/get-item-detail/v4': 25,
|
|
125
|
+
'jd/get-item-price/v1': 15,
|
|
126
|
+
'jd/get-shop-item-list/v1': 20,
|
|
127
|
+
'jd/search-item-list/v1': 15,
|
|
128
|
+
'kuaishou/get-user-detail/v1': 10,
|
|
129
|
+
'kuaishou/get-user-video-list/v2': 10,
|
|
130
|
+
'kuaishou/get-video-comment/v1': 10,
|
|
131
|
+
'kuaishou/get-video-detail/v2': 10,
|
|
132
|
+
'kuaishou/search-user/v2': 10,
|
|
133
|
+
'kuaishou/search-video/v1': 10,
|
|
134
|
+
'kuaishou/search-video/v2': 10,
|
|
135
|
+
'kuaishou/share-url-transfer/v1': 10,
|
|
136
|
+
'linkedin/get-post-comments/v1': 20,
|
|
137
|
+
'linkedin/get-user-detail/v1': 20,
|
|
138
|
+
'linkedin/get-user-posts/v1': 20,
|
|
139
|
+
'qq-huxuan/cgi-bin/advertiser/finder_publisher/detail/v1': 30,
|
|
140
|
+
'qq-huxuan/cgi-bin/advertiser/finder_publisher/get_finder_video_show/v1': 50,
|
|
141
|
+
'qq-huxuan/cgi-bin/advertiser/finder_publisher/get_rank_finder_content/v1': 30,
|
|
142
|
+
'qq-huxuan/cgi-bin/advertiser/finder_publisher/search/v1': 50,
|
|
143
|
+
'qq-huxuan/cgi-bin/advertiser/mp_publisher/detail/v1': 30,
|
|
144
|
+
'qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1': 50,
|
|
145
|
+
'qq-huxuan/cgi-bin/advertiser/mp_publisher/search/v1': 50,
|
|
146
|
+
'reddit/get-post-comments/v1': 10,
|
|
147
|
+
'reddit/get-post-detail/v1': 10,
|
|
148
|
+
'reddit/search/v1': 10,
|
|
149
|
+
'search/v1': 20,
|
|
150
|
+
'shopee/get-item-detail/v1': 20,
|
|
151
|
+
'shopee/get-item-detail/v2': 20,
|
|
152
|
+
'shopee/get-item-installments/v1': 20,
|
|
153
|
+
'shopee/get-item-review-models/v1': 20,
|
|
154
|
+
'shopee/get-item-review-tags/v1': 20,
|
|
155
|
+
'shopee/get-item-reviews/v1': 20,
|
|
156
|
+
'shopee/get-item-sku-matrix/v1': 20,
|
|
157
|
+
'shopee/get-item-sku-models/v1': 20,
|
|
158
|
+
'shopee/get-item-snapshot/v1': 20,
|
|
159
|
+
'shopee/get-search-facets/v1': 20,
|
|
160
|
+
'shopee/get-shop-base/v1': 20,
|
|
161
|
+
'shopee/get-shop-categories/v1': 20,
|
|
162
|
+
'shopee/get-shop-detail/v1': 20,
|
|
163
|
+
'shopee/get-shop-item-list/v1': 20,
|
|
164
|
+
'shopee/get-shop-reviews-rich/v1': 20,
|
|
165
|
+
'shopee/get-shop-reviews/v1': 20,
|
|
166
|
+
'shopee/get-shop-seo/v1': 20,
|
|
167
|
+
'shopee/search-item-list/v1': 20,
|
|
168
|
+
'taobao/get-item-comment/v3': 20,
|
|
169
|
+
'taobao/get-item-detail/v1': 25,
|
|
170
|
+
'taobao/get-item-detail/v3': 60,
|
|
171
|
+
'taobao/get-item-detail/v4': 55,
|
|
172
|
+
'taobao/get-item-detail/v5': 15,
|
|
173
|
+
'taobao/get-item-detail/v6': 25,
|
|
174
|
+
'taobao/get-item-detail/v8': 25,
|
|
175
|
+
'taobao/get-item-detail/v9': 25,
|
|
176
|
+
'taobao/get-shop-item-list/v1': 15,
|
|
177
|
+
'taobao/get-shop-item-list/v2': 20,
|
|
178
|
+
'taobao/get-shop-item-list/v3': 30,
|
|
179
|
+
'taobao/get-shop-item-list/v4': 25,
|
|
180
|
+
'taobao/get-social-feed/v1': 15,
|
|
181
|
+
'taobao/search-item-list/v1': 20,
|
|
182
|
+
'taobao/search-item-list/v2': 25,
|
|
183
|
+
'tiktok-shop/get-product-detail/v1': 10,
|
|
184
|
+
'tiktok-shop/search-products/v1': 10,
|
|
185
|
+
'tiktok/get-post-comment/v1': 10,
|
|
186
|
+
'tiktok/get-post-detail/v1': 10,
|
|
187
|
+
'tiktok/get-post-sub-comment/v1': 10,
|
|
188
|
+
'tiktok/get-user-detail/v1': 10,
|
|
189
|
+
'tiktok/get-user-post/v1': 10,
|
|
190
|
+
'tiktok/search-post/v1': 10,
|
|
191
|
+
'toutiao/get-article-detail/v1': 10,
|
|
192
|
+
'toutiao/get-user-detail/v1': 10,
|
|
193
|
+
'toutiao/get-user-id/v1': 10,
|
|
194
|
+
'toutiao/get-video-detail/v1': 10,
|
|
195
|
+
'toutiao/search/v2': 50,
|
|
196
|
+
'twitter/get-post-comments/v1': 10,
|
|
197
|
+
'twitter/get-post-detail/v1': 10,
|
|
198
|
+
'twitter/get-user-detail/v1': 10,
|
|
199
|
+
'twitter/get-user-posts/v1': 10,
|
|
200
|
+
'twitter/search/v1': 10,
|
|
201
|
+
'weibo/get-fans/v1': 10,
|
|
202
|
+
'weibo/get-followers/v1': 10,
|
|
203
|
+
'weibo/get-post-comments/v1': 10,
|
|
204
|
+
'weibo/get-user-detail/v3': 10,
|
|
205
|
+
'weibo/get-user-post/v1': 10,
|
|
206
|
+
'weibo/get-user-video-list/v1': 10,
|
|
207
|
+
'weibo/get-weibo-detail/v1': 10,
|
|
208
|
+
'weibo/hot-search/v1': 10,
|
|
209
|
+
'weibo/search-all/v2': 10,
|
|
210
|
+
'weibo/search-profile/v1': 10,
|
|
211
|
+
'weibo/tv-component/v1': 10,
|
|
212
|
+
'weixin-channels/convert-export-id/v1': 15,
|
|
213
|
+
'weixin-channels/get-account-videos/v1': 50,
|
|
214
|
+
'weixin-channels/get-bound-channel/v1': 100,
|
|
215
|
+
'weixin-channels/get-video-basic-info/v1': 30,
|
|
216
|
+
'weixin-channels/get-video-comment/v1': 15,
|
|
217
|
+
'weixin-channels/get-video-download-url/v1': 30,
|
|
218
|
+
'weixin-channels/get-video-metrics/v1': 15,
|
|
219
|
+
'weixin-channels/get-video-share-url/v1': 20,
|
|
220
|
+
'weixin-channels/get-video-sub-comment/v1': 15,
|
|
221
|
+
'weixin-channels/get-video-title/v1': 15,
|
|
222
|
+
'weixin-channels/search-account/v1': 150,
|
|
223
|
+
'weixin-channels/search-account/v2': 100,
|
|
224
|
+
'weixin-channels/search-account/v3': 50,
|
|
225
|
+
'weixin-channels/search-video/v1': 80,
|
|
226
|
+
'weixin-channels/search-video/v2': 150,
|
|
227
|
+
'weixin/convert-article-link/v1': 10,
|
|
228
|
+
'weixin/get-account-basic-info/v1': 100,
|
|
229
|
+
'weixin/get-account-history-articles/v1': 30,
|
|
230
|
+
'weixin/get-account-history-articles/v2': 40,
|
|
231
|
+
'weixin/get-account-original-count/v1': 150,
|
|
232
|
+
'weixin/get-account-principal-info/v1': 100,
|
|
233
|
+
'weixin/get-article-comment/v1': 20,
|
|
234
|
+
'weixin/get-article-detail/v1': 15,
|
|
235
|
+
'weixin/get-article-detail/v2': 15,
|
|
236
|
+
'weixin/get-article-detail/v3': 20,
|
|
237
|
+
'weixin/get-article-detail/v4': 15,
|
|
238
|
+
'weixin/get-article-detail/v5': 15,
|
|
239
|
+
'weixin/get-article-metrics/v1': 15,
|
|
240
|
+
'weixin/get-article-metrics/v2': 20,
|
|
241
|
+
'weixin/get-article-sub-comment/v1': 20,
|
|
242
|
+
'weixin/search-account/v1': 40,
|
|
243
|
+
'weixin/search-account/v2': 150,
|
|
244
|
+
'weixin/search-article/v1': 80,
|
|
245
|
+
'weixin/search-article/v2': 80,
|
|
246
|
+
'weixin/search-miniprogram/v1': 80,
|
|
247
|
+
'weixin/search-suggestions/v1': 80,
|
|
248
|
+
'weixin/search-wechat-index/v1': 80,
|
|
249
|
+
'xianyu/get-item-detail/v1': 20,
|
|
250
|
+
'xianyu/search-item-list/v1': 20,
|
|
251
|
+
'xiaohongshu-ec/search-products/v1': 20,
|
|
252
|
+
'xiaohongshu-pgy/api/pgy/content_square/search_note_v2/v1': 15,
|
|
253
|
+
'xiaohongshu-pgy/api/pgy/kol/data/core_data/v1': 15,
|
|
254
|
+
'xiaohongshu-pgy/api/solar/cooperator/blogger/v2/v1': 50,
|
|
255
|
+
'xiaohongshu-pgy/api/solar/cooperator/user/blogger/userId/v1': 15,
|
|
256
|
+
'xiaohongshu-pgy/api/solar/kol/data/userId/fans_overall_new_history/v1': 15,
|
|
257
|
+
'xiaohongshu-pgy/api/solar/kol/data/userId/fans_profile/v1': 15,
|
|
258
|
+
'xiaohongshu-pgy/api/solar/kol/dataV2/costEffective/v1': 15,
|
|
259
|
+
'xiaohongshu-pgy/api/solar/kol/dataV2/kolContentTags/v1': 15,
|
|
260
|
+
'xiaohongshu-pgy/api/solar/kol/dataV2/kolFeatureTags/v1': 15,
|
|
261
|
+
'xiaohongshu-pgy/api/solar/kol/dataV2/notesDetail/v1': 15,
|
|
262
|
+
'xiaohongshu-pgy/api/solar/kol/dataV3/dataSummary/v1': 15,
|
|
263
|
+
'xiaohongshu-pgy/api/solar/kol/dataV3/fansSummary/v1': 15,
|
|
264
|
+
'xiaohongshu-pgy/api/solar/kol/dataV3/notesRate/v1': 15,
|
|
265
|
+
'xiaohongshu-pgy/api/solar/kol/get_similar_kol/v1': 15,
|
|
266
|
+
'xiaohongshu-pgy/api/solar/note/noteId/detail/v1': 15,
|
|
267
|
+
'xiaohongshu-pgy/get-kol-note-list/v1': 50,
|
|
268
|
+
'xiaohongshu/ask-dots': 50,
|
|
269
|
+
'xiaohongshu/get-creator-hot-inspiration-feed/v1': 15,
|
|
270
|
+
'xiaohongshu/get-note-comment/v2': 15,
|
|
271
|
+
'xiaohongshu/get-note-detail/v1': 15,
|
|
272
|
+
'xiaohongshu/get-note-detail/v6': 15,
|
|
273
|
+
'xiaohongshu/get-note-sub-comment/v2': 15,
|
|
274
|
+
'xiaohongshu/get-topic-note-list/v1': 15,
|
|
275
|
+
'xiaohongshu/get-user-faved-note-list/v1': 15,
|
|
276
|
+
'xiaohongshu/get-user-note-list/v4': 15,
|
|
277
|
+
'xiaohongshu/get-user/v3': 15,
|
|
278
|
+
'xiaohongshu/hot-search/v1': 15,
|
|
279
|
+
'xiaohongshu/search-note/v2': 15,
|
|
280
|
+
'xiaohongshu/search-note/v4': 20,
|
|
281
|
+
'xiaohongshu/search-recommend/v1': 15,
|
|
282
|
+
'xiaohongshu/search-user/v2': 15,
|
|
283
|
+
'xiaohongshu/share-url-transfer/v1': 15,
|
|
284
|
+
'youku/get-user-detail/v1': 10,
|
|
285
|
+
'youku/get-video-detail/v1': 10,
|
|
286
|
+
'youku/search-video/v1': 10,
|
|
287
|
+
'youtube/get-channel-shorts/v1': 10,
|
|
288
|
+
'youtube/get-channel-videos/v1': 10,
|
|
289
|
+
'youtube/get-video-captions/v1': 10,
|
|
290
|
+
'youtube/get-video-comment/v1': 10,
|
|
291
|
+
'youtube/get-video-detail/v1': 10,
|
|
292
|
+
'youtube/get-video-sub-comment/v1': 10,
|
|
293
|
+
'youtube/search/v1': 10,
|
|
294
|
+
'zhihu/get-answer-comments/v1': 10,
|
|
295
|
+
'zhihu/get-answer-list/v1': 10,
|
|
296
|
+
'zhihu/get-column-article-detail/v1': 10,
|
|
297
|
+
'zhihu/get-column-article-list/v1': 10,
|
|
298
|
+
'zhihu/get-comment-replies/v1': 10,
|
|
299
|
+
'zhihu/get-user-articles/v1': 10,
|
|
300
|
+
'zhihu/get-user-follow-collections/v1': 10,
|
|
301
|
+
'zhihu/get-user-follow-columns/v1': 10,
|
|
302
|
+
'zhihu/get-user-follow-topics/v1': 10,
|
|
303
|
+
'zhihu/get-user-followees/v1': 10,
|
|
304
|
+
'zhihu/get-user-followers/v1': 10,
|
|
305
|
+
'zhihu/get-user-included-articles/v1': 10,
|
|
306
|
+
'zhihu/get-user-info/v1': 10,
|
|
307
|
+
'zhihu/search/v1': 20,
|
|
308
|
+
} as const satisfies Partial<Record<keyof typeof JUSTONE_ENDPOINTS, number>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JUSTONE_PRICE_FEN } from './pricing.generated.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 接口现行单价(分);定价表里没有就是 null——「价格未知」,别当成免费。
|
|
5
|
+
* 键在运行期才知道(库里存的、调用方传的),所以收 `string`。
|
|
6
|
+
*/
|
|
7
|
+
export function justOnePriceFen(endpoint: string): number | null {
|
|
8
|
+
return Object.hasOwn(JUSTONE_PRICE_FEN, endpoint)
|
|
9
|
+
? JUSTONE_PRICE_FEN[endpoint as keyof typeof JUSTONE_PRICE_FEN]
|
|
10
|
+
: null;
|
|
11
|
+
}
|