@geoly-ai/social-hub-sdk 0.1.20 → 0.1.21

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.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // 派单品牌映射 / 接单团队(B4)的类型。
2
2
  export * from "./intake-admin.js";
3
+ // 派单运营面(B5-ext E3)的类型。
4
+ export * from "./intake-ops.js";
3
5
  // 板块限制(阶段 A4)的类型与受限拦截识别 helper(getSubredditRestrictionBlock)。
4
6
  export * from "./subreddit-restrictions.js";
5
7
  /** 自动翻页的页大小 —— contracts `listSubredditBlocklistsQuerySchema.limit` 的硬上限。 */
@@ -3649,6 +3651,69 @@ export class SocialHubClient {
3649
3651
  body: JSON.stringify({ teamId }),
3650
3652
  });
3651
3653
  }
3654
+ // ── 派单运营面(B5-ext E3)──────────────────────────────────────────────
3655
+ // 系统级(不拼 /teams)。准入:admin,或全局 manager 且是接单团队的真实 active 成员;
3656
+ // API key / 服务凭据 / 受限 CLI token 全 403。订单标识 hubRef;写入口 rowVersion 乐观锁(409 = 过期,重新 get)。
3657
+ // schedule / re-review / start 受执行开关 INTAKE_OPS_EXECUTION_ENABLED 闸(默认关 → 503)。
3658
+ /** GET /v1/system/intake-ops/orders — 列表(status / kind / deliveryChannel / brandId / 分页)。 */
3659
+ async listIntakeOpsOrders(params = {}) {
3660
+ const q = buildQuery({
3661
+ status: params.status,
3662
+ kind: params.kind,
3663
+ deliveryChannel: params.deliveryChannel,
3664
+ brandId: params.brandId,
3665
+ limit: params.limit,
3666
+ offset: params.offset,
3667
+ });
3668
+ return this.fetchJson(`/v1/system/intake-ops/orders${q}`);
3669
+ }
3670
+ /** GET /v1/system/intake-ops/orders/:hubRef — 详情(含 rowVersion / checks / allowedActions)。 */
3671
+ async getIntakeOpsOrder(hubRef) {
3672
+ return this.fetchJson(`/v1/system/intake-ops/orders/${encodeURIComponent(hubRef)}`);
3673
+ }
3674
+ /** POST …/orders/:hubRef/thread-context — 人工粘贴线程语境(递增订单 rowVersion)。 */
3675
+ async provideIntakeThreadContext(hubRef, body) {
3676
+ return this.intakeOpsWrite(hubRef, "thread-context", "POST", body);
3677
+ }
3678
+ /** POST …/orders/:hubRef/accept */
3679
+ async acceptIntakeOrder(hubRef, body) {
3680
+ return this.intakeOpsWrite(hubRef, "accept", "POST", body);
3681
+ }
3682
+ /** POST …/orders/:hubRef/reject */
3683
+ async rejectIntakeOrder(hubRef, body) {
3684
+ return this.intakeOpsWrite(hubRef, "reject", "POST", body);
3685
+ }
3686
+ /** PUT …/orders/:hubRef/draft — 改稿(新内容版本,旧审核失效,须重审)。 */
3687
+ async editIntakeOrderDraft(hubRef, body) {
3688
+ return this.intakeOpsWrite(hubRef, "draft", "PUT", body);
3689
+ }
3690
+ /** POST …/orders/:hubRef/schedule — 排期并建审核目标(受执行开关闸)。 */
3691
+ async scheduleIntakeOrder(hubRef, body) {
3692
+ return this.intakeOpsWrite(hubRef, "schedule", "POST", body);
3693
+ }
3694
+ /** POST …/orders/:hubRef/re-review — 重新审核(受执行开关闸)。 */
3695
+ async reReviewIntakeOrder(hubRef, body) {
3696
+ return this.intakeOpsWrite(hubRef, "re-review", "POST", body);
3697
+ }
3698
+ /** POST …/orders/:hubRef/start — 标记开始执行(可选步骤;受执行开关闸)。 */
3699
+ async startIntakeOrder(hubRef, body) {
3700
+ return this.intakeOpsWrite(hubRef, "start", "POST", body);
3701
+ }
3702
+ /** POST …/orders/:hubRef/confirm-published — 回填已发布(需当前审核 passed + 内容身份一致)。 */
3703
+ async confirmIntakeOrderPublished(hubRef, body) {
3704
+ return this.intakeOpsWrite(hubRef, "confirm-published", "POST", body);
3705
+ }
3706
+ /** POST …/orders/:hubRef/fail — 置失败(须声明帖子不在 Reddit 上)。 */
3707
+ async failIntakeOrder(hubRef, body) {
3708
+ return this.intakeOpsWrite(hubRef, "fail", "POST", body);
3709
+ }
3710
+ /** POST …/orders/:hubRef/anomalies — 异常事实登记(不改订单状态、不产生 published 事件);rowVersion 可选。 */
3711
+ async registerIntakeOrderAnomaly(hubRef, body) {
3712
+ return this.intakeOpsWrite(hubRef, "anomalies", "POST", body);
3713
+ }
3714
+ intakeOpsWrite(hubRef, action, method, body) {
3715
+ return this.fetchJson(`/v1/system/intake-ops/orders/${encodeURIComponent(hubRef)}/${action}`, { method, body: JSON.stringify(body) });
3716
+ }
3652
3717
  // ── 板块限制(板块限制阶段 A4)──────────────────────────────────────────
3653
3718
  // 系统级管理面仅**不受限登录的 admin**(API key / 绑定 job·account / 带动作白名单的
3654
3719
  // CLI token 读写全 403);runner 自查用 team 级 checkSubredditRestriction。