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

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-dev12",
3
+ "version":"0.1.0-dev13",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -17,8 +17,8 @@ export enum UnitType {
17
17
  COMPUTE_UNIT = "COMPUTE_UNIT",
18
18
  }
19
19
 
20
- export enum Currency {
21
- CNY = "CNY",
20
+ export enum QuantityUnit {
21
+ EMPTY = "EMPTY",
22
22
  }
23
23
 
24
24
  export type Pagination = {
@@ -31,7 +31,7 @@ export type FilterStringArr = {
31
31
  values?: string[]
32
32
  }
33
33
 
34
- export type ListProductSkusRequest = {
34
+ export type ListProductSKUsRequest = {
35
35
  product?: string
36
36
  regionId?: string
37
37
  filter?: {[key: string]: FilterStringArr}
@@ -43,59 +43,59 @@ export type SkuItem = {
43
43
  id?: string
44
44
  saleable?: boolean
45
45
  billingType?: BillingType
46
- unit?: UnitType
46
+ meteringUnit?: UnitType
47
+ quantityUnit?: QuantityUnit
47
48
  price?: number
48
49
  region?: string
49
- specId?: string
50
+ specId?: number
50
51
  specName?: string
51
52
  specDetails?: {[key: string]: string}
52
53
  }
53
54
 
54
- export type ListProductSkusResponse = {
55
+ export type ListProductSKUsResponse = {
55
56
  items?: SkuItem[]
56
57
  pagination?: Pagination
57
58
  }
58
59
 
59
- export type GetProductSkuRequest = {
60
+ export type GetSKURequest = {
60
61
  id?: string
61
62
  }
62
63
 
63
- export type GetProductSkuResponse = {
64
+ export type SpecField = {
65
+ specId?: number
66
+ key?: string
67
+ value?: string
68
+ }
69
+
70
+ export type GetSKUResponse = {
64
71
  id?: string
65
72
  saleable?: boolean
66
73
  billingType?: BillingType
67
- unit?: UnitType
74
+ meteringUnit?: UnitType
75
+ quantityUnit?: QuantityUnit
68
76
  price?: number
69
77
  region?: string
70
- specId?: string
78
+ specId?: number
71
79
  specName?: string
72
- specDetails?: {[key: string]: string}
73
- }
74
-
75
- export type ListProductSpecDetailValuesRequest = {
76
- regionId?: string
77
- resourceKey?: string
78
- product?: string
80
+ specFields?: SpecField[]
79
81
  }
80
82
 
81
- export type ProductSpecDetailValueItem = {
83
+ export type GetSKUPriceRequest = {
82
84
  id?: string
83
- name?: string
84
85
  }
85
86
 
86
- export type ProductSpecDetailValuesArr = {
87
- items?: ProductSpecDetailValueItem[]
88
- }
89
-
90
- export type ListProductSpecDetailValuesResponse = {
91
- valuesMap?: {[key: string]: ProductSpecDetailValuesArr}
87
+ export type GetSKUPriceResponse = {
88
+ price?: string
92
89
  }
93
90
 
94
91
  export class Product {
95
- static GetProductSku(req: GetProductSkuRequest, initReq?: fm.InitReq): Promise<GetProductSkuResponse> {
96
- return fm.fetchReq<GetProductSkuRequest, GetProductSkuResponse>(`/apis/leopard.io/v1alpha1/product/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
92
+ static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
93
+ return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
94
+ }
95
+ static GetSKU(req: GetSKURequest, initReq?: fm.InitReq): Promise<GetSKUResponse> {
96
+ return fm.fetchReq<GetSKURequest, GetSKUResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
97
97
  }
98
- static ListProductSpecDetailValues(req: ListProductSpecDetailValuesRequest, initReq?: fm.InitReq): Promise<ListProductSpecDetailValuesResponse> {
99
- return fm.fetchReq<ListProductSpecDetailValuesRequest, ListProductSpecDetailValuesResponse>(`/apis/leopard.io/v1alpha1/products/${req["product"]}/values?${fm.renderURLSearchParams(req, ["product"])}`, {...initReq, method: "GET"})
98
+ static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
99
+ return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
100
100
  }
101
101
  }
@@ -1,101 +0,0 @@
1
- /* eslint-disable */
2
- // @ts-nocheck
3
- /*
4
- * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
- */
6
-
7
- import * as fm from "../fetch.pb"
8
-
9
- export enum BillingType {
10
- PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
11
- }
12
-
13
- export enum UnitType {
14
- HOUR = "HOUR",
15
- THOUSAND_TOKENS = "THOUSAND_TOKENS",
16
- GB_DAY = "GB_DAY",
17
- COMPUTE_UNIT = "COMPUTE_UNIT",
18
- }
19
-
20
- export enum QuantityUnit {
21
- EMPTY = "EMPTY",
22
- }
23
-
24
- export type Pagination = {
25
- total?: number
26
- page?: number
27
- pageSize?: number
28
- }
29
-
30
- export type FilterStringArr = {
31
- values?: string[]
32
- }
33
-
34
- export type ListProductSKUsRequest = {
35
- product?: string
36
- regionId?: string
37
- filter?: {[key: string]: FilterStringArr}
38
- page?: number
39
- pageSize?: number
40
- }
41
-
42
- export type SkuItem = {
43
- id?: string
44
- saleable?: boolean
45
- billingType?: BillingType
46
- meteringUnit?: UnitType
47
- quantityUnit?: QuantityUnit
48
- price?: number
49
- region?: string
50
- specId?: number
51
- specName?: string
52
- specDetails?: {[key: string]: string}
53
- }
54
-
55
- export type ListProductSKUsResponse = {
56
- items?: SkuItem[]
57
- pagination?: Pagination
58
- }
59
-
60
- export type GetSKURequest = {
61
- id?: string
62
- }
63
-
64
- export type SpecField = {
65
- specId?: number
66
- key?: string
67
- value?: string
68
- }
69
-
70
- export type GetSKUResponse = {
71
- id?: string
72
- saleable?: boolean
73
- billingType?: BillingType
74
- meteringUnit?: UnitType
75
- quantityUnit?: QuantityUnit
76
- price?: number
77
- region?: string
78
- specId?: number
79
- specName?: string
80
- specFields?: SpecField[]
81
- }
82
-
83
- export type GetSKUPriceRequest = {
84
- id?: string
85
- }
86
-
87
- export type GetSKUPriceResponse = {
88
- price?: string
89
- }
90
-
91
- export class SKU {
92
- static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
93
- return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/skus?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
94
- }
95
- static GetSKU(req: GetSKURequest, initReq?: fm.InitReq): Promise<GetSKUResponse> {
96
- return fm.fetchReq<GetSKURequest, GetSKUResponse>(`/apis/leopard.io/v1alpha1/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
97
- }
98
- static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
99
- return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
100
- }
101
- }