@daocloud-proto/leopard 0.1.0-dev13 → 0.1.0-dev14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/leopard",
3
- "version":"0.1.0-dev13",
3
+ "version":"0.1.0-dev14",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -49,7 +49,7 @@ export type SkuItem = {
49
49
  region?: string
50
50
  specId?: number
51
51
  specName?: string
52
- specDetails?: {[key: string]: string}
52
+ specFields?: SpecField[]
53
53
  }
54
54
 
55
55
  export type ListProductSKUsResponse = {
@@ -65,6 +65,13 @@ 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 ListRegionsResponse = {
68
75
  }
69
76
 
70
77
  export type GetSKUResponse = {
@@ -88,6 +95,13 @@ export type GetSKUPriceResponse = {
88
95
  price?: string
89
96
  }
90
97
 
98
+ export type ListProductSpecFieldRequest = {
99
+ }
100
+
101
+ export type ListProductSpecFieldResponse = {
102
+ specFields?: SpecField[]
103
+ }
104
+
91
105
  export class Product {
92
106
  static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
93
107
  return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -98,4 +112,10 @@ export class Product {
98
112
  static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
99
113
  return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
100
114
  }
115
+ static ListRegions(req: ListRegionsRequest, initReq?: fm.InitReq): Promise<ListRegionsResponse> {
116
+ return fm.fetchReq<ListRegionsRequest, ListRegionsResponse>(`/apis/leopard.io/v1alpha1/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
117
+ }
118
+ static ListProductSpecDetailValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
119
+ return fm.fetchReq<ListProductSpecFieldRequest, ListProductSpecFieldResponse>(`/apis/leopard.io/v1alpha1/products/specs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
120
+ }
101
121
  }