@scaleway/sdk 1.8.0 → 1.9.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.
@@ -25,12 +25,17 @@ class API extends API$1 {
25
25
  * @param request - The request {@link CreateProjectRequest}
26
26
  * @returns A Promise of Project
27
27
  */
28
- this.createProject = request => this.client.fetch({
29
- body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
30
- headers: jsonContentHeaders,
31
- method: 'POST',
32
- path: `/account/v2/projects`
33
- }, unmarshalProject);
28
+ this.createProject = function (request) {
29
+ if (request === void 0) {
30
+ request = {};
31
+ }
32
+ return _this.client.fetch({
33
+ body: JSON.stringify(marshalCreateProjectRequest(request, _this.client.settings)),
34
+ headers: jsonContentHeaders,
35
+ method: 'POST',
36
+ path: `/account/v2/projects`
37
+ }, unmarshalProject);
38
+ };
34
39
  this.pageOfListProjects = function (request) {
35
40
  if (request === void 0) {
36
41
  request = {};
@@ -1,3 +1,4 @@
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
1
2
  import { isJSONObject } from '../../../helpers/json.js';
2
3
  import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
3
4
 
@@ -26,7 +27,7 @@ const unmarshalListProjectsResponse = data => {
26
27
  };
27
28
  const marshalCreateProjectRequest = (request, defaults) => ({
28
29
  description: request.description,
29
- name: request.name,
30
+ name: request.name || randomName('proj'),
30
31
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
31
32
  });
32
33
  const marshalUpdateProjectRequest = (request, defaults) => ({
@@ -131,6 +131,7 @@ const unmarshalOS = data => {
131
131
  throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
132
132
  }
133
133
  return {
134
+ allowed: data.allowed,
134
135
  enabled: data.enabled,
135
136
  id: data.id,
136
137
  licenseRequired: data.license_required,
@@ -10,11 +10,7 @@ const jsonContentHeaders = {
10
10
  'Content-Type': 'application/json; charset=utf-8'
11
11
  };
12
12
 
13
- /**
14
- * Functions API.
15
- *
16
- * Serverless functions API. Functions API.
17
- */
13
+ /** Serverless Functions API. */
18
14
  class API extends API$1 {
19
15
  constructor() {
20
16
  var _this;
@@ -143,6 +143,7 @@ const unmarshalUser = data => {
143
143
  throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
144
144
  }
145
145
  return {
146
+ accountRootUserId: data.account_root_user_id,
146
147
  createdAt: unmarshalDate(data.created_at),
147
148
  deletable: data.deletable,
148
149
  email: data.email,
package/dist/index.cjs CHANGED
@@ -426,7 +426,7 @@ const assertValidSettings = obj => {
426
426
  }
427
427
  };
428
428
 
429
- const version = 'v1.7.0';
429
+ const version = 'v1.8.0';
430
430
  const userAgent = `scaleway-sdk-js/${version}`;
431
431
 
432
432
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -1886,6 +1886,18 @@ const enrichForPagination = (key, fetcher, request) => {
1886
1886
  });
1887
1887
  };
1888
1888
 
1889
+ 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'];
1890
+ 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'];
1891
+ const randomName = function () {
1892
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1893
+ let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';
1894
+ const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;
1895
+ if (name === `boring${separator}wozniak`) {
1896
+ return randomName(prefix, separator);
1897
+ }
1898
+ return prefix.length > 0 ? `${prefix}${separator}${name}` : name;
1899
+ };
1900
+
1889
1901
  // This file was automatically generated. DO NOT EDIT.
1890
1902
  const unmarshalProject = data => {
1891
1903
  if (!isJSONObject(data)) {
@@ -1911,7 +1923,7 @@ const unmarshalListProjectsResponse = data => {
1911
1923
  };
1912
1924
  const marshalCreateProjectRequest = (request, defaults) => ({
1913
1925
  description: request.description,
1914
- name: request.name,
1926
+ name: request.name || randomName('proj'),
1915
1927
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
1916
1928
  });
1917
1929
  const marshalUpdateProjectRequest = (request, defaults) => ({
@@ -1937,7 +1949,7 @@ let API$p = class API extends API$q {
1937
1949
  * @param request - The request {@link CreateProjectRequest}
1938
1950
  * @returns A Promise of Project
1939
1951
  */
1940
- createProject = request => this.client.fetch({
1952
+ createProject = (request = {}) => this.client.fetch({
1941
1953
  body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
1942
1954
  headers: jsonContentHeaders$m,
1943
1955
  method: 'POST',
@@ -2019,18 +2031,6 @@ var index$s = /*#__PURE__*/Object.freeze({
2019
2031
  /** Lists transient statutes of the enum {@link ServerStatus}. */
2020
2032
  const SERVER_TRANSIENT_STATUSES$2 = ['starting', 'rebooting', 'updating', 'locking', 'unlocking', 'reinstalling'];
2021
2033
 
2022
- 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'];
2023
- 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'];
2024
- const randomName = function () {
2025
- let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2026
- let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';
2027
- const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;
2028
- if (name === `boring${separator}wozniak`) {
2029
- return randomName(prefix, separator);
2030
- }
2031
- return prefix.length > 0 ? `${prefix}${separator}${name}` : name;
2032
- };
2033
-
2034
2034
  // This file was automatically generated. DO NOT EDIT.
2035
2035
  const unmarshalServerTypeCPU = data => {
2036
2036
  if (!isJSONObject(data)) {
@@ -2483,6 +2483,7 @@ const unmarshalOS = data => {
2483
2483
  throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
2484
2484
  }
2485
2485
  return {
2486
+ allowed: data.allowed,
2486
2487
  enabled: data.enabled,
2487
2488
  id: data.id,
2488
2489
  licenseRequired: data.license_required,
@@ -7297,11 +7298,7 @@ const jsonContentHeaders$f = {
7297
7298
  'Content-Type': 'application/json; charset=utf-8'
7298
7299
  };
7299
7300
 
7300
- /**
7301
- * Functions API.
7302
- *
7303
- * Serverless functions API. Functions API.
7304
- */
7301
+ /** Serverless Functions API. */
7305
7302
  let API$h = class API extends API$q {
7306
7303
  /** Lists the available regions of the API. */
7307
7304
  static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
@@ -7926,6 +7923,7 @@ const unmarshalUser$1 = data => {
7926
7923
  throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
7927
7924
  }
7928
7925
  return {
7926
+ accountRootUserId: data.account_root_user_id,
7929
7927
  createdAt: unmarshalDate(data.created_at),
7930
7928
  deletable: data.deletable,
7931
7929
  email: data.email,
package/dist/index.d.ts CHANGED
@@ -927,7 +927,7 @@ interface Project {
927
927
  }
928
928
  type CreateProjectRequest = {
929
929
  /** Name of the Project. */
930
- name: string;
930
+ name?: string;
931
931
  /** Organization ID of the Project. */
932
932
  organizationId?: string;
933
933
  /** Description of the Project. */
@@ -980,7 +980,7 @@ declare class API$p extends API$q {
980
980
  * @param request - The request {@link CreateProjectRequest}
981
981
  * @returns A Promise of Project
982
982
  */
983
- createProject: (request: Readonly<CreateProjectRequest>) => Promise<Project>;
983
+ createProject: (request?: Readonly<CreateProjectRequest>) => Promise<Project>;
984
984
  protected pageOfListProjects: (request?: Readonly<ListProjectsRequest>) => Promise<ListProjectsResponse>;
985
985
  /**
986
986
  * List all Projects of an Organization. List all Projects of an Organization.
@@ -1590,10 +1590,12 @@ interface OS {
1590
1590
  serviceUser?: OSOSField;
1591
1591
  /** Object defining the password requirements to install the service. */
1592
1592
  servicePassword?: OSOSField;
1593
- /** State of OS. */
1593
+ /** Defines if the operating system is enabled or not. */
1594
1594
  enabled: boolean;
1595
1595
  /** License required (check server options for pricing details). */
1596
1596
  licenseRequired: boolean;
1597
+ /** Defines if a specific Organization is allowed to install this OS type. */
1598
+ allowed: boolean;
1597
1599
  }
1598
1600
  interface OSOSField {
1599
1601
  editable: boolean;
@@ -6659,7 +6661,7 @@ type CronStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creat
6659
6661
  type DomainStatus$1 = 'unknown' | 'ready' | 'deleting' | 'error' | 'creating' | 'pending';
6660
6662
  type FunctionHttpOption = 'unknown_http_option' | 'enabled' | 'redirected';
6661
6663
  type FunctionPrivacy = 'unknown_privacy' | 'public' | 'private';
6662
- type FunctionRuntime = 'unknown_runtime' | 'golang' | 'python' | 'python3' | 'node8' | 'node10' | 'node14' | 'node16' | 'node17' | 'python37' | 'python38' | 'python39' | 'python310' | 'go113' | 'go117' | 'go118' | 'node18' | 'rust165' | 'go119' | 'python311' | 'php82' | 'node19' | 'go120';
6664
+ type FunctionRuntime = 'unknown_runtime' | 'golang' | 'python' | 'python3' | 'node8' | 'node10' | 'node14' | 'node16' | 'node17' | 'python37' | 'python38' | 'python39' | 'python310' | 'go113' | 'go117' | 'go118' | 'node18' | 'rust165' | 'go119' | 'python311' | 'php82' | 'node19' | 'go120' | 'node20';
6663
6665
  type FunctionStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creating' | 'pending' | 'created';
6664
6666
  type ListCronsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
6665
6667
  type ListDomainsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'hostname_asc' | 'hostname_desc';
@@ -7462,11 +7464,7 @@ type DeleteTriggerRequest = {
7462
7464
  triggerId: string;
7463
7465
  };
7464
7466
 
7465
- /**
7466
- * Functions API.
7467
- *
7468
- * Serverless functions API. Functions API.
7469
- */
7467
+ /** Serverless Functions API. */
7470
7468
  declare class API$h extends API$q {
7471
7469
  /** Lists the available regions of the API. */
7472
7470
  static readonly LOCALITIES: Region[];
@@ -8298,6 +8296,8 @@ interface User$1 {
8298
8296
  status: UserStatus;
8299
8297
  /** Defines whether MFA is enabled. */
8300
8298
  mfa: boolean;
8299
+ /** ID of the account root user associated with the user. */
8300
+ accountRootUserId: string;
8301
8301
  }
8302
8302
  type ListSSHKeysRequest$1 = {
8303
8303
  /** Sort order of the SSH keys. */
@@ -1,4 +1,4 @@
1
- const version = 'v1.7.0';
1
+ const version = 'v1.8.0';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -35,5 +35,5 @@
35
35
  "bundledDependencies": [
36
36
  "@scaleway/random-name"
37
37
  ],
38
- "gitHead": "74003d36a8c8dfd5b53853c7bc1754ab7fff68cd"
38
+ "gitHead": "307b3c269ecfde7c1ebb24a92c83bc1fcf35edd4"
39
39
  }