focus-product-extractor2
Version:
Extract product information from chat/order data
1,823 lines (1,788 loc) • 68.6 kB
JavaScript
"use strict";
var _index = _interopRequireDefault(require("../index.js"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
// const extractor = require('../index.js')
// 携带url的咨询聊天
const input2 = {
scene: 'chat',
rawData: {
messages: [{
text: "商品库存有限哦,很多用户都反馈部分地区下单无货了呐,看到了就尽快下单哈,价格仅限今天,查看订单 https://wqs.jd.com/order/n_detail_v2.shtml?deal_id=297893475880",
sender: "service",
timestamp: 1630000000
}, {
text: "https://item.jd.com/10103066146027.html?sdx=ehi-lLxFuZiE6JnJYYBcisAhtDaRCgwrsm1FuKdFaJH7cJjRIppa5X3srUvjUA",
sender: "buyer",
timestamp: 1630000001
}]
}
};
// 携带url的咨询正常一轮咨询商品的聊天
const input3 = {
scene: "chat",
rawData: {
messages: [{
text: "https://item.jd.com/10059903634606.html",
sender: "buyer",
timestamp: 1630000000
}, {
text: "欢迎来到Ulike官方旗舰店\nUlike蓝宝石冰点脱毛仪,连续7年销售第1!\n十年专注根源性脱毛,持续抑制毛发再生!\n京东 x Ulike x 3·8抢先购!\n★ Air3限时加赠【化妆镜+防晒帽】\n★ 限时12期免息带小U回家,轻轻松松变美无压力\nhttps://item.jd.com/10059903634606.html",
sender: "service",
timestamp: 1630000001
}, {
text: "【Ulike脱毛仪 ,自信脱毛 无惧目光】 等候您多时啦,我是您的专业美体顾问 有什么可以帮您的呢 ~",
sender: "service",
timestamp: 1630000002
}, {
text: "赠品一共哪些",
sender: "buyer",
timestamp: 1630000003
}, {
text: "您好呀宝子~",
sender: "service",
timestamp: 1630000004
}, {
text: "air3(水晶紫 海茶色) 下单享受超多赠品: 日常价格1999元,3·8到手1899元,立减100元 ①精致皮盒 ②护目镜 ③刮毛刀 ④身体乳 ⑤电动牙刷 ⑥防晒帽 ⑦化妆镜 赠品数量有限 先到先得~现在活动期间 赠品超多的呢",
sender: "service",
timestamp: 1630000005
}, {
text: "现在下单还可以额外加赠直播间赠品刮毛刀+芦荟胶一个哦~限时加赠的哦~先到先得哦",
sender: "service",
timestamp: 1630000006
}, {
text: "宝~这是入会链接:https://shopmember.m.jd.com/shopcard?venderId=218510&channel=401 这边为您申请到加入会员额外赠送一支价值99元的身体乳的哈,并且后续您也可以用积分兑换商品,您那边下单后联系客服备注下的喔",
sender: "service",
timestamp: 1630000007
}, {
text: "赠送的电动牙刷是限量的哦 您现在下单的话,小客服这边可以帮您预留一个名额哦,数量有限及时抢购哦",
sender: "service",
timestamp: 1630000008
}, {
text: "宝子 现在是3.8提前购的活动哦 ~现在下单价格和赠品是很划算呢 ~",
sender: "service",
timestamp: 1630000009
}, {
text: "那个按摩枕不送吗",
sender: "buyer",
timestamp: 1630000010
}, {
text: "下单后抽奖(按摩枕/安耐晒/兰蔻小黑瓶/牙刷头/筋膜枪),直播间开始时间是19-24点呢(七天内都是可以参加 只能中奖一次)(用订单后四位数)",
sender: "service",
timestamp: 1630000011
}, {
text: "38节火热开售,3月3日20点指定链接前20名抢赫莲娜黑绷带面霜! •Air3脱毛仪限时赠专属礼(LED化妆镜、防晒帽),活动下单享12期白条免息! •直播间下单加赠\"刮毛刀+芦荟胶\",还有抽奖参加哦!! 30天全程价保,买贵退差放心购,根源性脱毛不反复,脱毛更省心!",
sender: "service",
timestamp: 1630000012
}, {
text: "Ulike周年庆,活动提前享!抑制再生,根源性脱毛不反复! ★Air3领券提前购,活动到手1899,享30天保价,买贵退差! ★下单赠新款电动牙刷,活动期间再送LED化妆镜+防晒帽! Air3提前购券:https://3.cn/8PJ61-A",
sender: "service",
timestamp: 1630000013
}]
},
rules: {
// sources: ["buyer", "service"]
sources: ["buyer"]
// sources: ["service"]
}
};
// 多轮跨天咨询商品的聊天
const input4 = {
scene: "chat",
rawData: {
messages: [{
text: "https://item.jd.com/10071498227426.html",
sender: "buyer",
timestamp: 1630000000
}, {
text: "转人工卡片消息:自动转人工",
sender: "service",
timestamp: 1630000001
}, {
text: "~★Ulike小助手小U为您服务,您可以直接问我问题哦! ★618正式开启,直播间抢免单,整点抽千元大牌美妆! ☆叠加618补贴券再减260元,记得先领券再下单哦! 超级补贴(需PLUS会员)☞https://3.cn/abk-pOn 品类券☞https://3.cn/abk-oNh",
sender: "service",
timestamp: 1630000002
}, {
text: "小可爱,我们的客服工作时间为8:00-24:00,非常抱歉小U未能回答您的问题,您可以在客服小姐姐上班后咨询哦!",
sender: "service",
timestamp: 1630000003
}, {
text: "用户发起转人工",
sender: "buyer",
timestamp: 1630000004
}, {
text: "这是哪款",
sender: "buyer",
timestamp: 1630000005
}, {
text: "这款墨绿的5档位能量是19.8J (±20%),1档位能量是9.9J (±20%)哦",
sender: "buyer",
timestamp: 1630000006
}, {
text: "618领券再减260元,优惠仅剩6小时! ☆星品推荐Air3:蓝宝石冰点脱毛,下单买1享12! ☆直播间宠粉:1元秒杀享特权,整点抽300元E卡,直播抢免单! 整点抢半价戳☞https://3.cn/v/4jLZcu",
sender: "service",
timestamp: 1630000007
}, {
text: "https://item.jd.com/10028250046179.html",
sender: "buyer",
timestamp: 1630000008
}, {
text: "京东618年中大放价!爆款领券!蓝宝石脱毛仪轻松带回家! 我是您的专业美体顾问 有什么可以帮您的呢~",
sender: "service",
timestamp: 1630000009
}, {
text: "这款还能优惠吗",
sender: "buyer",
timestamp: 1630000010
}, {
text: "使用方法",
sender: "buyer",
timestamp: 1630000011
}, {
text: "这个是rose产品操作视频,可以复制到网页看一下哦 ----------------------------------------------------https://v.qq.com/x/page/k3251rmfuyq.html",
sender: "service",
timestamp: 1630000012
}, {
text: "正品保证吗",
sender: "buyer",
timestamp: 1630000013
}, {
text: "这个是产品使用视频,您复制链接到浏览器 就可以查看哈~",
sender: "service",
timestamp: 1630000014
}, {
text: "因为是给孩子买的,所以我要问明白,有哪些副作用",
sender: "buyer",
timestamp: 1630000015
}, {
text: "安全无副作用呢",
sender: "service",
timestamp: 1630000016
}, {
text: "仪器是没有年龄限制的,完全根据个人肌肤需求为主。但是我们建议18岁以上使用,青少年(未成年)毛发还在生长阶段,效果不会过于显著哦。小客服只负责我们旗舰店呢别的店铺不清楚呢",
sender: "service",
timestamp: 1630000017
}, {
text: "能不能再送个电动牙刷啊",
sender: "buyer",
timestamp: 1630000018
}, {
text: "https://dd-static.jd.com/ddimg/jfs/t1/223930/34/27014/12199/6490021aF2bef8397/da63d1e523f5caa0.jpg",
sender: "service",
timestamp: 1630000019
}, {
text: "【京东20周年大促-Ulike618送豪礼】 Rose下单拍1享12: ✔限量送:冲牙器+防晒伞+按摩枕 ✔刮毛刀+身体乳+护目镜+专属皮盒 ✔入会身体乳+直播间棉柔巾+直播间刮刀(签收后补发) ✔晒单有礼芦荟胶+30元礼金",
sender: "service",
timestamp: 1630000020
}, {
text: "「wxf15106962887」:能不能再送个电动牙刷啊 ------------------------------------- 送不了呢",
sender: "service",
timestamp: 1630000021
}, {
text: "用刀直接刮吗",
sender: "buyer",
timestamp: 1630000022
}, {
text: "使用脱毛仪之前无需擦拭任何护肤品,保持皮肤干爽直接使用即可哦",
sender: "service",
timestamp: 1630000023
}, {
text: "哪天结束,这活动",
sender: "buyer",
timestamp: 1630000024
}, {
text: "https://item.jd.com/10028250046179.html",
sender: "buyer",
timestamp: 1630000025
}, {
text: "这款",
sender: "buyer",
timestamp: 1630000026
}, {
text: "宝子 这个小客服目前还没接到通知的呢",
sender: "service",
timestamp: 1630000027
}, {
text: "https://dd-static.jd.com/ddimg/jfs/t1/112053/9/39071/60454/64906b26F349d5c32/12e578e8d2ddb0c6.jpg",
sender: "buyer",
timestamp: 1630000028
}, {
text: ".是的 宝子",
sender: "service",
timestamp: 1630000029
}, {
text: "多给点赠品吧,支持无理由退换货吗",
sender: "buyer",
timestamp: 1630000030
}, {
text: "京东20周年大促-Ulike618限时返场】 Rose下单拍1享12: ✔限量送:冲牙器+防晒伞+按摩枕 ✔刮毛刀+身体乳+护目镜+专属皮盒 ✔入会身体乳+直播间棉柔巾+直播间刮刀(签收后补发) ✔晒单有礼芦荟胶+30元礼金",
sender: "service",
timestamp: 1630000031
}, {
text: "为您申请一支入会《身体乳》哒~ 点击入会链接 一键入会的喔~入会后为您备注呐~ https://shopmember.m.jd.com/shopcard?venderId=218510&channel=401",
sender: "service",
timestamp: 1630000032
}, {
text: "1,先领取优惠券: https://coupon.m.jd.com/coupons/show.action?key=2eaa205c5fed4b98ad9225cae371a4bd&roleId=113209909&to=ulike520.jd.com 2,在拍下1年延保链接: https://item.jd.com/10078111604567.html 现在下单一元链接,享受亲肤超柔洁面巾一包+延保1年 超值服务!",
sender: "service",
timestamp: 1630000033
}, {
text: "https://dd-static.jd.com/ddimg/jfs/t1/119614/23/37467/5569/64906fb7Fbd276ba9/350809cff727ab8f.jpg",
sender: "service",
timestamp: 1630000034
}, {
text: "非常感谢小可爱的大力支持呢,辛苦宝子帮小客服点亮最右边的小星星【非常满意】哦,爱您哟~感谢您的支持(ps:如果点错一定要告诉小客服哦)https://dd-static.jd.com/ddimg/jfs/t1/125361/8/38940/6682/64907052F9310006f/c61e90f2bfe8aa10.png",
sender: "service",
timestamp: 1630000035
}, {
text: "一元已经下单了",
sender: "buyer",
timestamp: 1630000036
}, {
text: "恭喜您获得一份618专享1元秒杀特权福利包!获得权益后下单脱毛仪,即可享受【两年官方保修】,下单后记得联系客服备注生效哦!",
sender: "service",
timestamp: 1630000037
}, {
text: "我该干啥啊",
sender: "buyer",
timestamp: 1630000038
}, {
text: "您的<蓝宝石Rose脱毛仪>已经发货了哦,这边为您奉上使用提醒,注意查看哟~#E-s07https://dd-static.jd.com/ddimg/jfs/t1/196837/34/37584/64603/6491421aF27e991ad/7110f259d4d44191.jpg",
sender: "service",
timestamp: 1630000039
}, {
text: "https://item.jd.com/10028250046179.html",
sender: "buyer",
timestamp: 1630000040
}, {
// 卖家最后回复的与商品有关的url
text: "京东20周年-618活动盛典超值攻略-限定返场\n⏰Ulike-Air3,到手11重豪礼!\nhttps://item.jd.com/10059903634606.html\n自播间限时抢价值1030元娇韵诗50ml",
sender: "service",
timestamp: 1630000041
}, {
text: "那怎么试机器",
sender: "buyer",
timestamp: 1630000042
}, {
text: "宝子非常抱歉,您反馈的问题小客服暂时无法为您解决,为了更好的处理您的问题,这就帮您转接专员处理,【温馨提示:当前接待量繁忙,客服查看聊天后第一时间为您处理, 辛苦您耐心等待~】",
sender: "service",
timestamp: 1630000043
}, {
text: "https://dd-static.jd.com/ddimg/jfs/t1/164004/6/35973/47256/64955e03F7f67d1cc/83f467b2ceb84029.png",
sender: "service",
timestamp: 1630000044
}, {
text: "暂时没有",
sender: "buyer",
timestamp: 1630000045
}, {
text: "京东618返场大放价!爆款领券!蓝宝石脱毛仪轻松带回家! 我是您的专业美体顾问 有什么可以帮您的呢~\n很感激我们这一次的相遇,以后有任何问题欢迎随时来联系我们哦,很期待与您的再一次相遇~",
sender: "service",
timestamp: 1630000046
}, {
text: "是插电使用的吗",
sender: "buyer",
timestamp: 1630000047
}, {
text: "小可爱,我们的客服工作时间为8:00-24:00,非常抱歉小U未能回答您的问题,您可以在客服小姐姐上班后咨询哦!",
sender: "service",
timestamp: 1630000048
}, {
text: "https://item.jd.com/10028250046179.html",
sender: "buyer",
timestamp: 1630000049
}, {
text: "转人工卡片消息:自动转人工。https://dd-static.jd.com/ddimg/jfs/t1/221448/3/24347/165100/649783a7Fc00ae5b3/a752bc64a3a370f3.png",
sender: "service",
timestamp: 1630000050
}, {
text: "https://item.jd.com/10028250046179.html",
sender: "buyer",
timestamp: 1630000051
}, {
text: "欢迎来到Ulike京东官方旗舰店\nUlike蓝宝石冰点脱毛仪,连续7年销售第1!",
sender: "service",
timestamp: 1630000052
}, {
text: "我一次也没抽",
sender: "buyer",
timestamp: 1630000053
}, {
text: "很抱歉耽误到您了,长时间未与售后进行沟通,可能会导致您的对话从售后那边弹回售前,现在帮您再转接一下哦~",
sender: "service",
timestamp: 1630000054
}, {
// 这里是买家最后的提问
text: "ABC的我想要https://item.jd.com/10028250046179.html",
sender: "buyer",
timestamp: 1630000055
}, {
text: "欢迎来到Ulike京东官方旗舰店 【Ulike蓝宝石冰点脱毛仪,连续7年销售第1! 】",
sender: "service",
timestamp: 1630000056
}, {
text: "多少钱",
sender: "buyer",
timestamp: 1630000057
}, {
text: "11.11现货开卖,京仓快至当日达!今晚20点抢【1000元E卡】! 🎈蓝宝石Air3活动价1899,下单买1享13,全程保价不怕买贵! 🎈直播间下单享加赠,整点抽娇韵诗双萃精华! 蓝宝石冰脱Air3:https://3.cn/v/5DPNHO\nhttps://dd-static.jd.com/ddimg/jfs/t1/226892/15/272/84341/652ce80aF8cffb800/d0e97a4fcc78e021.jpg",
sender: "service",
timestamp: 1630000058
}]
},
rules: {
// sources: ["buyer", "service"]
// sources: ["buyer"]
// sources: ["service"]
}
};
// 多轮跨天咨询商品的聊天-测试自定义规则中传入matchedText
const patternInput1 = {
scene: "chat",
rawData: {
messages: [{
text: "https://item.jd.com/10071498227426.html",
sender: "buyer",
timestamp: 1630000010
}, {
text: "我一次也没抽str身体乳",
sender: "buyer",
timestamp: 1630000053
}, {
text: "转人工卡片消息:自动转人工",
sender: "service",
timestamp: 1630000001
}, {
text: "1~★Ulike小助手小身体乳U为您服务,您可以直接问我问题哦! ★618正式开启,直播间抢免单,整点抽千元大牌美妆! ☆叠加618补贴券再减260元,记得先领券再下单哦! 超级补贴(需PLUS会员)☞https://3.cn/abk-pOn 品类券☞https://3.cn/abk-oNh",
sender: "service",
timestamp: 1630000002
}, {
text: "11.11现货开卖,京仓快至当日达!今晚20点抢【1000元E卡】! 🎈蓝宝石Air3活动价1899,下单买1享13,全程保价不怕买贵! 🎈直播间下单享加赠,整点抽娇韵诗双萃精华! 蓝宝石冰脱Air3:https://3.cn/v/5DPNHO\nhttps://dd-static.jd.com/ddimg/jfs/t1/226892/15/272/84341/652ce80aF8cffb800/d0e97a4fcc78e021.jpg",
sender: "service",
timestamp: 1630000058
}, {
text: "https://dd-static.jd.com/ddimg/jfs/t1/112053/9/39071/60454/64906b26F349d5c32/12e578e8d2ddb0c6.jpg身体乳",
sender: "buyer",
timestamp: 1630000028
}, {
text: ".是的 宝子身体乳身体乳可以看这个哦",
sender: "service",
timestamp: 1630000029
}, {
text: "多给点赠品吧,支持无理由退换货吗",
sender: "buyer",
timestamp: 1630000030
}, {
text: "京东20周年大促-Ulike618限时返场】 Rose下单拍1享12: ✔限量送:冲牙器+防晒伞+按摩枕 ✔刮毛刀+身体乳+护目镜+专属皮盒 ✔入会身体乳+直播间棉柔巾+直播间刮刀(签收后补发) ✔晒单有礼芦荟胶+30元礼金",
sender: "service",
timestamp: 1630000031
}, {
text: "为您申请一支入会《身体乳》哒~ 点击入会链接 一键入会的喔~入会后为您备注呐~ https://shopmember.m.jd.com/shopcard?venderId=218510&channel=401",
sender: "service",
timestamp: 1630000032
}]
},
rules: {
// sources: ["buyer", "service"]
// sources: ["buyer"],
// sources: ["service"]
customRules: [{
pattern: '身体乳'
// flags: 'g' // 添加全局匹配标志
}]
}
};
// const result = extractor.process(input4)
// const result = extractor.process(patternInput1)
// console.log("[result] ",JSON.stringify(result, null, 2))
// 测试自定义规则匹配"无理由退换货"相关消息
const returnPolicyInput = {
scene: "chat",
rawData: {
messages: [{
text: "这个商品支持无理由退换货吗?",
sender: "buyer",
timestamp: 1630000000
}, {
text: "请问可以无理由退2货吗?",
sender: "buyer",
timestamp: 1630000001
}, {
text: "无理由退换货政策2是怎样的",
sender: "buyer",
timestamp: 1630000002
}, {
text: "支持7天无理由退换货",
sender: "service",
timestamp: 1630000003
}, {
text: "多给点赠品吧,支持无理由2退换货吗",
sender: "buyer",
timestamp: 1630000004
}, {
text: "本商品不支持无理由退换货",
sender: "service",
timestamp: 1630000005
}]
},
rules: {
sources: ["buyer"],
customRules: [{
pattern: '无理由(?:退换货|退货)|退换货政策',
flags: 'g'
}]
}
};
// const returnPolicyResult = extractor.process(returnPolicyInput);
// console.log("[returnPolicyResult] ", JSON.stringify(returnPolicyResult, null, 2));
const input5 = {
scene: "chat",
platform: "jd",
shopId: "12345",
rawData: {
messages: [{
message: {
type: 1,
// 文本消息
sub_type: 1,
text: {
content: "https://item.jd.com/10071498227426.html"
},
sku_id: "",
spu_id: ""
},
sender: "buyer",
timestamp: 1630000000
}, {
message: {
type: 1,
// 卡片消息
sub_type: 4,
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: "Ulike蓝宝石冰点脱毛仪",
desc: "连续7年销售第1!十年专注根源性脱毛",
price: 1899,
num: 1,
image_url: "https://img10.360buyimg.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://item.jd.com/10071498227426.html"
}]
}
}]
},
sku_id: "321",
spu_id: "123"
},
sender: "service",
timestamp: 1630000001
}]
},
rules: {
// sources: ["buyer", "service"],
// sources: ["buyer"],
sources: ["service"]
}
};
const JdInput = {
scene: "chat",
platform: "jd",
shopId: "12345",
rawData: {
messages: [
// 1. 文本消息
{
sender: "buyer",
timestamp: 1,
message: {
type: 1,
sub_type: 1,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
text: {
content: "请问Ulike蓝宝石脱毛仪和飞利浦哪个更好?"
}
}
}, {
message: {
type: 1,
// 文本消息
sub_type: 1,
text: {
content: "https://item.jd.com/10071498227426.html"
},
sku_id: "",
spu_id: ""
},
sender: "buyer",
timestamp: 2
},
// 2. 图片消息
{
sender: "service",
timestamp: 3,
message: {
type: 1,
sub_type: 2,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
image: {
url: "https://img10.360buyimg.com/img/jfs/t1/123/4567/7890.jpg",
width: 800,
height: 600
}
}
},
// 3. 视频消息
{
sender: "service",
timestamp: 4,
message: {
type: 1,
sub_type: 3,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
video: {
url: "http://example.com/video.mp4",
width: 480,
height: 1080
}
}
},
// 4. 卡片消息-标题
{
sender: "service",
timestamp: 5,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
header: {
type: 1,
icon: "http://icon.img",
title: "Ulike蓝宝石脱毛仪"
}
}]
}
}
},
// 5. 卡片消息-文本
{
sender: "service",
timestamp: 6,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
content: {
type: 2,
icon: "http://icon.img",
title: "活动说明",
content: "618大促活动正在进行中..."
}
}]
}
}
},
// 6. 卡片消息-图片
{
sender: "service",
timestamp: 7,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
img: {
type: 3,
url: "http://img.url"
}
}]
}
}
},
// 7. 卡片消息-商品
{
sender: "service",
timestamp: 80,
message: {
type: 1,
sub_type: 4,
sku_id: "321666",
spu_id: "123",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: "Ulike蓝宝石冰点脱毛仪",
desc: "连续7年销售第1!十年专注根源性脱毛",
price: 1899,
num: 1,
image_url: "https://img10.360buyimg.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://item.jd.com/1007149822742600016661.html"
}, {
title: "Ulike蓝宝石冰点脱毛仪--2",
desc: "连续7年销售第1!十年专注根源性脱毛--2",
price: 1899,
num: 1,
image_url: "https://img10.360buyimg.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://item.jd.com/1007149822742600016662.html"
}]
}
}]
}
}
},
// 8. 卡片消息-订单
{
sender: "system",
timestamp: 9,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "311349464904",
question: "",
origin_data: "",
card_msg: {
data: [{
orders: {
type: 5,
title: "您的订单",
desc: "已发货",
order_id: "311349464904",
total_price: "1899.00",
list: [{
title: "Ulike蓝宝石冰点脱毛仪",
desc: "",
extra_info: ["¥1899.00", "1件", "配送中"],
price: 1899,
num: 1,
image_url: "https://img10.360buyimg.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://item.jd.com/10071498227428.html"
}]
}
}]
}
}
},
// 9. 卡片消息-信息列表
{
sender: "service",
timestamp: 10,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
infos: {
type: 6,
list: [{
title: "订单状态",
desc: "已发货"
}, {
title: "物流信息",
desc: "京东快递 JD123456789"
}]
}
}]
}
}
},
// 10. 卡片消息-进度
{
sender: "system",
timestamp: 11,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
progress: {
type: 7,
list: [{
title: "订单创建",
icon: "http://icon1.img",
color: "#4CAF50",
desc: "2023-06-01 10:00:00",
tip: "已完成"
}, {
title: "商品出库",
icon: "http://icon2.img",
color: "#4CAF50",
desc: "2023-06-01 14:30:00",
tip: "已完成"
}, {
title: "配送中",
icon: "http://icon3.img",
color: "#2196F3",
desc: "预计2023-06-02送达",
tip: "进行中"
}]
}
}]
}
}
},
// 11. 卡片消息-优惠券
{
sender: "service",
timestamp: 12,
message: {
type: 1,
sub_type: 4,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
coupons: {
type: 8,
list: [{
style: 0,
type: 0,
begin: 16987923298,
end: 16987923298,
name: "仅限购买Ulike产品使用",
status: 0,
discount: "7.5",
quota: "300",
tag: "限品类东券",
image_url: "https://img10.360buyimg.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg"
}]
}
}]
}
}
},
// 12. 文件消息
{
sender: "service",
timestamp: 13,
message: {
type: 1,
sub_type: 5,
sku_id: "77-1",
spu_id: "77",
order_id: "",
question: "",
origin_data: "",
file: {
url: "http://example.com/使用说明书.pdf"
}
}
},
// 13. 语音消息
{
sender: "buyer",
timestamp: 14,
message: {
type: 1,
sub_type: 9,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
voice: {
url: "https://dd-static.jd.com/dd-file/27431E53-55AE-4B07-9701-4B80B0A2178E.pdf",
duration: 11
}
}
},
// 14. 买家进线消息
{
sender: "buyer",
timestamp: 15,
message: {
type: 1,
sub_type: 6,
sku_id: "321",
spu_id: "123",
order_id: "311349464904",
question: "",
origin_data: "",
buyer_enter_msg: {
from: "1",
sku_id: "321",
spu_id: "123",
order_id: "311349464904"
}
}
},
// 15. 转接消息
{
sender: "system",
timestamp: 16,
message: {
type: 1,
sub_type: 7,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
transfer_out: {
from: "1",
from_spin: "售前客服",
to_spin: "售后客服",
reason: "咨询售后问题",
pin: "miaji",
order_id: "order123",
plat_goods_id: "goods1234"
}
}
},
// 15. 转接消息
{
sender: "buyer",
timestamp: 1000000016,
message: {
type: 1,
sub_type: 8,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
transfer_in: {
from: "1",
from_spin: "1-转人工无人值守",
to_spin: "售后客服",
reason: "咨询售后问题",
pin: "miaji",
order_id: "order123",
plat_goods_id: "goods1234"
}
}
}, {
message: {
type: 1,
// 文本消息
sub_type: 1,
text: {
content: "https://item.jd.com/10071498227499.html"
},
sku_id: "",
spu_id: ""
},
sender: "buyer",
timestamp: 17
}, {
message: {
type: 1,
// 文本消息
sub_type: 1,
text: {
content: "https://item.jd.com/100714982274991.html"
},
sku_id: "",
spu_id: ""
},
sender: "buyer",
timestamp: 18
},
// 卡片消息-商品
{
sender: "service",
timestamp: 19,
message: {
type: 1,
sub_type: 4,
// sku_id: "321",
spu_id: "123",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: "Ulike蓝宝石冰点脱毛仪",
desc: "连续7年销售第1!十年专注根源性脱毛",
price: 1899,
num: 1,
image_url: "https://img10.360buyimg.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://item.jd.com/1007149822742600019.html"
}]
}
}]
}
}
}]
},
rules: {
customRules: [{
// 匹配PDD商品URL中的goods_id参数
pattern: "goods_id=(\\d+)",
flags: "gi"
}, {
pattern: "\\b\\d{12,}\\b"
}]
// sources: ["buyer"]
// sources: ["service"]
// sources: ["system"]
// sources: ["buyer", "service", "system"]
}
};
// const Result = extractor.process(JdInput);
// console.log("[input6] \n", JSON.stringify(Result, null, 2));
const PddInput1 = {
scene: "chat",
platform: "pdd",
shopId: "pdd_shop_123",
rawData: {
messages: [
// 1. 文本消息 - PDD商品链接
{
sender: "buyer",
timestamp: 7,
message: {
type: 1,
sub_type: 1,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
text: {
content: "https://mobile.yangkeduo.com/goods.html?goods_id=5428067607988"
}
}
},
// 2. 文本消息 - 纯数字ID
{
sender: "service",
timestamp: 8,
message: {
type: 1,
sub_type: 1,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
text: {
content: "464207308303725"
}
}
},
// 3. 卡片消息-商品
{
sender: "service",
timestamp: 11,
message: {
type: 1,
sub_type: 4,
// sku_id: "321",
spu_id: "123",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: "PDD爆款商品",
desc: "拼多多热销第一名",
price: 599,
num: 1,
image_url: "https://img.pddpic.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://mobile.yangkeduo.com/goods.html?goods_id=54280676079800"
}]
}
}]
}
}
},
// 4. 卡片消息-订单
{
sender: "system",
timestamp: 15,
message: {
type: 1,
sub_type: 4,
sku_id: "123",
spu_id: "",
order_id: "250407-573618327851862",
question: "",
origin_data: "",
card_msg: {
data: [{
orders: {
type: 5,
title: "您的PDD订单",
desc: "已发货",
order_id: "250407-573618327851862",
total_price: "599.00",
list: [{
title: "PDD爆款商品",
desc: "",
extra_info: ["¥599.00", "1件", "配送中"],
price: 599,
num: 1,
image_url: "https://img.pddpic.com/n1/jfs/t1/123456/7890123/123456/abcdefg/12345678/abcdefgh.jpg",
ware_url: "https://mobile.yangkeduo.com/goods.html?goods_id=542806760798"
}]
}
}]
}
}
},
// 5. 买家进线消息
{
sender: "buyer",
timestamp: 13,
message: {
type: 1,
sub_type: 6,
sku_id: "54280676079812312",
spu_id: "123",
order_id: "250407-573618327851862",
question: "",
origin_data: "",
buyer_enter_msg: {
from: "1",
sku_id: "54280676079812",
spu_id: "123",
order_id: "250407-573618327851862"
}
}
}]
},
rules: {
// sources: [ "system"]
sources: ["buyer"]
// sources: ["buyer", "service", "system"]
// sources: ["buyer", "service", "system"]
// sources: ["buyer", "service", "system"]
}
};
// const Result = extractor.process(PddInput1);
// console.log("[Result] \n", JSON.stringify(Result, null, 2));
const DyInput1 = {
scene: 'chat',
platform: 'dy',
shopId: 'dy_shop_12345',
rawData: {
messages: [
// 1. 纯文本消息
{
sender: 'buyer',
timestamp: 1,
message: {
type: 1,
sub_type: 1,
// TEXT
text: {
content: '我想购买这个商品:https://haohuo.jinritemai.com/ecommerce/trade/detail/index.html?id=3740802983957497151'
}
}
},
// 2. 商品卡片消息
{
sender: 'service',
timestamp: 2,
message: {
type: 4,
sub_type: 4,
// CARD
sku_id: '321',
spu_id: 'dy_spu_456',
card_msg: {
data: [{
wares: {
type: 1,
list: [{
title: '抖音爆款商品',
desc: '限时特价',
price: 99.9,
num: 1,
image_url: 'https://example.com/image1.jpg',
ware_url: 'https://haohuo.jinritemai.com/m/trade/detail?id=3740802983957497151'
}]
}
}]
}
}
},
// 3. 订单卡片消息
{
sender: 'system',
timestamp: 3,
message: {
type: 4,
sub_type: 4,
// CARD
order_id: 'dy_order_789',
card_msg: {
data: [{
orders: {
type: 2,
title: '您的订单',
desc: '已发货',
order_id: 'dy_order_789',
total_price: '199.8',
list: [{
title: '抖音爆款商品',
price: 99.9,
num: 2,
image_url: 'https://example.com/image1.jpg'
}]
}
}]
}
}
},
// 4. 买家进线消息
{
sender: 'buyer',
timestamp: 4,
message: {
type: 6,
sub_type: 6,
// BUYER_ENTER
buyer_enter_msg: {
from: '商品详情页',
sku_id: '123-',
spu_id: 'dy_spu_456',
order_id: 'dy_order_789'
}
}
},
// 5. 图片消息(包含商品URL)
{
sender: 'buyer',
timestamp: 5,
message: {
type: 2,
sub_type: 2,
// IMAGE
image: {
url: 'https://example.com/product_screenshot.jpg',
width: 800,
height: 600
}
}
}]
},
rules: {
// sources: ['buyer', 'service', 'system'],
// customRules: [
// {
// pattern: '商品ID:(\\d+)',
// flags: 'g',
// description: '提取商品ID格式'
// }
// ]
}
};
const inputKs = {
scene: 'chat',
platform: 'ks',
shopId: 'ks_shop_12345',
rawData: {
messages: [
// 1. 纯文本消息
{
sender: 'buyer',
timestamp: 1,
message: {
type: 1,
sub_type: 1,
// TEXT
text: {
content: '我想购买这个商品:https://www.kwaishop.com/merchant/shop/detail?id=24122507666640'
}
}
},
// 2. 商品卡片消息
{
sender: 'service',
timestamp: 2,
message: {
type: 4,
sub_type: 4,
// CARD
sku_id: '24122507666640',
spu_id: 'ks_spu_456',
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: '快手爆款商品',
desc: '限时特价',
price: 89.9,
num: 1,
image_url: 'https://example.com/image1.jpg',
ware_url: 'https://m.kwaishop.com/shop/detail?id=24122507666640'
}]
}
}]
}
}
},
// 3. 订单卡片消息
{
sender: 'system',
timestamp: 3,
message: {
type: 4,
sub_type: 4,
// CARD
order_id: 'ks_order_789',
card_msg: {
data: [{
orders: {
type: 2,
title: '您的订单',
desc: '已发货',
order_id: 'ks_order_789',
total_price: '179.8',
list: [{
title: '快手爆款商品',
price: 89.9,
num: 2,
image_url: 'https://example.com/image1.jpg'
}]
}
}]
}
}
},
// 4. 买家进线消息
{
sender: 'buyer',
timestamp: 4,
message: {
type: 6,
sub_type: 6,
// BUYER_ENTER
buyer_enter_msg: {
from: '商品详情页',
sku_id: '1233',
spu_id: 'ks_spu_456',
order_id: 'ks_order_789'
}
}
},
// 5. 图片消息
{
sender: 'buyer',
timestamp: 5,
message: {
type: 2,
sub_type: 2,
// IMAGE
image: {
url: 'https://example.com/product_screenshot.jpg',
width: 800,
height: 600
}
}
}]
},
rules: {
// sources: ['buyer', 'service', 'system'],
// sources: ['buyer', 'service', 'system'],
// customRules: [
// {
// pattern: '商品ID:(\\d+)',
// flags: 'g',
// description: '提取商品ID格式'
// }
// ]
}
};
// const Result = extractor.process(inputKs);
// console.log("[Result] \n", JSON.stringify(Result, null, 2));
const inputXhs = {
scene: 'chat',
platform: 'xhs',
shopId: 'xhs_shop_12345',
rawData: {
messages: [
// 1. 纯文本消息
// {
// sender: 'buyer',
// timestamp: 1,
// message: {
// type: 1,
// sub_type: 1, // TEXT
// text: {
// content: '我想购买这个商品:https://www.xiaohongshu.com/goods-detail/67ce76ab8deea80001010f49'
// }
// }
// },
// 2. 商品卡片消息
{
sender: 'service',
timestamp: 20,
message: {
type: 4,
sub_type: 4,
// CARD
sku_id: '67ce76ab8deea80001010f49',
spu_id: 'xhs_spu_456',
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: '小红书爆款商品',
desc: '限时特价',
price: 129.9,
num: 1,
image_url: 'https://example.com/image1.jpg',
ware_url: 'https://www.xiaohongshu.com/goods-detail/67ce76ab8deea80001010f49?sourceFrom=customer_card'
}]
}
}]
}
}
},
// // 3. 订单卡片消息
// {
// sender: 'system',
// timestamp: 3,
// message: {
// type: 4,
// sub_type: 4, // CARD
// order_id: 'xhs_order_789',
// card_msg: {
// data: [{
// orders: {
// type: 2,
// title: '您的订单',
// desc: '已发货',
// order_id: 'xhs_order_789',
// total_price: '259.8',
// list: [{
// title: '小红书爆款商品',
// price: 129.9,
// num: 2,
// image_url: 'https://example.com/image1.jpg'
// }]
// }
// }]
// }
// }
// },
// // 4. 买家进线消息
// {
// sender: 'buyer',
// timestamp: 4,
// message: {
// type: 6,
// sub_type: 6, // BUYER_ENTER
// buyer_enter_msg: {
// from: '商品详情页',
// sku_id: '67ce76ab8deea80001010f49',
// spu_id: 'xhs_spu_456',
// order_id: 'xhs_order_789'
// }
// }
// },
// // 5. 图片消息
// {
// sender: 'buyer',
// timestamp: 5,
// message: {
// type: 2,
// sub_type: 2, // IMAGE
// image: {
// url: 'https://example.com/product_screenshot.jpg',
// width: 800,
// height: 600
// }
// }
// },
// 6. 带参数的商品链接
{
sender: 'buyer',
timestamp: 6,
message: {
type: 1,
sub_type: 1,
text: {
content: '这个商品有优惠吗?https://www.xiaohongshu.com/goods-detail/67e375423d0cf400013134a7?sourceFrom=share'
}
}
}]
},
rules: {
// sources: ['buyer', 'service', 'system'],
// customRules: [
// {
// pattern: '商品ID:([a-f0-9]{24})',
// flags: 'g',
// description: '提取小红书商品ID格式'
// }
// ]
}
};
// const Result = extractor.process(inputXhs);
// console.log("[Result] \n", JSON.stringify(Result, null, 2));
const customPddInput = {
scene: "chat",
platform: "pdd",
shopId: "pdd_shop_123",
rawData: {
messages: [
// 1. 文本消息 - PDD商品链接
{
sender: "buyer",
timestamp: 7,
message: {
type: 1,
sub_type: 1,
text: {
content: "https://mobile.yangkeduo.com/goods.html?goods_id=5428067607988"
}
}
},
// 2. 文本消息 - 纯数字ID
{
sender: "service",
timestamp: 8,
message: {
type: 1,
sub_type: 1,
text: {
content: "464207308303725"
}
}
},
// 3. 卡片消息-商品
{
sender: "service",
timestamp: 11,
message: {
type: 1,
sub_type: 4,
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: "PDD爆款商品",
ware_url: "https://mobile.yangkeduo.com/goods.html?goods_id=54280676079800"
}]
}
}]
}
}
}]
},
rules: {
// sources: ['buyer'],
// sources: ['service'],
// sources: ['system'],
// sources: ['buyer', 'service', 'system'],
customRules: [{
// 匹配PDD商品URL中的goods_id参数
pattern: "goods_id=(\\d+)",
flags: "gi"
}, {
pattern: "\\b\\d{12,}\\b"
}]
}
};
// const result = extractor.process(customPddInput);
// console.log("[PDD匹配结果]", JSON.stringify(result, null, 2));
const TbInput = {
scene: "chat",
platform: "tb",
shopId: "tb_shop_123",
rawData: {
messages: [
// 1. 文本消息 - 淘宝商品链接
{
sender: "buyer",
timestamp: 10,
message: {
type: 1,
sub_type: 1,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
text: {
content: "http://item.taobao.com/item.htm?id=827149057696"
}
}
},
// 2. 视频消息回复
{
sender: "service",
timestamp: 9,
message: {
type: 1,
sub_type: 3,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
video: {
url: "https://api.360zqf.com/oss/zqf-yxf-0/0877681b2e75951e233c1c1168f28bae.mp4",
width: 640,
height: 360
}
}
},
// 3. 图片消息
{
sender: "buyer",
timestamp: 8,
message: {
type: 1,
sub_type: 2,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
image: {
url: "http://private-store.1yangai.com/answer_pics/66c872619b82f80c58b1896d.jpg",
width: 800,
height: 600
}
}
},
// 4. 卡片消息-商品
{
sender: "service",
timestamp: 11,
message: {
type: 1,
sub_type: 4,
sku_id: "747690467878",
spu_id: "tb_spu_123",
order_id: "",
question: "",
origin_data: "",
card_msg: {
data: [{
wares: {
type: 4,
list: [{
title: "淘宝爆款商品",
desc: "限时特价",
price: 299,
num: 1,
image_url: "https://img.alicdn.com/bao/uploaded/i1/2201509363649/O1CN01JYwZ9M1xZ5XQ2Qj7Z_!!0-item_pic.jpg",
ware_url: "http://item.taobao.com/item.htm?id=747690467878"
}]
}
}]
}
}
},
// 5. 买家进线消息
{
sender: "buyer",
timestamp: 7,
message: {
type: 1,
sub_type: 6,
sku_id: "770170424503",
spu_id: "tb_spu_456",
order_id: "tb_order_789",
question: "",
origin_data: "",
buyer_enter_msg: {
from: "1",
sku_id: "7701704245031",
spu_id: "tb_spu_456",
order_id: "tb_order_789"
}
}
},
// 6. 转接消息
{
sender: "system",
timestamp: 6,
message: {
type: 1,
sub_type: 7,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
transfer_out: {
from: "1",
from_spin: "售前客服",
to_spin: "售后客服",
reason: "咨询售后问题",
pin: "miaji",
order_id: "tb_order_789",
plat_goods_id: "770170424503"
}
}
}]
},
rules: {
// sources: ["buyer", "service", "system"]
// sources: ["buyer"]
// sources: ["service"]
// sources: ["system"]
// customRules: [
// {
// pattern: /(\d+)/g,
// }
// ]
}
};
// 使用示例
const tbResult = await _index.default.process(TbInput);
console.log("[tbResult] \n", JSON.stringify(tbResult, null, 2));
// 测试与商品中心联动
const TbInputToGC1 = {
scene: "chat",
platform: "tb",
shopId: "5d4789702452f60013b780fe",
rawData: {
messages: [
// 1. 文本消息 - 淘宝商品链接
{
sender: "buyer",
timestamp: 1,
message: {
type: 1,
sub_type: 1,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
text: {
content: "https://item.taobao.com/item.htm?id=717532504039"
}
}
}]
},
rules: {
// sources: ["buyer", "service", "system"]
// sources: ["buyer"]
// sources: ["service"]
// sources: ["system"]
}
};
// 使用示例
// const tbResult = await extractor.process({
// ...TbInputToGC1
// });
// console.log("\n[tbResult] \n", JSON.stringify(tbResult, null, 2));
const lazadaInputToGC1 = {
scene: "chat",
// platform: "lazada",
platform: "shopee",
// platform: "tiktok",
shopId: "5d4789702452f60013b780fe",
rawData: {
messages: [
// 1. 文本消息 - 淘宝商品链接
{
sender: "buyer",
timestamp: 1,
message: {
type: 1,
sub_type: 1,
sku_id: "",
spu_id: "",
order_id: "",
question: "",
origin_data: "",
text: {
// content: "https://www.lazada.co.th/red-full-yuncheng-apple-i5692348052-s24278110684.html"
content: "https://shopee.co.th/Premium-Quality-Apples-Freshly-Harvested-and-Directly-from-the-Orchard-i.1283617457.27970524106?xptdk=21bcdeba-f3a9-427a-9b8d-7f331e4767b8"
// content: "https://th.xiapibuy.com/B-262%F0%9F%94%A5%E0%B8%81%E0%B8%A3%E0%B8%B0%E0%B9%80%E0%B8%9B%E0%B9%8B%E0%B8%B2%E0%B8%AA%E0%B8%B0%E0%B8%9E%E0%B8%B2%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%87-%E0%B8%81%E0%B8%A3%E0%B8%B0%E0%B9%80%E0%B8%9B%E0%B9%8B%E0%B8%B2%E0%B8%9C%E0%B9%89%E0%B8%B2%E0%B9%81%E0%B8%84%E0%B8%99%E0%B8%A7%E0%B8%B2%E0%B8%AA-%E0%B8%AA%E0%B9%8D%E0%B8%B2%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%AB%E0%B8%8D%E0%B8%B4%E0%B8%87-3%E0%B8%AA%E0%B8%B5-high-quality-(%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%A1%E0%B8%B5%E0%B8%88%E0%B8%B5%E0%B9%89%E0%B8%AB%E0%B9%89%E0%B8%AD%E0%B8%A2%E0%B8%81%E0%B8%A3%E0%B8%B0%E0%B9%80%E0%B8%9B%E0%B9%8B%E0%B8%B2)-i.26237854.23953961353"
// content: "https://shop.tiktok.com/view/product/1730886246444074606?locale=en®ion=MY"
}
}
}]
},
rules: {
// sources: ["buyer", "service", "system"]
// sources: ["buyer"]
// sources: ["service"]
// sources: ["system"]
}
};
// 使用示例
// const tbResult = await extractor.process({
// ...lazadaInputToGC1,
// authConfig: {
// // overseasAuth: 'YOUR_OVERSEAS_AUTH_TOKEN' // 添加海外平台认证
// // taobaoAuth: 'Basic c2Vjb25kYXJ5VXNlcjpCQjE3MEQwMUFFNEY4NDU0QTRGNjEwMUYwQThBNUM3Mg==',
// // domesticAuth: 'Basic c2Vjb25kYXJ5VXNlcjo4RTI4NUQ1RTA0RTRDMThERkMyNzg1OUE1MEIyQ0MyMg=='
// }
// });
// console.log("\n[overseasAuth Result] \n", JSON.stringify(tbResult, null, 2));
// const shopeeUrl = 'https://shopee.co.th/xxx-i.1283617457.27970524106';
// const shopeeId = extractor.extractFromUrl(shopeeUrl, 'shopee');
// console.log('Shopee商品ID:', shopeeId); // 预期输出: 27970524106
// const tiktokUrl = 'https://shop.tiktok.com/view/product/1730886246444074606';
// const tiktokId = extractor.extractFromUrl(tiktokUrl, 'tiktok');
// console.log('TikTok商品ID:', tiktokId); // 预期输出: 1730886246444074606
// 淘系的商品中心返回的示例:
// curl -X POST \
// "https://gateway.1yangai.com/open/goods-center/gc/v2/goods_info" \
// -H "Content-Type: application/json" \
// -H "Authorization: Basic c2Vjb25kYXJ5VXNlcjpCQjE3MEQwMUFFNEY4NDU0QTRGNjEwMUYwQThBNUM3Mg==" \(这个要写成laf实例的配置项)
// -d '{
// "plat_goods_id": "717532504039",
// "platform": "tb",
// "shop_id": "5d4789702452f60013b780fe"
// }'
// {"code":0,"data":{"id":"645b4fde3d2d73a78d2f1a4f","shop_id":"5d4789702452f60013b780fe","platform":"tb","plat_goods_id":"717532504039","plat_goods_name":"六只兔子3条装男士内裤7A抑菌舒适透气无痕短裤平角裤四角裤40s棉","plat_goods_url":"https://item.taobao.com/item.htm?id=717532504039","plat_goods_img":"https://img.alicdn.com/bao/uploaded/i4/154491046/O1CN01w08nfL1Jb7FsxxxTb_!!154491046.jpg","create_time":"2025-04-09T16:41:34.58983+08:00","update_time":"2025-04-09T18:51:51.59287+08:00","article_number":"1B23E1375A365","goods_hot":11280,"price":"59.90","props":[{"source":2,"prop_name":"腰型","value":["中腰"]},{"source":2,"prop_name":"适用对象","value":["青年"]},{"source":2,"prop_name":"面料俗称","value":["其他"]},{"source":2,"prop_name":"功能","value":["提臀"]},{"source":2,"prop_name":"条数","value":["3条"]},{"source":2,"prop_name":"图案","value":["纯色"]},{"source":2,"prop_name":"适用性别","value":["男"]},{"source":2,"prop_name":"尺码","value":["3XL","2XL","L","XL","4XL"]},{"source":2,"prop_name":"品牌","value":["SIX RABBIT/六只兔子"]},{"source":2,"prop_name":"风格","value":["简约"]},{"source":2,"prop_name":"成分含量","value":["41%(含)-60%(含)"]},{"source":2,"prop_name":"款号","value":["1B23E1375A365"]},{"source":2,"prop_name":"材质","value":["棉"]},{"source":2,"prop_name":"上市年份季节","value":["2024年春季"]},{"source":2,"prop_name":"款式","value":["平角裤"]},{"source":2,"prop_name":"颜色分类","value":["米白+浅兰+浅灰","深灰+绿色+浅兰","深灰+米白+绿色","浅杏+中灰+浅灰","浅杏+浅绿+中灰","浅绿+浅蓝+浅灰","中灰+浅蓝+浅杏","浅灰+卡其+浅绿","卡其+浅蓝+浅灰","卡其+浅绿+浅蓝","浅绿+浅灰+粉色","浅蓝+浅灰+粉色","粉色+浅绿+浅蓝","浅灰+浅蓝+浅蓝","浅咖+浅灰+冰蓝","奶绿+浅咖+浅灰","浅灰+冰蓝+黑色","浅兰+浅灰+深灰","浅灰 +深灰+米白","米白+绿色+浅兰","绿色+浅灰+深灰","浅灰+米白+绿色","浅兰+深灰+米白","绿色+浅兰+浅灰"]}],"sku_props":[{"source":0,"prop_name":"尺码","value":["L","XL","2XL","3XL","4XL"]},{"source":0,"prop_name":"颜色分类","value":["米白+浅兰+浅灰","深灰+绿色+浅兰","深灰+米白+绿色","浅杏+中灰+浅灰","浅杏+浅绿+中灰","浅绿+浅蓝+浅灰","中灰+浅蓝+浅杏","浅灰+卡其+浅绿","卡其+浅蓝+浅灰","卡其+浅绿+浅蓝","浅绿+浅灰+粉色","浅蓝+浅灰+粉色","粉色+浅绿+浅蓝","浅灰+浅蓝+浅蓝","浅咖+浅灰+冰蓝","奶绿+浅咖+浅灰","浅灰+冰蓝+黑色","浅兰+浅灰+深灰","浅灰 +深灰+米白","米白+绿色+浅兰","绿色+浅灰+深灰","浅灰+米白+绿色","浅兰+深灰+米白","绿色+浅兰+浅灰"]}],"custom_props":[],"system_props":[],"relation_props":[{"source":4,"prop_name":"goods_category_id","value":["5d4a2b33589b0900094b5865"]}],"all_props":[{"source":2,"prop_name":"尺码(销售属性)","value":["L","XL","2XL","3XL","4XL"]},{"source":2,"prop_name":"颜色分类(销售属性)","value":["米白+浅兰+浅灰","深灰+绿色+浅兰","深灰+米白+绿色","浅杏+中灰+浅灰","浅杏+浅绿+中灰","浅绿+浅蓝+浅灰","中灰+浅蓝+浅杏","浅灰+卡其+浅绿","卡其+浅蓝+浅灰","卡其+浅绿+浅蓝","浅绿+浅灰+粉色","浅蓝+浅灰+粉色","粉色+浅绿+浅蓝","浅灰+浅蓝+浅蓝","浅咖+浅灰+冰蓝","奶绿+浅咖+浅灰","浅灰+冰蓝+黑色","浅兰+浅灰+深灰","浅灰 +深灰+米白","米白+绿色+浅兰","绿色+浅灰+深灰","浅灰+米白+绿色","浅兰+深灰+米白","绿色+浅兰+浅灰"]},{"source":2,"prop_name":"腰型","value":["中腰"]},{"source":2,"prop_name":"适用对象","value":["青年"]},{"source":2,"prop_name":"面料俗称","value":["其他"]},{"source":2,"prop_name":"功能","value":["提臀"]},{"source":2,"prop_name":"条数","value":["3条"]},{"source":2,"prop_name":"图案","value":["纯色"]},{"source":2,"prop_name":"适用性别","value":["男"]},{"source":2,"prop_name":"尺码","value":["3XL","2XL","L","XL","4XL"]},{"source":2,"prop_name":"品牌","value":["SIX RABBIT/六只兔子"]},{"source":2,"prop_name":"风格","value":["简约"]},{"source":2,"prop_name":"成分含量","value":["41%(含)-60%(含)"]},{"source":2,"prop_name":"款号","value":["1B23E1375A365"]},{"source":2,"prop_name":"材质","value":["棉"]},{"source":2,"prop_name":"上市年份季节","value":["2024年春季"]},{"source":2,"prop_name":"款式","value":["平角裤"]},{"source":2,"prop_name":"颜色分类","value":["米白+浅兰+浅灰","深灰+绿色+浅兰","深灰+米白+绿色","浅杏+中灰+浅灰","浅杏+浅绿+中灰","浅绿+浅蓝+浅灰","中灰+浅蓝+浅杏","浅灰+卡其+浅绿","卡其+浅蓝+浅灰","卡其+浅绿+浅蓝","浅绿+浅灰+粉色","浅蓝+浅灰+粉色","粉色+浅绿+浅蓝","浅灰+浅蓝+浅蓝","浅咖+浅灰+冰蓝","奶绿+浅咖+浅灰","浅灰+冰蓝+黑色","浅兰+浅灰+深灰","浅灰 +深灰+米白","米白+绿色+浅兰","绿色+浅灰+深灰","浅灰+米白+绿色","浅兰+深灰+米白","绿色+浅兰+浅灰"]},{"source":4,"prop_name":"goods_category_id","value":["5d4a2b33589b0900094b5865"]}],"cid":201775802,"plat_cid":"201775802","seller_cids":["","1739824817","1738276161","1739824814",""],"list_time":"2025-04-05 17:04:41","created_time":"2023-05-10T16:03:38+08:00","status":1,"is_onsale":true,"profit_stat":{},"presale":0,"presale_end_time":{"type":0,"value":"0001-01-01T00:00:00Z","description":""},"presale_delivery_time":{"source":0,"type":0,"value":