@scaleway/sdk 0.1.0-beta.33 → 0.1.0-beta.34

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/applesilicon/v1alpha1/marshalling.gen.js +1 -1
  2. package/dist/api/container/v1beta1/marshalling.gen.js +1 -1
  3. package/dist/api/domain/v2beta1/api.gen.js +1 -1
  4. package/dist/api/function/v1beta1/marshalling.gen.js +1 -1
  5. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -1
  6. package/dist/api/instance/v1/api.utils.js +8 -0
  7. package/dist/api/instance/v1/marshalling.gen.js +8 -4
  8. package/dist/api/iot/v1/marshalling.gen.js +1 -1
  9. package/dist/api/k8s/v1/marshalling.gen.js +1 -1
  10. package/dist/api/lb/v1/marshalling.gen.js +9 -2
  11. package/dist/api/marketplace/v2/api.gen.js +4 -1
  12. package/dist/api/marketplace/v2/marshalling.gen.js +1 -0
  13. package/dist/api/mnq/v1alpha1/marshalling.gen.js +1 -1
  14. package/dist/api/rdb/v1/marshalling.gen.js +1 -1
  15. package/dist/api/redis/v1/marshalling.gen.js +2 -1
  16. package/dist/api/redis/v1alpha1/marshalling.gen.js +1 -1
  17. package/dist/api/registry/v1/marshalling.gen.js +1 -1
  18. package/dist/api/tem/v1alpha1/api.gen.js +1 -11
  19. package/dist/api/vpc/v1/marshalling.gen.js +1 -1
  20. package/dist/api/vpcgw/v1/marshalling.gen.js +1 -1
  21. package/dist/index.cjs +50 -13
  22. package/dist/index.d.ts +57 -11
  23. package/{node_modules/@scaleway/random-name/dist/index.browser.js → dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js} +1 -1
  24. package/dist/scw/constants.js +1 -1
  25. package/node_modules/@scaleway/random-name/CHANGELOG.md +32 -0
  26. package/node_modules/@scaleway/random-name/dist/index.js +4 -2
  27. package/node_modules/@scaleway/random-name/package.json +6 -6
  28. package/package.json +3 -3
  29. package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js +0 -11
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -325,7 +325,7 @@ class RegistrarAPI extends API$1 {
325
325
  this.searchAvailableDomains = request => this.client.fetch({
326
326
  method: 'GET',
327
327
  path: `/domain/v2beta1/search-domains`,
328
- urlParams: urlParams(['domains', request.domains], ['tlds', request.tlds])
328
+ urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds])
329
329
  }, unmarshalSearchAvailableDomainsResponse);
330
330
  this.createDomainHost = request => this.client.fetch({
331
331
  body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -244,6 +244,14 @@ class InstanceV1UtilsAPI extends API {
244
244
  }, unmarshalSetImageResponse)).then(res => ({
245
245
  image: res.image
246
246
  }));
247
+ this.setServerUserData = request => this.client.fetch({
248
+ body: request.content,
249
+ headers: {
250
+ 'Content-Type': 'text/plain'
251
+ },
252
+ method: 'PATCH',
253
+ path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`
254
+ });
247
255
  }
248
256
  }
249
257
 
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalMapOfObject, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -175,7 +175,9 @@ const unmarshalServerMaintenance = data => {
175
175
  if (!isJSONObject(data)) {
176
176
  throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`);
177
177
  }
178
- return {};
178
+ return {
179
+ reason: data.reason
180
+ };
179
181
  };
