@daocloud-proto/leopard 0.1.0-dev5 → 0.1.0-dev7

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-dev5",
3
+ "version":"0.1.0-dev7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -7,18 +7,18 @@
7
7
  import * as fm from "../fetch.pb"
8
8
 
9
9
  export enum BillingType {
10
- PayAsYouGo = "PayAsYouGo",
11
- SubscriptionDaily = "SubscriptionDaily",
12
- SubscriptionWeekly = "SubscriptionWeekly",
13
- SubscriptionMonthly = "SubscriptionMonthly",
14
- SubscriptionYearly = "SubscriptionYearly",
10
+ PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
11
+ SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
12
+ SUBSCRIPTION_WEEKLY = "SUBSCRIPTION_WEEKLY",
13
+ SUBSCRIPTION_MONTHLY = "SUBSCRIPTION_MONTHLY",
14
+ SUBSCRIPTION_YEARLY = "SUBSCRIPTION_YEARLY",
15
15
  }
16
16
 
17
17
  export enum UnitType {
18
- Hour = "Hour",
19
- ThousandTokens = "ThousandTokens",
20
- GBDay = "GBDay",
21
- ComputeUnit = "ComputeUnit",
18
+ HOUR = "HOUR",
19
+ THOUSAND_TOKENS = "THOUSAND_TOKENS",
20
+ GB_DAY = "GB_DAY",
21
+ COMPUTE_UNIT = "COMPUTE_UNIT",
22
22
  }
23
23
 
