@geoly-ai/social-hub-sdk 0.0.43 → 0.0.45

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 CHANGED
@@ -193,6 +193,193 @@ export type UpdateContentDraftBody = {
193
193
  /** Optimistic concurrency: last-loaded version; a mismatch is rejected 409. */
194
194
  expectedVersion?: number;
195
195
  };
196
+ /** 审核目标状态(mirrors contracts REVIEW_TARGET_STATUSES;SDK 不 hard-dep contracts)。 */
197
+ export type ReviewTargetStatusLike = "pending" | "running" | "passed" | "needs_revision" | "blocked" | "degraded" | "superseded";
198
+ export type ListReviewTargetsParams = {
199
+ limit?: number;
200
+ offset?: number;
201
+ /** 逗号拼后传服务端;空数组=不过滤。 */
202
+ status?: ReviewTargetStatusLike[];
203
+ contentType?: "post" | "comment";
204
+ };
205
+ /** 建审核目标 body(mirrors contracts createReviewTargetBodySchema;宽松结构由服务端 zod 校验)。 */
206
+ export type CreateReviewTargetBody = {
207
+ sourceKind: "content_draft" | "comment_draft" | "calendar_entry" | "scheduled_job" | "post_performance" | "external_delegated";
208
+ contentType: "post" | "comment";
209
+ deliveryMode: "internal_publish" | "external_delegated";
210
+ reviewLevel: "draft" | "target";
211
+ contentDraftId?: string;
212
+ commentDraftId?: string;
213
+ calendarEntryId?: string;
214
+ scheduledJobId?: string;
215
+ postSnapshotId?: string;
216
+ externalRef?: string;
217
+ socialAccountId?: string;
218
+ subreddit?: string;
219
+ brandId?: string;
220
+ contentVersion: number;
221
+ contentHash: string;
222
+ dedupeKey: string;
223
+ subject: {
224
+ title?: string;
225
+ body: string;
226
+ threadContext?: Record<string, unknown>;
227
+ subreddit?: string;
228
+ };
229
+ };
230
+ export type CommentDraftStatusLike = "draft" | "scheduled" | "approved" | "archived" | "published";
231
+ /**
232
+ * 评论审核语境快照(mirrors contracts commentDraftThreadContextSchema;严格对象——
233
+ * 服务端 `.strict()` 拒未知键)。subredditRules 由服务端注入,勿从客户端提交。
234
+ */
235
+ export type CommentDraftThreadContext = {
236
+ postTitle?: string;
237
+ postBody?: string;
238
+ /** 父评论正文快照(回复场景)。 */
239
+ parentComment?: string;
240
+ /** 线程头部评论样本(有序)。 */
241
+ topComments?: string[];
242
+ subredditToneHint?: string;
243
+ commentType?: "reply" | "top_level";
244
+ };
245
+ export type ListCommentDraftsParams = {
246
+ limit?: number;
247
+ offset?: number;
248
+ /** 逗号拼后传服务端;空数组=不过滤。 */
249
+ brandId?: string[];
250
+ campaignId?: string;
251
+ status?: CommentDraftStatusLike[];
252
+ subreddit?: string;
253
+ search?: string;
254
+ /** 聚合可见团队(跨 team 列表);默认单团队。 */
255
+ aggregateVisibleTeams?: boolean;
256
+ /** 把聚合收窄到指定可见团队(逗号拼);空数组=不收窄。 */
257
+ scopeTeamIds?: string[];
258
+ };
259
+ export type CreateCommentDraftBody = {
260
+ brandId: string;
261
+ campaignId?: string;
262
+ body: string;
263
+ subreddit: string;
264
+ threadPermalink?: string;
265
+ parentCommentId?: string;
266
+ threadContext?: CommentDraftThreadContext;
267
+ };
268
+ export type UpdateCommentDraftBody = {
269
+ body?: string;
270
+ subreddit?: string;
271
+ /** null = 清除(回到未选帖)。 */
272
+ threadPermalink?: string | null;
273
+ parentCommentId?: string | null;
274
+ threadContext?: CommentDraftThreadContext | null;
275
+ /** 仅人工态;scheduled/published 由系统驱动,不可客户端直设。 */
276
+ status?: "draft" | "approved" | "archived";
277
+ /** Optimistic concurrency: last-loaded content version; mismatch → 409. */
278
+ expectedVersion?: number;
279
+ };
280
+ export type ScheduleCommentDraftBody = {
281
+ socialAccountId: string;
282
+ /** ISO datetime。 */
283
+ runAt: string;
284
+ windowMinutes?: number;
285
+ };
286
+ export type DeliveryBundleStatusLike = "open" | "closed" | "cancelled";
287
+ /** 客户面列 bundle:brandId 服务端**必填**(客户按 brand 收窄);SDK 类型强制。 */
288
+ export type ListClientDeliveryBundlesParams = {
289
+ brandId: string;
290
+ status?: DeliveryBundleStatusLike;
291
+ limit?: number;
292
+ offset?: number;
293
+ };
294
+ /** staff 建 bundle。 */
295
+ export type CreateClientDeliveryBundleBody = {
296
+ brandId: string;
297
+ bundleCode: string;
298
+ name: string;
299
+ clientDueAt?: string | null;
300
+ };
301
+ /** staff upsert item(帖/评 + 矩阵规划字段)。 */
302
+ export type UpsertClientDeliveryItemBody = {
303
+ kind: "post" | "comment";
304
+ itemCode: string;
305
+ contentDraftId?: string | null;
306
+ commentDraftId?: string | null;
307
+ ordinal?: number;
308
+ boundProductId?: string | null;
309
+ primaryPostType?: string[] | null;
310
+ writingVariant?: string | null;
311
+ structureFamily?: string | null;
312
+ contentFunction?: string | null;
313
+ functionDetail?: string | null;
314
+ brandEntryMode?: string | null;
315
+ anchorSlot?: string | null;
316
+ mappingRuleId?: string | null;
317
+ vocabularyVersion?: string | null;
318
+ };
319
+ /** staff 送审 revision(note 可选)。 */
320
+ export type SubmitClientDeliveryRevisionBody = {
321
+ note?: string;
322
+ };
323
+ export type ClientDeliveryInventoryStatus = "in_stock" | "low_stock" | "out_of_stock" | "preorder" | "discontinued" | "unknown";
324
+ /** 产品事实版本 body(客户面:正文/draft 字段物理不接受;仅事实)。 */
325
+ export type ClientDeliveryFactVersionBody = {
326
+ positioning?: string | null;
327
+ materials?: string | null;
328
+ priceAmount?: string | null;
329
+ priceCurrency?: string | null;
330
+ inventoryStatus?: ClientDeliveryInventoryStatus | null;
331
+ inventoryAsOf?: string | null;
332
+ shippingDaysMin?: number | null;
333
+ shippingDaysMax?: number | null;
334
+ factsJson?: Record<string, string | number | boolean | null>;
335
+ effectiveAt?: string | null;
336
+ expiresAt?: string | null;
337
+ sourceRef?: string | null;
338
+ };
339
+ /** staff 事实版本 body:额外可指定 provenance(默认 staff)。 */
340
+ export type StaffClientDeliveryFactVersionBody = ClientDeliveryFactVersionBody & {
341
+ provenance?: "client" | "staff" | "import";
342
+ };
343
+ /** staff 建产品身份。 */
344
+ export type CreateClientDeliveryProductBody = {
345
+ brandId: string;
346
+ sku: string;
347
+ brandRegistryId?: string | null;
348
+ modelName?: string | null;
349
+ market?: string | null;
350
+ status?: string;
351
+ };
352
+ /** staff 建品牌内容政策版本。 */
353
+ export type CreateClientDeliveryPolicyVersionBody = {
354
+ brandId: string;
355
+ market?: string | null;
356
+ provenance?: "client" | "staff" | "import";
357
+ policyJson?: Record<string, unknown>;
358
+ effectiveAt?: string | null;
359
+ };
360
+ /** 字段级评论(request-changes 内嵌 / 独立讨论)。 */
361
+ export type ClientDeliveryDecisionComment = {
362
+ fieldKey: string;
363
+ quotedText?: string;
364
+ body: string;
365
+ };
366
+ /** 客户批准(CAS:expectedRevisionHash)。 */
367
+ export type ApproveClientDeliveryRevisionBody = {
368
+ expectedRevisionHash: string;
369
+ note?: string;
370
+ };
371
+ /** 客户请求修改(CAS + 字段级评论,至少一条)。 */
372
+ export type RequestChangesClientDeliveryRevisionBody = {
373
+ expectedRevisionHash: string;
374
+ comments: ClientDeliveryDecisionComment[];
375
+ note?: string;
376
+ };
377
+ /** 客户字段级讨论评论。 */
378
+ export type AddClientDeliveryCommentBody = {
379
+ fieldKey: string;
380
+ quotedText?: string;
381
+ body: string;
382
+ };
196
383
  export type UpdateNotificationChannelBody = {
197
384
  provider?: string;
198
385
  externalId?: string;
@@ -212,6 +399,24 @@ export type ListHotPostsParams = {
212
399
  subreddit?: string;
213
400
  sortBy?: "score" | "comments" | "capturedAt" | "upvoteRatio";
214
401
  };
402
+ /**
403
+ * hot_post 列表每行 enrich 的 content_classification「current proposed」四轴(see contracts
404
+ * HotPostContentClassificationView)。`null` = 无当前 revision 的成功 run(missing/stale/无 active spec)。
405
+ */
406
+ export type HotPostClassification = {
407
+ contentForms: string[];
408
+ intent: string;
409
+ sentiment: string;
410
+ format: string;
411
+ };
412
+ /**
413
+ * listHotPosts 返回的单行(除既有 hot_post 字段外,带 classification enrich;宽松索引签名保留兼容)。
414
+ * classification 为可选:新 SDK 连未升级的旧服务端时该字段可能缺失(滚动升级安全)。
415
+ */
416
+ export type HotPostListItem = Record<string, unknown> & {
417
+ id: string;
418
+ classification?: HotPostClassification | null;
419
+ };
215
420
  export type ListKolIntentsParams = {
216
421
  limit?: number;
217
422
  offset?: number;
@@ -486,6 +691,157 @@ export declare class SocialHubClient {
486
691
  }): Promise<{
487
692
  id: string;
488
693
  }>;
694
+ /**
695
+ * GET /content-review-targets — team-scoped 审核目标列表(status/contentType 过滤 +
696
+ * limit/offset 分页)。status 传数组时按逗号拼(与 commaSeparatedQueryList 契约一致)。
697
+ */
698
+ listReviewTargets(teamId: string, params?: ListReviewTargetsParams | number): Promise<{
699
+ items: unknown[];
700
+ total: number;
701
+ limit: number;
702
+ offset: number;
703
+ }>;
704
+ /** GET /content-review-targets/:id — 审核目标详情(target + 待审正文 + 若有的 review 摘要)。 */
705
+ getReviewTarget(teamId: string, id: string): Promise<unknown>;
706
+ /**
707
+ * POST /content-review-targets — 建 pending 审核目标 + 存待审正文快照(幂等:dedupeKey
708
+ * 命中且 payload 未漂移返既有 target,HTTP 200;新建 201)。body 为完整 createReviewTargetBody。
709
+ */
710
+ createReviewTarget(teamId: string, body: CreateReviewTargetBody): Promise<{
711
+ target: unknown;
712
+ }>;
713
+ /** GET /comment-drafts — team-scoped 评论草稿列表(brand/campaign/status/subreddit/search 过滤 + 分页)。 */
714
+ listCommentDrafts(teamId: string, params?: ListCommentDraftsParams | number): Promise<{
715
+ items: unknown[];
716
+ total: number;
717
+ limit: number;
718
+ offset: number;
719
+ }>;
720
+ /** GET /comment-drafts/:draftId — 单条评论草稿。 */
721
+ getCommentDraft(teamId: string, draftId: string): Promise<unknown>;
722
+ /** POST /comment-drafts — 建评论草稿(返回 { id })。 */
723
+ createCommentDraft(teamId: string, body: CreateCommentDraftBody): Promise<{
724
+ id: string;
725
+ }>;
726
+ /**
727
+ * PATCH /comment-drafts/:draftId — 编辑评论草稿。expectedVersion 开乐观并发(版本不匹配 409);
728
+ * status 仅接受人工态(draft/approved/archived),scheduled/published 由排期/complete 系统驱动。
729
+ */
730
+ updateCommentDraft(teamId: string, draftId: string, body: UpdateCommentDraftBody): Promise<{
731
+ ok: boolean;
732
+ version: number;
733
+ updatedAt: string;
734
+ }>;
735
+ /** DELETE /comment-drafts/:draftId — 删评论草稿(204)。 */
736
+ deleteCommentDraft(teamId: string, draftId: string): Promise<void>;
737
+ /**
738
+ * POST /comment-drafts/:draftId/schedule — 评论草稿排期(唯一 publish_comment 建 job 入口)。
739
+ * 一事务:锁 draft + 一稿一投 + 建 job + 建 pending review target + draft→scheduled;过 publish
740
+ * guardrail。入队失败返 warning(job 仍 scheduled,可被 ops 领)。
741
+ */
742
+ scheduleCommentDraft(teamId: string, draftId: string, body: ScheduleCommentDraftBody): Promise<{
743
+ scheduledJobId: string;
744
+ /** 同事务建的 pending 审核目标(审核门追踪入口)。 */
745
+ reviewTargetId: string;
746
+ reviewTargetStatus: string;
747
+ /** BullMQ 入队失败时的告警(job 仍 scheduled,可被 ops 领)。 */
748
+ warning?: string;
749
+ }>;
750
+ private clientDeliveryBase;
751
+ /** GET client-delivery/bundles?brandId=(必填)&status=&limit=&offset= — 客户面 bundle 列表。 */
752
+ clientDeliveryListBundles(teamId: string, params: ListClientDeliveryBundlesParams): Promise<{
753
+ items: unknown[];
754
+ }>;
755
+ /** GET client-delivery/bundles/:id — 单个 bundle(client 视图脱敏 / staff 完整)。 */
756
+ clientDeliveryGetBundle(teamId: string, bundleId: string): Promise<unknown>;
757
+ /** GET client-delivery/bundles/:id/items — bundle 下条目列表。 */
758
+ clientDeliveryListItems(teamId: string, bundleId: string): Promise<{
759
+ items: unknown[];
760
+ }>;
761
+ /** GET client-delivery/items/:id — 单个条目。 */
762
+ clientDeliveryGetItem(teamId: string, itemId: string): Promise<unknown>;
763
+ /** GET client-delivery/items/:id/revisions — 条目下 revision 列表。 */
764
+ clientDeliveryListRevisions(teamId: string, itemId: string): Promise<{
765
+ items: unknown[];
766
+ }>;
767
+ /** GET client-delivery/revisions/:id — 单个 revision(含 sourceContentHash 作 CAS 凭证)。 */
768
+ clientDeliveryGetRevision(teamId: string, revisionId: string): Promise<unknown>;
769
+ /** GET client-delivery/revisions/:id/comments — revision 字段级评论列表。 */
770
+ clientDeliveryListComments(teamId: string, revisionId: string): Promise<{
771
+ items: unknown[];
772
+ }>;
773
+ /** GET client-delivery/revisions/:id/events — revision 决策事件链(append-only)。 */
774
+ clientDeliveryListEvents(teamId: string, revisionId: string): Promise<{
775
+ items: unknown[];
776
+ }>;
777
+ /**
778
+ * POST client-delivery/revisions/:id/approve — 客户批准(CAS)。expectedRevisionHash 与服务端
779
+ * 当前 revision hash 不符 → 409(SDK 透传为 `HTTP 409:` Error);须 user 凭证(拒 api_key)。
780
+ */
781
+ clientDeliveryApproveRevision(teamId: string, revisionId: string, body: ApproveClientDeliveryRevisionBody): Promise<{
782
+ revision: unknown;
783
+ }>;
784
+ /**
785
+ * POST client-delivery/revisions/:id/request-changes — 客户请求修改 + 字段级评论(CAS)。
786
+ * hash 不符 → 409;须 user 凭证。
787
+ */
788
+ clientDeliveryRequestChanges(teamId: string, revisionId: string, body: RequestChangesClientDeliveryRevisionBody): Promise<{
789
+ revision: unknown;
790
+ }>;
791
+ /** POST client-delivery/revisions/:id/comments — 客户字段级讨论(非决策);须 user 凭证。 */
792
+ clientDeliveryAddComment(teamId: string, revisionId: string, body: AddClientDeliveryCommentBody): Promise<{
793
+ comment: unknown;
794
+ }>;
795
+ /** POST client-delivery/comments/:id/resolve — 客户关闭讨论(幂等);须 user 凭证。 */
796
+ clientDeliveryResolveComment(teamId: string, commentId: string): Promise<{
797
+ comment: unknown;
798
+ }>;
799
+ /**
800
+ * POST client-delivery/products/:productId/fact-versions(**客户面**)— 客户提交产品事实版本。
801
+ * provenance 服务端强制 'client';正文/draft 字段物理不接受。须 user 凭证。
802
+ */
803
+ clientDeliveryCreateClientFactVersion(teamId: string, productId: string, body: ClientDeliveryFactVersionBody): Promise<{
804
+ factVersion: unknown;
805
+ }>;
806
+ /** POST client-delivery/bundles — staff 建 bundle。 */
807
+ clientDeliveryCreateBundle(teamId: string, body: CreateClientDeliveryBundleBody): Promise<{
808
+ bundle: unknown;
809
+ }>;
810
+ /** POST client-delivery/bundles/:id/items — staff upsert 条目(帖/评 + 矩阵字段)。 */
811
+ clientDeliveryUpsertItem(teamId: string, bundleId: string, body: UpsertClientDeliveryItemBody): Promise<{
812
+ item: unknown;
813
+ }>;
814
+ /** POST client-delivery/items/:id/revisions — staff 建不可变送审快照(无 body)。 */
815
+ clientDeliveryCreateRevision(teamId: string, itemId: string): Promise<{
816
+ revision: unknown;
817
+ }>;
818
+ /** POST client-delivery/revisions/:id/submit — staff 送审(not_submitted|withdrawn → pending)。 */
819
+ clientDeliverySubmitRevision(teamId: string, revisionId: string, body?: SubmitClientDeliveryRevisionBody): Promise<{
820
+ revision: unknown;
821
+ }>;
822
+ /** POST client-delivery/products — staff 建产品身份。 */
823
+ clientDeliveryCreateProduct(teamId: string, body: CreateClientDeliveryProductBody): Promise<{
824
+ product: unknown;
825
+ }>;
826
+ /**
827
+ * POST client-delivery/products/:productId/fact-versions(**staff 面**)— staff 提交事实版本。
828
+ * provenance 由 body 决定(默认 staff)。须 user 凭证。
829
+ */
830
+ clientDeliveryCreateFactVersion(teamId: string, productId: string, body: StaffClientDeliveryFactVersionBody): Promise<{
831
+ factVersion: unknown;
832
+ }>;
833
+ /** POST client-delivery/products/:productId/fact-versions/:fvId/activate — staff 激活 + stale 传播。 */
834
+ clientDeliveryActivateFactVersion(teamId: string, productId: string, factVersionId: string): Promise<{
835
+ factVersion: unknown;
836
+ }>;
837
+ /** POST client-delivery/policy-versions — staff 建品牌内容政策版本。 */
838
+ clientDeliveryCreatePolicyVersion(teamId: string, body: CreateClientDeliveryPolicyVersionBody): Promise<{
839
+ policyVersion: unknown;
840
+ }>;
841
+ /** POST client-delivery/policy-versions/:id/activate — staff 激活政策版本。 */
842
+ clientDeliveryActivatePolicyVersion(teamId: string, policyVersionId: string): Promise<{
843
+ policyVersion: unknown;
844
+ }>;
489
845
  listReports(teamId: string, options?: ListReportsParams | number): Promise<{
490
846
  items: unknown[];
491
847
  }>;
@@ -1127,7 +1483,7 @@ export declare class SocialHubClient {
1127
1483
  }>;
1128
1484
  deleteSubredditWatchlist(watchlistId: string): Promise<void>;
1129
1485
  listHotPosts(params?: ListHotPostsParams): Promise<{
1130
- items: unknown[];
1486
+ items: HotPostListItem[];
1131
1487
  total: number;
1132
1488
  limit: number;
1133
1489
  offset: number;