@scaleway/sdk 1.29.0 → 1.31.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.
Files changed (29) hide show
  1. package/dist/api/account/v2/marshalling.gen.js +1 -1
  2. package/dist/api/account/v3/marshalling.gen.js +1 -1
  3. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -1
  4. package/dist/api/cockpit/v1beta1/marshalling.gen.js +7 -3
  5. package/dist/api/container/v1beta1/marshalling.gen.js +1 -1
  6. package/dist/api/function/v1beta1/marshalling.gen.js +1 -1
  7. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -1
  8. package/dist/api/instance/v1/api.gen.js +45 -3
  9. package/dist/api/instance/v1/marshalling.gen.js +31 -2
  10. package/dist/api/iot/v1/marshalling.gen.js +1 -1
  11. package/dist/api/ipfs/v1alpha1/api.gen.js +51 -1
  12. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +8 -7
  13. package/dist/api/k8s/v1/marshalling.gen.js +1 -1
  14. package/dist/api/lb/v1/marshalling.gen.js +1 -1
  15. package/dist/api/mnq/v1alpha1/marshalling.gen.js +1 -1
  16. package/dist/api/rdb/v1/marshalling.gen.js +1 -1
  17. package/dist/api/redis/v1/marshalling.gen.js +1 -1
  18. package/dist/api/registry/v1/marshalling.gen.js +1 -1
  19. package/dist/api/vpc/v1/marshalling.gen.js +1 -1
  20. package/dist/api/vpc/v2/marshalling.gen.js +1 -1
  21. package/dist/api/vpcgw/v1/marshalling.gen.js +1 -1
  22. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +1 -0
  23. package/dist/index.cjs +132 -13
  24. package/dist/index.d.ts +175 -14
  25. package/dist/scw/constants.js +1 -1
  26. package/node_modules/@scaleway/random-name/CHANGELOG.md +11 -13
  27. package/node_modules/@scaleway/random-name/package.json +7 -7
  28. package/package.json +3 -3
  29. /package/dist/node_modules/.pnpm/{@scaleway_random-name@4.0.1 → @scaleway_random-name@4.0.2}/node_modules/@scaleway/random-name/dist/index.js +0 -0
package/dist/index.cjs CHANGED
@@ -497,7 +497,7 @@ const assertValidSettings = obj => {
497
497
  }
498
498
  };
499
499
 
500
- const version = 'v1.28.0';
500
+ const version = 'v1.30.0';
501
501
  const userAgent = `scaleway-sdk-js/${version}`;
502
502
 
503
503
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -3745,11 +3745,13 @@ const unmarshalTokenScopes = data => {
3745
3745
  return {
3746
3746
  queryLogs: data.query_logs,
3747
3747
  queryMetrics: data.query_metrics,
3748
+ queryTraces: data.query_traces,
3748
3749
  setupAlerts: data.setup_alerts,
3749
3750
  setupLogsRules: data.setup_logs_rules,
3750
3751
  setupMetricsRules: data.setup_metrics_rules,
3751
3752
  writeLogs: data.write_logs,
3752
- writeMetrics: data.write_metrics
3753
+ writeMetrics: data.write_metrics,
3754
+ writeTraces: data.write_traces
3753
3755
  };
3754
3756
  };
