@optima-chat/tiktok-cli 0.3.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/index.js +235 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -357,8 +357,243 @@ var COMMANDS = [
|
|
|
357
357
|
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
358
|
run: ({ shop, args: args2 }) => proxy("POST", shop, `/product/202309/products/${args2.product}/partial_edit`, { body: readBodyFile(args2["body-file"]) }),
|
|
359
359
|
readback: ({ shop, args: args2 }) => proxy("GET", shop, `/product/202309/products/${args2.product}`, {})
|
|
360
|
+
},
|
|
361
|
+
// ===== 联盟只读命令(affiliate_seller,版本号取自 docs/batch2-affiliate-shapes.md 真调结果) =====
|
|
362
|
+
{
|
|
363
|
+
name: "affiliate creators search",
|
|
364
|
+
summary: "\u8054\u76DF\u5E7F\u573A\u627E\u8FBE\u4EBA\uFF08--keyword\uFF0C--page-size 12|20\uFF0C\u9ED8\u8BA4 12\uFF09",
|
|
365
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/marketplace_creators/search", {
|
|
366
|
+
query: { page_size: String(args2["page-size"] ?? 12) },
|
|
367
|
+
body: args2.keyword ? { keyword: args2.keyword } : {}
|
|
368
|
+
})
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: "affiliate creators perf",
|
|
372
|
+
summary: "\u8FBE\u4EBA\u5E26\u8D27\u8868\u73B0\u8BE6\u60C5\uFF08--creator \u5FC5\u586B\uFF0Ccreator_open_id\uFF09",
|
|
373
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202508/marketplace_creators/${args2.creator}`, {})
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: "affiliate target-collab search",
|
|
377
|
+
summary: "\u5B9A\u5411\u9080\u7EA6\u5217\u8868\uFF08--status collaboration_status\uFF0C\u5982 ONGOING/EXPIRING/VALID/CANCELING/COMPLETED\uFF1B--page-size\uFF09",
|
|
378
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/target_collaborations/search", {
|
|
379
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
380
|
+
body: args2.status ? { collaboration_status: args2.status } : {}
|
|
381
|
+
})
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: "affiliate target-collab query",
|
|
385
|
+
summary: "\u5B9A\u5411\u9080\u7EA6\u8BE6\u60C5\uFF08--id \u5FC5\u586B\uFF09",
|
|
386
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202508/target_collaborations/${args2.id}`, {})
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "affiliate samples search",
|
|
390
|
+
summary: "\u6837\u54C1\u7533\u8BF7\u5217\u8868\uFF08--page-size\uFF09",
|
|
391
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/sample_applications/search", {
|
|
392
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
393
|
+
body: {}
|
|
394
|
+
})
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "affiliate dm list",
|
|
398
|
+
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",
|
|
399
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, "/affiliate_seller/202412/conversations", {
|
|
400
|
+
query: {
|
|
401
|
+
page_size: String(args2["page-size"] ?? 20),
|
|
402
|
+
...args2.status ? { conversation_status: args2.status } : {}
|
|
403
|
+
}
|
|
404
|
+
})
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: "affiliate dm messages",
|
|
408
|
+
summary: "\u4F1A\u8BDD\u6D88\u606F\u8BB0\u5F55\uFF08--conversation \u5FC5\u586B\uFF0Cconversation_id\uFF09",
|
|
409
|
+
run: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202412/conversation/${args2.conversation}/messages`, {})
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "affiliate orders search",
|
|
413
|
+
summary: "\u8054\u76DF\u8BA2\u5355\u5217\u8868\uFF08\u4F63\u91D1\u660E\u7EC6\uFF0C--page-size\uFF09",
|
|
414
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202410/orders/search", {
|
|
415
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
416
|
+
body: {}
|
|
417
|
+
})
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "affiliate open-collab products-search",
|
|
421
|
+
summary: "\u516C\u5F00\u5408\u4F5C\u53EF\u8BBE\u4F63\u54C1\u5217\u8868\uFF08--page-size\uFF09",
|
|
422
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202405/open_collaborations/products/search", {
|
|
423
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
424
|
+
body: {}
|
|
425
|
+
})
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "affiliate open-collab search",
|
|
429
|
+
summary: "\u516C\u5F00\u5408\u4F5C\u751F\u6548\u5217\u8868\uFF08\u542B current_commission\uFF0C--page-size\uFF09",
|
|
430
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202412/open_collaborations/search", {
|
|
431
|
+
query: { page_size: String(args2["page-size"] ?? 20) },
|
|
432
|
+
body: {}
|
|
433
|
+
})
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: "affiliate open-collab settings get",
|
|
437
|
+
summary: "\u516C\u5F00\u5408\u4F5C\u5168\u5C40\u8BBE\u7F6E\uFF08\u81EA\u52A8\u65B0\u589E\u54C1\u9ED8\u8BA4\u4F63\u91D1\uFF09",
|
|
438
|
+
run: ({ shop }) => proxy("GET", shop, "/affiliate_seller/202409/open_collaboration_settings", {})
|
|
439
|
+
},
|
|
440
|
+
// ===== 联盟写命令(managing-affiliate-program,三道阀:dry-run 预览 → --apply 提交 → 回读) =====
|
|
441
|
+
{
|
|
442
|
+
name: "affiliate target-collab create",
|
|
443
|
+
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",
|
|
444
|
+
write: true,
|
|
445
|
+
preview: ({ args: args2 }) => [{
|
|
446
|
+
step: "\u53D1\u5B9A\u5411\u9080\u7EA6",
|
|
447
|
+
method: "POST",
|
|
448
|
+
path: "/affiliate_seller/202508/target_collaborations",
|
|
449
|
+
body: readBodyFile(args2["body-file"])
|
|
450
|
+
}],
|
|
451
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/target_collaborations", {
|
|
452
|
+
body: readBodyFile(args2["body-file"])
|
|
453
|
+
}),
|
|
454
|
+
readback: ({ shop }) => proxy("POST", shop, "/affiliate_seller/202508/target_collaborations/search", {
|
|
455
|
+
query: { page_size: "12" },
|
|
456
|
+
body: { collaboration_status: "ONGOING" }
|
|
457
|
+
})
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "affiliate target-collab update",
|
|
461
|
+
summary: "\u6539\u5B9A\u5411\u9080\u7EA6\uFF08--id --body-file collab.json\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u63D0\u4EA4",
|
|
462
|
+
write: true,
|
|
463
|
+
preview: ({ args: args2 }) => [{
|
|
464
|
+
step: "\u6539\u5B9A\u5411\u9080\u7EA6",
|
|
465
|
+
method: "PUT",
|
|
466
|
+
path: `/affiliate_seller/202508/target_collaborations/${args2.id}`,
|
|
467
|
+
body: readBodyFile(args2["body-file"])
|
|
468
|
+
}],
|
|
469
|
+
run: ({ shop, args: args2 }) => proxy("PUT", shop, `/affiliate_seller/202508/target_collaborations/${args2.id}`, {
|
|
470
|
+
body: readBodyFile(args2["body-file"])
|
|
471
|
+
}),
|
|
472
|
+
readback: ({ shop, args: args2 }) => proxy("GET", shop, `/affiliate_seller/202508/target_collaborations/${args2.id}`, {})
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: "affiliate target-collab remove",
|
|
476
|
+
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",
|
|
477
|
+
write: true,
|
|
478
|
+
preview: ({ args: args2 }) => [{
|
|
479
|
+
step: "\u64A4\u56DE\u5B9A\u5411\u9080\u7EA6",
|
|
480
|
+
method: "DELETE",
|
|
481
|
+
path: `/affiliate_seller/202409/target_collaborations/${args2.id}`,
|
|
482
|
+
body: void 0
|
|
483
|
+
}],
|
|
484
|
+
run: ({ shop, args: args2 }) => proxy("DELETE", shop, `/affiliate_seller/202409/target_collaborations/${args2.id}`, {})
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
name: "affiliate target-collab link",
|
|
488
|
+
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",
|
|
489
|
+
write: true,
|
|
490
|
+
preview: ({ args: args2 }) => [{
|
|
491
|
+
step: "\u751F\u6210\u9080\u7EA6\u94FE\u63A5",
|
|
492
|
+
method: "POST",
|
|
493
|
+
path: `/affiliate_seller/202509/target_collaboration/${args2.id}/link`,
|
|
494
|
+
body: void 0
|
|
495
|
+
}],
|
|
496
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, `/affiliate_seller/202509/target_collaboration/${args2.id}/link`, {})
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "affiliate dm open",
|
|
500
|
+
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",
|
|
501
|
+
write: true,
|
|
502
|
+
preview: ({ args: args2 }) => [{
|
|
503
|
+
step: "\u5F00\u79C1\u4FE1\u4F1A\u8BDD",
|
|
504
|
+
method: "POST",
|
|
505
|
+
path: "/affiliate_seller/202508/conversations",
|
|
506
|
+
body: { creator_open_id: args2.creator }
|
|
507
|
+
}],
|
|
508
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202508/conversations", {
|
|
509
|
+
body: { creator_open_id: args2.creator }
|
|
510
|
+
})
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: "affiliate dm send",
|
|
514
|
+
summary: "\u7ED9\u8FBE\u4EBA\u53D1\u79C1\u4FE1\uFF08--conversation --content [--msg-type TEXT]\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
515
|
+
write: true,
|
|
516
|
+
preview: ({ args: args2 }) => [{
|
|
517
|
+
step: "\u53D1\u79C1\u4FE1",
|
|
518
|
+
method: "POST",
|
|
519
|
+
path: `/affiliate_seller/202412/conversations/${args2.conversation}/messages`,
|
|
520
|
+
body: { content: args2.content, msg_type: args2["msg-type"] ?? "TEXT" }
|
|
521
|
+
}],
|
|
522
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, `/affiliate_seller/202412/conversations/${args2.conversation}/messages`, {
|
|
523
|
+
body: { content: args2.content, msg_type: args2["msg-type"] ?? "TEXT" }
|
|
524
|
+
})
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
name: "affiliate samples review",
|
|
528
|
+
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",
|
|
529
|
+
write: true,
|
|
530
|
+
preview: ({ args: args2 }) => [{
|
|
531
|
+
step: "\u5BA1\u6279\u6837\u54C1\u7533\u8BF7",
|
|
532
|
+
method: "POST",
|
|
533
|
+
path: `/affiliate_seller/202507/sample_applications/${args2.id}/review`,
|
|
534
|
+
body: sampleReviewBody(args2)
|
|
535
|
+
}],
|
|
536
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, `/affiliate_seller/202507/sample_applications/${args2.id}/review`, {
|
|
537
|
+
body: sampleReviewBody(args2)
|
|
538
|
+
}),
|
|
539
|
+
readback: ({ shop }) => proxy("POST", shop, "/affiliate_seller/202508/sample_applications/search", {
|
|
540
|
+
query: { page_size: "20" },
|
|
541
|
+
body: {}
|
|
542
|
+
})
|
|
543
|
+
},
|
|
544
|
+
// ===== 联盟写命令(managing-open-collaboration,三道阀:dry-run 预览 → --apply 提交 → 回读) =====
|
|
545
|
+
{
|
|
546
|
+
name: "affiliate open-collab set-commission",
|
|
547
|
+
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",
|
|
548
|
+
write: true,
|
|
549
|
+
preview: ({ args: args2 }) => [{
|
|
550
|
+
step: "\u8BBE\u6309\u54C1\u516C\u5F00\u5408\u4F5C\u4F63\u91D1",
|
|
551
|
+
method: "POST",
|
|
552
|
+
path: "/affiliate_seller/202412/open_collaborations",
|
|
553
|
+
body: { product_id: args2.product, commission_rate: Number(args2.rate) }
|
|
554
|
+
}],
|
|
555
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202412/open_collaborations", {
|
|
556
|
+
body: { product_id: args2.product, commission_rate: Number(args2.rate) }
|
|
557
|
+
}),
|
|
558
|
+
readback: ({ shop }) => proxy("POST", shop, "/affiliate_seller/202405/open_collaborations/products/search", {
|
|
559
|
+
query: { page_size: "20" },
|
|
560
|
+
body: {}
|
|
561
|
+
})
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "affiliate open-collab remove",
|
|
565
|
+
summary: "\u79FB\u9664\u54C1\u7684\u516C\u5F00\u5408\u4F5C\uFF08--product product_id\uFF09\u3002\u9ED8\u8BA4 dry-run\uFF0C--apply \u624D\u53D1",
|
|
566
|
+
write: true,
|
|
567
|
+
preview: ({ args: args2 }) => [{
|
|
568
|
+
step: "\u79FB\u9664\u516C\u5F00\u5408\u4F5C",
|
|
569
|
+
method: "DELETE",
|
|
570
|
+
path: `/affiliate_seller/202409/open_collaborations/products/${args2.product}`,
|
|
571
|
+
body: void 0
|
|
572
|
+
}],
|
|
573
|
+
run: ({ shop, args: args2 }) => proxy("DELETE", shop, `/affiliate_seller/202409/open_collaborations/products/${args2.product}`, {})
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: "affiliate open-collab settings edit",
|
|
577
|
+
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",
|
|
578
|
+
write: true,
|
|
579
|
+
preview: ({ args: args2 }) => [{
|
|
580
|
+
step: "\u6539\u5168\u5C40\u9ED8\u8BA4",
|
|
581
|
+
method: "POST",
|
|
582
|
+
path: "/affiliate_seller/202405/open_collaboration_settings",
|
|
583
|
+
body: { auto_add_product: { commission_rate: Number(args2.rate), enable: args2.enable === "true" } }
|
|
584
|
+
}],
|
|
585
|
+
run: ({ shop, args: args2 }) => proxy("POST", shop, "/affiliate_seller/202405/open_collaboration_settings", {
|
|
586
|
+
body: { auto_add_product: { commission_rate: Number(args2.rate), enable: args2.enable === "true" } }
|
|
587
|
+
}),
|
|
588
|
+
readback: ({ shop }) => proxy("GET", shop, "/affiliate_seller/202409/open_collaboration_settings", {})
|
|
360
589
|
}
|
|
361
590
|
];
|
|
591
|
+
function sampleReviewBody(args2) {
|
|
592
|
+
return {
|
|
593
|
+
review_result: args2.result,
|
|
594
|
+
...args2["reject-reason"] ? { reject_reason: args2["reject-reason"] } : {}
|
|
595
|
+
};
|
|
596
|
+
}
|
|
362
597
|
function inventoryBody(args2) {
|
|
363
598
|
return {
|
|
364
599
|
skus: [{
|