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

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-dev14",
3
+ "version":"0.1.0-dev16",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -0,0 +1,39 @@
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 Action {
10
+ AddOrUpdate = "AddOrUpdate",
11
+ Delete = "Delete",
12
+ }
13
+
14
+ export type UpdateInventoryRequest = {
15
+ action?: Action
16
+ inventory?: inventory
17
+ }
18
+
19
+ export type inventory = {
20
+ region?: string
21
+ node?: string
22
+ resources?: resource[]
23
+ }
24
+
25
+ export type resource = {
26
+ specFieldKey?: string
27
+ specFieldValue?: string
28
+ total?: number
29
+ free?: number
30
+ }
31
+
32
+ export type UpdateInventoryResponse = {
33
+ }
34
+
35
+ export class Inventory {
36
+ static UpdateInventory(req: UpdateInventoryRequest, initReq?: fm.InitReq): Promise<UpdateInventoryResponse> {
37
+ return fm.fetchReq<UpdateInventoryRequest, UpdateInventoryResponse>(`/apis/leopard.io/v1alpha1/inventory`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
38
+ }
39
+ }
@@ -71,7 +71,13 @@ export type SpecField = {
71
71
  export type ListRegionsRequest = {
72
72
  }
73
73
 
74
+ export type Region = {
75
+ regionId?: string
76
+ regionName?: string
77
+ }
78
+
74
79
  export type ListRegionsResponse = {
80
+ items?: Region[]
75
81
  }
76
82
 
77
83
  export type GetSKUResponse = {
@@ -96,6 +102,9 @@ export type GetSKUPriceResponse = {
96
102
  }
97
103
 
98
104
  export type ListProductSpecFieldRequest = {
105
+ regionId?: string
106
+ specKey?: string
107
+ product?: string
99
108
  }
100
109
 
101
110
  export type ListProductSpecFieldResponse = {
@@ -113,9 +122,9 @@ export class Product {
113
122
  return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
114
123
  }
115
124
  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"})
125
+ return fm.fetchReq<ListRegionsRequest, ListRegionsResponse>(`/apis/leopard.io/v1alpha1/products/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
117
126
  }
118
- static ListProductSpecDetailValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
127
+ static ListProductSpecFieldValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
119
128
  return fm.fetchReq<ListProductSpecFieldRequest, ListProductSpecFieldResponse>(`/apis/leopard.io/v1alpha1/products/specs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
120
129
  }
121
130
  }