@scaleway/sdk-product-catalog 1.3.1 → 1.5.0

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.
@@ -12,7 +12,8 @@ class PublicCatalogAPI extends sdkClient.API {
12
12
  [
13
13
  "page_size",
14
14
  request.pageSize ?? this.client.settings.defaultPageSize
15
- ]
15
+ ],
16
+ ["product_types", request.productTypes]
16
17
  )
17
18
  },
18
19
  marshalling_gen.unmarshalListPublicCatalogProductsResponse
@@ -10,7 +10,8 @@ class PublicCatalogAPI extends API {
10
10
  [
11
11
  "page_size",
12
12
  request.pageSize ?? this.client.settings.defaultPageSize
13
- ]
13
+ ],
14
+ ["product_types", request.productTypes]
14
15
  )
15
16
  },
16
17
  unmarshalListPublicCatalogProductsResponse
@@ -1,4 +1,4 @@
1
1
  export { PublicCatalogAPI } from './api.gen';
2
2
  export * from './marshalling.gen';
3
- export type { ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, PublicCatalogProduct, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, PublicCatalogProductProperties, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesDedibox, PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesHardwareCPU, PublicCatalogProductPropertiesHardwareCPUArch, PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, PublicCatalogProductPropertiesHardwareGPU, PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, PublicCatalogProductUnitOfMeasure, PublicCatalogProductUnitOfMeasureCountableUnit, } from './types.gen';
3
+ export type { ListPublicCatalogProductsRequestProductType, ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, PublicCatalogProduct, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, PublicCatalogProductProperties, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesDedibox, PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesHardwareCPU, PublicCatalogProductPropertiesHardwareCPUArch, PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, PublicCatalogProductPropertiesHardwareGPU, PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, PublicCatalogProductStatus, PublicCatalogProductUnitOfMeasure, PublicCatalogProductUnitOfMeasureCountableUnit, } from './types.gen';
4
4
  export * as ValidationRules from './validation-rules.gen';
@@ -141,7 +141,9 @@ const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
141
141
  );
142
142
  }
143
143
  return {
144
- range: data.range
144
+ offerId: data.offer_id,
145
+ range: data.range,
146
+ recommendedReplacementOfferIds: data.recommended_replacement_offer_ids
145
147
  };
146
148
  };
147
149
  const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data) => {
@@ -211,6 +213,7 @@ const unmarshalPublicCatalogProduct = (data) => {
211
213
  }
212
214
  return {
213
215
  description: data.description,
216
+ endOfLifeAt: sdkClient.unmarshalDate(data.end_of_life_at),
214
217
  environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
215
218
  data.environmental_impact_estimation
216
219
  ) : void 0,
@@ -220,6 +223,7 @@ const unmarshalPublicCatalogProduct = (data) => {
220
223
  properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
221
224
  serviceCategory: data.service_category,
222
225
  sku: data.sku,
226
+ status: data.status,
223
227
  unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) : void 0,
224
228
  variant: data.variant
225
229
  };
@@ -1,4 +1,4 @@
1
- import { isJSONObject, unmarshalArrayOfObject, unmarshalMoney } from "@scaleway/sdk-client";
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney } from "@scaleway/sdk-client";
2
2
  const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data) => {
3
3
  if (!isJSONObject(data)) {
4
4
  throw new TypeError(
@@ -139,7 +139,9 @@ const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
139
139
  );
140
140
  }
141
141
  return {
142
- range: data.range
142
+ offerId: data.offer_id,
143
+ range: data.range,
144
+ recommendedReplacementOfferIds: data.recommended_replacement_offer_ids
143
145
  };
144
146
  };
145
147
  const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data) => {
@@ -209,6 +211,7 @@ const unmarshalPublicCatalogProduct = (data) => {
209
211
  }
210
212
  return {
211
213
  description: data.description,
214
+ endOfLifeAt: unmarshalDate(data.end_of_life_at),
212
215
  environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
213
216
  data.environmental_impact_estimation
214
217
  ) : void 0,
@@ -218,6 +221,7 @@ const unmarshalPublicCatalogProduct = (data) => {
218
221
  properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
219
222
  serviceCategory: data.service_category,
220
223
  sku: data.sku,
224
+ status: data.status,
221
225
  unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) : void 0,
222
226
  variant: data.variant
223
227
  };
@@ -1,5 +1,7 @@
1
1
  import type { Money, Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client';
2
+ export type ListPublicCatalogProductsRequestProductType = 'unknown_product_type' | 'instance' | 'apple_silicon' | 'elastic_metal' | 'dedibox';
2
3
  export type PublicCatalogProductPropertiesHardwareCPUArch = 'unknown_arch' | 'x64' | 'arm64' | 'riscv' | 'apple_silicon';
4
+ export type PublicCatalogProductStatus = 'unknown_status' | 'public_beta' | 'preview' | 'general_availability' | 'end_of_deployment' | 'end_of_support';
3
5
  export type PublicCatalogProductUnitOfMeasureCountableUnit = 'unknown_countable_unit' | 'chunk' | 'core' | 'currency' | 'device' | 'domain' | 'email' | 'gb_s' | 'gigabyte' | 'hour' | 'iops_gigabyte' | 'ip' | 'month' | 'node' | 'plan' | 'query' | 'request' | 'session' | 'vcpu_s' | 'version' | 'year' | 'key' | 'token' | 'minute' | 'setup' | 'day';
4
6
  export interface PublicCatalogProductPropertiesHardwareCPUPhysical {
5
7
  /**
@@ -160,6 +162,14 @@ export interface PublicCatalogProductPropertiesInstance {
160
162
  * The range of the Instance server.
161
163
  */
162
164
  range: string;
165
+ /**
166
+ * The offer ID of the Instance server.
167
+ */
168
+ offerId: string;
169
+ /**
170
+ * The recommended replacement offer IDs of the Instance server.
171
+ */
172
+ recommendedReplacementOfferIds: string[];
163
173
  }
164
174
  export interface PublicCatalogProductEnvironmentalImpactEstimation {
165
175
  kgCo2Equivalent?: number;
@@ -272,6 +282,14 @@ export interface PublicCatalogProduct {
272
282
  * The unit of measure of the product.
273
283
  */
274
284
  unitOfMeasure?: PublicCatalogProductUnitOfMeasure;
285
+ /**
286
+ * The status of the product.
287
+ */
288
+ status: PublicCatalogProductStatus;
289
+ /**
290
+ * The end of life date of the product.
291
+ */
292
+ endOfLifeAt?: Date;
275
293
  }
276
294
  export interface ListPublicCatalogProductsResponse {
277
295
  /**
@@ -292,4 +310,8 @@ export type PublicCatalogApiListPublicCatalogProductsRequest = {
292
310
  * The number of products per page. Value must be greater or equal to 1.
293
311
  */
294
312
  pageSize?: number;
313
+ /**
314
+ * The list of filtered product categories.
315
+ */
316
+ productTypes?: ListPublicCatalogProductsRequestProductType[];
295
317
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-product-catalog",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "Scaleway SDK product-catalog",
5
- "types": "dist/index.d.ts",
5
+ "license": "Apache-2.0",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.3"
33
+ "@scaleway/sdk-std": "1.0.4"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.2"
36
+ "@scaleway/sdk-client": "^1.2.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.2"
39
+ "@scaleway/sdk-client": "^1.2.3"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",