3755
3757
  const unmarshalCockpitEndpoints = data => {
@@ -3888,11 +3890,13 @@ const marshalContactPoint = (request, defaults) => ({
3888
3890
  const marshalTokenScopes = (request, defaults) => ({
3889
3891
  query_logs: request.queryLogs,
3890
3892
  query_metrics: request.queryMetrics,
3893
+ query_traces: request.queryTraces,
3891
3894
  setup_alerts: request.setupAlerts,
3892
3895
  setup_logs_rules: request.setupLogsRules,
3893
3896
  setup_metrics_rules: request.setupMetricsRules,
3894
3897
  write_logs: request.writeLogs,
3895
- write_metrics: request.writeMetrics
3898
+ write_metrics: request.writeMetrics,
3899
+ write_traces: request.writeTraces
3896
3900
  });
3897
3901
  const marshalActivateCockpitRequest = (request, defaults) => ({
3898
3902
  project_id: request.projectId ?? defaults.defaultProjectId
@@ -10315,6 +10319,16 @@ const unmarshalListVolumesTypesResponse = data => {
10315
10319
  volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeType)
10316
10320
  };
10317
10321
  };
10322
+ const unmarshalMigrationPlan = data => {
10323
+ if (!isJSONObject(data)) {
10324
+ throw new TypeError(`Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.`);
10325
+ }
10326
+ return {
10327
+ snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$1),
10328
+ validationKey: data.validation_key,
10329
+ volume: data.volume ? unmarshalVolume$2(data.volume) : undefined
10330
+ };
10331
+ };
10318
10332
  const unmarshalServerActionResponse = data => {
10319
10333
  if (!isJSONObject(data)) {
10320
10334
  throw new TypeError(`Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`);
@@ -10579,6 +10593,16 @@ const marshalVolumeTemplate = (request, defaults) => ({
10579
10593
  value: request.organization
10580
10594
  }])
10581
10595
  });
10596
+ const marshalApplyBlockMigrationRequest = (request, defaults) => ({
10597
+ validation_key: request.validationKey,
10598
+ ...resolveOneOf([{
10599
+ param: 'volume_id',
10600
+ value: request.volumeId
10601
+ }, {
10602
+ param: 'snapshot_id',
10603
+ value: request.snapshotId
10604
+ }])
10605
+ });
10582
10606
  const marshalCreateImageRequest = (request, defaults) => ({
10583
10607
  arch: request.arch,
10584
10608
  default_bootscript: request.defaultBootscript,
@@ -10743,6 +10767,15 @@ const marshalExportSnapshotRequest = (request, defaults) => ({
10743
10767
  bucket: request.bucket,
10744
10768
  key: request.key
10745
10769
  });
10770
+ const marshalPlanBlockMigrationRequest = (request, defaults) => ({
10771
+ ...resolveOneOf([{
10772
+ param: 'volume_id',
10773
+ value: request.volumeId
10774
+ }, {
10775
+ param: 'snapshot_id',
10776
+ value: request.snapshotId
10777
+ }])
10778
+ });
10746
10779
  const marshalServerActionRequest = (request, defaults) => ({
10747
10780
  action: request.action ?? 'poweron',
10748
10781
  name: request.name,
@@ -10950,7 +10983,7 @@ let API$h = class API extends API$s {
10950
10983
  pageOfListServers = (request = {}) => this.client.fetch({
10951
10984
  method: 'GET',
10952
10985
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,
10953
- urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
10986
+ urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
10954
10987
  }, unmarshalListServersResponse);
10955
10988
 
10956
10989
  /**
@@ -11502,7 +11535,7 @@ let API$h = class API extends API$s {
11502
11535
  pageOfListIps = (request = {}) => this.client.fetch({
11503
11536
  method: 'GET',
11504
11537
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`,
11505
- urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined])
11538
+ urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['type', request.type])
11506
11539
  }, unmarshalListIpsResponse$1);
11507
11540
 
11508
11541
  /**
@@ -11653,6 +11686,40 @@ let API$h = class API extends API$s {
11653
11686
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dashboard`,
11654
11687
  urlParams: urlParams(['organization', request.organization], ['project', request.project])
11655
11688
  }, unmarshalGetDashboardResponse);
11689
+
11690
+ /**
11691
+ * Get a volume or snapshot's migration plan. Given a volume or snapshot,
11692
+ * returns the migration plan for a call to the RPC ApplyBlockMigration. This
11693
+ * plan will include zero or one volume, and zero or more snapshots, which
11694
+ * will need to be migrated together. This RPC does not perform the actual
11695
+ * migration itself, ApplyBlockMigration must be used. The validation_key
11696
+ * value returned by this call must be provided to the ApplyBlockMigration
11697
+ * call to confirm that all resources listed in the plan should be migrated.
11698
+ *
11699
+ * @param request - The request {@link PlanBlockMigrationRequest}
11700
+ * @returns A Promise of MigrationPlan
11701
+ */
11702
+ planBlockMigration = (request = {}) => this.client.fetch({
11703
+ body: JSON.stringify(marshalPlanBlockMigrationRequest(request, this.client.settings)),
11704
+ headers: jsonContentHeaders$f,
11705
+ method: 'POST',
11706
+ path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/plan`
11707
+ }, unmarshalMigrationPlan);
11708
+
11709
+ /**
11710
+ * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be
11711
+ * used, this RPC must be preceded by a call to PlanBlockMigration. To migrate
11712
+ * all resources mentioned in the MigrationPlan, the validation_key returned
11713
+ * in the MigrationPlan must be provided.
11714
+ *
11715
+ * @param request - The request {@link ApplyBlockMigrationRequest}
11716
+ */
11717
+ applyBlockMigration = request => this.client.fetch({
11718
+ body: JSON.stringify(marshalApplyBlockMigrationRequest(request, this.client.settings)),
11719
+ headers: jsonContentHeaders$f,
11720
+ method: 'POST',
11721
+ path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`
11722
+ });
11656
11723
  };
11657
11724
 
11658
11725
  // This file was automatically generated. DO NOT EDIT.
@@ -13125,7 +13192,6 @@ const unmarshalName = data => {
13125
13192
  throw new TypeError(`Unmarshalling the type 'Name' failed as data isn't a dictionary.`);
13126
13193
  }
13127
13194
  return {
13128
- cid: data.cid,
13129
13195
  createdAt: unmarshalDate(data.created_at),
13130
13196
  key: data.key,
13131
13197
  name: data.name,
@@ -13133,7 +13199,8 @@ const unmarshalName = data => {
13133
13199
  projectId: data.project_id,
13134
13200
  status: data.status,
13135
13201
  tags: data.tags,
13136
- updatedAt: unmarshalDate(data.updated_at)
13202
+ updatedAt: unmarshalDate(data.updated_at),
13203
+ value: data.value
13137
13204
  };
13138
13205
  };
13139
13206
  const unmarshalPin = data => {
@@ -13218,9 +13285,9 @@ const marshalPinOptions = (request, defaults) => ({
13218
13285
  required_zones: request.requiredZones
13219
13286
  });
13220
13287
  const marshalCreateNameRequest = (request, defaults) => ({
13221
- cid: request.cid,
13222
13288
  name: request.name,
13223
- project_id: request.projectId ?? defaults.defaultProjectId
13289
+ project_id: request.projectId ?? defaults.defaultProjectId,
13290
+ value: request.value
13224
13291
  });
13225
13292
  const marshalCreatePinByCIDRequest = (request, defaults) => ({
13226
13293
  cid: request.cid,
@@ -13242,7 +13309,8 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
13242
13309
  const marshalImportKeyNameRequest = (request, defaults) => ({
13243
13310
  name: request.name,
13244
13311
  private_key: request.privateKey,
13245
- project_id: request.projectId ?? defaults.defaultProjectId
13312
+ project_id: request.projectId ?? defaults.defaultProjectId,
13313
+ value: request.value
13246
13314
  });
13247
13315
  const marshalReplacePinRequest = (request, defaults) => ({
13248
13316
  cid: request.cid,
@@ -13252,9 +13320,9 @@ const marshalReplacePinRequest = (request, defaults) => ({
13252
13320
  volume_id: request.volumeId
13253
13321
  });
13254
13322
  const marshalUpdateNameRequest = (request, defaults) => ({
13255
- cid: request.cid,
13256
13323
  name: request.name,
13257
- tags: request.tags
13324
+ tags: request.tags,
13325
+ value: request.value
13258
13326
  });
13259
13327
  const marshalUpdateVolumeRequest = (request, defaults) => ({
13260
13328
  name: request.name,
@@ -13412,7 +13480,7 @@ let API$f = class API extends API$s {
13412
13480
  }, unmarshalListPinsResponse);
13413
13481
 
13414
13482
  /**
13415
- * List all pins within a volume. Retrieve information about all pins into a
13483
+ * List all pins within a volume. Retrieve information about all pins within a
13416
13484
  * volume.
13417
13485
  *
13418
13486
  * @param request - The request {@link ListPinsRequest}
@@ -13432,12 +13500,27 @@ let API$f = class API extends API$s {
13432
13500
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`,
13433
13501
  urlParams: urlParams(['volume_id', request.volumeId])
13434
13502
  });
13503
+
13504
+ /**
13505
+ * Create a new name. You can use the `ipfs key` command to list and generate
13506
+ * more names and their respective keys.
13507
+ *
13508
+ * @param request - The request {@link CreateNameRequest}
13509
+ * @returns A Promise of Name
13510
+ */
13435
13511
  createName = request => this.client.fetch({
13436
13512
  body: JSON.stringify(marshalCreateNameRequest(request, this.client.settings)),
13437
13513
  headers: jsonContentHeaders$d,
13438
13514
  method: 'POST',
13439
13515
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`
13440
13516
  }, unmarshalName);
13517
+
13518
+ /**
13519
+ * Get information about a name. Retrieve information about a specific name.
13520
+ *
13521
+ * @param request - The request {@link GetNameRequest}
13522
+ * @returns A Promise of Name
13523
+ */
13441
13524
  getName = request => this.client.fetch({
13442
13525
  method: 'GET',
13443
13526
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
@@ -13451,6 +13534,12 @@ let API$f = class API extends API$s {
13451
13534
  * @returns A Promise of Name
13452
13535
  */
13453
13536
  waitForName = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAME_TRANSIENT_STATUSES.includes(res.status))), this.getName, request, options);
13537
+
13538
+ /**
13539
+ * Delete an existing name. Delete a name by its ID.
13540
+ *
13541
+ * @param request - The request {@link DeleteNameRequest}
13542
+ */
13454
13543
  deleteName = request => this.client.fetch({
13455
13544
  method: 'DELETE',
13456
13545
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
@@ -13460,17 +13549,46 @@ let API$f = class API extends API$s {
13460
13549
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`,
13461
13550
  urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
13462
13551
  }, unmarshalListNamesResponse);
13552
+
13553
+ /**
13554
+ * List all names by a Project ID. Retrieve information about all names from a
13555
+ * Project ID.
13556
+ *
13557
+ * @param request - The request {@link ListNamesRequest}
13558
+ * @returns A Promise of ListNamesResponse
13559
+ */
13463
13560
  listNames = (request = {}) => enrichForPagination('names', this.pageOfListNames, request);
13561
+
13562
+ /**
13563
+ * Update name information. Update name information (CID, tag, name...).
13564
+ *
13565
+ * @param request - The request {@link UpdateNameRequest}
13566
+ * @returns A Promise of Name
13567
+ */
13464
13568
  updateName = request => this.client.fetch({
13465
13569
  body: JSON.stringify(marshalUpdateNameRequest(request, this.client.settings)),
13466
13570
  headers: jsonContentHeaders$d,
13467
13571
  method: 'PATCH',
13468
13572
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
13469
13573
  }, unmarshalName);
13574
+
13575
+ /**
13576
+ * Export your private key. Export a private key by its ID.
13577
+ *
13578
+ * @param request - The request {@link ExportKeyNameRequest}
13579
+ * @returns A Promise of ExportKeyNameResponse
13580
+ */
13470
13581
  exportKeyName = request => this.client.fetch({
13471
13582
  method: 'GET',
13472
13583
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/export-key/${validatePathParam('nameId', request.nameId)}`
13473
13584
  }, unmarshalExportKeyNameResponse);
13585
+
13586
+ /**
13587
+ * Import your private key. Import a private key.
13588
+ *
13589
+ * @param request - The request {@link ImportKeyNameRequest}
13590
+ * @returns A Promise of Name
13591
+ */
13474
13592
  importKeyName = request => this.client.fetch({
13475
13593
  body: JSON.stringify(marshalImportKeyNameRequest(request, this.client.settings)),
13476
13594
  headers: jsonContentHeaders$d,
@@ -22957,6 +23075,7 @@ const unmarshalOfferProduct = data => {
22957
23075
  emailAccountsQuota: data.email_accounts_quota,
22958
23076
  emailStorageQuota: data.email_storage_quota,
22959
23077
  hostingStorageQuota: data.hosting_storage_quota,
23078
+ maxAddonDomains: data.max_addon_domains,
22960
23079
  name: data.name,
22961
23080
  option: data.option,
22962
23081
  ram: data.ram,