@optima-chat/tiktok-cli 0.3.0 → 0.5.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/index.js +258 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -167,6 +167,18 @@ var COMMANDS = [
|
|
|
167
167
|
body: {}
|
|
168
168
|
})
|
|
169
169
|
},
|
|
170
|
+
{
|
|
171
|
+
name: "products get",
|
|
172
|
+
summary: "\u5355\u4E2A\u5546\u54C1\u5B8C\u6574\u8BE6\u60C5\uFF08--product id\uFF1B\u9010\u5B57\u6BB5\u56DE\u8BFB\u7528\uFF1A\u6807\u9898/\u63CF\u8FF0/\u56FE/SKU/\u4EF7/\u5E93\u5B58/\u91CD\u91CF/\u5C3A\u5BF8/\u5C5E\u6027\uFF09",
|
|
173
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/product/202309/products/${args2.product}`, {})
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "products diagnose",
|
|
177
|
+
summary: "\u5546\u54C1\u5B98\u65B9\u95EE\u9898\u8BCA\u65AD\uFF08--product \u9017\u53F7\u5206\u9694\u672C\u5E97\u81EA\u6709\u5546\u54C1 id\uFF09",
|
|
178
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, "/product/202405/products/diagnoses", {
|
|
179
|
+
query: { product_ids: String(args2.product ?? "") }
|
|
180
|
+
})
|
|
181
|
+
},
|
|
170
182
|
{
|
|
171
183
|
name: "promotions list",
|
|
172
184
|
summary: "\u4FC3\u9500\u6D3B\u52A8\u5217\u8868\uFF08--status ONGOING/NOT_START/EXPIRED\uFF09",
|
|
@@ -185,6 +197,17 @@ var COMMANDS = [
|
|
|
185
197
|
}
|
|
186
198
|
})
|
|
187
199
|
},
|
|
200
|
+
// ===== 账号状态只读命令 =====
|
|
201
|
+
{
|
|
202
|
+
name: "seller status",
|
|
203
|
+
summary: "\u8D26\u53F7/\u5E97\u94FA\u72B6\u6001\uFF08seller_status/shop_statuses/tax_form_status\uFF09",
|
|
204
|
+
run: ({ shop }) => proxy("GET", shop, "/seller/202508/status", {})
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "seller permissions",
|
|
208
|
+
summary: "\u5DF2\u6388\u6743\u6743\u9650\u5217\u8868",
|
|
209
|
+
run: ({ shop }) => proxy("GET", shop, "/seller/202309/permissions", {})
|
|
210
|
+
},
|
|
188
211
|
// ===== 建品前置只读辅助命令 =====
|
|
189
212
|
{
|
|
190
213
|
name: "products prerequisites",
|
|
@@ -357,8 +380,243 @@ var COMMANDS = [
|
|
|
357
380
|
preview: ({ args: args2 }) => [{ step: "partial_edit\uFF08\u5D4C\u5957\u5B57\u6BB5\u672A\u5217\u5B50\u9879\u4F1A\u88AB\u6E05\u7A7A\uFF09", method: "POST", path: `/product/202309/products/${args2.product}/partial_edit`, body: readBodyFile(args2["body-file"]) }],
|
|
358
381
|
run: ({ shop, args: args2 }) => proxy("POST", shop, `/product/202309/products/${args2.product}/partial_edit`, { body: readBodyFile(args2["body-file"]) }),
|
|
359
382
|
readback: ({ shop, args: args2 }) => proxy("GET", shop, `/product/202309/products/${args2.product}`, {})
|
|
383
|
+
},
|
|
384
|
+
// ===== 联盟只读命令(affiliate_seller,版本号取自 docs/batch2-affiliate-shapes.md 真调结果) =====
|
|
385
|
+
{
|
|
386
|
+
name: "affiliate creators search",
|
|
387
|
+
summary: "\u8054\u76DF\u5E7F\u573A\u627E\u8FBE\u4EBA\uFF08--keyword\uFF0C--page-size 12|20\uFF0C\u9ED8\u8BA4 12\uFF09",
|
|
388
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/marketplace_creators/search", {
|
|
389
|
+
query: { page_size: String(args2["page-size"] ?? 12) },
|
|
390
|
+
body: args2.keyword ? { keyword: args2.keyword } : {}
|
|
391
|
+
})
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "affiliate creators perf",
|
|
395
|
+
summary: "\u8FBE\u4EBA\u5E26\u8D27\u8868\u73B0\u8BE6\u60C5\uFF08--creator \u5FC5\u586B\uFF0Ccreator_open_id\uFF09",
|
|
396
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202508/marketplace_creators/${args2.creator}`, {})
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: "affiliate target-collab search",
|
|
400
|
+
summary: "\u5B9A\u5411\u9080\u7EA6\u5217\u8868\uFF08--status collaboration_status\uFF0C\u5982 ONGOING/EXPIRING/VALID/CANCELING/COMPLETED\uFF1B--page-size\uFF09",
|
|
401
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/target_collaborations/search", {
|
|
402
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
403
|
+
body: args2.status ? { collaboration_status: args2.status } : {}
|
|
404
|
+
})
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: "affiliate target-collab query",
|
|
408
|
+
summary: "\u5B9A\u5411\u9080\u7EA6\u8BE6\u60C5\uFF08--id \u5FC5\u586B\uFF09",
|
|
409
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202508/target_collaborations/${args2.id}`, {})
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "affiliate samples search",
|
|
413
|
+
summary: "\u6837\u54C1\u7533\u8BF7\u5217\u8868\uFF08--page-size\uFF09",
|
|
414
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/sample_applications/search", {
|
|
415
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
416
|
+
body: {}
|
|
417
|
+
})
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "affiliate dm list",
|
|
421
|
+
summary: "\u79C1\u4FE1\u4F1A\u8BDD\u5217\u8868\uFF08--page-size\uFF0C--status conversation_status \u53EF\u9009\uFF09\u3002\u26A0\uFE0F\u7248\u672C\u56FA\u5B9A 202412",
|
|
422
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, "/affiliate_seller/202412/conversations", {
|
|
423
|
+
query: {
|
|
424
|
+
page_size: String(args2["page-size"] ?? 20),
|
|
425
|
+
...args2.status ? { conversation_status: args2.status } : {}
|
|
426
|
+
}
|
|
427
|
+
})
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: "affiliate dm messages",
|
|
431
|
+
summary: "\u4F1A\u8BDD\u6D88\u606F\u8BB0\u5F55\uFF08--conversation \u5FC5\u586B\uFF0Cconversation_id\uFF09",
|
|
432
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202412/conversation/${args2.conversation}/messages`, {})
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: "affiliate orders search",
|
|
436
|
+
summary: "\u8054\u76DF\u8BA2\u5355\u5217\u8868\uFF08\u4F63\u91D1\u660E\u7EC6\uFF0C--page-size\uFF09",
|
|
437
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202410/orders/search", {
|
|
438
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
439
|
+
body: {}
|
|
440
|
+
})
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "affiliate open-collab products-search",
|
|
444
|
+
summary: "\u516C\u5F00\u5408\u4F5C\u53EF\u8BBE\u4F63\u54C1\u5217\u8868\uFF08--page-size\uFF09",
|
|
445
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202405/open_collaborations/products/search", {
|
|
446
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
447
|
+
body: {}
|
|
448
|
+
})
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "affiliate open-collab search",
|
|
452
|
+
summary: "\u516C\u5F00\u5408\u4F5C\u751F\u6548\u5217\u8868\uFF08\u542B current_commission\uFF0C--page-size\uFF09",
|
|
453
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202412/open_collaborations/search", {
|
|
454
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
455
|
+
body: {}
|
|
456
|
+
})
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "affiliate open-collab settings get",
|
|
460
|
+
summary: "\u516C\u5F00\u5408\u4F5C\u5168\u5C40\u8BBE\u7F6E\uFF08\u81EA\u52A8\u65B0\u589E\u54C1\u9ED8\u8BA4\u4F63\u91D1\uFF09",
|
|
461
|
+
run: ({ shop }) => proxy("GET", shop, "/affiliate_seller/202409/open_collaboration_settings", {})
|
|
462
|
+
},
|
|
463
|
+
// ===== 联盟写命令(managing-affiliate-program,三道阀:dry-run 预览 → --apply 提交 → 回读) =====
|
|
464
|
+
{
|
|
465
|
+
name: "affiliate target-collab create",
|
|
466
|
+
summary: "\u53D1\u5B9A\u5411\u9080\u7EA6\uFF08--body-file collab.json\uFF0C\u542B creator_user_open_ids[]/products[]/free_sample_rule\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
467
|
+
write: true,
|
|
468
|
+
preview: ({ args: args2 }) => [{
|
|
469
|
+
step: "\u53D1\u5B9A\u5411\u9080\u7EA6",
|
|
470
|
+
method: "POST",
|
|
471
|
+
path: "/affiliate_seller/202508/target_collaborations",
|
|
472
|
+
body: readBodyFile(args2["body-file"])
|
|
473
|
+
}],
|
|
474
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/target_collaborations", {
|
|
475
|
+
body: readBodyFile(args2["body-file"])
|
|
476
|
+
}),
|
|
477
|
+
readback: ({ shop }) => proxy("POST", shop, "/affiliate_seller/202508/target_collaborations/search", {
|
|
478
|
+
query: { page_size: "12" },
|
|
479
|
+
body: { collaboration_status: "ONGOING" }
|
|
480
|
+
})
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
name: "affiliate target-collab update",
|
|
484
|
+
summary: "\u6539\u5B9A\u5411\u9080\u7EA6\uFF08--id --body-file collab.json\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u63D0\u4EA4",
|
|
485
|
+
write: true,
|
|
486
|
+
preview: ({ args: args2 }) => [{
|
|
487
|
+
step: "\u6539\u5B9A\u5411\u9080\u7EA6",
|
|
488
|
+
method: "PUT",
|
|
489
|
+
path: `/affiliate_seller/202508/target_collaborations/${args2.id}`,
|
|
490
|
+
body: readBodyFile(args2["body-file"])
|
|
491
|
+
}],
|
|
492
|
+
run: ({ shop, args: args2 }) => proxy("PUT", shop, `/affiliate_seller/202508/target_collaborations/${args2.id}`, {
|
|
493
|
+
body: readBodyFile(args2["body-file"])
|
|
494
|
+
}),
|
|
495
|
+
readback: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202508/target_collaborations/${args2.id}`, {})
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "affiliate target-collab remove",
|
|
499
|
+
summary: "\u64A4\u56DE\u5B9A\u5411\u9080\u7EA6\uFF08--id \u5FC5\u586B\uFF0C\u64A4\u56DE\u5B89\u5168\u7F51\uFF09\u3002\u4E0D\u53EF\u9006\uFF0C\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
500
|
+
write: true,
|
|
501
|
+
preview: ({ args: args2 }) => [{
|
|
502
|
+
step: "\u64A4\u56DE\u5B9A\u5411\u9080\u7EA6",
|
|
503
|
+
method: "DELETE",
|
|
504
|
+
path: `/affiliate_seller/202409/target_collaborations/${args2.id}`,
|
|
505
|
+
body: void 0
|
|
506
|
+
}],
|
|
507
|
+
run: ({ shop, args: args2 }) => proxy("DELETE", shop, `/affiliate_seller/202409/target_collaborations/${args2.id}`, {})
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: "affiliate target-collab link",
|
|
511
|
+
summary: "\u751F\u6210\u5B9A\u5411\u9080\u7EA6\u5206\u4EAB\u94FE\u63A5\uFF08--id \u5FC5\u586B\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
512
|
+
write: true,
|
|
513
|
+
preview: ({ args: args2 }) => [{
|
|
514
|
+
step: "\u751F\u6210\u9080\u7EA6\u94FE\u63A5",
|
|
515
|
+
method: "POST",
|
|
516
|
+
path: `/affiliate_seller/202509/target_collaboration/${args2.id}/link`,
|
|
517
|
+
body: void 0
|
|
518
|
+
}],
|
|
519
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, `/affiliate_seller/202509/target_collaboration/${args2.id}/link`, {})
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
name: "affiliate dm open",
|
|
523
|
+
summary: "\u5F00\u8FBE\u4EBA\u79C1\u4FE1\u4F1A\u8BDD\uFF08--creator \u5FC5\u586B\uFF0Ccreator_open_id\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
524
|
+
write: true,
|
|
525
|
+
preview: ({ args: args2 }) => [{
|
|
526
|
+
step: "\u5F00\u79C1\u4FE1\u4F1A\u8BDD",
|
|
527
|
+
method: "POST",
|
|
528
|
+
path: "/affiliate_seller/202508/conversations",
|
|
529
|
+
body: { creator_open_id: args2.creator }
|
|
530
|
+
}],
|
|
531
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/conversations", {
|
|
532
|
+
body: { creator_open_id: args2.creator }
|
|
533
|
+
})
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "affiliate dm send",
|
|
537
|
+
summary: "\u7ED9\u8FBE\u4EBA\u53D1\u79C1\u4FE1\uFF08--conversation --content [--msg-type TEXT]\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
538
|
+
write: true,
|
|
539
|
+
preview: ({ args: args2 }) => [{
|
|
540
|
+
step: "\u53D1\u79C1\u4FE1",
|
|
541
|
+
method: "POST",
|
|
542
|
+
path: `/affiliate_seller/202412/conversations/${args2.conversation}/messages`,
|
|
543
|
+
body: { content: args2.content, msg_type: args2["msg-type"] ?? "TEXT" }
|
|
544
|
+
}],
|
|
545
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, `/affiliate_seller/202412/conversations/${args2.conversation}/messages`, {
|
|
546
|
+
body: { content: args2.content, msg_type: args2["msg-type"] ?? "TEXT" }
|
|
547
|
+
})
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: "affiliate samples review",
|
|
551
|
+
summary: "\u5BA1\u6279\u6837\u54C1\u7533\u8BF7\uFF08--id application_id --result review_result [--reject-reason]\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
552
|
+
write: true,
|
|
553
|
+
preview: ({ args: args2 }) => [{
|
|
554
|
+
step: "\u5BA1\u6279\u6837\u54C1\u7533\u8BF7",
|
|
555
|
+
method: "POST",
|
|
556
|
+
path: `/affiliate_seller/202507/sample_applications/${args2.id}/review`,
|
|
557
|
+
body: sampleReviewBody(args2)
|
|
558
|
+
}],
|
|
559
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, `/affiliate_seller/202507/sample_applications/${args2.id}/review`, {
|
|
560
|
+
body: sampleReviewBody(args2)
|
|
561
|
+
}),
|
|
562
|
+
readback: ({ shop }) => proxy("POST", shop, "/affiliate_seller/202508/sample_applications/search", {
|
|
563
|
+
query: { page_size: "20" },
|
|
564
|
+
body: {}
|
|
565
|
+
})
|
|
566
|
+
},
|
|
567
|
+
// ===== 联盟写命令(managing-open-collaboration,三道阀:dry-run 预览 → --apply 提交 → 回读) =====
|
|
568
|
+
{
|
|
569
|
+
name: "affiliate open-collab set-commission",
|
|
570
|
+
summary: "\u6309\u54C1\u8BBE\u516C\u5F00\u5408\u4F5C\u4F63\u91D1\u7387\uFF08--product product_id --rate\uFF0C\u5355\u4F4D=\u767E\u5206\u6BD4\xD7100\uFF0C\u5982 1350=13.5%\uFF0C\u8303\u56F4 800-8000\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u5B58",
|
|
571
|
+
write: true,
|
|
572
|
+
preview: ({ args: args2 }) => [{
|
|
573
|
+
step: "\u8BBE\u6309\u54C1\u516C\u5F00\u5408\u4F5C\u4F63\u91D1",
|
|
574
|
+
method: "POST",
|
|
575
|
+
path: "/affiliate_seller/202412/open_collaborations",
|
|
576
|
+
body: { product_id: args2.product, commission_rate: Number(args2.rate) }
|
|
577
|
+
}],
|
|
578
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202412/open_collaborations", {
|
|
579
|
+
body: { product_id: args2.product, commission_rate: Number(args2.rate) }
|
|
580
|
+
}),
|
|
581
|
+
readback: ({ shop }) => proxy("POST", shop, "/affiliate_seller/202405/open_collaborations/products/search", {
|
|
582
|
+
query: { page_size: "20" },
|
|
583
|
+
body: {}
|
|
584
|
+
})
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
name: "affiliate open-collab remove",
|
|
588
|
+
summary: "\u79FB\u9664\u54C1\u7684\u516C\u5F00\u5408\u4F5C\uFF08--product product_id\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
589
|
+
write: true,
|
|
590
|
+
preview: ({ args: args2 }) => [{
|
|
591
|
+
step: "\u79FB\u9664\u516C\u5F00\u5408\u4F5C",
|
|
592
|
+
method: "DELETE",
|
|
593
|
+
path: `/affiliate_seller/202409/open_collaborations/products/${args2.product}`,
|
|
594
|
+
body: void 0
|
|
595
|
+
}],
|
|
596
|
+
run: ({ shop, args: args2 }) => proxy("DELETE", shop, `/affiliate_seller/202409/open_collaborations/products/${args2.product}`, {})
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "affiliate open-collab settings edit",
|
|
600
|
+
summary: "\u6539\u516C\u5F00\u5408\u4F5C\u5168\u5C40\u9ED8\u8BA4\uFF08\u81EA\u52A8\u65B0\u589E\u54C1\u4F63\u91D1\uFF0C--rate --enable true|false\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u5B58",
|
|
601
|
+
write: true,
|
|
602
|
+
preview: ({ args: args2 }) => [{
|
|
603
|
+
step: "\u6539\u5168\u5C40\u9ED8\u8BA4",
|
|
604
|
+
method: "POST",
|
|
605
|
+
path: "/affiliate_seller/202405/open_collaboration_settings",
|
|
606
|
+
body: { auto_add_product: { commission_rate: Number(args2.rate), enable: args2.enable === "true" } }
|
|
607
|
+
}],
|
|
608
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202405/open_collaboration_settings", {
|
|
609
|
+
body: { auto_add_product: { commission_rate: Number(args2.rate), enable: args2.enable === "true" } }
|
|
610
|
+
}),
|
|
611
|
+
readback: ({ shop }) => proxy("GET", shop, "/affiliate_seller/202409/open_collaboration_settings", {})
|
|
360
612
|
}
|
|
361
613
|
];
|
|
614
|
+
function sampleReviewBody(args2) {
|
|
615
|
+
return {
|
|
616
|
+
review_result: args2.result,
|
|
617
|
+
...args2["reject-reason"] ? { reject_reason: args2["reject-reason"] } : {}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
362
620
|
function inventoryBody(args2) {
|
|
363
621
|
return {
|
|
364
622
|
skus: [{
|