@polyv/product-sdk 1.1.0-rc-20250703.1 → 1.3.0-rc-20250814.1

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/index.es.d.ts CHANGED
@@ -273,6 +273,14 @@ export declare interface FinanceProductData extends ProductBasicData, ProductLin
273
273
  yield: string;
274
274
  }
275
275
 
276
+ export declare interface GetLaunchProductListParams {
277
+ pageNumber?: number;
278
+ pageSize?: number;
279
+ keyword?: string;
280
+ /** 在架状态 */
281
+ status?: ProductStatus;
282
+ }
283
+
276
284
  /**
277
285
  * 获取订单详情参数
278
286
  */
@@ -326,6 +334,17 @@ export declare interface GetProductListParams {
326
334
  page?: number;
327
335
  }
328
336
 
337
+ export declare interface LaunchProductListResult extends PageContent<ProductData> {
338
+ /**
339
+ * 上架数量
340
+ */
341
+ upCount: number;
342
+ /**
343
+ * 下架数量
344
+ */
345
+ downCount: number;
346
+ }
347
+
329
348
  export declare type MaybePromise<R> = () => Promise<R> | R;
330
349
 
331
350
  /**
@@ -348,10 +367,18 @@ export declare interface NormalProductData extends ProductBasicData, ProductLink
348
367
  * 价格
349
368
  */
350
369
  realPrice: number;
370
+ /**
371
+ * 原价类型
372
+ */
373
+ originPriceType: ProductPriceType;
351
374
  /**
352
375
  * 原价
353
376
  */
354
377
  originPrice: number;
378
+ /**
379
+ * 自定义原价
380
+ */
381
+ customOriginalPrice: string;
355
382
  /**
356
383
  * 自定义价格
357
384
  */
@@ -372,6 +399,10 @@ export declare interface NormalProductData extends ProductBasicData, ProductLink
372
399
  * 客服方式
373
400
  */
374
401
  customerServiceType: ProductServiceType;
402
+ /**
403
+ * 是否强制显示售罄
404
+ */
405
+ forceShowSoldOut: boolean;
375
406
  /**
376
407
  * 库存开关
377
408
  */
@@ -781,7 +812,7 @@ export declare interface PositionProductData extends ProductBasicData, ProductLi
781
812
  */
