@daocloud-proto/leopard 0.1.0-dev13 → 0.1.0-dev15
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/package.json +1 -1
- package/v1alpha1/product.pb.ts +30 -1
package/package.json
CHANGED
package/v1alpha1/product.pb.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type SkuItem = {
|
|
|
49
49
|
region?: string
|
|
50
50
|
specId?: number
|
|
51
51
|
specName?: string
|
|
52
|
-
|
|
52
|
+
specFields?: SpecField[]
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export type ListProductSKUsResponse = {
|
|
@@ -65,6 +65,19 @@ export type SpecField = {
|
|
|
65
65
|
specId?: number
|
|
66
66
|
key?: string
|
|
67
67
|
value?: string
|
|
68
|
+
keyName?: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ListRegionsRequest = {
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type Region = {
|
|
75
|
+
regionId?: string
|
|
76
|
+
regionName?: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type ListRegionsResponse = {
|
|
80
|
+
items?: Region[]
|
|
68
81
|
}
|
|
69
82
|
|
|
70
83
|
export type GetSKUResponse = {
|
|
@@ -88,6 +101,16 @@ export type GetSKUPriceResponse = {
|
|
|
88
101
|
price?: string
|
|
89
102
|
}
|
|
90
103
|
|
|
104
|
+
export type ListProductSpecFieldRequest = {
|
|
105
|
+
regionId?: string
|
|
106
|
+
specKey?: string
|
|
107
|
+
product?: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type ListProductSpecFieldResponse = {
|
|
111
|
+
specFields?: SpecField[]
|
|
112
|
+
}
|
|
113
|
+
|
|
91
114
|
export class Product {
|
|
92
115
|
static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
|
|
93
116
|
return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
@@ -98,4 +121,10 @@ export class Product {
|
|
|
98
121
|
static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
|
|
99
122
|
return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
100
123
|
}
|
|
124
|
+
static ListRegions(req: ListRegionsRequest, initReq?: fm.InitReq): Promise<ListRegionsResponse> {
|
|
125
|
+
return fm.fetchReq<ListRegionsRequest, ListRegionsResponse>(`/apis/leopard.io/v1alpha1/products/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
126
|
+
}
|
|
127
|
+
static ListProductSpecFieldValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
|
|
128
|
+
return fm.fetchReq<ListProductSpecFieldRequest, ListProductSpecFieldResponse>(`/apis/leopard.io/v1alpha1/products/specs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
129
|
+
}
|
|
101
130
|
}
|