180
182
  const unmarshalServerTypeCapabilities = data => {
181
183
  if (!isJSONObject(data)) {
@@ -976,7 +978,9 @@ const marshalServerLocation = (request, defaults) => ({
976
978
  platform_id: request.platformId,
977
979
  zone_id: request.zoneId
978
980
  });
979
- const marshalServerMaintenance = (request, defaults) => ({});
981
+ const marshalServerMaintenance = (request, defaults) => ({
982
+ reason: request.reason
983
+ });
980
984
  const marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({
981
985
  action: request.action,
982
986
  dest_port_from: request.destPortFrom,
@@ -1269,7 +1273,7 @@ const marshalSetServerRequest = (request, defaults) => ({
1269
1273
  image: request.image ? marshalImage(request.image) : undefined,
1270
1274
  ipv6: request.ipv6 ? marshalServerIpv6(request.ipv6) : undefined,
1271
1275
  location: request.location ? marshalServerLocation(request.location) : undefined,
1272
- maintenances: request.maintenances ? request.maintenances.map(elt => marshalServerMaintenance()) : undefined,
1276
+ maintenances: request.maintenances ? request.maintenances.map(elt => marshalServerMaintenance(elt)) : undefined,
1273
1277
  modification_date: request.modificationDate,
1274
1278
  name: request.name,
1275
1279
  organization: request.organization,
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
4
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -267,6 +267,7 @@ const unmarshalRouteMatch = data => {
267
267
  throw new TypeError(`Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`);
268
268
  }
269
269
  return {
270
+ hostHeader: data.host_header,
270
271
  sni: data.sni
271
272
  };
272
273
  };
@@ -534,7 +535,13 @@ const marshalPrivateNetworkStaticConfig = (request, defaults) => ({
534
535
  ip_address: request.ipAddress
535
536
  });
536
537
  const marshalRouteMatch = (request, defaults) => ({
537
- sni: request.sni
538
+ ...resolveOneOf([{
539
+ param: 'sni',
540
+ value: request.sni
541
+ }, {
542
+ param: 'host_header',
543
+ value: request.hostHeader
544
+ }])
538
545
  });
539
546
  const marshalSubscriberEmailConfig = (request, defaults) => ({
540
547
  email: request.email
@@ -37,12 +37,15 @@ class API extends API$1 {
37
37
  return _this.client.fetch({
38
38
  method: 'GET',
39
39
  path: `/marketplace/v2/local-images`,
40
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
40
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['zone', request.zone ?? _this.client.settings.defaultZone], ...Object.entries(resolveOneOf([{
41
41
  param: 'image_id',
42
42
  value: request.imageId
43
43
  }, {
44
44
  param: 'version_id',
45
45
  value: request.versionId
46
+ }, {
47
+ param: 'image_label',
48
+ value: request.imageLabel
46
49
  }])))
47
50
  }, unmarshalListLocalImagesResponse);
48
51
  };
@@ -36,6 +36,7 @@ const unmarshalLocalImage = data => {
36
36
  arch: data.arch,
37
37
  compatibleCommercialTypes: data.compatible_commercial_types,
38
38
  id: data.id,
39
+ label: data.label,
39
40
  zone: data.zone
40
41
  };
41
42
  };
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
4
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
4
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
@@ -84,6 +84,7 @@ const unmarshalCluster = data => {
84
84
  tags: data.tags,
85
85
  tlsEnabled: data.tls_enabled,
86
86
  updatedAt: unmarshalDate(data.updated_at),
87
+ upgradableVersions: data.upgradable_versions,
87
88
  userName: data.user_name,
88
89
  version: data.version,
89
90
  zone: data.zone
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
4
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
@@ -1,8 +1,7 @@
1
1
  import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
2
  import { API as API$1 } from '../../../scw/api.js';
3
- import { unmarshalServiceInfo } from '../../../scw/custom-marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
6
5
  import { EMAIL_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from './content.gen.js';
7
6
  import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse } from './marshalling.gen.js';
8
7
 
@@ -21,15 +20,6 @@ class API extends API$1 {
21
20
  var _this;
22
21
  super(...arguments);
23
22
  _this = this;
24
- this.getServiceInfo = function (request) {
25
- if (request === void 0) {
26
- request = {};
27
- }
28
- return _this.client.fetch({
29
- method: 'GET',
30
- path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}`
31
- }, unmarshalServiceInfo);
32
- };
33
23
  this.createEmail = request => this.client.fetch({
34
24
  body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)),
35
25
  headers: jsonContentHeaders,
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.3/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
package/dist/index.cjs CHANGED
@@ -392,7 +392,7 @@ const assertValidSettings = obj => {
392
392
  }
393
393
  };
394
394
 
395
- const version = 'v0.1.0-beta.32';
395
+ const version = 'v0.1.0-beta.33';
396
396
  const userAgent = `scaleway-sdk-js/${version}`;
397
397
 
398
398
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -2081,8 +2081,10 @@ const SERVER_TRANSIENT_STATUSES$2 = ['starting', 'rebooting', 'updating', 'locki
2081
2081
 
2082
2082
  const ADJECTIVES = ['admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'beautiful', 'blissful', 'bold', 'boring', 'brave', 'busy', 'charming', 'clever', 'cool', 'compassionate', 'competent', 'condescending', 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'exciting', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', 'frosty', 'funny', 'gallant', 'gifted', 'goofy', 'gracious', 'great', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', 'infallible', 'inspiring', 'interesting', 'intelligent', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nice', 'nifty', 'nostalgic', 'objective', 'optimistic', 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'strange', 'stupefied', 'suspicious', 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen'];
2083
2083
  const NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'bouman', 'boyd', 'brahmagupta', 'brattain', 'brown', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'carver', 'cerf', 'chandrasekhar', 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cohen', 'chaum', 'clarke', 'colden', 'cori', 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', 'jackson', 'jang', 'jemison', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'mirzakhani', 'montalcini', 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'ritchie', 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'satoshi', 'shamir', 'shannon', 'shaw', 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'stonebraker', 'sutherland', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', 'wilbur', 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', 'zhukovsky'];
2084
- const randomName = (prefix = '', separator = '-') => {
2085
- const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)]}`;
2084
+ const randomName = function () {
2085
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2086
+ let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';
2087
+ const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;
2086
2088
  if (name === `boring${separator}wozniak`) {
2087
2089
  return randomName(prefix, separator);
2088
2090
  }
@@ -5883,7 +5885,7 @@ class RegistrarAPI extends API$n {
5883
5885
  searchAvailableDomains = request => this.client.fetch({
5884
5886
  method: 'GET',
5885
5887
  path: `/domain/v2beta1/search-domains`,
5886
- urlParams: urlParams(['domains', request.domains], ['tlds', request.tlds])
5888
+ urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds])
5887
5889
  }, unmarshalSearchAvailableDomainsResponse);
5888
5890
 
5889
5891
  /**
@@ -8406,7 +8408,9 @@ const unmarshalServerMaintenance = data => {
8406
8408
  if (!isJSONObject(data)) {
8407
8409
  throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`);
8408
8410
  }
8409
- return {};
8411
+ return {
8412
+ reason: data.reason
8413
+ };
8410
8414
  };
8411
8415
  const unmarshalServerTypeCapabilities = data => {
8412
8416
  if (!isJSONObject(data)) {
@@ -9204,7 +9208,9 @@ const marshalServerLocation = (request, defaults) => ({
9204
9208
  platform_id: request.platformId,
9205
9209
  zone_id: request.zoneId
9206
9210
  });
9207
- const marshalServerMaintenance = (request, defaults) => ({});
9211
+ const marshalServerMaintenance = (request, defaults) => ({
9212
+ reason: request.reason
9213
+ });
9208
9214
  const marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({
9209
9215
  action: request.action,
9210
9216
  dest_port_from: request.destPortFrom,
@@ -9485,7 +9491,7 @@ const marshalSetServerRequest = (request, defaults) => ({
9485
9491
  image: request.image ? marshalImage(request.image) : undefined,
9486
9492
  ipv6: request.ipv6 ? marshalServerIpv6(request.ipv6) : undefined,
9487
9493
  location: request.location ? marshalServerLocation(request.location) : undefined,
9488
- maintenances: request.maintenances ? request.maintenances.map(elt => marshalServerMaintenance()) : undefined,
9494
+ maintenances: request.maintenances ? request.maintenances.map(elt => marshalServerMaintenance(elt)) : undefined,
9489
9495
  modification_date: request.modificationDate,
9490
9496
  name: request.name,
9491
9497
  organization: request.organization,
@@ -10685,6 +10691,20 @@ class InstanceV1UtilsAPI extends API$e {
10685
10691
  }, unmarshalSetImageResponse)).then(res => ({
10686
10692
  image: res.image
10687
10693
  }));
10694
+
10695
+ /**
10696
+ * Sets the content of a user data on a server for the given key.
10697
+ *
10698
+ * @param request - The request {@link SetServerUserDataRequest}
10699
+ */
10700
+ setServerUserData = request => this.client.fetch({
10701
+ body: request.content,
10702
+ headers: {
10703
+ 'Content-Type': 'text/plain'
10704
+ },
10705
+ method: 'PATCH',
10706
+ path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`
10707
+ });
10688
10708
  }
10689
10709
 
10690
10710
  var index$g = /*#__PURE__*/Object.freeze({
@@ -11256,6 +11276,7 @@ let API$d = class API extends API$n {
11256
11276
  /**
11257
11277
  * Get a hub's metrics
11258
11278
  *
11279
+ * @deprecated
11259
11280
  * @param request - The request {@link GetHubMetricsRequest}
11260
11281
  * @returns A Promise of GetHubMetricsResponse
11261
11282
  */
@@ -11415,6 +11436,7 @@ let API$d = class API extends API$n {
11415
11436
  /**
11416
11437
  * Get a device's metrics
11417
11438
  *
11439
+ * @deprecated
11418
11440
  * @param request - The request {@link GetDeviceMetricsRequest}
11419
11441
  * @returns A Promise of GetDeviceMetricsResponse
11420
11442
  */
@@ -12723,6 +12745,7 @@ const unmarshalRouteMatch = data => {
12723
12745
  throw new TypeError(`Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`);
12724
12746
  }
12725
12747
  return {
12748
+ hostHeader: data.host_header,
12726
12749
  sni: data.sni
12727
12750
  };
12728
12751
  };
@@ -12990,7 +13013,13 @@ const marshalPrivateNetworkStaticConfig = (request, defaults) => ({
12990
13013
  ip_address: request.ipAddress
12991
13014
  });
12992
13015
  const marshalRouteMatch = (request, defaults) => ({
12993
- sni: request.sni
13016
+ ...resolveOneOf([{
13017
+ param: 'sni',
13018
+ value: request.sni
13019
+ }, {
13020
+ param: 'host_header',
13021
+ value: request.hostHeader
13022
+ }])
12994
13023
  });
12995
13024
  const marshalSubscriberEmailConfig = (request, defaults) => ({
12996
13025
  email: request.email
@@ -15033,6 +15062,7 @@ const unmarshalLocalImage = data => {
15033
15062
  arch: data.arch,
15034
15063
  compatibleCommercialTypes: data.compatible_commercial_types,
15035
15064
  id: data.id,
15065
+ label: data.label,
15036
15066
  zone: data.zone
15037
15067
  };
15038
15068
  };
@@ -15125,14 +15155,24 @@ let API$9 = class API extends API$n {
15125
15155
  pageOfListLocalImages = (request = {}) => this.client.fetch({
15126
15156
  method: 'GET',
15127
15157
  path: `/marketplace/v2/local-images`,
15128
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
15158
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['zone', request.zone ?? this.client.settings.defaultZone], ...Object.entries(resolveOneOf([{
15129
15159
  param: 'image_id',
15130
15160
  value: request.imageId
15131
15161
  }, {
15132
15162
  param: 'version_id',
15133
15163
  value: request.versionId
15164
+ }, {
15165
+ param: 'image_label',
15166
+ value: request.imageLabel
15134
15167
  }])))
15135
15168
  }, unmarshalListLocalImagesResponse);
15169
+
15170
+ /**
15171
+ * List local images from a specific image or version
15172
+ *
15173
+ * @param request - The request {@link ListLocalImagesRequest}
15174
+ * @returns A Promise of ListLocalImagesResponse
15175
+ */
15136
15176
  listLocalImages = (request = {}) => enrichForPagination('localImages', this.pageOfListLocalImages, request);
15137
15177
  getLocalImage = request => this.client.fetch({
15138
15178
  method: 'GET',
@@ -17532,6 +17572,7 @@ const unmarshalCluster = data => {
17532
17572
  tags: data.tags,
17533
17573
  tlsEnabled: data.tls_enabled,
17534
17574
  updatedAt: unmarshalDate(data.updated_at),
17575
+ upgradableVersions: data.upgradable_versions,
17535
17576
  userName: data.user_name,
17536
17577
  version: data.version,
17537
17578
  zone: data.zone
@@ -18996,10 +19037,6 @@ const jsonContentHeaders$2 = {
18996
19037
  let API$2 = class API extends API$n {
18997
19038
  /** Lists the available regions of the API. */
18998
19039
  static LOCALITIES = ['fr-par'];
18999
- getServiceInfo = (request = {}) => this.client.fetch({
19000
- method: 'GET',
19001
- path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}`
19002
- }, unmarshalServiceInfo);
19003
19040
 
19004
19041
  /**
19005
19042
  * Send an email
package/dist/index.d.ts CHANGED
@@ -4487,6 +4487,8 @@ type RegistrarApiSearchAvailableDomainsRequest = {
4487
4487
  domains: Array<string>;
4488
4488
  /** Array of tlds to search on */
4489
4489
  tlds?: Array<string>;
4490
+ /** Search exact match */
4491
+ strictSearch: boolean;
4490
4492
  };
4491
4493
  type RegistrarApiCreateDomainHostRequest = {
4492
4494
  domain: string;
@@ -8605,6 +8607,7 @@ interface ServerLocation {
8605
8607
  zoneId: string;
8606
8608
  }
8607
8609
  interface ServerMaintenance {
8610
+ reason: string;
8608
8611
  }
8609
8612
  interface ServerSummary {
8610
8613
  id: string;
@@ -10318,6 +10321,15 @@ type UpdateImageRequest$1 = {
10318
10321
  interface UpdateImageResponse {
10319
10322
  image?: Image$3;
10320
10323
  }
10324
+ type SetServerUserDataRequest = {
10325
+ /** Zone to target. If none is passed will use default zone from the config */
10326
+ zone?: Zone;
10327
+ serverId: string;
10328
+ /** The user data key to set */
10329
+ key: string;
10330
+ /** The data encoded in base64 */
10331
+ content: string;
10332
+ };
10321
10333
 
10322
10334
  declare class InstanceV1UtilsAPI extends API$e {
10323
10335
  /**
@@ -10424,6 +10436,12 @@ declare class InstanceV1UtilsAPI extends API$e {
10424
10436
  * @returns A Promise of UpdateImageResponse
10425
10437
  */
10426
10438
  updateImage: (request: Readonly<UpdateImageRequest$1>) => Promise<UpdateImageResponse>;
10439
+ /**
10440
+ * Sets the content of a user data on a server for the given key.
10441
+ *
10442
+ * @param request - The request {@link SetServerUserDataRequest}
10443
+ */
10444
+ setServerUserData: (request: Readonly<SetServerUserDataRequest>) => Promise<void>;
10427
10445
  }
10428
10446
 
10429
10447
  /** Lists transient statutes of the enum {@link ImageState}. */
@@ -10569,6 +10587,7 @@ type index$g_SetPlacementGroupServersResponse = SetPlacementGroupServersResponse
10569
10587
  type index$g_SetSecurityGroupRulesRequest = SetSecurityGroupRulesRequest;
10570
10588
  type index$g_SetSecurityGroupRulesRequestRule = SetSecurityGroupRulesRequestRule;
10571
10589
  type index$g_SetSecurityGroupRulesResponse = SetSecurityGroupRulesResponse;
10590
+ type index$g_SetServerUserDataRequest = SetServerUserDataRequest;
10572
10591
  type index$g_SnapshotBaseVolume = SnapshotBaseVolume;
10573
10592
  type index$g_SnapshotState = SnapshotState;
10574
10593
  type index$g_SnapshotVolumeType = SnapshotVolumeType;
@@ -10748,6 +10767,7 @@ declare namespace index$g {
10748
10767
  index$g_SetSecurityGroupRulesRequest as SetSecurityGroupRulesRequest,
10749
10768
  index$g_SetSecurityGroupRulesRequestRule as SetSecurityGroupRulesRequestRule,
10750
10769
  index$g_SetSecurityGroupRulesResponse as SetSecurityGroupRulesResponse,
10770
+ index$g_SetServerUserDataRequest as SetServerUserDataRequest,
10751
10771
  Snapshot$1 as Snapshot,
10752
10772
  index$g_SnapshotBaseVolume as SnapshotBaseVolume,
10753
10773
  index$g_SnapshotState as SnapshotState,
@@ -11684,6 +11704,7 @@ declare class API$d extends API$n {
11684
11704
  /**
11685
11705
  * Get a hub's metrics
11686
11706
  *
11707
+ * @deprecated
11687
11708
  * @param request - The request {@link GetHubMetricsRequest}
11688
11709
  * @returns A Promise of GetHubMetricsResponse
11689
11710
  */
@@ -11778,6 +11799,7 @@ declare class API$d extends API$n {
11778
11799
  /**
11779
11800
  * Get a device's metrics
11780
11801
  *
11802
+ * @deprecated
11781
11803
  * @param request - The request {@link GetDeviceMetricsRequest}
11782
11804
  * @returns A Promise of GetDeviceMetricsResponse
11783
11805
  */
@@ -12689,7 +12711,7 @@ type CreateClusterRequest$3 = {
12689
12711
  * could be set.
12690
12712
  */
12691
12713
  projectId?: string;
12692
- /** The type of the cluster */
12714
+ /** The type of the cluster (possible values are kapsule, multicloud). */
12693
12715
  type: string;
12694
12716
  /** The name of the cluster */
12695
12717
  name?: string;
@@ -14070,9 +14092,18 @@ interface Route {
14070
14092
  interface RouteMatch {
14071
14093
  /**
14072
14094
  * Server Name Indication TLS extension (SNI) field from an incoming
14073
- * connection made via an SSL/TLS transport layer
14095
+ * connection made via an SSL/TLS transport layer.
14096
+ *
14097
+ * One-of ('matchType'): at most one of 'sni', 'hostHeader' could be set.
14074
14098
  */
14075
14099
  sni?: string;
14100
+ /**
14101
+ * The Host request header specifies the host of the server to which the
14102
+ * request is being sent.
14103
+ *
14104
+ * One-of ('matchType'): at most one of 'sni', 'hostHeader' could be set.
14105
+ */
14106
+ hostHeader?: string;
14076
14107
  }
14077
14108
  /** Set acls response */
14078
14109
  interface SetAclsResponse {
@@ -17211,6 +17242,8 @@ interface LocalImage {
17211
17242
  arch: string;
17212
17243
  /** Availability Zone where this local image is available */
17213
17244
  zone: Zone;
17245
+ /** Image label this image belongs to */
17246
+ label: string;
17214
17247
  }
17215
17248
  /** Version */
17216
17249
  interface Version {
@@ -17256,13 +17289,25 @@ type GetVersionRequest = {
17256
17289
  versionId: string;
17257
17290
  };
17258
17291
  type ListLocalImagesRequest = {
17259
- /** One-of ('scope'): at most one of 'imageId', 'versionId' could be set. */
17292
+ /**
17293
+ * One-of ('scope'): at most one of 'imageId', 'versionId', 'imageLabel' could
17294
+ * be set.
17295
+ */
17260
17296
  imageId?: string;
17261
- /** One-of ('scope'): at most one of 'imageId', 'versionId' could be set. */
17297
+ /**
17298
+ * One-of ('scope'): at most one of 'imageId', 'versionId', 'imageLabel' could
17299
+ * be set.
17300
+ */
17262
17301
  versionId?: string;
17263
17302
  pageSize?: number;
17264
17303
  page?: number;
17265
17304
  orderBy?: ListLocalImagesRequestOrderBy;
17305
+ /**
17306
+ * One-of ('scope'): at most one of 'imageId', 'versionId', 'imageLabel' could
17307
+ * be set.
17308
+ */
17309
+ imageLabel?: string;
17310
+ zone?: Zone;
17266
17311
  };
17267
17312
  type GetLocalImageRequest = {
17268
17313
  localImageId: string;
@@ -17302,6 +17347,12 @@ declare class API$9 extends API$n {
17302
17347
  };
17303
17348
  getVersion: (request: Readonly<GetVersionRequest>) => Promise<Version>;
17304
17349
  protected pageOfListLocalImages: (request?: Readonly<ListLocalImagesRequest>) => Promise<ListLocalImagesResponse>;
17350
+ /**
17351
+ * List local images from a specific image or version
17352
+ *
17353
+ * @param request - The request {@link ListLocalImagesRequest}
17354
+ * @returns A Promise of ListLocalImagesResponse
17355
+ */
17305
17356
  listLocalImages: (request?: Readonly<ListLocalImagesRequest>) => Promise<ListLocalImagesResponse> & {
17306
17357
  all: () => Promise<LocalImage[]>;
17307
17358
  [Symbol.asyncIterator]: () => AsyncGenerator<LocalImage[], void, void>;
@@ -20389,6 +20440,8 @@ interface Cluster {
20389
20440
  zone: Zone;
20390
20441
  /** Name of the user associated to the cluster */
20391
20442
  userName: string;
20443
+ /** List of versions the cluster can be migrated to */
20444
+ upgradableVersions: Array<string>;
20392
20445
  }
20393
20446
  /** Cluster metrics response */
20394
20447
  interface ClusterMetricsResponse {
@@ -22264,10 +22317,6 @@ interface Statistics {
22264
22317
  */
22265
22318
  canceledCount: number;
22266
22319
  }
22267
- type GetServiceInfoRequest = {
22268
- /** Region to target. If none is passed will use default region from the config */
22269
- region?: Region;
22270
- };
22271
22320
  type CreateEmailRequest = {
22272
22321
  /** Region to target. If none is passed will use default region from the config */
22273
22322
  region?: Region;
@@ -22388,7 +22437,6 @@ type CheckDomainRequest = {
22388
22437
  declare class API$2 extends API$n {
22389
22438
  /** Lists the available regions of the API. */
22390
22439
  static readonly LOCALITIES: Region[];
22391
- getServiceInfo: (request?: Readonly<GetServiceInfoRequest>) => Promise<ServiceInfo>;
22392
22440
  /**
22393
22441
  * Send an email
22394
22442
  *
@@ -22509,7 +22557,6 @@ type index_gen$2_EmailStatus = EmailStatus;
22509
22557
  type index_gen$2_EmailTry = EmailTry;
22510
22558
  type index_gen$2_GetDomainRequest = GetDomainRequest;
22511
22559
  type index_gen$2_GetEmailRequest = GetEmailRequest;
22512
- type index_gen$2_GetServiceInfoRequest = GetServiceInfoRequest;
22513
22560
  type index_gen$2_GetStatisticsRequest = GetStatisticsRequest;
22514
22561
  type index_gen$2_ListDomainsRequest = ListDomainsRequest;
22515
22562
  type index_gen$2_ListDomainsResponse = ListDomainsResponse;
@@ -22538,7 +22585,6 @@ declare namespace index_gen$2 {
22538
22585
  index_gen$2_EmailTry as EmailTry,
22539
22586
  index_gen$2_GetDomainRequest as GetDomainRequest,
22540
22587
  index_gen$2_GetEmailRequest as GetEmailRequest,
22541
- index_gen$2_GetServiceInfoRequest as GetServiceInfoRequest,
22542
22588
  index_gen$2_GetStatisticsRequest as GetStatisticsRequest,
22543
22589
  index_gen$2_ListDomainsRequest as ListDomainsRequest,
22544
22590
  index_gen$2_ListDomainsResponse as ListDomainsResponse,
@@ -3,7 +3,7 @@ const NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimed
3
3
  const randomName = function () {
4
4
  let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5
5
  let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';
6
- const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)]}`;
6
+ const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;
7
7
  if (name === `boring${separator}wozniak`) {
8
8
  return randomName(prefix, separator);
9
9
  }
@@ -1,4 +1,4 @@
1
- const version = 'v0.1.0-beta.32';
1
+ const version = 'v0.1.0-beta.33';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.0.1 (2023-01-13)
7
+
8
+
9
+ ### :package: Chore
10
+
11
+ * **release:** publish ([9d6de7b](https://github.com/scaleway/scaleway-lib/commit/9d6de7b63065f53774cb64b0e5a46a868dc9933a))
12
+
13
+
14
+ ### :bug: Bug Fixes
15
+
16
+ * harden ts code ([#1158](https://github.com/scaleway/scaleway-lib/issues/1158)) ([7e2130e](https://github.com/scaleway/scaleway-lib/commit/7e2130ea4c2a079c69ec49b27444daa8f6076d03))
17
+
18
+
19
+
20
+ ## 4.0.0 (2023-01-06)
21
+
22
+
23
+ ### ⚠ BREAKING CHANGES
24
+
25
+ * packages are ESM only
26
+
27
+ ### :package: Chore
28
+
29
+ * **release:** publish ([20c9d4f](https://github.com/scaleway/scaleway-lib/commit/20c9d4fb39822245252bf362bc7a8d26127e511d))
30
+
31
+
32
+ ### :gear: Features
33
+
34
+ * publish packages as ESM only ([#1145](https://github.com/scaleway/scaleway-lib/issues/1145)) ([4c25097](https://github.com/scaleway/scaleway-lib/commit/4c25097254a5ba7f0a5dbb6fdf5d6578a75f777a))
35
+
36
+
37
+
6
38
  ## 3.0.3 (2022-12-29)
7
39
 
8
40
  ### Bug Fixes
@@ -1,7 +1,9 @@
1
1
  const ADJECTIVES = ['admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'beautiful', 'blissful', 'bold', 'boring', 'brave', 'busy', 'charming', 'clever', 'cool', 'compassionate', 'competent', 'condescending', 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'exciting', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', 'frosty', 'funny', 'gallant', 'gifted', 'goofy', 'gracious', 'great', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', 'infallible', 'inspiring', 'interesting', 'intelligent', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nice', 'nifty', 'nostalgic', 'objective', 'optimistic', 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'strange', 'stupefied', 'suspicious', 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen'];
2
2
  const NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'bouman', 'boyd', 'brahmagupta', 'brattain', 'brown', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'carver', 'cerf', 'chandrasekhar', 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cohen', 'chaum', 'clarke', 'colden', 'cori', 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', 'jackson', 'jang', 'jemison', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'mirzakhani', 'montalcini', 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'ritchie', 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'satoshi', 'shamir', 'shannon', 'shaw', 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'stonebraker', 'sutherland', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', 'wilbur', 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', 'zhukovsky'];
3
- const randomName = (prefix = '', separator = '-') => {
4
- const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)]}`;
3
+ const randomName = function () {
4
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5
+ let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';
6
+ const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;
5
7
  if (name === `boring${separator}wozniak`) {
6
8
  return randomName(prefix, separator);
7
9
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@scaleway/random-name",
3
- "version": "3.0.3",
3
+ "version": "4.0.1",
4
4
  "description": "A small utility to generate a random name",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": ">=14.x"
8
+ },
9
+ "sideEffects": false,
6
10
  "main": "dist/index.js",
7
11
  "module": "dist/index.js",
8
12
  "types": "dist/index.d.ts",
9
- "sideEffects": false,
10
- "browser": {
11
- "dist/index.js": "./dist/index.browser.js"
12
- },
13
13
  "publishConfig": {
14
14
  "access": "public"
15
15
  },
@@ -19,5 +19,5 @@
19
19
  "directory": "packages/random-name"
20
20
  },
21
21
  "license": "MIT",
22
- "gitHead": "6f4e0715a61e04c1eae8e3ba28199ac99f47c818"
22
+ "gitHead": "4f0be52e1cf86895150e66c1206ee1e7fd7a72e7"
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "0.1.0-beta.33",
3
+ "version": "0.1.0-beta.34",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "type": "module",
32
32
  "dependencies": {
33
- "@scaleway/random-name": "^3.0.3",
33
+ "@scaleway/random-name": "^4.0.0",
34
34
  "cross-fetch": "^3.1.5"
35
35
  },
36
36
  "bundledDependencies": [
37
37
  "@scaleway/random-name"
38
38
  ],
39
- "gitHead": "41e097896eb25a6e14abd79ab2d9467a75cb83f5"
39
+ "gitHead": "3ab3ba0f584165cf170f07d352f5d7cc8f0bcc14"
40
40
  }
@@ -1,11 +0,0 @@
1
- const ADJECTIVES = ['admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'beautiful', 'blissful', 'bold', 'boring', 'brave', 'busy', 'charming', 'clever', 'cool', 'compassionate', 'competent', 'condescending', 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'exciting', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', 'frosty', 'funny', 'gallant', 'gifted', 'goofy', 'gracious', 'great', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', 'infallible', 'inspiring', 'interesting', 'intelligent', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nice', 'nifty', 'nostalgic', 'objective', 'optimistic', 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'strange', 'stupefied', 'suspicious', 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen'];
2
- const NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'bouman', 'boyd', 'brahmagupta', 'brattain', 'brown', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'carver', 'cerf', 'chandrasekhar', 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cohen', 'chaum', 'clarke', 'colden', 'cori', 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', 'jackson', 'jang', 'jemison', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'mirzakhani', 'montalcini', 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'ritchie', 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'satoshi', 'shamir', 'shannon', 'shaw', 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'stonebraker', 'sutherland', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', 'wilbur', 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', 'zhukovsky'];
3
- const randomName = (prefix = '', separator = '-') => {
4
- const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)]}`;
5
- if (name === `boring${separator}wozniak`) {
6
- return randomName(prefix, separator);
7
- }
8
- return prefix.length > 0 ? `${prefix}${separator}${name}` : name;
9
- };
10
-
11
- export { randomName as default };