@scaleway/sdk 0.1.0-beta.21 → 0.1.0-beta.22

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.
@@ -1,7 +1,7 @@
1
1
  import { API } from '../../../scw/api.js';
2
2
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalUpdateProjectRequest } from './marshalling.gen.js';
4
+ import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalUpdateProjectRequest, unmarshalListMFAOTPsResponse, marshalCreateMFAOTPRequest, unmarshalMFAOTP, marshalValidateMFAOTPRequest, unmarshalValidateMFAOTPResponse } from './marshalling.gen.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  const jsonContentHeaders = {
@@ -69,6 +69,28 @@ class AccountV2GenAPI extends API {
69
69
  path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
70
70
  }, unmarshalProject);
71
71
  };
72
+ this.pageOfListMFAOTPs = request => this.client.fetch({
73
+ method: 'GET',
74
+ path: `/account/v2/mfa/otps`,
75
+ urlParams: urlParams(['account_root_user_id', request.accountRootUserId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
76
+ }, unmarshalListMFAOTPsResponse);
77
+ this.listMFAOTPs = request => enrichForPagination('mfaOtps', this.pageOfListMFAOTPs, request);
78
+ this.createMFAOTP = request => this.client.fetch({
79
+ body: JSON.stringify(marshalCreateMFAOTPRequest(request, this.client.settings)),
80
+ headers: jsonContentHeaders,
81
+ method: 'POST',
82
+ path: `/account/v2/mfa/otps`
83
+ }, unmarshalMFAOTP);
84
+ this.validateMFAOTP = request => this.client.fetch({
85
+ body: JSON.stringify(marshalValidateMFAOTPRequest(request, this.client.settings)),
86
+ headers: jsonContentHeaders,
87
+ method: 'POST',
88
+ path: `/account/v2/mfa/otps/${validatePathParam('mfaOtpId', request.mfaOtpId)}/validate`
89
+ }, unmarshalValidateMFAOTPResponse);
90
+ this.deleteMFAOTP = request => this.client.fetch({
91
+ method: 'DELETE',
92
+ path: `/account/v2/mfa/otps/${validatePathParam('mfaOtpId', request.mfaOtpId)}`
93
+ });
72
94
  }
73
95
  }
74
96
 
@@ -2,6 +2,14 @@ import { isJSONObject } from '../../../helpers/json.js';
2
2
  import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
