ftdsy-attr 1.0.4 → 2.0.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.
Files changed (64) hide show
  1. package/dist/ftdsy-attr.cjs.js +2 -0
  2. package/dist/ftdsy-attr.cjs.js.map +1 -0
  3. package/dist/ftdsy-attr.d.ts +93 -0
  4. package/dist/ftdsy-attr.esm.js +2 -0
  5. package/dist/ftdsy-attr.esm.js.map +1 -0
  6. package/dist/index.html +831 -2563
  7. package/dist/types/api/tb/index.d.ts +3 -0
  8. package/dist/types/category/bags/bags_leather.d.ts +16 -0
  9. package/dist/types/category/bags/bags_motion.d.ts +16 -0
  10. package/dist/types/category/clothing/clothing_accessory.d.ts +16 -0
  11. package/dist/types/category/clothing/clothing_children.d.ts +16 -0
  12. package/dist/types/category/clothing/clothing_jewelry.d.ts +16 -0
  13. package/dist/types/category/clothing/clothing_men.d.ts +16 -0
  14. package/dist/types/category/clothing/clothing_motion.d.ts +16 -0
  15. package/dist/types/category/clothing/clothing_underwear.d.ts +16 -0
  16. package/dist/types/category/clothing/clothing_women.d.ts +16 -0
  17. package/dist/types/category/departmentStore/departmentStore_bedding.d.ts +16 -0
  18. package/dist/types/category/departmentStore/departmentStore_flower.d.ts +16 -0
  19. package/dist/types/category/departmentStore/departmentStore_homefabric.d.ts +16 -0
  20. package/dist/types/category/departmentStore/departmentStore_petanimal.d.ts +16 -0
  21. package/dist/types/category/departmentStore/departmentStore_storage.d.ts +16 -0
  22. package/dist/types/category/index.d.ts +7 -0
  23. package/dist/types/category/motherBaby/motherBaby_bady.d.ts +16 -0
  24. package/dist/types/category/motherBaby/motherBaby_gravida.d.ts +16 -0
  25. package/dist/types/category/numeral/numeral_accessory.d.ts +16 -0
  26. package/dist/types/category/numeral/numeral_camera.d.ts +16 -0
  27. package/dist/types/category/numeral/numeral_computer.d.ts +16 -0
  28. package/dist/types/category/shoes/shoes_children.d.ts +16 -0
  29. package/dist/types/category/shoes/shoes_men.d.ts +16 -0
  30. package/dist/types/category/shoes/shoes_motion.d.ts +16 -0
  31. package/dist/types/category/shoes/shoes_women.d.ts +16 -0
  32. package/dist/types/category/sportsOutdoor/sportsOutdoor_outdoors.d.ts +16 -0
  33. package/dist/types/category/sportsOutdoor/sportsOutdoor_sports.d.ts +16 -0
  34. package/dist/types/category/vehicle/vehicle_cycling.d.ts +16 -0
  35. package/dist/types/category/vehicle/vehicle_electricvehicle.d.ts +16 -0
  36. package/dist/types/category/vehicle/vehicle_motorcycle.d.ts +16 -0
  37. package/dist/types/main.d.ts +21 -0
  38. package/dist/types/models/defaultModel.d.ts +16 -0
  39. package/dist/types/models/index.d.ts +11 -0
  40. package/dist/types/models/modal.d.ts +11 -0
  41. package/dist/types/platform/index.d.ts +6 -0
  42. package/dist/types/platform/platform/albb.d.ts +6 -0
  43. package/dist/types/platform/platform/dy.d.ts +6 -0
  44. package/dist/types/platform/platform/jd.d.ts +6 -0
  45. package/dist/types/platform/platform/ks.d.ts +6 -0
  46. package/dist/types/platform/platform/pdd.d.ts +9 -0
  47. package/dist/types/platform/platform/shopee.d.ts +6 -0
  48. package/dist/types/platform/platform/tb.d.ts +6 -0
  49. package/dist/types/platform/platform/tiktok.d.ts +6 -0
  50. package/dist/types/platform/platform/tm.d.ts +6 -0
  51. package/dist/types/platform/platform/wxsph.d.ts +6 -0
  52. package/dist/types/platform/platform/xhs.d.ts +6 -0
  53. package/dist/types/platform/type.d.ts +70 -0
  54. package/dist/types/property/index.d.ts +10 -0
  55. package/dist/types/property/matchProperty.d.ts +6 -0
  56. package/dist/types/property/perpareProperty.d.ts +9 -0
  57. package/dist/types/property/predictionProperty.d.ts +9 -0
  58. package/dist/types/type.d.ts +36 -0
  59. package/dist/types/utils/axios.d.ts +15 -0
  60. package/dist/types/utils/error.d.ts +12 -0
  61. package/dist/types/utils/utils.d.ts +46 -0
  62. package/package.json +24 -19
  63. package/dist/ftdsy-attr.js +0 -13903
  64. package/dist/ftdsy-attr.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ftdsy-attr.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,93 @@
