@geoly-ai/social-hub-sdk 0.1.16 → 0.1.18
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/index.d.ts +403 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +196 -0
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +144 -0
- package/dist/index.test.js.map +1 -1
- package/dist/public-reddit.test.d.ts +2 -0
- package/dist/public-reddit.test.d.ts.map +1 -0
- package/dist/public-reddit.test.js +132 -0
- package/dist/public-reddit.test.js.map +1 -0
- package/dist/subreddit-restrictions.d.ts +234 -0
- package/dist/subreddit-restrictions.d.ts.map +1 -0
- package/dist/subreddit-restrictions.js +41 -0
- package/dist/subreddit-restrictions.js.map +1 -0
- package/dist/subreddit-restrictions.test.d.ts +2 -0
- package/dist/subreddit-restrictions.test.d.ts.map +1 -0
- package/dist/subreddit-restrictions.test.js +226 -0
- package/dist/subreddit-restrictions.test.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ConfirmSubredditRestrictionInput, CreateSubredditRestrictionInput, ListSubredditRestrictionsParams, ListSubredditRestrictionsResponse, OpsBlockedJobAck, OpsBlockedReceipt, ReportSubredditRestrictionInput, ReportSubredditRestrictionResponse, RevokeSubredditRestrictionInput, SubredditRestriction, SubredditRestrictionCheckResult, SubredditRestrictionFanoutParams, SubredditRestrictionFanoutResponse } from "./subreddit-restrictions.js";
|
|
2
|
+
export * from "./subreddit-restrictions.js";
|
|
1
3
|
/**
|
|
2
4
|
* 「返回了不完整结果、但看起来像完整的」这一族缺陷的统一探针。
|
|
3
5
|
*
|
|
@@ -196,6 +198,8 @@ export type ListRedditPostSnapshotsParams = {
|
|
|
196
198
|
draftStatus?: string;
|
|
197
199
|
postType?: string;
|
|
198
200
|
repostType?: string;
|
|
201
|
+
/** 账号类型:`internal` / `external`,可逗号分隔;proxy / 海外兼职 / 未知 / 空值在选了任一项时不命中。 */
|
|
202
|
+
accountType?: string;
|
|
199
203
|
containsBrandKeyword?: "true" | "false" | "unset";
|
|
200
204
|
primaryProduct?: string;
|
|
201
205
|
/**
|
|
@@ -221,6 +225,8 @@ export type RedditPostSnapshotStatsParams = {
|
|
|
221
225
|
draftStatus?: string;
|
|
222
226
|
postType?: string;
|
|
223
227
|
repostType?: string;
|
|
228
|
+
/** 账号类型:`internal` / `external`,可逗号分隔;proxy / 海外兼职 / 未知 / 空值在选了任一项时不命中。 */
|
|
229
|
+
accountType?: string;
|
|
224
230
|
containsBrandKeyword?: "true" | "false" | "unset";
|
|
225
231
|
primaryProduct?: string;
|
|
226
232
|
/** 序列号闭区间(与列表同口径)。 */
|
|
@@ -267,6 +273,15 @@ export type AccountPoolsResponse = {
|
|
|
267
273
|
personaPools?: unknown;
|
|
268
274
|
systemPools?: unknown;
|
|
269
275
|
fallback?: unknown;
|
|
276
|
+
/**
|
|
277
|
+
* 分页方案 B8b:本次生效的 limit / 返回条数 / 是否被截断(配额、limit 或单 key 行数上限)。
|
|
278
|
+
* 该端点没有 offset。配额 / limit 截断可调大 limit 或收窄 industry/tier;单 key 行数上限是
|
|
279
|
+
* 上游固定帽,调 limit 补不全,只能收窄 industry 或人工处理。
|
|
280
|
+
* 旧服务端不返回这三个字段。
|
|
281
|
+
*/
|
|
282
|
+
selectionLimit?: number;
|
|
283
|
+
returned?: number;
|
|
284
|
+
truncated?: boolean;
|
|
270
285
|
};
|
|
271
286
|
export type DeviceCodeResponse = {
|
|
272
287
|
device_code: string;
|
|
@@ -382,6 +397,113 @@ export type ContentReviewRequestInput = {
|
|
|
382
397
|
/** 第几次送审;服务端强制上限 2(防重写循环)。 */
|
|
383
398
|
attempt?: 1 | 2;
|
|
384
399
|
traceId?: string;
|
|
400
|
+
} & ReviewScopeDeclaration;
|
|
401
|
+
/**
|
|
402
|
+
* ── Aporro Native Copy:四象限声明 / 逐稿 Card / acceptance 回执(手抄镜像)──
|
|
403
|
+
*
|
|
404
|
+
* 🔴 SDK **不能** re-export contracts(contracts 是 `private: true`,直接引用会生成
|
|
405
|
+
* 消费者装不上的 `.d.ts`),所以这组类型是手抄的,真源在
|
|
406
|
+
* `packages/contracts/src/review-scope.ts` 与 `knowledge-boundary.ts`。
|
|
407
|
+
* 手抄就会漂移 —— `index.test.ts` 里有对应的 `expectTypeOf` 编译期锁。
|
|
408
|
+
*
|
|
409
|
+
* 线上请求体一直是**原样透传**的(服务端 zod 校验);补这组类型之前,TS 调用方
|
|
410
|
+
* 传这几个字段会在编译期就被 SDK 自己的类型拦下 —— 能力在服务端,SDK 这层把门关上了。
|
|
411
|
+
*/
|
|
412
|
+
export type ReviewAccountBinding = "account_bound" | "persona_less";
|
|
413
|
+
export type ReviewBrandTreatment = "managed_brand" | "organic";
|
|
414
|
+
export type ReviewScopeSource = "declared" | "legacy_derived";
|
|
415
|
+
export type ReviewBrandResolutionStatus = "resolved" | "none" | "unresolved";
|
|
416
|
+
export type ReviewAcceptanceProfile = "default" | "native_copy";
|
|
417
|
+
/** 调用方**声明**的象限(意图,不是事实)。 */
|
|
418
|
+
export type ReviewRequestedScope = {
|
|
419
|
+
accountBinding: ReviewAccountBinding;
|
|
420
|
+
brandTreatment: ReviewBrandTreatment;
|
|
421
|
+
};
|
|
422
|
+
/** 服务端解析后的权威象限 + 可用性事实。 */
|
|
423
|
+
export type ReviewResolvedScope = {
|
|
424
|
+
accountBinding: ReviewAccountBinding;
|
|
425
|
+
brandTreatment: ReviewBrandTreatment;
|
|
426
|
+
/** ⚠️ `legacy_derived` 不满足 Native Copy profile,也不满足发布 gate。 */
|
|
427
|
+
scopeSource: ReviewScopeSource;
|
|
428
|
+
/** `unresolved` 是覆盖态:声明 organic 却识别到已登记品牌 → 转人工,不豁免。 */
|
|
429
|
+
brandResolutionStatus: ReviewBrandResolutionStatus;
|
|
430
|
+
brandResolutionDetail: {
|
|
431
|
+
detectedBrandId: string | null;
|
|
432
|
+
detectedBrandKey: string | null;
|
|
433
|
+
reason: string;
|
|
434
|
+
resolverVersion: string;
|
|
435
|
+
} | null;
|
|
436
|
+
personaVoiceEvidenceAvailable: boolean;
|
|
437
|
+
knowledgeContextAvailable: boolean;
|
|
438
|
+
rulesEvidenceAvailable: boolean;
|
|
439
|
+
styleProfileAvailable: boolean;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* 逐稿知识边界(Persona Card)。服务端内容寻址后固化,worker 发布前复审时完整恢复。
|
|
443
|
+
* ⚠️ 当前 **不影响 verdict**:`knowledge_boundary_consistency` 维度尚未激活
|
|
444
|
+
* (方案块 2a 口径下的 v5 原子提交),本字段现阶段只留痕、只决定 Gate 0 是否齐备。
|
|
445
|
+
*/
|
|
446
|
+
export type KnowledgeBoundaryContextInput = {
|
|
447
|
+
schemaVersion: 1;
|
|
448
|
+
knowledgeAccess: "research" | "owned" | "used" | "observed" | "supplied_by_brand";
|
|
449
|
+
/** 最多 4 项。 */
|
|
450
|
+
permittedExperienceClaims: Array<"ownership" | "delivery" | "wear" | "service">;
|
|
451
|
+
postingWhy: string;
|
|
452
|
+
knows: string[];
|
|
453
|
+
doesNotKnow: string[];
|
|
454
|
+
attentionFocus?: string;
|
|
455
|
+
questionIntent?: string;
|
|
456
|
+
permittedFactVersionIds?: string[];
|
|
457
|
+
archetypeLabels?: string[];
|
|
458
|
+
};
|
|
459
|
+
export type KnowledgeContextRef = {
|
|
460
|
+
id: string;
|
|
461
|
+
hash: string;
|
|
462
|
+
schemaVersion: number;
|
|
463
|
+
};
|
|
464
|
+
/** 本次生效的 acceptance profile(可能被降级,原因在 downgradedReason)。 */
|
|
465
|
+
export type ResolvedAcceptanceProfile = {
|
|
466
|
+
profile: ReviewAcceptanceProfile;
|
|
467
|
+
policyVersion: string;
|
|
468
|
+
/** 非 null = 请求了 native_copy 但被降级(`legacy_derived_scope` / `incomplete_gate0`)。 */
|
|
469
|
+
downgradedReason: string | null;
|
|
470
|
+
};
|
|
471
|
+
export type ReviewProfileVerdictDetail = {
|
|
472
|
+
profile: ReviewAcceptanceProfile;
|
|
473
|
+
policyVersion: string;
|
|
474
|
+
verdict: "pass" | "revise" | "block" | "required_missing" | "not_applicable";
|
|
475
|
+
findings: Array<{
|
|
476
|
+
rule: string;
|
|
477
|
+
dimension: string | null;
|
|
478
|
+
threshold: number | null;
|
|
479
|
+
actual: number | null;
|
|
480
|
+
detail: string | null;
|
|
481
|
+
}>;
|
|
482
|
+
missingGateItems: string[];
|
|
483
|
+
};
|
|
484
|
+
/**
|
|
485
|
+
* 审核响应里的 Aporro 回执(帖/评共用)。全部可选:旧 pod / 旧 engine 下服务端会
|
|
486
|
+
* fail-closed **省略**它们,调用方应把「字段不在」读成「没有这项能力」,⛔ 不是「通过」。
|
|
487
|
+
*/
|
|
488
|
+
export type ReviewScopeReceipt = {
|
|
489
|
+
resolvedScope?: ReviewResolvedScope;
|
|
490
|
+
capabilities?: string[];
|
|
491
|
+
knowledgeContextRef?: KnowledgeContextRef | null;
|
|
492
|
+
resolvedAcceptanceProfile?: ResolvedAcceptanceProfile;
|
|
493
|
+
profileVerdictDetail?: ReviewProfileVerdictDetail | null;
|
|
494
|
+
};
|
|
495
|
+
/** 审核请求里的 Aporro 声明字段(帖/评共用)。 */
|
|
496
|
+
export type ReviewScopeDeclaration = {
|
|
497
|
+
requestedScope?: ReviewRequestedScope;
|
|
498
|
+
/**
|
|
499
|
+
* ⚠️ 两类入口约束**不同**(Codex 块 5 P1 纠正了我原来写的「需同时声明」):
|
|
500
|
+
* - 同步 `postReview` / `contentReview`:三个字段各自可选,不要求成对;只传 Card
|
|
501
|
+
* 不传 requestedScope 时服务端照收,按 `legacy_derived` 象限审(不满足 native_copy)。
|
|
502
|
+
* - 异步 `createReviewTarget`:Card 与 requestedAcceptanceProfile **必须**伴随
|
|
503
|
+
* requestedScope,否则 400 —— 因为只有声明分支会被固化,不拦就是「接受后丢数据」。
|
|
504
|
+
*/
|
|
505
|
+
knowledgeContext?: KnowledgeBoundaryContextInput;
|
|
506
|
+
requestedAcceptanceProfile?: ReviewAcceptanceProfile;
|
|
385
507
|
};
|
|
386
508
|
export type ContentReviewResponse = {
|
|
387
509
|
reviewId: string;
|
|
@@ -406,7 +528,7 @@ export type ContentReviewResponse = {
|
|
|
406
528
|
thresholdSnapshot: Record<string, unknown>;
|
|
407
529
|
latencyMs: number;
|
|
408
530
|
degradedReason: string | null;
|
|
409
|
-
};
|
|
531
|
+
} & ReviewScopeReceipt;
|
|
410
532
|
/** 审核目标状态(mirrors contracts REVIEW_TARGET_STATUSES;SDK 不 hard-dep contracts)。 */
|
|
411
533
|
export type ReviewTargetStatusLike = "pending" | "running" | "passed" | "needs_revision" | "blocked" | "degraded" | "superseded";
|
|
412
534
|
/**
|
|
@@ -459,10 +581,11 @@ export type CreateReviewTargetBody = {
|
|
|
459
581
|
subject: {
|
|
460
582
|
title?: string;
|
|
461
583
|
body: string;
|
|
584
|
+
/** ⚠️ Gate 0 的版规证据读的是这里的 `subredditRules`(worker 重建请求也读这个位置)。 */
|
|
462
585
|
threadContext?: Record<string, unknown>;
|
|
463
586
|
subreddit?: string;
|
|
464
587
|
};
|
|
465
|
-
};
|
|
588
|
+
} & ReviewScopeDeclaration;
|
|
466
589
|
export type CommentDraftStatusLike = "draft" | "scheduled" | "approved" | "archived" | "published";
|
|
467
590
|
/**
|
|
468
591
|
* 评论审核语境快照(mirrors contracts commentDraftThreadContextSchema;严格对象——
|
|
@@ -1071,6 +1194,188 @@ export type EnableSubredditMonitorBody = {
|
|
|
1071
1194
|
watchlistId: string;
|
|
1072
1195
|
fetchLimit?: number;
|
|
1073
1196
|
};
|
|
1197
|
+
/**
|
|
1198
|
+
* 监听配置更新 body。
|
|
1199
|
+
*
|
|
1200
|
+
* 🔴 **没有 `enabled`,也不许加**:改配置绝不隐式改启停 —— 启停走
|
|
1201
|
+
* `enableSubredditMonitor`(启用)与 `disableSubredditMonitor`(软停)两个显式入口。
|
|
1202
|
+
* 🔴 **没有 `sort`**:DDL 的 CHECK 只允许 `'new'` 一个值,加了就是「改了就 400」的面。
|
|
1203
|
+
*/
|
|
1204
|
+
export type UpdateSubredditMonitorConfigBody = {
|
|
1205
|
+
/**
|
|
1206
|
+
* 单页抓取条数上限,1–100(与 `EnableSubredditMonitorBody` 同一套边界)。
|
|
1207
|
+
*
|
|
1208
|
+
* 🔴 **必填,⛔ 不要写成可选。** 服务端 schema 要求「至少给一个可更新字段」,
|
|
1209
|
+
* 而当前可更新字段只有它一个 —— 声明成可选会让 `updateSubredditMonitorConfig(id, {})`
|
|
1210
|
+
* 通过类型检查、运行时必然 400。将来真的加了第二个可更新字段,再把这里
|
|
1211
|
+
* 改成「二选一」的联合类型。
|
|
1212
|
+
*/
|
|
1213
|
+
fetchLimit: number;
|
|
1214
|
+
};
|
|
1215
|
+
/** 公开库端点前缀(供应商无关)。 */
|
|
1216
|
+
export declare const PUBLIC_REDDIT_BASE_PATH = "/v1/system/public-reddit";
|
|
1217
|
+
export declare const PUBLIC_REDDIT_PATHS: {
|
|
1218
|
+
readonly communities: "/v1/system/public-reddit/communities";
|
|
1219
|
+
readonly posts: "/v1/system/public-reddit/posts";
|
|
1220
|
+
readonly postCounts: "/v1/system/public-reddit/post-counts";
|
|
1221
|
+
readonly status: "/v1/system/public-reddit/status";
|
|
1222
|
+
};
|
|
1223
|
+
/**
|
|
1224
|
+
* 公开库错误码(服务端 `error.code`)。🔴 `DISABLED` / `POLICY_DENIED` / `AUTH_FAILED` 等
|
|
1225
|
+
* 都是「读不到」而**不是**「没有数据」,调用方绝不能把它们当成空结果。
|
|
1226
|
+
*/
|
|
1227
|
+
export declare const PUBLIC_REDDIT_ERROR_CODES: {
|
|
1228
|
+
readonly DISABLED: "PUBLIC_REDDIT_DISABLED";
|
|
1229
|
+
readonly BUDGET_EXHAUSTED: "PUBLIC_REDDIT_BUDGET_EXHAUSTED";
|
|
1230
|
+
readonly DEGRADED: "PUBLIC_REDDIT_DEGRADED";
|
|
1231
|
+
readonly COUNT_TIMEOUT: "PUBLIC_REDDIT_COUNT_TIMEOUT";
|
|
1232
|
+
readonly RATE_LIMITED: "PUBLIC_REDDIT_RATE_LIMITED";
|
|
1233
|
+
readonly AUTH_FAILED: "PUBLIC_REDDIT_AUTH_FAILED";
|
|
1234
|
+
readonly POLICY_DENIED: "PUBLIC_REDDIT_POLICY_DENIED";
|
|
1235
|
+
readonly COMMUNITY_NOT_AVAILABLE: "PUBLIC_REDDIT_COMMUNITY_NOT_AVAILABLE";
|
|
1236
|
+
readonly SCOPE_TOO_LARGE: "PUBLIC_REDDIT_SCOPE_TOO_LARGE";
|
|
1237
|
+
readonly QUERY_REQUIRED: "PUBLIC_REDDIT_QUERY_REQUIRED";
|
|
1238
|
+
readonly INVALID_REQUEST: "PUBLIC_REDDIT_INVALID_REQUEST";
|
|
1239
|
+
readonly INVALID_WINDOW: "PUBLIC_REDDIT_INVALID_WINDOW";
|
|
1240
|
+
readonly INVALID_COMMUNITY: "PUBLIC_REDDIT_INVALID_COMMUNITY";
|
|
1241
|
+
readonly CURSOR_MISMATCH: "PUBLIC_REDDIT_CURSOR_MISMATCH";
|
|
1242
|
+
readonly CURSOR_RESET: "PUBLIC_REDDIT_CURSOR_RESET";
|
|
1243
|
+
readonly UNAVAILABLE: "PUBLIC_REDDIT_UNAVAILABLE";
|
|
1244
|
+
readonly BAD_UPSTREAM_RESPONSE: "PUBLIC_REDDIT_BAD_UPSTREAM_RESPONSE";
|
|
1245
|
+
};
|
|
1246
|
+
export type PublicRedditNamedWindow = "day" | "week" | "month" | "last_90d" | "last_360d" | "last_full_week";
|
|
1247
|
+
/** 窗口:命名窗口与显式 [from,to) 二选一(服务端校验互斥)。 */
|
|
1248
|
+
export type PublicRedditWindowParams = {
|
|
1249
|
+
window?: PublicRedditNamedWindow;
|
|
1250
|
+
from?: string;
|
|
1251
|
+
to?: string;
|
|
1252
|
+
};
|
|
1253
|
+
export type ListPublicRedditCommunitiesParams = {
|
|
1254
|
+
/** 数组按逗号拼接(与服务端 csv 形状一致)。 */
|
|
1255
|
+
industryKey?: string | string[];
|
|
1256
|
+
tierKey?: string | string[];
|
|
1257
|
+
poolKind?: string | string[];
|
|
1258
|
+
hasProfile?: boolean;
|
|
1259
|
+
limit?: number;
|
|
1260
|
+
/** Hub 令牌:原样回传上一页的 nextCursor。 */
|
|
1261
|
+
cursor?: string;
|
|
1262
|
+
};
|
|
1263
|
+
export type SearchPublicRedditPostsParams = PublicRedditWindowParams & {
|
|
1264
|
+
/** 必填、≤20 个;数组按逗号拼接。 */
|
|
1265
|
+
subreddit: string | string[];
|
|
1266
|
+
/** ⚠️ 会发往外部数据服务。 */
|
|
1267
|
+
query?: string;
|
|
1268
|
+
sort?: "created_at_desc";
|
|
1269
|
+
limit?: number;
|
|
1270
|
+
cursor?: string;
|
|
1271
|
+
includeBody?: boolean;
|
|
1272
|
+
};
|
|
1273
|
+
export type CountPublicRedditPostsBody = PublicRedditWindowParams & {
|
|
1274
|
+
subreddits: string[];
|
|
1275
|
+
/** 必填;⚠️ 会发往外部数据服务。 */
|
|
1276
|
+
query: string;
|
|
1277
|
+
artifactType?: "post" | "comment";
|
|
1278
|
+
};
|
|
1279
|
+
export type PublicRedditSourceMeta = {
|
|
1280
|
+
provider: "cyberredd";
|
|
1281
|
+
mode: "off" | "shadow" | "on";
|
|
1282
|
+
dataCutoff: string | null;
|
|
1283
|
+
resolvedWindow: {
|
|
1284
|
+
from: string;
|
|
1285
|
+
to: string;
|
|
1286
|
+
name: string | null;
|
|
1287
|
+
} | null;
|
|
1288
|
+
fetchedAt: string;
|
|
1289
|
+
cached: boolean;
|
|
1290
|
+
excludedCommunities: Array<{
|
|
1291
|
+
communityId: string;
|
|
1292
|
+
reason: string;
|
|
1293
|
+
}>;
|
|
1294
|
+
warnings: Array<{
|
|
1295
|
+
code: string;
|
|
1296
|
+
message?: string;
|
|
1297
|
+
}>;
|
|
1298
|
+
};
|
|
1299
|
+
export type PublicRedditCommunity = {
|
|
1300
|
+
communityId: string;
|
|
1301
|
+
name: string | null;
|
|
1302
|
+
url: string | null;
|
|
1303
|
+
industryKeys: string[] | null;
|
|
1304
|
+
tierKey: string | null;
|
|
1305
|
+
poolKind: string | null;
|
|
1306
|
+
hasProfile: boolean | null;
|
|
1307
|
+
dataCutoff: string | null;
|
|
1308
|
+
};
|
|
1309
|
+
export type PublicRedditPost = {
|
|
1310
|
+
upstreamId: string;
|
|
1311
|
+
redditPostId: string | null;
|
|
1312
|
+
communityId: string;
|
|
1313
|
+
title: string | null;
|
|
1314
|
+
bodyExcerpt: string | null;
|
|
1315
|
+
body?: string | null;
|
|
1316
|
+
authorName: string | null;
|
|
1317
|
+
createdAt: string | null;
|
|
1318
|
+
url: string | null;
|
|
1319
|
+
contentState: string | null;
|
|
1320
|
+
observationStatus: string | null;
|
|
1321
|
+
intent: string | null;
|
|
1322
|
+
sentiment: string | null;
|
|
1323
|
+
labelVocabulary: "cyberredd_v1";
|
|
1324
|
+
};
|
|
1325
|
+
export type ListPublicRedditCommunitiesResponse = {
|
|
1326
|
+
items: PublicRedditCommunity[];
|
|
1327
|
+
nextCursor: string | null;
|
|
1328
|
+
source: PublicRedditSourceMeta;
|
|
1329
|
+
};
|
|
1330
|
+
export type SearchPublicRedditPostsResponse = {
|
|
1331
|
+
items: PublicRedditPost[];
|
|
1332
|
+
nextCursor: string | null;
|
|
1333
|
+
source: PublicRedditSourceMeta;
|
|
1334
|
+
};
|
|
1335
|
+
export type CountPublicRedditPostsResponse = {
|
|
1336
|
+
artifactType: "post" | "comment";
|
|
1337
|
+
window: {
|
|
1338
|
+
from: string;
|
|
1339
|
+
to: string;
|
|
1340
|
+
name: string | null;
|
|
1341
|
+
};
|
|
1342
|
+
exact: boolean;
|
|
1343
|
+
/** exact=false 时为 null,绝不是部分和。 */
|
|
1344
|
+
total: number | null;
|
|
1345
|
+
communities: Array<{
|
|
1346
|
+
communityId: string;
|
|
1347
|
+
status: string;
|
|
1348
|
+
count: number | null;
|
|
1349
|
+
dataCutoff: string | null;
|
|
1350
|
+
windowCovered: boolean | null;
|
|
1351
|
+
}>;
|
|
1352
|
+
source: PublicRedditSourceMeta;
|
|
1353
|
+
};
|
|
1354
|
+
export type PublicRedditStatus = {
|
|
1355
|
+
mode: "off" | "shadow" | "on";
|
|
1356
|
+
capabilities: Array<"catalog" | "post_search" | "post_count">;
|
|
1357
|
+
configured: boolean;
|
|
1358
|
+
keyFingerprint: string | null;
|
|
1359
|
+
keyExpiresAt: string | null;
|
|
1360
|
+
credential: Record<string, unknown>;
|
|
1361
|
+
breaker: {
|
|
1362
|
+
state: string;
|
|
1363
|
+
openedAt: string | null;
|
|
1364
|
+
};
|
|
1365
|
+
budget: {
|
|
1366
|
+
windowSeconds: number;
|
|
1367
|
+
limit: number;
|
|
1368
|
+
used: number;
|
|
1369
|
+
};
|
|
1370
|
+
catalogIndex: {
|
|
1371
|
+
size: number | null;
|
|
1372
|
+
refreshedAt: string | null;
|
|
1373
|
+
};
|
|
1374
|
+
lastError: {
|
|
1375
|
+
code: string;
|
|
1376
|
+
at: string;
|
|
1377
|
+
} | null;
|
|
1378
|
+
};
|
|
1074
1379
|
export type ListHotPostsParams = {
|
|
1075
1380
|
limit?: number;
|
|
1076
1381
|
offset?: number;
|
|
@@ -2595,6 +2900,9 @@ export declare class SocialHubClient {
|
|
|
2595
2900
|
items: unknown[];
|
|
2596
2901
|
total: number;
|
|
2597
2902
|
}>;
|
|
2903
|
+
/**
|
|
2904
|
+
* 评论样本列表。⚠️ 只含 Hub 内现有评论样本(非归档,约 5.7 万条);历史/归档评论已迁至 CyberRedd。
|
|
2905
|
+
*/
|
|
2598
2906
|
listRedditCommentSamples(params?: {
|
|
2599
2907
|
postId?: string;
|
|
2600
2908
|
subreddit?: string;
|
|
@@ -2624,6 +2932,7 @@ export declare class SocialHubClient {
|
|
|
2624
2932
|
* (totalRelation=unavailable)。
|
|
2625
2933
|
* ⚠️ 无过滤时是全表精确 count,属昂贵读——基线用途,**禁止轮询**。
|
|
2626
2934
|
* 口径是库内 reddit_comment_samples 行数,不是 Reddit 线程真实评论总数。
|
|
2935
|
+
* ⚠️ 只含 Hub 内现有评论样本(非归档,约 5.7 万条);历史/归档评论已迁至 CyberRedd。
|
|
2627
2936
|
*/
|
|
2628
2937
|
countRedditCommentSamples(params?: {
|
|
2629
2938
|
postId?: string;
|
|
@@ -2784,6 +3093,17 @@ export declare class SocialHubClient {
|
|
|
2784
3093
|
* observation ledger 因此保留,重启后已报告过的帖子不会重复报告。
|
|
2785
3094
|
*/
|
|
2786
3095
|
enableSubredditMonitor(body: EnableSubredditMonitorBody): Promise<SubredditMonitorConfig>;
|
|
3096
|
+
/**
|
|
3097
|
+
* **只改监听配置,⛔ 不碰启停。**
|
|
3098
|
+
*
|
|
3099
|
+
* 🔴 与 {@link SocialOpsHubClient.enableSubredditMonitor} 的区别就是全部要点:
|
|
3100
|
+
* 那个 `POST` 是 upsert,`DO UPDATE` 里写死 `enabled = true`,所以在一个**被软停**的
|
|
3101
|
+
* 监听上用它改 `fetchLimit` 会把监听静默重新启用。本方法背后的 SQL 里不出现
|
|
3102
|
+
* `enabled` 列,改完启停状态原样不动。
|
|
3103
|
+
*
|
|
3104
|
+
* ⚠️ **不 upsert**:该 watchlist 没配置过监听 -> 404(不会被悄悄创建成监听)。
|
|
3105
|
+
*/
|
|
3106
|
+
updateSubredditMonitorConfig(watchlistId: string, body: UpdateSubredditMonitorConfigBody): Promise<SubredditMonitorConfig>;
|
|
2787
3107
|
/**
|
|
2788
3108
|
* 停止监听:DELETE 语义但服务端做**软停**(enabled=false),不删 observation ledger。
|
|
2789
3109
|
* 幂等 —— 本来就没在监听时返回 `{ ok: true, updated: false }`,不是 404。
|
|
@@ -3043,6 +3363,17 @@ export declare class SocialHubClient {
|
|
|
3043
3363
|
}>;
|
|
3044
3364
|
}>;
|
|
3045
3365
|
exportHotPostsCsv(params?: ListHotPostsParams): Promise<string>;
|
|
3366
|
+
/** GET /v1/system/public-reddit/communities — 公开库社区目录(只读;系统级,无 team 前缀)。 */
|
|
3367
|
+
listPublicRedditCommunities(params?: ListPublicRedditCommunitiesParams): Promise<ListPublicRedditCommunitiesResponse>;
|
|
3368
|
+
/** GET /v1/system/public-reddit/posts — 公开库帖子检索(必须带板块;query 会发往外部数据服务)。 */
|
|
3369
|
+
searchPublicRedditPosts(params: SearchPublicRedditPostsParams): Promise<SearchPublicRedditPostsResponse>;
|
|
3370
|
+
/**
|
|
3371
|
+
* POST /v1/system/public-reddit/post-counts — 公开库计数。
|
|
3372
|
+
* ⚠️ 昂贵读,禁止轮询;必须带 query;query 会发往外部数据服务。
|
|
3373
|
+
*/
|
|
3374
|
+
countPublicRedditPosts(body: CountPublicRedditPostsBody): Promise<CountPublicRedditPostsResponse>;
|
|
3375
|
+
/** GET /v1/system/public-reddit/status — 开关/熔断/预算(仅 unrestricted admin)。 */
|
|
3376
|
+
getPublicRedditStatus(): Promise<PublicRedditStatus>;
|
|
3046
3377
|
listKolIntents(params?: ListKolIntentsParams): Promise<{
|
|
3047
3378
|
items: unknown[];
|
|
3048
3379
|
total: number;
|
|
@@ -3276,6 +3607,9 @@ export declare class SocialHubClient {
|
|
|
3276
3607
|
calendarEntryId?: string;
|
|
3277
3608
|
redditPostSnapshotId?: string;
|
|
3278
3609
|
payload?: Record<string, unknown>;
|
|
3610
|
+
/** execution fencing token pair(认领时拿到的;两者须同时给出或同时省略)。 */
|
|
3611
|
+
executionGeneration?: number;
|
|
3612
|
+
executionId?: string;
|
|
3279
3613
|
}): Promise<{
|
|
3280
3614
|
ok: boolean;
|
|
3281
3615
|
jobId: string;
|
|
@@ -3284,33 +3618,39 @@ export declare class SocialHubClient {
|
|
|
3284
3618
|
alreadyCompleted?: boolean;
|
|
3285
3619
|
trace: Record<string, unknown>;
|
|
3286
3620
|
updated: Record<string, unknown>;
|
|
3287
|
-
}>;
|
|
3621
|
+
} | OpsBlockedReceipt>;
|
|
3288
3622
|
opsFail(teamId: string, body: {
|
|
3289
3623
|
agentId: string;
|
|
3290
3624
|
jobId: string;
|
|
3291
3625
|
reason: string;
|
|
3292
3626
|
message?: string;
|
|
3293
3627
|
payload?: Record<string, unknown>;
|
|
3628
|
+
/** execution fencing token pair(认领时拿到的;两者须同时给出或同时省略)。 */
|
|
3629
|
+
executionGeneration?: number;
|
|
3630
|
+
executionId?: string;
|
|
3294
3631
|
}): Promise<{
|
|
3295
3632
|
ok: boolean;
|
|
3296
3633
|
jobId: string;
|
|
3297
3634
|
status: string;
|
|
3298
3635
|
/** True when the job was already in this terminal — idempotent retry. */
|
|
3299
3636
|
alreadyTerminal?: boolean;
|
|
3300
|
-
}>;
|
|
3637
|
+
} | OpsBlockedJobAck>;
|
|
3301
3638
|
opsSkip(teamId: string, body: {
|
|
3302
3639
|
agentId: string;
|
|
3303
3640
|
jobId: string;
|
|
3304
3641
|
reason: string;
|
|
3305
3642
|
message?: string;
|
|
3306
3643
|
payload?: Record<string, unknown>;
|
|
3644
|
+
/** execution fencing token pair(认领时拿到的;两者须同时给出或同时省略)。 */
|
|
3645
|
+
executionGeneration?: number;
|
|
3646
|
+
executionId?: string;
|
|
3307
3647
|
}): Promise<{
|
|
3308
3648
|
ok: boolean;
|
|
3309
3649
|
jobId: string;
|
|
3310
3650
|
status: string;
|
|
3311
3651
|
/** True when the job was already in this terminal — idempotent retry. */
|
|
3312
3652
|
alreadyTerminal?: boolean;
|
|
3313
|
-
}>;
|
|
3653
|
+
} | OpsBlockedJobAck>;
|
|
3314
3654
|
/**
|
|
3315
3655
|
* 评论内容复审:独立 LLM 六维评审+服务端权威计分。
|
|
3316
3656
|
* executionStatus=degraded 时 verdict 不可作为权威判定,调用方应降级本地自审。
|
|
@@ -3342,7 +3682,7 @@ export declare class SocialHubClient {
|
|
|
3342
3682
|
thresholdSnapshot: Record<string, unknown>;
|
|
3343
3683
|
latencyMs: number;
|
|
3344
3684
|
degradedReason: string | null;
|
|
3345
|
-
}>;
|
|
3685
|
+
} & ReviewScopeReceipt>;
|
|
3346
3686
|
/** 互动时序 P2:批量调度上下文(team 级,best_effort 一致性,keyset 分页)。 */
|
|
3347
3687
|
getInteractionScheduleContext(teamId: string, params?: {
|
|
3348
3688
|
limit?: number;
|
|
@@ -3373,6 +3713,16 @@ export declare class SocialHubClient {
|
|
|
3373
3713
|
systemPools?: unknown;
|
|
3374
3714
|
fallback?: unknown;
|
|
3375
3715
|
exhaustion?: SubredditCandidatesExhaustion;
|
|
3716
|
+
/**
|
|
3717
|
+
* 分页方案 B8b:本次生效的 limit / 返回条数 / 是否被截断(配额、limit 或单 key 行数上限)。
|
|
3718
|
+
* 该端点没有 offset。配额 / limit 截断可调大 limit 或收窄 industry/tier;单 key 行数上限是
|
|
3719
|
+
* 上游固定帽,调 limit 补不全,只能收窄 industry 或人工处理。评论动作下配额阶段尚未过冷却 /
|
|
3720
|
+
* affinity,`truncated: true` 可能偏多报;`false` 是精确的「没被截」。
|
|
3721
|
+
* 旧服务端不返回这三个字段。
|
|
3722
|
+
*/
|
|
3723
|
+
selectionLimit?: number;
|
|
3724
|
+
returned?: number;
|
|
3725
|
+
truncated?: boolean;
|
|
3376
3726
|
}>;
|
|
3377
3727
|
listSubredditPostAnnotations(teamId: string, params?: {
|
|
3378
3728
|
subreddit?: string;
|
|
@@ -3896,7 +4246,20 @@ export declare class SocialHubClient {
|
|
|
3896
4246
|
}): Promise<{
|
|
3897
4247
|
purpose: string;
|
|
3898
4248
|
activeSpecId: string | null;
|
|
4249
|
+
/**
|
|
4250
|
+
* ⚠️ 本页条数,**不是总数**。保留仅为兼容,与 `returned` 恒相等;新代码读 `returned`。
|
|
4251
|
+
* @deprecated 用 `returned`。
|
|
4252
|
+
*/
|
|
3899
4253
|
count: number;
|
|
4254
|
+
/** 本页实际返回的条数。 */
|
|
4255
|
+
returned: number;
|
|
4256
|
+
/** 本次生效的条数上限(请求的 limit,缺省 20)。 */
|
|
4257
|
+
selectionLimit: number;
|
|
4258
|
+
/**
|
|
4259
|
+
* 是否还有更多未返回的 run(服务端多取一条哨兵判定,精确)。
|
|
4260
|
+
* 这是 recent 投影,**没有分页** —— 为 true 时请调大 limit 或改用精确查询,⛔ 不要自拼 offset。
|
|
4261
|
+
*/
|
|
4262
|
+
truncated: boolean;
|
|
3900
4263
|
runs: unknown[];
|
|
3901
4264
|
}>;
|
|
3902
4265
|
/**
|
|
@@ -4373,6 +4736,40 @@ export declare class SocialHubClient {
|
|
|
4373
4736
|
availability: string;
|
|
4374
4737
|
availabilityCheckedAt: string;
|
|
4375
4738
|
}>;
|
|
4739
|
+
/** GET /v1/system/subreddit-restrictions — 列表(state 多值、updatedSince 增量拉取)。 */
|
|
4740
|
+
listSubredditRestrictions(params?: ListSubredditRestrictionsParams): Promise<ListSubredditRestrictionsResponse>;
|
|
4741
|
+
/** GET /v1/system/subreddit-restrictions/:id — 单条(含全量 evidence)。 */
|
|
4742
|
+
getSubredditRestriction(id: string): Promise<SubredditRestriction>;
|
|
4743
|
+
/** POST /v1/system/subreddit-restrictions — 新建(已有活跃限制 → 409 RESTRICTION_EXISTS)。 */
|
|
4744
|
+
createSubredditRestriction(body: CreateSubredditRestrictionInput): Promise<SubredditRestriction>;
|
|
4745
|
+
/** POST .../:id/confirm — provisional / verification_overdue → confirmed(409 VERSION_MISMATCH / INVALID_STATE)。 */
|
|
4746
|
+
confirmSubredditRestriction(id: string, body?: ConfirmSubredditRestrictionInput): Promise<SubredditRestriction>;
|
|
4747
|
+
/** POST .../:id/revoke — 解封(唯一的解封路径)。 */
|
|
4748
|
+
revokeSubredditRestriction(id: string, body: RevokeSubredditRestrictionInput): Promise<SubredditRestriction>;
|
|
4749
|
+
/** GET .../:id/fanout — 扇出汇总 + 回执明细(阶段 B 之前为空、complete=false)。 */
|
|
4750
|
+
getSubredditRestrictionFanout(id: string, params?: SubredditRestrictionFanoutParams): Promise<SubredditRestrictionFanoutResponse>;
|
|
4751
|
+
/**
|
|
4752
|
+
* GET /v1/teams/:teamId/subreddit-restrictions — team 级只读列表(`compliance:read`,manager 可用)。
|
|
4753
|
+
* 过滤参数与系统级 list 相同,只回证据摘要。运营侧 agent 拉取状态走这个,不走系统级 admin 面。
|
|
4754
|
+
*/
|
|
4755
|
+
listTeamSubredditRestrictions(teamId: string, params?: ListSubredditRestrictionsParams): Promise<ListSubredditRestrictionsResponse>;
|
|
4756
|
+
/**
|
|
4757
|
+
* GET /v1/teams/:teamId/subreddit-restrictions/:id/fanout — 只统计、只返回**本 team** 的回执;
|
|
4758
|
+
* outbox 的 summary / lastError 为 null(跨 team 信息)。complete 仍按全局 outbox 判断。
|
|
4759
|
+
*/
|
|
4760
|
+
getTeamSubredditRestrictionFanout(teamId: string, id: string, params?: Omit<SubredditRestrictionFanoutParams, "teamId">): Promise<SubredditRestrictionFanoutResponse>;
|
|
4761
|
+
/** POST /v1/teams/:teamId/subreddit-restrictions/report — runner 上报(只写 provisional 或 sanction)。 */
|
|
4762
|
+
reportSubredditRestriction(teamId: string, body: ReportSubredditRestrictionInput): Promise<ReportSubredditRestrictionResponse>;
|
|
4763
|
+
/**
|
|
4764
|
+
* GET /v1/teams/:teamId/subreddit-restrictions/check — runner 动手前自查。
|
|
4765
|
+
* 账号可以用 `socialAccountId`(与 contracts 同名)或 `account`(CLI flag 同名)给;两者都给且不同
|
|
4766
|
+
* → 直接抛错,绝不静默丢掉其中一个 —— 丢了账号就只判系统级,会得到假的 `allowed:true`。
|
|
4767
|
+
*/
|
|
4768
|
+
checkSubredditRestriction(teamId: string, params: {
|
|
4769
|
+
subreddit: string;
|
|
4770
|
+
socialAccountId?: string;
|
|
4771
|
+
account?: string;
|
|
4772
|
+
}): Promise<SubredditRestrictionCheckResult>;
|
|
4376
4773
|
}
|
|
4377
4774
|
export type NotificationSubscriptionStatus = "active" | "paused"
|
|
4378
4775
|
/** 游标落后于保留 floor,已无法保证不漏;需人工确认后 reset。 */
|
|
@@ -4978,5 +5375,4 @@ export type CalendarEntryStatus = "draft" | "scheduled" | "exported" | "running"
|
|
|
4978
5375
|
export type ReviewTargetStatus = "pending" | "running" | "passed" | "needs_revision" | "blocked" | "degraded" | "superseded";
|
|
4979
5376
|
/** 契约 `reviewGateStateSchema` 的镜像(日历条目上的审核门投影)。 */
|
|
4980
5377
|
export type ReviewGateState = "passed" | "waiting" | "revision_required" | "blocked" | "stale" | "untracked";
|
|
4981
|
-
export {};
|
|
4982
5378
|
//# sourceMappingURL=index.d.ts.map
|