5
+ const unmarshalMFAOTP = data => {
6
+ if (!isJSONObject(data)) {
7
+ throw new TypeError(`Unmarshalling the type 'MFAOTP' failed as data isn't a dictionary.`);
8
+ }
9
+ return {
10
+ id: data.id
11
+ };
12
+ };
5
13
  const unmarshalProject = data => {
6
14
  if (!isJSONObject(data)) {
7
15
  throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
@@ -15,6 +23,15 @@ const unmarshalProject = data => {
15
23
  updatedAt: unmarshalDate(data.updated_at)
16
24
  };
17
25
  };
26
+ const unmarshalListMFAOTPsResponse = data => {
27
+ if (!isJSONObject(data)) {
28
+ throw new TypeError(`Unmarshalling the type 'ListMFAOTPsResponse' failed as data isn't a dictionary.`);
29
+ }
30
+ return {
31
+ mfaOtps: unmarshalArrayOfObject(data.mfa_otps, unmarshalMFAOTP),
32
+ totalCount: data.total_count
33
+ };
34
+ };
18
35
  const unmarshalListProjectsResponse = data => {
19
36
  if (!isJSONObject(data)) {
20
37
  throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
@@ -24,6 +41,17 @@ const unmarshalListProjectsResponse = data => {
24
41
  totalCount: data.total_count
25
42
  };
26
43
  };
44
+ const unmarshalValidateMFAOTPResponse = data => {
45
+ if (!isJSONObject(data)) {
46
+ throw new TypeError(`Unmarshalling the type 'ValidateMFAOTPResponse' failed as data isn't a dictionary.`);
47
+ }
48
+ return {
49
+ backupCodes: data.backup_codes
50
+ };
51
+ };
52
+ const marshalCreateMFAOTPRequest = (request, defaults) => ({
53
+ account_root_user_id: request.accountRootUserId
54
+ });
27
55
  const marshalCreateProjectRequest = (request, defaults) => ({
28
56
  description: request.description,
29
57
  name: request.name,
@@ -33,5 +61,8 @@ const marshalUpdateProjectRequest = (request, defaults) => ({
33
61
  description: request.description,
34
62
  name: request.name
35
63
  });
64
+ const marshalValidateMFAOTPRequest = (request, defaults) => ({
65
+ otp: request.otp
66
+ });
36
67
 
37
- export { marshalCreateProjectRequest, marshalUpdateProjectRequest, unmarshalListProjectsResponse, unmarshalProject };
68
+ export { marshalCreateMFAOTPRequest, marshalCreateProjectRequest, marshalUpdateProjectRequest, marshalValidateMFAOTPRequest, unmarshalListMFAOTPsResponse, unmarshalListProjectsResponse, unmarshalMFAOTP, unmarshalProject, unmarshalValidateMFAOTPResponse };
@@ -145,6 +145,17 @@ const unmarshalReadReplica = data => {
145
145
  status: data.status
146
146
  };
147
147
  };
148
+ const unmarshalUpgradableVersion = data => {
149
+ if (!isJSONObject(data)) {
150
+ throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
151
+ }
152
+ return {
153
+ id: data.id,
154
+ minorVersion: data.minor_version,
155
+ name: data.name,
156
+ version: data.version
157
+ };
158
+ };
148
159
  const unmarshalVolume = data => {
149
160
  if (!isJSONObject(data)) {
150
161
  throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
@@ -235,6 +246,7 @@ const unmarshalInstance = data => {
235
246
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
236
247
  status: data.status,
237
248
  tags: data.tags,
249
+ upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
238
250
  volume: data.volume ? unmarshalVolume(data.volume) : undefined
239
251
  };
240
252
  };
@@ -646,6 +658,9 @@ const marshalUpgradeInstanceRequest = (request, defaults) => ({
646
658
  }, {
647
659
  param: 'volume_type',
648
660
  value: request.volumeType
661
+ }, {
662
+ param: 'upgradable_version_id',
663
+ value: request.upgradableVersionId
649
664
  }])
650
665
  });
651
666
 
package/dist/index.cjs CHANGED
@@ -358,7 +358,7 @@ const assertValidSettings = obj => {
358
358
  if (typeof obj.userAgent !== 'string') throw new Error(`Invalid User-Agent`);
359
359
  };
360
360
 
361
- const version = 'v0.1.0-beta.20';
361
+ const version = 'v0.1.0-beta.21';
362
362
  const userAgent = `scaleway-sdk-js/${version}`;
363
363
 
364
364
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -1884,6 +1884,14 @@ var index$H = /*#__PURE__*/Object.freeze({
1884
1884
  });
1885
1885
 
1886
1886
  // This file was automatically generated. DO NOT EDIT.
1887
+ const unmarshalMFAOTP = data => {
1888
+ if (!isJSONObject(data)) {
1889
+ throw new TypeError(`Unmarshalling the type 'MFAOTP' failed as data isn't a dictionary.`);
1890
+ }
1891
+ return {
1892
+ id: data.id
1893
+ };
1894
+ };
1887
1895
  const unmarshalProject = data => {
1888
1896
  if (!isJSONObject(data)) {
1889
1897
  throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
@@ -1897,6 +1905,15 @@ const unmarshalProject = data => {
1897
1905
  updatedAt: unmarshalDate(data.updated_at)
1898
1906
  };
1899
1907
  };
1908
+ const unmarshalListMFAOTPsResponse = data => {
1909
+ if (!isJSONObject(data)) {
1910
+ throw new TypeError(`Unmarshalling the type 'ListMFAOTPsResponse' failed as data isn't a dictionary.`);
1911
+ }
1912
+ return {
1913
+ mfaOtps: unmarshalArrayOfObject(data.mfa_otps, unmarshalMFAOTP),
1914
+ totalCount: data.total_count
1915
+ };
1916
+ };
1900
1917
  const unmarshalListProjectsResponse = data => {
1901
1918
  if (!isJSONObject(data)) {
1902
1919
  throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
@@ -1906,6 +1923,17 @@ const unmarshalListProjectsResponse = data => {
1906
1923
  totalCount: data.total_count
1907
1924
  };
1908
1925
  };
1926
+ const unmarshalValidateMFAOTPResponse = data => {
1927
+ if (!isJSONObject(data)) {
1928
+ throw new TypeError(`Unmarshalling the type 'ValidateMFAOTPResponse' failed as data isn't a dictionary.`);
1929
+ }
1930
+ return {
1931
+ backupCodes: data.backup_codes
1932
+ };
1933
+ };
1934
+ const marshalCreateMFAOTPRequest = (request, defaults) => ({
1935
+ account_root_user_id: request.accountRootUserId
1936
+ });
1909
1937
  const marshalCreateProjectRequest = (request, defaults) => ({
1910
1938
  description: request.description,
1911
1939
  name: request.name,
@@ -1915,6 +1943,9 @@ const marshalUpdateProjectRequest = (request, defaults) => ({
1915
1943
  description: request.description,
1916
1944
  name: request.name
1917
1945
  });
1946
+ const marshalValidateMFAOTPRequest = (request, defaults) => ({
1947
+ otp: request.otp
1948
+ });
1918
1949
 
1919
1950
  // This file was automatically generated. DO NOT EDIT.
1920
1951
  const jsonContentHeaders$k = {
@@ -1986,6 +2017,55 @@ class AccountV2GenAPI extends API {
1986
2017
  method: 'PATCH',
1987
2018
  path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`
1988
2019
  }, unmarshalProject);
2020
+ pageOfListMFAOTPs = request => this.client.fetch({
2021
+ method: 'GET',
2022
+ path: `/account/v2/mfa/otps`,
2023
+ urlParams: urlParams(['account_root_user_id', request.accountRootUserId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
2024
+ }, unmarshalListMFAOTPsResponse);
2025
+
2026
+ /**
2027
+ * List MFA OTPs
2028
+ *
2029
+ * @param request - The request {@link ListMFAOTPsRequest}
2030
+ * @returns A Promise of ListMFAOTPsResponse
2031
+ */
2032
+ listMFAOTPs = request => enrichForPagination('mfaOtps', this.pageOfListMFAOTPs, request);
2033
+
2034
+ /**
2035
+ * Create MFA OTP
2036
+ *
2037
+ * @param request - The request {@link CreateMFAOTPRequest}
2038
+ * @returns A Promise of MFAOTP
2039
+ */
2040
+ createMFAOTP = request => this.client.fetch({
2041
+ body: JSON.stringify(marshalCreateMFAOTPRequest(request, this.client.settings)),
2042
+ headers: jsonContentHeaders$k,
2043
+ method: 'POST',
2044
+ path: `/account/v2/mfa/otps`
2045
+ }, unmarshalMFAOTP);
2046
+
2047
+ /**
2048
+ * Validate MFA OTP
2049
+ *
2050
+ * @param request - The request {@link ValidateMFAOTPRequest}
2051
+ * @returns A Promise of ValidateMFAOTPResponse
2052
+ */
2053
+ validateMFAOTP = request => this.client.fetch({
2054
+ body: JSON.stringify(marshalValidateMFAOTPRequest(request, this.client.settings)),
2055
+ headers: jsonContentHeaders$k,
2056
+ method: 'POST',
2057
+ path: `/account/v2/mfa/otps/${validatePathParam('mfaOtpId', request.mfaOtpId)}/validate`
2058
+ }, unmarshalValidateMFAOTPResponse);
2059
+
2060
+ /**
2061
+ * Delete MFA OTP
2062
+ *
2063
+ * @param request - The request {@link DeleteMFAOTPRequest}
2064
+ */
2065
+ deleteMFAOTP = request => this.client.fetch({
2066
+ method: 'DELETE',
2067
+ path: `/account/v2/mfa/otps/${validatePathParam('mfaOtpId', request.mfaOtpId)}`
2068
+ });
1989
2069
  }
1990
2070
 
1991
2071
  var index$G = /*#__PURE__*/Object.freeze({
@@ -14902,6 +14982,17 @@ const unmarshalReadReplica = data => {
14902
14982
  status: data.status
14903
14983
  };
14904
14984
  };
14985
+ const unmarshalUpgradableVersion = data => {
14986
+ if (!isJSONObject(data)) {
14987
+ throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
14988
+ }
14989
+ return {
14990
+ id: data.id,
14991
+ minorVersion: data.minor_version,
14992
+ name: data.name,
14993
+ version: data.version
14994
+ };
14995
+ };
14905
14996
  const unmarshalVolume = data => {
14906
14997
  if (!isJSONObject(data)) {
14907
14998
  throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
@@ -14992,6 +15083,7 @@ const unmarshalInstance = data => {
14992
15083
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
14993
15084
  status: data.status,
14994
15085
  tags: data.tags,
15086
+ upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
14995
15087
  volume: data.volume ? unmarshalVolume(data.volume) : undefined
14996
15088
  };
14997
15089
  };
@@ -15403,6 +15495,9 @@ const marshalUpgradeInstanceRequest = (request, defaults) => ({
15403
15495
  }, {
15404
15496
  param: 'volume_type',
15405
15497
  value: request.volumeType
15498
+ }, {
15499
+ param: 'upgradable_version_id',
15500
+ value: request.upgradableVersionId
15406
15501
  }])
15407
15502
  });
15408
15503
 
@@ -15539,8 +15634,8 @@ class RdbV1GenAPI extends API {
15539
15634
  }, unmarshalDatabaseBackup);
15540
15635
 
15541
15636
  /**
15542
- * Upgrade your current `node_type` or enable high availability on your
15543
- * standalone database instance.
15637
+ * Upgrade your current instance specifications like node type, high
15638
+ * availability, volume, or db engine version.
15544
15639
  *
15545
15640
  * @param request - The request {@link UpgradeInstanceRequest}
15546
15641
  * @returns A Promise of Instance
package/dist/index.d.ts CHANGED
@@ -1026,7 +1026,15 @@ declare namespace index$H {
1026
1026
  };
1027
1027
  }
1028
1028
 
1029
+ declare type ListMFAOTPsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
1029
1030
  declare type ListProjectsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
1031
+ /** List mfaot ps response */
1032
+ interface ListMFAOTPsResponse {
1033
+ /** The total number of MFA OTPs */
1034
+ totalCount: number;
1035
+ /** The paginated returned MFA OTPs */
1036
+ mfaOtps: Array<MFAOTP>;
1037
+ }
1030
1038
  /** List projects response */
1031
1039
  interface ListProjectsResponse {
1032
1040
  /** The total number of projects */
@@ -1034,6 +1042,11 @@ interface ListProjectsResponse {
1034
1042
  /** The paginated returned projects */
1035
1043
  projects: Array<Project>;
1036
1044
  }
1045
+ /** Mfaotp */
1046
+ interface MFAOTP {
1047
+ /** The ID of the MFA OTP */
1048
+ id: string;
1049
+ }
1037
1050
  /** Project */
1038
1051
  interface Project {
1039
1052
  /** The ID of the project */
@@ -1049,6 +1062,11 @@ interface Project {
1049
1062
  /** The description of the project */
1050
1063
  description: string;
1051
1064
  }
1065
+ /** Validate mfaotp response */
1066
+ interface ValidateMFAOTPResponse {
1067
+ /** The backup codes of the MFA OTP */
1068
+ backupCodes: Array<string>;
1069
+ }
1052
1070
  declare type CreateProjectRequest = {
1053
1071
  /** The name of the project */
1054
1072
  name: string;
@@ -1087,6 +1105,30 @@ declare type UpdateProjectRequest = {
1087
1105
  /** The description of the project */
1088
1106
  description?: string;
1089
1107
  };
1108
+ declare type ListMFAOTPsRequest = {
1109
+ /** The page number for the returned MFA OTPs */
1110
+ page?: number;
1111
+ /** The maximum number of MFA OTP per page */
1112
+ pageSize?: number;
1113
+ /** The sort order of the returned MFA OTPs */
1114
+ orderBy?: ListMFAOTPsRequestOrderBy;
1115
+ /** Filter out by a account root user ID */
1116
+ accountRootUserId: string;
1117
+ };
1118
+ declare type CreateMFAOTPRequest = {
1119
+ /** The account root user ID of the MFA OTP */
1120
+ accountRootUserId: string;
1121
+ };
1122
+ declare type ValidateMFAOTPRequest = {
1123
+ /** The MFA OTP ID */
1124
+ mfaOtpId: string;
1125
+ /** The code of the MFA OTP */
1126
+ otp: string;
1127
+ };
1128
+ declare type DeleteMFAOTPRequest = {
1129
+ /** The MFA OTP ID */
1130
+ mfaOtpId: string;
1131
+ };
1090
1132
 
1091
1133
  /**
1092
1134
  * Account API.
@@ -1132,27 +1174,74 @@ declare class AccountV2GenAPI extends API {
1132
1174
  * @returns A Promise of Project
1133
1175
  */
1134
1176
  updateProject: (request?: Readonly<UpdateProjectRequest>) => Promise<Project>;
1177
+ protected pageOfListMFAOTPs: (request: Readonly<ListMFAOTPsRequest>) => Promise<ListMFAOTPsResponse>;
1178
+ /**
1179
+ * List MFA OTPs
1180
+ *
1181
+ * @param request - The request {@link ListMFAOTPsRequest}
1182
+ * @returns A Promise of ListMFAOTPsResponse
1183
+ */
1184
+ listMFAOTPs: (request: Readonly<ListMFAOTPsRequest>) => Promise<ListMFAOTPsResponse> & {
1185
+ all: () => Promise<MFAOTP[]>;
1186
+ [Symbol.asyncIterator]: () => AsyncGenerator<MFAOTP[], void, void>;
1187
+ };
1188
+ /**
1189
+ * Create MFA OTP
1190
+ *
1191
+ * @param request - The request {@link CreateMFAOTPRequest}
1192
+ * @returns A Promise of MFAOTP
1193
+ */
1194
+ createMFAOTP: (request: Readonly<CreateMFAOTPRequest>) => Promise<MFAOTP>;
1195
+ /**
1196
+ * Validate MFA OTP
1197
+ *
1198
+ * @param request - The request {@link ValidateMFAOTPRequest}
1199
+ * @returns A Promise of ValidateMFAOTPResponse
1200
+ */
1201
+ validateMFAOTP: (request: Readonly<ValidateMFAOTPRequest>) => Promise<ValidateMFAOTPResponse>;
1202
+ /**
1203
+ * Delete MFA OTP
1204
+ *
1205
+ * @param request - The request {@link DeleteMFAOTPRequest}
1206
+ */
1207
+ deleteMFAOTP: (request: Readonly<DeleteMFAOTPRequest>) => Promise<void>;
1135
1208
  }
1136
1209
 
1210
+ type index$G_ListMFAOTPsRequestOrderBy = ListMFAOTPsRequestOrderBy;
1137
1211
  type index$G_ListProjectsRequestOrderBy = ListProjectsRequestOrderBy;
1212
+ type index$G_ListMFAOTPsResponse = ListMFAOTPsResponse;
1138
1213
  type index$G_ListProjectsResponse = ListProjectsResponse;
1214
+ type index$G_MFAOTP = MFAOTP;
1139
1215
  type index$G_Project = Project;
1216
+ type index$G_ValidateMFAOTPResponse = ValidateMFAOTPResponse;
1140
1217
  type index$G_CreateProjectRequest = CreateProjectRequest;
1141
1218
  type index$G_ListProjectsRequest = ListProjectsRequest;
1142
1219
  type index$G_GetProjectRequest = GetProjectRequest;
1143
1220
  type index$G_DeleteProjectRequest = DeleteProjectRequest;
1144
1221
  type index$G_UpdateProjectRequest = UpdateProjectRequest;
1222
+ type index$G_ListMFAOTPsRequest = ListMFAOTPsRequest;
1223
+ type index$G_CreateMFAOTPRequest = CreateMFAOTPRequest;
1224
+ type index$G_ValidateMFAOTPRequest = ValidateMFAOTPRequest;
1225
+ type index$G_DeleteMFAOTPRequest = DeleteMFAOTPRequest;
1145
1226
  declare namespace index$G {
1146
1227
  export {
1147
1228
  AccountV2GenAPI as API,
1229
+ index$G_ListMFAOTPsRequestOrderBy as ListMFAOTPsRequestOrderBy,
1148
1230
  index$G_ListProjectsRequestOrderBy as ListProjectsRequestOrderBy,
1231
+ index$G_ListMFAOTPsResponse as ListMFAOTPsResponse,
1149
1232
  index$G_ListProjectsResponse as ListProjectsResponse,
1233
+ index$G_MFAOTP as MFAOTP,
1150
1234
  index$G_Project as Project,
1235
+ index$G_ValidateMFAOTPResponse as ValidateMFAOTPResponse,
1151
1236
  index$G_CreateProjectRequest as CreateProjectRequest,
1152
1237
  index$G_ListProjectsRequest as ListProjectsRequest,
1153
1238
  index$G_GetProjectRequest as GetProjectRequest,
1154
1239
  index$G_DeleteProjectRequest as DeleteProjectRequest,
1155
1240
  index$G_UpdateProjectRequest as UpdateProjectRequest,
1241
+ index$G_ListMFAOTPsRequest as ListMFAOTPsRequest,
1242
+ index$G_CreateMFAOTPRequest as CreateMFAOTPRequest,
1243
+ index$G_ValidateMFAOTPRequest as ValidateMFAOTPRequest,
1244
+ index$G_DeleteMFAOTPRequest as DeleteMFAOTPRequest,
1156
1245
  };
1157
1246
  }
1158
1247
 
@@ -17022,6 +17111,8 @@ interface Instance {
17022
17111
  status: InstanceStatus;
17023
17112
  /** Database engine of the database (PostgreSQL, MySQL, ...) */
17024
17113
  engine: string;
17114
+ /** Available database engine versions for upgrade */
17115
+ upgradableVersion: Array<UpgradableVersion>;
17025
17116
  /** @deprecated Endpoint of the instance */
17026
17117
  endpoint?: Endpoint$2;
17027
17118
  /** List of tags applied to the instance */
@@ -17304,6 +17395,12 @@ interface Snapshot {
17304
17395
  /** Region of this snapshot */
17305
17396
  region: Region;
17306
17397
  }
17398
+ interface UpgradableVersion {
17399
+ id: string;
17400
+ name: string;
17401
+ version: string;
17402
+ minorVersion: string;
17403
+ }
17307
17404
  /** User */
17308
17405
  interface User {
17309
17406
  /**
@@ -17419,30 +17516,38 @@ declare type UpgradeInstanceRequest = {
17419
17516
  * Node type of the instance you want to upgrade to.
17420
17517
  *
17421
17518
  * One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
17422
- * 'volumeSize', 'volumeType' could be set.
17519
+ * 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
17423
17520
  */
17424
17521
  nodeType?: string;
17425
17522
  /**
17426
17523
  * Set to true to enable high availability on your instance.
17427
17524
  *
17428
17525
  * One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
17429
- * 'volumeSize', 'volumeType' could be set.
17526
+ * 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
17430
17527
  */
17431
17528
  enableHa?: boolean;
17432
17529
  /**
17433
17530
  * Increase your block storage volume size.
17434
17531
  *
17435
17532
  * One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
17436
- * 'volumeSize', 'volumeType' could be set.
17533
+ * 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
17437
17534
  */
17438
17535
  volumeSize?: number;
17439
17536
  /**
17440
17537
  * Change your instance storage type.
17441
17538
  *
17442
17539
  * One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
17443
- * 'volumeSize', 'volumeType' could be set.
17540
+ * 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
17444
17541
  */
17445
17542
  volumeType?: VolumeType;
17543
+ /**
17544
+ * This will create a new Database Instance with same instance specification
17545
+ * as the current one and perform a Database Engine upgrade.
17546
+ *
17547
+ * One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
17548
+ * 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
17549
+ */
17550
+ upgradableVersionId?: string;
17446
17551
  };
17447
17552
  declare type ListInstancesRequest = {
17448
17553
  /** Region to target. If none is passed will use default region from the config */
@@ -17981,8 +18086,8 @@ declare class RdbV1GenAPI extends API {
17981
18086
  */
17982
18087
  exportDatabaseBackup: (request: Readonly<ExportDatabaseBackupRequest>) => Promise<DatabaseBackup>;
17983
18088
  /**
17984
- * Upgrade your current `node_type` or enable high availability on your
17985
- * standalone database instance.
18089
+ * Upgrade your current instance specifications like node type, high
18090
+ * availability, volume, or db engine version.
17986
18091
  *
17987
18092
  * @param request - The request {@link UpgradeInstanceRequest}
17988
18093
  * @returns A Promise of Instance
@@ -18421,6 +18526,7 @@ type index$e_ReadReplicaEndpointSpecPrivateNetwork = ReadReplicaEndpointSpecPriv
18421
18526
  type index$e_SetInstanceACLRulesResponse = SetInstanceACLRulesResponse;
18422
18527
  type index$e_SetInstanceSettingsResponse = SetInstanceSettingsResponse;
18423
18528
  type index$e_Snapshot = Snapshot;
18529
+ type index$e_UpgradableVersion = UpgradableVersion;
18424
18530
  type index$e_User = User;
18425
18531
  type index$e_Volume = Volume;
18426
18532
  type index$e_ListDatabaseEnginesRequest = ListDatabaseEnginesRequest;
@@ -18551,6 +18657,7 @@ declare namespace index$e {
18551
18657
  index$e_SetInstanceACLRulesResponse as SetInstanceACLRulesResponse,
18552
18658
  index$e_SetInstanceSettingsResponse as SetInstanceSettingsResponse,
18553
18659
  index$e_Snapshot as Snapshot,
18660
+ index$e_UpgradableVersion as UpgradableVersion,
18554
18661
  index$e_User as User,
18555
18662
  index$e_Volume as Volume,
18556
18663
  index$e_ListDatabaseEnginesRequest as ListDatabaseEnginesRequest,
@@ -1,4 +1,4 @@
1
- const version = 'v0.1.0-beta.20';
1
+ const version = 'v0.1.0-beta.21';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
@@ -32,11 +32,17 @@ function* pages(key, fetcher, request, firstPage) {
32
32
  * @param initial - The first page
33
33
  * @returns An async generator of resources arrays
34
34
  */
35
- async function* fetchPaginated(key, fetcher, request, initial) {
36
- if (initial === void 0) {
37
- initial = fetcher(request);
35
+ function fetchPaginated(key, fetcher, request, initial) {
36
+ try {
37
+ if (initial === void 0) {
38
+ initial = fetcher(request);
39
+ }
40
+ return async function* () {
41
+ yield* pages(key, fetcher, request, await initial);
42
+ }();
43
+ } catch (e) {
44
+ return Promise.reject(e);
38
45
  }
39
- yield* pages(key, fetcher, request, await initial);
40
46
  }
41
47
 
42
48
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "0.1.0-beta.21",
3
+ "version": "0.1.0-beta.22",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -36,5 +36,5 @@
36
36
  "bundledDependencies": [
37
37
  "@scaleway/random-name"
38
38
  ],
39
- "gitHead": "3a524c526779830f3d1387073b857c9220e2c159"
39
+ "gitHead": "1b2bda8722b64b7f4e7ec30bb9722246902a7bd5"
40
40
  }