1
+ type Platform = 'pdd' | 'tb' | 'jd' | 'dy' | 'shopee' | 'xhs' | 'ks' | 'dsy' | 'albb' | 'shopeebt' | 'tgc' | 'wxsph' | 'tiktok' | 'tm' | 'tiktokUs';
2
+ type GoodsAttr = {
3
+ id?: string | number;
4
+ attr_name: string;
5
+ value: string | string[];
6
+ value_id?: string | number | string[];
7
+ };
8
+ type PropertyItem = {
9
+ property_id: string | number;
10
+ property_name: string;
11
+ property_required: boolean;
12
+ property_type: number;
13
+ property_value?: number | string | PropertySelectOption[] | PropertySelectOption | object;
14
+ property_values: PropertySelectOption[];
15
+ select_max_num: number;
16
+ select_custom: boolean;
17
+ input_num: number;
18
+ input_max_num: number;
19
+ input_type: string;
20
+ property_unit: string;
21
+ property_units: string[];
22
+ input_operator?: string;
23
+ input_values?: PropertyInputOption[];
24
+ date_format: string;
25
+ has_children: boolean;
26
+ show?: boolean;
27
+ show_condition: PropertyShowCondition[];
28
+ condition_values: PropertySelectOption[];
29
+ property_tips?: string;
30
+ measure_templates?: any;
31
+ property_cstore?: boolean;
32
+ };
33
+ type PropertySelectOption = {
34
+ name: string;
35
+ value_id: string;
36
+ value: string;
37
+ parent_value?: string[];
38
+ parent_id?: string;
39
+ parent_name?: string;
40
+ children_values?: PropertySelectOption[];
41
+ disableContent?: boolean;
42
+ content?: number;
43
+ similarity?: number;
44
+ };
45
+ type PropertyInputOption = {
46
+ title: string;
47
+ value: string;
48
+ };
49
+ type PropertyShowCondition = {
50
+ parent_property_id: string;
51
+ parent_property_value: string[];
52
+ };
53
+
54
+ /**
55
+ * 生成自定义属性列表
56
+ * 对目标平台的属性列表进行处理,获取转换后的自定义属性列表
57
+ * */
58
+ declare function createCategoryProperties(platform: Platform, pt_attrs: any[]): PropertyItem[];
59
+
60
+ interface MatchGoods {
61
+ title?: string;
62
+ goods_sn?: string;
63
+ ccc_code?: string;
64
+ remark?: string;
65
+ }
66
+ interface MatchDatas extends MatchGoods {
67
+ cate_id: string;
68
+ cate_path: string;
69
+ platform: Platform;
70
+ properties: any[];
71
+ attrs?: any[];
72
+ }
73
+
74
+ declare const _default: {
75
+ version: string;
76
+ matchCategoryProperties: typeof matchCategoryProperties;
77
+ createCategoryProperties: typeof createCategoryProperties;
78
+ createCategoryPropertyTemplate: typeof createCategoryPropertyTemplate;
79
+ };
80
+
81
+ /**
82
+ * 匹配属性值
83
+ * @param matchDatas 匹配数据
84
+ * @param matchLevel 匹配等级
85
+ * @param outType 匹配结果输出类型 group: 分组,template: 模板
86
+ * */
87
+ declare function matchCategoryProperties(matchDatas: MatchDatas, matchLevel?: number, outType?: string): Promise<unknown>;
88
+ /**
89
+ * 创建分类属性模板
90
+ * */
91
+ declare function createCategoryPropertyTemplate(properties: any[]): GoodsAttr[];
92
+
93
+ export { _default as default };