782
813
  export declare class Product {
783
814
  iarCore: InteractionReceiveCore;
784
- config: ProductSDKConfig;
815
+ config?: ProductSDKConfig | undefined;
785
816
  ProductType: typeof ProductType;
786
817
  ProductLinkType: typeof ProductLinkType;
787
818
  ProductLinkJumpWay: typeof ProductLinkJumpWay;
@@ -795,7 +826,11 @@ export declare class Product {
795
826
  ProductServiceType: typeof ProductServiceType;
796
827
  ProductPushRule: typeof ProductPushRule;
797
828
  eventEmitter: EventEmitter<ProductEventsRelations, ProductEvents>;
798
- constructor(iarCore: InteractionReceiveCore, config: ProductSDKConfig);
829
+ private __currentPushingProductId;
830
+ private __currentPushingProductPushRule;
831
+ private __isPushingProduct;
832
+ constructor(iarCore: InteractionReceiveCore, config?: ProductSDKConfig | undefined);
833
+ /* Excluded from this release type: __clearCurrentPushingProduct */
799
834
  /**
800
835
  * 获取商品标签列表
801
836
  * @param params 获取参数
@@ -821,6 +856,11 @@ export declare class Product {
821
856
  * ```
822
857
  */
823
858
  getProductList(params?: GetProductListParams): Promise<ProductListResult>;
859
+ /**
860
+ * 获取商品列表(发起端)
861
+ * @param params 获取参数
862
+ */
863
+ getLaunchProductList(params: GetLaunchProductListParams): Promise<LaunchProductListResult>;
824
864
  /**
825
865
  * 获取商品数据
826
866
  * @param productId 商品 id
@@ -899,6 +939,7 @@ export declare class Product {
899
939
  * ```
900
940
  */
901
941
  getProductHotSaleConfig(): Promise<ProductHotSaleConfig | undefined>;
942
+ /* Excluded from this release type: getCurrentPushingProductId */
902
943
  /**
903
944
  * 获取当前推送中的商品数据
904
945
  * @example
@@ -908,6 +949,111 @@ export declare class Product {
908
949
  * ```
909
950
  */
910
951
  getCurrentPushingProduct(productId?: number): Promise<ProductData | undefined>;
952
+ protected _explainProduct(productId: number, recordType: ProductExplainOperation): Promise<void | undefined>;
953
+ /**
954
+ * 开始商品讲解
955
+ * @param productId 商品 id
956
+ * @example
957
+ * ```js
958
+ * await productTarget.startExplain(123);
959
+ * ```
960
+ */
961
+ startExplain(productId: number): Promise<void> | undefined;
962
+ /**
963
+ * 重新开始商品讲解
964
+ * @param productId 商品 id
965
+ * @example
966
+ * ```js
967
+ * await productTarget.restartExplain(123);
968
+ * ```
969
+ */
970
+ restartExplain(productId: number): Promise<void> | undefined;
971
+ /**
972
+ * 结束商品讲解
973
+ * @param productId 商品 id
974
+ * @example
975
+ * ```js
976
+ * await productTarget.endExplain(123);
977
+ * ```
978
+ */
979
+ endExplain(productId: number): Promise<void> | undefined;
980
+ /**
981
+ * 删除商品讲解
982
+ * @param productId 商品 id
983
+ * @example
984
+ * ```js
985
+ * await productTarget.deleteExplain(123);
986
+ * ```
987
+ */
988
+ deleteExplain(productId: number): Promise<void>;
989
+ /**
990
+ * 商品开价
991
+ * @param productId 商品 id
992
+ * @example
993
+ * ```js
994
+ * await productTarget.openProductPrice(123);
995
+ * ```
996
+ */
997
+ openProductPrice(productId: number): Promise<void>;
998
+ /**
999
+ * 商品隐藏价格
1000
+ * @param productId 商品 id
1001
+ * @example
1002
+ * ```js
1003
+ * await productTarget.hideProductPrice(123);
1004
+ * ```
1005
+ */
1006
+ hideProductPrice(productId: number): Promise<void>;
1007
+ /**
1008
+ * 获取商品设置
1009
+ */
1010
+ getProductSetting(): Promise<ProductSetting>;
1011
+ /**
1012
+ * 推送商品
1013
+ * @param productId 商品 id
1014
+ * @param rule 推送规则
1015
+ * @example
1016
+ * ```js
1017
+ * await productTarget.pushProduct(123, ProductPushRule.SmallCard);
1018
+ * ```
1019
+ */
1020
+ pushProduct(productId: number, rule?: ProductPushRule): Promise<void>;
1021
+ /**
1022
+ * 取消推送商品
1023
+ * @param productId 商品 id
1024
+ * @example
1025
+ * ```js
1026
+ * await productTarget.cancelPushProduct(123);
1027
+ * ```
1028
+ */
1029
+ cancelPushProduct(productId: number): Promise<void>;
1030
+ /**
1031
+ * 批量删除商品
1032
+ * @param productIds 商品 id 列表
1033
+ * @example
1034
+ * ```js
1035
+ * await productTarget.batchDeleteProduct([123, 456]);
1036
+ * ```
1037
+ */
1038
+ batchDeleteProduct(productIds: number[]): Promise<void>;
1039
+ /**
1040
+ * 批量上架商品
1041
+ * @param productIds 商品 id 列表
1042
+ * @example
1043
+ * ```js
1044
+ * await productTarget.batchOnShelfProduct([123, 456]);
1045
+ * ```
1046
+ */
1047
+ batchOnShelfProduct(productIds: number[]): Promise<void>;
1048
+ /**
1049
+ * 批量下架商品
1050
+ * @param productIds 商品 id 列表
1051
+ * @example
1052
+ * ```js
1053
+ * await productTarget.batchOffShelfProduct([123, 456]);
1054
+ * ```
1055
+ */
1056
+ batchOffShelfProduct(productIds: number[]): Promise<void>;
911
1057
  /**
912
1058
  * 判断当前用户是否支持直接购买商品
913
1059
  * @example
@@ -987,6 +1133,14 @@ export declare interface ProductBasicData {
987
1133
  * 商品推送记录 id
988
1134
  */
989
1135
  pushLogId?: string;
1136
+ /**
1137
+ * 排序
1138
+ */
1139
+ rank: number;
1140
+ /**
1141
+ * 原始数据
1142
+ */
1143
+ originalData?: unknown;
990
1144
  }
991
1145
 
992
1146
  /**
@@ -1032,7 +1186,7 @@ export declare interface ProductConfig {
1032
1186
  /**
1033
1187
  * 埋点上报总开关
1034
1188
  */
1035
- watchEventTrackEnabled: boolean;
1189
+ watchEventTrackEnabled?: boolean;
1036
1190
  /**
1037
1191
  * 互动事件上报开关
1038
1192
  */
@@ -1044,7 +1198,7 @@ export declare interface ProductConfig {
1044
1198
  /**
1045
1199
  * 商品讲解开关
1046
1200
  */
1047
- productExplainEnabled: boolean;
1201
+ productExplainEnabled?: boolean;
1048
1202
  /**
1049
1203
  * 商品热卖中开关
1050
1204
  */
@@ -1056,15 +1210,19 @@ export declare interface ProductConfig {
1056
1210
  /**
1057
1211
  * 点击商品的封面/标题区域是否直接跳转外链
1058
1212
  */
1059
- outLinkProductRedirectEnabled: boolean;
1213
+ outLinkProductRedirectEnabled?: boolean;
1060
1214
  /**
1061
1215
  * 商品订单入口是否显示
1062
1216
  */
1063
- productPayOrderEnabled: boolean;
1217
+ productPayOrderEnabled?: boolean;
1064
1218
  /**
1065
1219
  * 商品库链接跳转提示
1066
1220
  */
1067
1221
  productLinkJumpTipEnabled?: boolean;
1222
+ /**
1223
+ * 业务逻辑上是否允许直接购买
1224
+ */
1225
+ directBuyEnabled?: boolean;
1068
1226
  }
1069
1227
 
1070
1228
  /**
@@ -1264,6 +1422,24 @@ export declare interface ProductExplainData {
1264
1422
  explainType?: ProductExplainType;
1265
1423
  }
1266
1424
 
1425
+ /**
1426
+ * 商品讲解操作
1427
+ */
1428
+ export declare const enum ProductExplainOperation {
1429
+ /**
1430
+ * 开始讲解
1431
+ */
1432
+ Start = "start",
1433
+ /**
1434
+ * 结束讲解
1435
+ */
1436
+ End = "end",
1437
+ /**
1438
+ * 重新讲解
1439
+ */
1440
+ Restart = "restart"
1441
+ }
1442
+
1267
1443
  /**
1268
1444
  * 商品讲解状态
1269
1445
  */
@@ -1493,7 +1669,7 @@ export declare interface ProductSDKConfig {
1493
1669
  /**
1494
1670
  * 传入的商品配置
1495
1671
  */
1496
- getProductConfig: MaybePromise<ProductConfig>;
1672
+ getProductConfig?: MaybePromise<ProductConfig>;
1497
1673
  }
1498
1674
 
1499
1675
  /**
@@ -1510,6 +1686,23 @@ export declare enum ProductServiceType {
1510
1686
  Custom = "custom"
1511
1687
  }
1512
1688
 
1689
+ /**
1690
+ * 商品设置
1691
+ */
1692
+ export declare interface ProductSetting {
1693
+ /** 商品讲解开关 */
1694
+ productExplainEnabled: boolean;
1695
+ /** 商品讲解自动推送置顶 */
1696
+ productExplainingAutoPushAndSticky: boolean;
1697
+ /** 商品推送方式 */
1698
+ productPushRule: ProductPushRule | 'chooseCard';
1699
+ /** 推送中的商品 */
1700
+ pushingProduct?: {
1701
+ productId: number;
1702
+ pushRule: ProductPushRule;
1703
+ };
1704
+ }
1705
+
1513
1706
  /**
1514
1707
  * 商品状态
1515
1708
  */
@@ -1521,7 +1714,7 @@ export declare enum ProductStatus {
1521
1714
  /**
1522
1715
  * 下架
1523
1716
  */
1524
- OffSale = 0
1717
+ OffSale = 2
1525
1718
  }
1526
1719
 
1527
1720
  /**