@daocloud-proto/leopard 0.4.0 → 0.4.1-rc1

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.4.0",
3
+ "version":"0.4.1-rc1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -162,6 +162,149 @@ export type RegionType = {
162
162
  zhCnName?: string
163
163
  }
164
164
 
165
+ export type ListProductSpecInfoRequest = {
166
+ product?: string
167
+ name?: string
168
+ page?: number
169
+ pageSize?: number
170
+ }
171
+
172
+ export type SpecInfo = {
173
+ id?: number
174
+ name?: string
175
+ product?: string
176
+ items?: SpecFieldInfo[]
177
+ }
178
+
179
+ export type ListProductSpecInfoResponse = {
180
+ items?: SpecInfo[]
181
+ pagination?: Pagination
182
+ }
183
+
184
+ export type CreateSpecInfoRequest = {
185
+ name?: string
186
+ product?: string
187
+ items?: SpecFieldInfo[]
188
+ }
189
+
190
+ export type SpecFieldInfo = {
191
+ key?: string
192
+ value?: string
193
+ enUs?: string
194
+ zhCn?: string
195
+ id?: number
196
+ specId?: number
197
+ }
198
+
199
+ export type CreateSpecInfoResponse = {
200
+ id?: number
201
+ name?: string
202
+ product?: string
203
+ items?: SpecFieldInfo[]
204
+ }
205
+
206
+ export type UpdateSpecInfoRequest = {
207
+ id?: number
208
+ items?: SpecFieldInfo[]
209
+ }
210
+
211
+ export type UpdateSpecInfoResponse = {
212
+ }
213
+
214
+ export type DeleteSpecInfoRequest = {
215
+ id?: number
216
+ }
217
+
218
+ export type DeleteSpecInfoResponse = {
219
+ }
220
+
221
+ export type SpecFieldKey = {
222
+ id?: number
223
+ key?: string
224
+ enUs?: string
225
+ zhCn?: string
226
+ type?: string[]
227
+ }
228
+
229
+ export type ProductSpecFieldKeys = {
230
+ product?: string
231
+ items?: SpecFieldKey[]
232
+ }
233
+
234
+ export type ListProductSpecFieldKeyRequest = {
235
+ }
236
+
237
+ export type ListProductSpecFieldKeyResponse = {
238
+ items?: ProductSpecFieldKeys[]
239
+ }
240
+
241
+ export type ListSKUInfosRequest = {
242
+ product?: string
243
+ regionId?: string
244
+ filter?: {[key: string]: FilterStringArr}
245
+ page?: number
246
+ pageSize?: number
247
+ }
248
+
249
+ export type ListSKUInfosResponse = {
250
+ items?: SkuItem[]
251
+ pagination?: Pagination
252
+ }
253
+
254
+ export type GetSKUInfoRequest = {
255
+ id?: string
256
+ }
257
+
258
+ export type GetSKUInfoResponse = {
259
+ id?: string
260
+ productName?: string
261
+ specId?: number
262
+ regionName?: string
263
+ price?: string
264
+ freeQuantity?: number
265
+ description?: string
266
+ available?: number
267
+ }
268
+
269
+ export type CreateSKUInfoRequest = {
270
+ specId?: number
271
+ productName?: string
272
+ billingPolicyId?: number
273
+ regionName?: string
274
+ price?: string
275
+ freeQuantity?: number
276
+ description?: string
277
+ available?: number
278
+ displayOrder?: number
279
+ }
280
+
281
+ export type CreateSKUInfoResponse = {
282
+ id?: string
283
+ }
284
+
285
+ export type UpdateSKUInfoRequest = {
286
+ id?: string
287
+ specId?: number
288
+ productName?: string
289
+ billingPolicyId?: number
290
+ regionName?: string
291
+ price?: string
292
+ freeQuantity?: number
293
+ description?: string
294
+ available?: number
295
+ displayOrder?: number
296
+ }
297
+
298
+ export type UpdateSKUInfoResponse = {
299
+ }
300
+
301
+ export type DeleteSKUInfoRequest = {
302
+ id?: string
303
+ }
304
+
305
+ export type DeleteSKUInfoResponse = {
306
+ }
307
+
165
308
  export class Product {
166
309
  static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
167
310
  return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -187,4 +330,34 @@ export class Product {
187
330
  static ListProductSpecFieldValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
188
331
  return fm.fetchReq<ListProductSpecFieldRequest, ListProductSpecFieldResponse>(`/apis/leopard.io/v1alpha1/products/specs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
189
332
  }
333
+ static ListSpecInfo(req: ListProductSpecInfoRequest, initReq?: fm.InitReq): Promise<ListProductSpecInfoResponse> {
334
+ return fm.fetchReq<ListProductSpecInfoRequest, ListProductSpecInfoResponse>(`/apis/leopard.io/v1alpha1/products/spec-infos?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
335
+ }
336
+ static CreateSpecInfo(req: CreateSpecInfoRequest, initReq?: fm.InitReq): Promise<CreateSpecInfoResponse> {
337
+ return fm.fetchReq<CreateSpecInfoRequest, CreateSpecInfoResponse>(`/apis/leopard.io/v1alpha1/products/spec-infos`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
338
+ }
339
+ static UpdateSpecInfo(req: UpdateSpecInfoRequest, initReq?: fm.InitReq): Promise<UpdateSpecInfoResponse> {
340
+ return fm.fetchReq<UpdateSpecInfoRequest, UpdateSpecInfoResponse>(`/apis/leopard.io/v1alpha1/products/spec-infos/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
341
+ }
342
+ static DeleteSpecInfo(req: DeleteSpecInfoRequest, initReq?: fm.InitReq): Promise<DeleteSpecInfoResponse> {
343
+ return fm.fetchReq<DeleteSpecInfoRequest, DeleteSpecInfoResponse>(`/apis/leopard.io/v1alpha1/products/spec-infos/${req["id"]}`, {...initReq, method: "DELETE"})
344
+ }
345
+ static ListProductSpecFieldKey(req: ListProductSpecFieldKeyRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldKeyResponse> {
346
+ return fm.fetchReq<ListProductSpecFieldKeyRequest, ListProductSpecFieldKeyResponse>(`/apis/leopard.io/v1alpha1/products/spec-field-keys?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
347
+ }
348
+ static ListSKUInfo(req: ListSKUInfosRequest, initReq?: fm.InitReq): Promise<ListSKUInfosResponse> {
349
+ return fm.fetchReq<ListSKUInfosRequest, ListSKUInfosResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
350
+ }
351
+ static GetSKUInfo(req: GetSKUInfoRequest, initReq?: fm.InitReq): Promise<GetSKUInfoResponse> {
352
+ return fm.fetchReq<GetSKUInfoRequest, GetSKUInfoResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
353
+ }
354
+ static CreateSKUInfo(req: CreateSKUInfoRequest, initReq?: fm.InitReq): Promise<CreateSKUInfoResponse> {
355
+ return fm.fetchReq<CreateSKUInfoRequest, CreateSKUInfoResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
356
+ }
357
+ static UpdateSKUInfo(req: UpdateSKUInfoRequest, initReq?: fm.InitReq): Promise<UpdateSKUInfoResponse> {
358
+ return fm.fetchReq<UpdateSKUInfoRequest, UpdateSKUInfoResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
359
+ }
360
+ static DeleteSKUInfo(req: DeleteSKUInfoRequest, initReq?: fm.InitReq): Promise<DeleteSKUInfoResponse> {
361
+ return fm.fetchReq<DeleteSKUInfoRequest, DeleteSKUInfoResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["id"]}`, {...initReq, method: "DELETE"})
362
+ }
190
363
  }