icms-api 0.1.6 → 0.1.8

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.
@@ -17,6 +17,22 @@ export declare class ICMSClient {
17
17
  password: string;
18
18
  }>): Promise<Member | undefined>;
19
19
  logout(): Promise<void>;
20
+ /**
21
+ * 注册 C 端会员(手机号/邮箱 + 密码)
22
+ * @param username 手机号或邮箱
23
+ * @param password 密码
24
+ * @param nickname 昵称(可选)
25
+ * @returns 注册成功且已登录时返回 Member,否则 undefined
26
+ */
27
+ register({ username, password, nickname }: Readonly<{
28
+ username: string;
29
+ password: string;
30
+ nickname?: string;
31
+ }>): Promise<Member | undefined>;
32
+ /**
33
+ * 检查用户名(手机号/邮箱)是否已注册
34
+ */
35
+ checkRegistered(username: string): Promise<boolean>;
20
36
  loadI18nList(): Promise<Array<I18NWebsite>>;
21
37
  loadWebsite(params?: Readonly<{
22
38
  showNav?: boolean;
@@ -110,7 +126,7 @@ export declare class ICMSClient {
110
126
  /** 获取所有货架(类目)列表 */
111
127
  loadGoodsShelves(): Promise<Array<GoodsCategory>>;
112
128
  /** 获取指定货架的商品列表 */
113
- loadCategoryGoods(params: Readonly<{
129
+ loadCategoryGoods(params?: Readonly<{
114
130
  cateCode: string;
115
131
  count?: number;
116
132
  }>): Promise<Array<GoodsItem>>;
@@ -7,7 +7,7 @@ import { PhotoContent } from './types/cms-photo';
7
7
  import { VideoContent } from './types/cms-video';
8
8
  import { ActivityContent } from './types/cms-activity';
9
9
  import { Reviews, SubscribeUser, ContactUs } from './types/cms-message';
10
- import { SpecDescription, GoodsItem, GoodsCategory, GoodsTag } from './types/cms-mall';
10
+ import { SpecDescription, GoodsItem, GoodsDetail, GoodsCategory, GoodsTag } from './types/cms-mall';
11
11
  export declare const helloURL: string;
12
12
  export declare class ICMSServer {
13
13
  private readonly http;
@@ -265,7 +265,7 @@ export declare class ICMSServer {
265
265
  /** 获取所有货架(类目)列表 */
266
266
  loadGoodsShelves(): Promise<Array<GoodsCategory>>;
267
267
  /** 获取指定货架的商品列表 */
268
- loadCategoryGoods(params: Readonly<{
268
+ loadCategoryGoods(params?: Readonly<{
269
269
  cateCode: string;
270
270
  count?: number;
271
271
  }>): Promise<Array<GoodsItem>>;
@@ -274,4 +274,6 @@ export declare class ICMSServer {
274
274
  cateCode?: string;
275
275
  keyword?: string;
276
276
  } & PageParams>): Promise<PageInfo<GoodsItem>>;
277
+ /** 获取商品详情(含 detailContent HTML) */
278
+ getGoodsDetail(goodsListedId: string): Promise<GoodsDetail | undefined>;
277
279
  }
@@ -25,8 +25,14 @@ export interface GoodsImage {
25
25
  /** 商品视频 */
26
26
  export interface GoodsVideo {
27
27
  id?: string;
28
+ /** 视频名称 */
29
+ name?: string;
30
+ /** 视频描述 */
31
+ description?: string;
32
+ /** 封面图地址 */
33
+ coverUrl?: string;
34
+ /** 视频地址 */
28
35
  url?: string;
29
- poster?: string;
30
36
  }
31
37
  /** 商品基础信息(用于列表展示) */
32
38
  export interface GoodsItem {
@@ -41,6 +47,10 @@ export interface GoodsItem {
41
47
  video?: GoodsVideo;
42
48
  tags?: string;
43
49
  hidden?: boolean;
50
+ /** 网站编号 */
51
+ websiteNo?: string;
52
+ /** 关联基础产品编码 */
53
+ proCode?: string;
44
54
  createTime?: string;
45
55
  lastUpdateTime?: string;
46
56
  /** 货架编码 */
@@ -48,6 +58,13 @@ export interface GoodsItem {
48
58
  /** 货架名称(后端 Transient 填充) */
49
59
  cateName?: string;
50
60
  }
61
+ /** 商品详情(含 detailContent,由 getGoodsDetail 接口返回) */
62
+ export interface GoodsDetail extends GoodsItem {
63
+ /** 详情内容(HTML,后端 showDetail() 将 detailContent 填充到 rawContent) */
64
+ rawContent?: string;
65
+ /** 商品规格(后端 showSpecInfo() 填充) */
66
+ specInfo?: SpecInfo;
67
+ }
51
68
  /** 货架(商品类目) */
52
69
  export interface GoodsCategory {
53
70
  id: string;
@@ -66,3 +83,40 @@ export interface GoodsTag {
66
83
  name: string;
67
84
  websiteNo?: string;
68
85
  }
86
+ /** 商品规格属性 */
87
+ export interface SpecProps {
88
+ /** 属性编号 */
89
+ code: string;
90
+ /** 属性名称 */
91
+ name: string;
92
+ /** 售价 */
93
+ price: number;
94
+ /** 标识图标 */
95
+ iconUrl?: string;
96
+ /** 绑定的图片文件JSON */
97
+ images?: string;
98
+ }
99
+ /** 商品规格项 */
100
+ export interface SpecItem {
101
+ /** 规格编号 */
102
+ code: string;
103
+ /** 规格名称 */
104
+ name: string;
105
+ /** 是否必选 */
106
+ required: boolean;
107
+ /** 是否可多选 */
108
+ multiple: boolean;
109
+ /** 规格说明代码 */
110
+ descCode?: string;
111
+ /** 启用图库绑定 */
112
+ imageLib: boolean;
113
+ /** 属性列表 */
114
+ props?: Array<SpecProps>;
115
+ }
116
+ /** 商品规格 */
117
+ export interface SpecInfo {
118
+ /** 产品编码 */
119
+ productCode?: string;
120
+ /** 规格项列表 */
121
+ specificationItems?: Array<SpecItem>;
122
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "icms-api",
3
3
  "private": false,
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "description": "对iCMS内容管理系统API的封装,使用该API能快速使用iCMS搭建您的WebApp!",
6
6
  "type": "module",
7
7
  "main": "./dist/icms-api.cjs.js",