24
24
  export type ListBillingsRequest = {
@@ -7,31 +7,31 @@
7
7
  import * as fm from "../fetch.pb"
8
8
 
9
9
  export enum OrderType {
10
- Purchase = "Purchase",
11
- Refund = "Refund",
12
- Upgrade = "Upgrade",
13
- Downgrade = "Downgrade",
10
+ PURCHASE = "PURCHASE",
11
+ REFUND = "REFUND",
12
+ UPGRADE = "UPGRADE",
13
+ DOWNGRADE = "DOWNGRADE",
14
14
  }
15
15
 
16
16
  export enum BillingType {
17
- PayAsYouGo = "PayAsYouGo",
18
- SubscriptionDaily = "SubscriptionDaily",
19
- SubscriptionWeekly = "SubscriptionWeekly",
20
- SubscriptionMonthly = "SubscriptionMonthly",
21
- SubscriptionYearly = "SubscriptionYearly",
17
+ PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
18
+ SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
19
+ SUBSCRIPTION_WEEKLY = "SUBSCRIPTION_WEEKLY",
20
+ SUBSCRIPTION_MONTHLY = "SUBSCRIPTION_MONTHLY",
21
+ SUBSCRIPTION_YEARLY = "SUBSCRIPTION_YEARLY",
22
22
  }
23
23
 
24
24
  export enum OrderStatus {
25
- Paid = "Paid",
26
- Partial = "Partial",
27
- Refunded = "Refunded",
25
+ PAID = "PAID",
26
+ PARTIAL = "PARTIAL",
27
+ REFUNDED = "REFUNDED",
28
28
  }
29
29
 
30
30
  export enum UnitType {
31
- Hour = "Hour",
32
- ThousandTokens = "ThousandTokens",
33
- GBDay = "GBDay",
34
- ComputeUnit = "ComputeUnit",
31
+ HOUR = "HOUR",
32
+ THOUSAND_TOKENS = "THOUSAND_TOKENS",
33
+ GB_DAY = "GB_DAY",
34
+ COMPUTE_UNIT = "COMPUTE_UNIT",
35
35
  }
36
36
 
37
37
  export type Pagination = {
@@ -105,14 +105,19 @@ export type GetOrderRequest = {
105
105
 
106
106
  export type GetOrderResponse = {
107
107
  orderInfo?: OrderInfo
108
- productInfo?: ProductInfo
108
+ productInfo?: ProductInfo[]
109
+ }
110
+
111
+ export type Product = {
112
+ id?: string
113
+ name?: string
109
114
  }
110
115
 
111
116
  export type GetProductsRequest = {
112
117
  }
113
118
 
114
119
  export type GetProductsResponse = {
115
- items?: string[]
120
+ products?: Product[]
116
121
  }
117
122
 
118
123
  export type CreateOrderRequest = {
@@ -0,0 +1,100 @@
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 Currency {
21
+ CNY = "CNY",
22
+ }
23
+
24
+ export type Pagination = {
25
+ total?: number
26
+ page?: number
27
+ pageSize?: number
28
+ }
29
+
30
+ export type ListProductSkusRequest = {
31
+ product?: string
32
+ regionId?: string
33
+ filter?: {[key: string]: string}
34
+ page?: number
35
+ pageSize?: number
36
+ }
37
+
38
+ export type SkuItem = {
39
+ id?: string
40
+ saleable?: boolean
41
+ billingType?: BillingType
42
+ unit?: UnitType
43
+ price?: number
44
+ region?: string
45
+ specId?: string
46
+ specName?: string
47
+ specDetails?: {[key: string]: string}
48
+ }
49
+
50
+ export type ListProductSkusResponse = {
51
+ items?: SkuItem[]
52
+ pagination?: Pagination
53
+ }
54
+
55
+ export type GetProductSkuRequest = {
56
+ id?: string
57
+ }
58
+
59
+ export type GetProductSkuResponse = {
60
+ id?: string
61
+ saleable?: boolean
62
+ billingType?: BillingType
63
+ unit?: UnitType
64
+ price?: number
65
+ region?: string
66
+ specId?: string
67
+ specName?: string
68
+ specDetails?: {[key: string]: string}
69
+ }
70
+
71
+ export type ListProductSpecDetailValuesRequest = {
72
+ regionId?: string
73
+ resourceKey?: string
74
+ product?: string
75
+ }
76
+
77
+ export type ProductSpecDetailValueItem = {
78
+ id?: string
79
+ name?: string
80
+ }
81
+
82
+ export type ProductSpecDetailValuesArr = {
83
+ items?: ProductSpecDetailValueItem[]
84
+ }
85
+
86
+ export type ListProductSpecDetailValuesResponse = {
87
+ valuesMap?: {[key: string]: ProductSpecDetailValuesArr}
88
+ }
89
+
90
+ export class Product {
91
+ static ListProductSkus(req: ListProductSkusRequest, initReq?: fm.InitReq): Promise<ListProductSkusResponse> {
92
+ return fm.fetchReq<ListProductSkusRequest, ListProductSkusResponse>(`/apis/leopard.io/v1alpha1/product/${req["product"]}/skus?${fm.renderURLSearchParams(req, ["product"])}`, {...initReq, method: "GET"})
93
+ }
94
+ static GetProductSku(req: GetProductSkuRequest, initReq?: fm.InitReq): Promise<GetProductSkuResponse> {
95
+ return fm.fetchReq<GetProductSkuRequest, GetProductSkuResponse>(`/apis/leopard.io/v1alpha1/product/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
96
+ }
97
+ static ListProductSpecDetailValues(req: ListProductSpecDetailValuesRequest, initReq?: fm.InitReq): Promise<ListProductSpecDetailValuesResponse> {
98
+ return fm.fetchReq<ListProductSpecDetailValuesRequest, ListProductSpecDetailValuesResponse>(`/apis/leopard.io/v1alpha1/products/${req["product"]}/values?${fm.renderURLSearchParams(req, ["product"])}`, {...initReq, method: "GET"})
99
+ }
100
+ }
@@ -29,9 +29,9 @@ export type ListTransactionsRequest = {
29
29
  pageSize?: number
30
30
  serialNumber?: string
31
31
  billingId?: string
32
- paymentType?: PaymentType
33
- transactionType?: TransactionType
34
- transactionChannel?: TransactionChannel
32
+ paymentType?: string
33
+ transactionType?: string
34
+ transactionChannel?: string
35
35
  }
36
36
 
37
37
  export type ListTransactionsRequestResponse = {
@@ -7,13 +7,13 @@
7
7
  import * as fm from "../fetch.pb"
8
8
 
9
9
  export enum PaymentChannel {
10
- Alipay = "Alipay",
11
- Wechat = "Wechat",
10
+ ALIPAY = "ALIPAY",
11
+ WECHAT = "WECHAT",
12
12
  }
13
13
 
14
14
  export enum PaymentType {
15
- QrCode = "QrCode",
16
- Redirect = "Redirect",
15
+ QR_CODE = "QR_CODE",
16
+ REDIRECT = "REDIRECT",
17
17
  }
18
18
 
19
19
  export type BalanceRequest = {