@scaleway/sdk 1.23.0 → 1.25.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.
@@ -1,7 +1,7 @@
1
1
  import { API as API$1 } from '../../../scw/api.js';
2
2
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalGeneratePasswordRequest, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse, unmarshalListTagsResponse } from './marshalling.gen.js';
4
+ import { marshalCreateSecretRequest, unmarshalSecret, marshalCreateFolderRequest, unmarshalFolder, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalListFoldersResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalGeneratePasswordRequest, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse, unmarshalListTagsResponse } from './marshalling.gen.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -20,7 +20,7 @@ class API extends API$1 {
20
20
  static LOCALITIES = ['fr-par'];
21
21
 
22
22
  /**
23
- * Create a secret. You must sepcify the `region` to create a secret.
23
+ * Create a secret. You must specify the `region` to create a secret.
24
24
  *
25
25
  * @param request - The request {@link CreateSecretRequest}
26
26
  * @returns A Promise of Secret
@@ -32,6 +32,19 @@ class API extends API$1 {
32
32
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
33
33
  }, unmarshalSecret);
34
34
 
35
+ /**
36
+ * Create folder.
37
+ *
38
+ * @param request - The request {@link CreateFolderRequest}
39
+ * @returns A Promise of Folder
40
+ */
41
+ createFolder = request => this.client.fetch({
42
+ body: JSON.stringify(marshalCreateFolderRequest(request, this.client.settings)),
43
+ headers: jsonContentHeaders,
44
+ method: 'POST',
45
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`
46
+ }, unmarshalFolder);
47
+
35
48
  /**
36
49
  * Get metadata using the secret's ID. Retrieve the metadata of a secret
37
50
  * specified by the `region` and `secret_id` parameters.
@@ -48,6 +61,11 @@ class API extends API$1 {
48
61
  * Get metadata using the secret's name. Retrieve the metadata of a secret
49
62
  * specified by the `region` and `secret_name` parameters.
50
63
  *
64
+ * GetSecretByName usage is now deprecated.
65
+ *
66
+ * Scaleway recommends you to use ListSecrets with the `name` filter.
67
+ *
68
+ * @deprecated
51
69
  * @param request - The request {@link GetSecretByNameRequest}
52
70
  * @returns A Promise of Secret
53
71
  */
@@ -80,7 +98,7 @@ class API extends API$1 {
80
98
  return _this.client.fetch({
81
99
  method: 'GET',
82
100
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets`,
83
- urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])
101
+ urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
84
102
  }, unmarshalListSecretsResponse);
85
103
  };
86
104
  })();
@@ -102,6 +120,35 @@ class API extends API$1 {
102
120
  return enrichForPagination('secrets', _this2.pageOfListSecrets, request);
103
121
  };
104
122
  })();
123
+ pageOfListFolders = (() => {
124
+ var _this3 = this;
125
+ return function (request) {
126
+ if (request === void 0) {
127
+ request = {};
128
+ }
129
+ return _this3.client.fetch({
130
+ method: 'GET',
131
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/folders`,
132
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId ?? _this3.client.settings.defaultProjectId])
133
+ }, unmarshalListFoldersResponse);
134
+ };
135
+ })();
136
+
137
+ /**
138
+ * List secrets. Retrieve the list of folders created within a Project.
139
+ *
140
+ * @param request - The request {@link ListFoldersRequest}
141
+ * @returns A Promise of ListFoldersResponse
142
+ */
143
+ listFolders = (() => {
144
+ var _this4 = this;
145
+ return function (request) {
146
+ if (request === void 0) {
147
+ request = {};
148
+ }
149
+ return enrichForPagination('folders', _this4.pageOfListFolders, request);
150
+ };
151
+ })();
105
152
 
106
153
  /**
107
154
  * Delete a secret. Delete a given secret specified by the `region` and
@@ -114,6 +161,16 @@ class API extends API$1 {
114
161
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
115
162
  });
116
163
 
164
+ /**
165
+ * Delete a given folder specified by the and `folder_id` parameter.
166
+ *
167
+ * @param request - The request {@link DeleteFolderRequest}
168
+ */
169
+ deleteFolder = request => this.client.fetch({
170
+ method: 'DELETE',
171
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders/${validatePathParam('folderId', request.folderId)}`
172
+ });
173
+
117
174
  /**
118
175
  * Protect a secret. Protect a given secret specified by the `secret_id`
119
176
  * parameter. A protected secret can be read and modified but cannot be
@@ -324,15 +381,15 @@ class API extends API$1 {
324
381
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy`
325
382
  }, unmarshalSecretVersion);
326
383
  pageOfListTags = (() => {
327
- var _this3 = this;
384
+ var _this5 = this;
328
385
  return function (request) {
329
386
  if (request === void 0) {
330
387
  request = {};
331
388
  }
332
- return _this3.client.fetch({
389
+ return _this5.client.fetch({
333
390
  method: 'GET',
334
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/tags`,
335
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
391
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/tags`,
392
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId])
336
393
  }, unmarshalListTagsResponse);
337
394
  };
338
395
  })();
@@ -344,12 +401,12 @@ class API extends API$1 {
344
401
  * @returns A Promise of ListTagsResponse
345
402
  */
346
403
  listTags = (() => {
347
- var _this4 = this;
404
+ var _this6 = this;
348
405
  return function (request) {
349
406
  if (request === void 0) {
350
407
  request = {};
351
408
  }
352
- return enrichForPagination('tags', _this4.pageOfListTags, request);
409
+ return enrichForPagination('tags', _this6.pageOfListTags, request);
353
410
  };
354
411
  })();
355
412
  }
@@ -3,6 +3,18 @@ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../he
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
5
5
  // If you have any remark or suggestion do not hesitate to open an issue.
6
+ const unmarshalFolder = data => {
7
+ if (!isJSONObject(data)) {
8
+ throw new TypeError(`Unmarshalling the type 'Folder' failed as data isn't a dictionary.`);
9
+ }
10
+ return {
11
+ createdAt: unmarshalDate(data.created_at),
12
+ id: data.id,
13
+ name: data.name,
14
+ path: data.path,
15
+ projectId: data.project_id
16
+ };
17
+ };
6
18
  const unmarshalSecret = data => {
7
19
  if (!isJSONObject(data)) {
8
20
  throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
@@ -14,6 +26,7 @@ const unmarshalSecret = data => {
14
26
  isManaged: data.is_managed,
15
27
  isProtected: data.is_protected,
16
28
  name: data.name,
29
+ path: data.path,
17
30
  projectId: data.project_id,
18
31
  region: data.region,
19
32
  status: data.status,
@@ -48,6 +61,15 @@ const unmarshalAccessSecretVersionResponse = data => {
48
61
  secretId: data.secret_id
49
62
  };
50
63
  };
64
+ const unmarshalListFoldersResponse = data => {
65
+ if (!isJSONObject(data)) {
66
+ throw new TypeError(`Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.`);
67
+ }
68
+ return {
69
+ folders: unmarshalArrayOfObject(data.folders, unmarshalFolder),
70
+ totalCount: data.total_count
71
+ };
72
+ };
51
73
  const unmarshalListSecretVersionsResponse = data => {
52
74
  if (!isJSONObject(data)) {
53
75
  throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);
@@ -86,9 +108,15 @@ const marshalAddSecretOwnerRequest = (request, defaults) => ({
86
108
  product: request.product ?? 'unknown',
87
109
  product_name: request.productName
88
110
  });
111
+ const marshalCreateFolderRequest = (request, defaults) => ({
112
+ name: request.name,
113
+ path: request.path,
114
+ project_id: request.projectId ?? defaults.defaultProjectId
115
+ });
89
116
  const marshalCreateSecretRequest = (request, defaults) => ({
90
117
  description: request.description,
91
118
  name: request.name,
119
+ path: request.path,
92
120
  project_id: request.projectId ?? defaults.defaultProjectId,
93
121
  tags: request.tags,
94
122
  type: request.type ?? 'unknown_secret_type'
@@ -115,10 +143,11 @@ const marshalGeneratePasswordRequest = (request, defaults) => ({
115
143
  const marshalUpdateSecretRequest = (request, defaults) => ({
116
144
  description: request.description,
117
145
  name: request.name,
146
+ path: request.path,
118
147
  tags: request.tags
119
148
  });
120
149
  const marshalUpdateSecretVersionRequest = (request, defaults) => ({
121
150
  description: request.description
122
151
  });
123
152
 
124
- export { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalGeneratePasswordRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
153
+ export { marshalAddSecretOwnerRequest, marshalCreateFolderRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalGeneratePasswordRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalFolder, unmarshalListFoldersResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
package/dist/index.cjs CHANGED
@@ -497,7 +497,7 @@ const assertValidSettings = obj => {
497
497
  }
498
498
  };
499
499
 
500
- const version = 'v1.22.0';
500
+ const version = 'v1.24.0';
501
501
  const userAgent = `scaleway-sdk-js/${version}`;
502
502
 
503
503
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -20288,6 +20288,18 @@ var index$6 = /*#__PURE__*/Object.freeze({
20288
20288
 
20289
20289
  // This file was automatically generated. DO NOT EDIT.
20290
20290
  // If you have any remark or suggestion do not hesitate to open an issue.
20291
+ const unmarshalFolder = data => {
20292
+ if (!isJSONObject(data)) {
20293
+ throw new TypeError(`Unmarshalling the type 'Folder' failed as data isn't a dictionary.`);
20294
+ }
20295
+ return {
20296
+ createdAt: unmarshalDate(data.created_at),
20297
+ id: data.id,
20298
+ name: data.name,
20299
+ path: data.path,
20300
+ projectId: data.project_id
20301
+ };
20302
+ };
20291
20303
  const unmarshalSecret = data => {
20292
20304
  if (!isJSONObject(data)) {
20293
20305
  throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
@@ -20299,6 +20311,7 @@ const unmarshalSecret = data => {
20299
20311
  isManaged: data.is_managed,
20300
20312
  isProtected: data.is_protected,
20301
20313
  name: data.name,
20314
+ path: data.path,
20302
20315
  projectId: data.project_id,
20303
20316
  region: data.region,
20304
20317
  status: data.status,
@@ -20333,6 +20346,15 @@ const unmarshalAccessSecretVersionResponse = data => {
20333
20346
  secretId: data.secret_id
20334
20347
  };
20335
20348
  };
20349
+ const unmarshalListFoldersResponse = data => {
20350
+ if (!isJSONObject(data)) {
20351
+ throw new TypeError(`Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.`);
20352
+ }
20353
+ return {
20354
+ folders: unmarshalArrayOfObject(data.folders, unmarshalFolder),
20355
+ totalCount: data.total_count
20356
+ };
20357
+ };
20336
20358
  const unmarshalListSecretVersionsResponse = data => {
20337
20359
  if (!isJSONObject(data)) {
20338
20360
  throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);
@@ -20371,9 +20393,15 @@ const marshalAddSecretOwnerRequest = (request, defaults) => ({
20371
20393
  product: request.product ?? 'unknown',
20372
20394
  product_name: request.productName
20373
20395
  });
20396
+ const marshalCreateFolderRequest = (request, defaults) => ({
20397
+ name: request.name,
20398
+ path: request.path,
20399
+ project_id: request.projectId ?? defaults.defaultProjectId
20400
+ });
20374
20401
  const marshalCreateSecretRequest = (request, defaults) => ({
20375
20402
  description: request.description,
20376
20403
  name: request.name,
20404
+ path: request.path,
20377
20405
  project_id: request.projectId ?? defaults.defaultProjectId,
20378
20406
  tags: request.tags,
20379
20407
  type: request.type ?? 'unknown_secret_type'
@@ -20400,6 +20428,7 @@ const marshalGeneratePasswordRequest = (request, defaults) => ({
20400
20428
  const marshalUpdateSecretRequest = (request, defaults) => ({
20401
20429
  description: request.description,
20402
20430
  name: request.name,
20431
+ path: request.path,
20403
20432
  tags: request.tags
20404
20433
  });
20405
20434
  const marshalUpdateSecretVersionRequest = (request, defaults) => ({
@@ -20423,7 +20452,7 @@ let API$6 = class API extends API$s {
20423
20452
  static LOCALITIES = ['fr-par'];
20424
20453
 
20425
20454
  /**
20426
- * Create a secret. You must sepcify the `region` to create a secret.
20455
+ * Create a secret. You must specify the `region` to create a secret.
20427
20456
  *
20428
20457
  * @param request - The request {@link CreateSecretRequest}
20429
20458
  * @returns A Promise of Secret
@@ -20435,6 +20464,19 @@ let API$6 = class API extends API$s {
20435
20464
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
20436
20465
  }, unmarshalSecret);
20437
20466
 
20467
+ /**
20468
+ * Create folder.
20469
+ *
20470
+ * @param request - The request {@link CreateFolderRequest}
20471
+ * @returns A Promise of Folder
20472
+ */
20473
+ createFolder = request => this.client.fetch({
20474
+ body: JSON.stringify(marshalCreateFolderRequest(request, this.client.settings)),
20475
+ headers: jsonContentHeaders$6,
20476
+ method: 'POST',
20477
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`
20478
+ }, unmarshalFolder);
20479
+
20438
20480
  /**
20439
20481
  * Get metadata using the secret's ID. Retrieve the metadata of a secret
20440
20482
  * specified by the `region` and `secret_id` parameters.
@@ -20451,6 +20493,11 @@ let API$6 = class API extends API$s {
20451
20493
  * Get metadata using the secret's name. Retrieve the metadata of a secret
20452
20494
  * specified by the `region` and `secret_name` parameters.
20453
20495
  *
20496
+ * GetSecretByName usage is now deprecated.
20497
+ *
20498
+ * Scaleway recommends you to use ListSecrets with the `name` filter.
20499
+ *
20500
+ * @deprecated
20454
20501
  * @param request - The request {@link GetSecretByNameRequest}
20455
20502
  * @returns A Promise of Secret
20456
20503
  */
@@ -20477,7 +20524,7 @@ let API$6 = class API extends API$s {
20477
20524
  pageOfListSecrets = (request = {}) => this.client.fetch({
20478
20525
  method: 'GET',
20479
20526
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`,
20480
- urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])
20527
+ urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
20481
20528
  }, unmarshalListSecretsResponse);
20482
20529
 
20483
20530
  /**
@@ -20489,6 +20536,19 @@ let API$6 = class API extends API$s {
20489
20536
  * @returns A Promise of ListSecretsResponse
20490
20537
  */
20491
20538
  listSecrets = (request = {}) => enrichForPagination('secrets', this.pageOfListSecrets, request);
20539
+ pageOfListFolders = (request = {}) => this.client.fetch({
20540
+ method: 'GET',
20541
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`,
20542
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
20543
+ }, unmarshalListFoldersResponse);
20544
+
20545
+ /**
20546
+ * List secrets. Retrieve the list of folders created within a Project.
20547
+ *
20548
+ * @param request - The request {@link ListFoldersRequest}
20549
+ * @returns A Promise of ListFoldersResponse
20550
+ */
20551
+ listFolders = (request = {}) => enrichForPagination('folders', this.pageOfListFolders, request);
20492
20552
 
20493
20553
  /**
20494
20554
  * Delete a secret. Delete a given secret specified by the `region` and
@@ -20501,6 +20561,16 @@ let API$6 = class API extends API$s {
20501
20561
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
20502
20562
  });
20503
20563
 
20564
+ /**
20565
+ * Delete a given folder specified by the and `folder_id` parameter.
20566
+ *
20567
+ * @param request - The request {@link DeleteFolderRequest}
20568
+ */
20569
+ deleteFolder = request => this.client.fetch({
20570
+ method: 'DELETE',
20571
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders/${validatePathParam('folderId', request.folderId)}`
20572
+ });
20573
+
20504
20574
  /**
20505
20575
  * Protect a secret. Protect a given secret specified by the `secret_id`
20506
20576
  * parameter. A protected secret can be read and modified but cannot be
package/dist/index.d.ts CHANGED
@@ -10112,7 +10112,7 @@ declare namespace index$j {
10112
10112
  };
10113
10113
  }
10114
10114
 
10115
- type Arch = 'x86_64' | 'arm';
10115
+ type Arch = 'x86_64' | 'arm' | 'arm64';
10116
10116
  type BootType = 'local' | 'bootscript' | 'rescue';
10117
10117
  type ImageState = 'available' | 'creating' | 'error';
10118
10118
  type IpState = 'unknown_state' | 'detached' | 'attached' | 'pending' | 'error';
@@ -17098,7 +17098,7 @@ interface PrivateNetwork$3 {
17098
17098
  updatedAt?: Date;
17099
17099
  }
17100
17100
  interface PrivateNetworkDHCPConfig {
17101
- ipId: string;
17101
+ ipId?: string;
17102
17102
  }
17103
17103
  interface PrivateNetworkIpamConfig {
17104
17104
  }
@@ -25105,6 +25105,7 @@ declare namespace index$6 {
25105
25105
  };
25106
25106
  }
25107
25107
 
25108
+ type ListFoldersRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
25108
25109
  type ListSecretsRequestOrderBy = 'name_asc' | 'name_desc' | 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
25109
25110
  type Product = 'unknown';
25110
25111
  type SecretStatus = 'ready' | 'locked';
@@ -25127,6 +25128,26 @@ interface AccessSecretVersionResponse {
25127
25128
  */
25128
25129
  dataCrc32?: number;
25129
25130
  }
25131
+ /** Folder. */
25132
+ interface Folder {
25133
+ /** ID of the folder. */
25134
+ id: string;
25135
+ /** ID of the Project containing the folder. */
25136
+ projectId: string;
25137
+ /** Name of the folder. */
25138
+ name: string;
25139
+ /** Path of the folder. Location of the folder in the directory structure. */
25140
+ path: string;
25141
+ /** Date and time of the folder's creation. */
25142
+ createdAt?: Date;
25143
+ }
25144
+ /** List folders response. */
25145
+ interface ListFoldersResponse {
25146
+ /** List of folders. */
25147
+ folders: Folder[];
25148
+ /** Count of all folders matching the requested criteria. */
25149
+ totalCount: number;
25150
+ }
25130
25151
  /** List secret versions response. */
25131
25152
  interface ListSecretVersionsResponse {
25132
25153
  /** Single page of versions. */
@@ -25191,6 +25212,8 @@ interface Secret {
25191
25212
  isProtected: boolean;
25192
25213
  /** Type of the secret. See `Secret.Type` enum for description of values. */
25193
25214
  type: SecretType;
25215
+ /** Path of the secret. Location of the secret in the directory structure. */
25216
+ path: string;
25194
25217
  /** Region of the secret. */
25195
25218
  region: Region;
25196
25219
  }
@@ -25238,6 +25261,27 @@ type CreateSecretRequest = {
25238
25261
  * values. If not specified, the type is `Opaque`.
25239
25262
  */
25240
25263
  type?: SecretType;
25264
+ /**
25265
+ * Path of the secret. (Optional.) Location of the secret in the directory
25266
+ * structure. If not specified, the path is `/`.
25267
+ */
25268
+ path?: string;
25269
+ };
25270
+ type CreateFolderRequest = {
25271
+ /**
25272
+ * Region to target. If none is passed will use default region from the
25273
+ * config.
25274
+ */
25275
+ region?: Region;
25276
+ /** ID of the Project containing the folder. */
25277
+ projectId?: string;
25278
+ /** Name of the folder. */
25279
+ name: string;
25280
+ /**
25281
+ * Path of the folder. (Optional.) Location of the folder in the directory
25282
+ * structure. If not specified, the path is `/`.
25283
+ */
25284
+ path?: string;
25241
25285
  };
25242
25286
  type GetSecretRequest = {
25243
25287
  /**
@@ -25276,6 +25320,11 @@ type UpdateSecretRequest = {
25276
25320
  tags?: string[];
25277
25321
  /** Description of the secret. */
25278
25322
  description?: string;
25323
+ /**
25324
+ * Path of the folder. (Optional.) Location of the folder in the directory
25325
+ * structure. If not specified, the path is `/`.
25326
+ */
25327
+ path?: string;
25279
25328
  };
25280
25329
  type ListSecretsRequest = {
25281
25330
  /**
@@ -25296,6 +25345,22 @@ type ListSecretsRequest = {
25296
25345
  name?: string;
25297
25346
  /** Filter by managed / not managed (optional). */
25298
25347
  isManaged?: boolean;
25348
+ /** Filter by path (optional). */
25349
+ path?: string;
25350
+ };
25351
+ type ListFoldersRequest = {
25352
+ /**
25353
+ * Region to target. If none is passed will use default region from the
25354
+ * config.
25355
+ */
25356
+ region?: Region;
25357
+ /** ID of the Project. */
25358
+ projectId?: string;
25359
+ /** Filter by path (optional). */
25360
+ path?: string;
25361
+ page?: number;
25362
+ pageSize?: number;
25363
+ orderBy?: ListFoldersRequestOrderBy;
25299
25364
  };
25300
25365
  type DeleteSecretRequest = {
25301
25366
  /**
@@ -25306,6 +25371,15 @@ type DeleteSecretRequest = {
25306
25371
  /** ID of the secret. */
25307
25372
  secretId: string;
25308
25373
  };
25374
+ type DeleteFolderRequest = {
25375
+ /**
25376
+ * Region to target. If none is passed will use default region from the
25377
+ * config.
25378
+ */
25379
+ region?: Region;
25380
+ /** ID of the folder. */
25381
+ folderId: string;
25382
+ };
25309
25383
  type ProtectSecretRequest = {
25310
25384
  /**
25311
25385
  * Region to target. If none is passed will use default region from the
@@ -25590,12 +25664,19 @@ declare class API$6 extends API$s {
25590
25664
  /** Lists the available regions of the API. */
25591
25665
  static readonly LOCALITIES: Region[];
25592
25666
  /**
25593
- * Create a secret. You must sepcify the `region` to create a secret.
25667
+ * Create a secret. You must specify the `region` to create a secret.
25594
25668
  *
25595
25669
  * @param request - The request {@link CreateSecretRequest}
25596
25670
  * @returns A Promise of Secret
25597
25671
  */
25598
25672
  createSecret: (request: Readonly<CreateSecretRequest>) => Promise<Secret>;
25673
+ /**
25674
+ * Create folder.
25675
+ *
25676
+ * @param request - The request {@link CreateFolderRequest}
25677
+ * @returns A Promise of Folder
25678
+ */
25679
+ createFolder: (request: Readonly<CreateFolderRequest>) => Promise<Folder>;
25599
25680
  /**
25600
25681
  * Get metadata using the secret's ID. Retrieve the metadata of a secret
25601
25682
  * specified by the `region` and `secret_id` parameters.
@@ -25608,6 +25689,11 @@ declare class API$6 extends API$s {
25608
25689
  * Get metadata using the secret's name. Retrieve the metadata of a secret
25609
25690
  * specified by the `region` and `secret_name` parameters.
25610
25691
  *
25692
+ * GetSecretByName usage is now deprecated.
25693
+ *
25694
+ * Scaleway recommends you to use ListSecrets with the `name` filter.
25695
+ *
25696
+ * @deprecated
25611
25697
  * @param request - The request {@link GetSecretByNameRequest}
25612
25698
  * @returns A Promise of Secret
25613
25699
  */
@@ -25634,6 +25720,17 @@ declare class API$6 extends API$s {
25634
25720
  all: () => Promise<Secret[]>;
25635
25721
  [Symbol.asyncIterator]: () => AsyncGenerator<Secret[], void, void>;
25636
25722
  };
25723
+ protected pageOfListFolders: (request?: Readonly<ListFoldersRequest>) => Promise<ListFoldersResponse>;
25724
+ /**
25725
+ * List secrets. Retrieve the list of folders created within a Project.
25726
+ *
25727
+ * @param request - The request {@link ListFoldersRequest}
25728
+ * @returns A Promise of ListFoldersResponse
25729
+ */
25730
+ listFolders: (request?: Readonly<ListFoldersRequest>) => Promise<ListFoldersResponse> & {
25731
+ all: () => Promise<Folder[]>;
25732
+ [Symbol.asyncIterator]: () => AsyncGenerator<Folder[], void, void>;
25733
+ };
25637
25734
  /**
25638
25735
  * Delete a secret. Delete a given secret specified by the `region` and
25639
25736
  * `secret_id` parameters.
@@ -25641,6 +25738,12 @@ declare class API$6 extends API$s {
25641
25738
  * @param request - The request {@link DeleteSecretRequest}
25642
25739
  */
25643
25740
  deleteSecret: (request: Readonly<DeleteSecretRequest>) => Promise<void>;
25741
+ /**
25742
+ * Delete a given folder specified by the and `folder_id` parameter.
25743
+ *
25744
+ * @param request - The request {@link DeleteFolderRequest}
25745
+ */
25746
+ deleteFolder: (request: Readonly<DeleteFolderRequest>) => Promise<void>;
25644
25747
  /**
25645
25748
  * Protect a secret. Protect a given secret specified by the `secret_id`
25646
25749
  * parameter. A protected secret can be read and modified but cannot be
@@ -25792,17 +25895,23 @@ type index_gen$6_AccessSecretVersionByNameRequest = AccessSecretVersionByNameReq
25792
25895
  type index_gen$6_AccessSecretVersionRequest = AccessSecretVersionRequest;
25793
25896
  type index_gen$6_AccessSecretVersionResponse = AccessSecretVersionResponse;
25794
25897
  type index_gen$6_AddSecretOwnerRequest = AddSecretOwnerRequest;
25898
+ type index_gen$6_CreateFolderRequest = CreateFolderRequest;
25795
25899
  type index_gen$6_CreateSecretRequest = CreateSecretRequest;
25796
25900
  type index_gen$6_CreateSecretVersionRequest = CreateSecretVersionRequest;
25901
+ type index_gen$6_DeleteFolderRequest = DeleteFolderRequest;
25797
25902
  type index_gen$6_DeleteSecretRequest = DeleteSecretRequest;
25798
25903
  type index_gen$6_DestroySecretVersionRequest = DestroySecretVersionRequest;
25799
25904
  type index_gen$6_DisableSecretVersionRequest = DisableSecretVersionRequest;
25800
25905
  type index_gen$6_EnableSecretVersionRequest = EnableSecretVersionRequest;
25906
+ type index_gen$6_Folder = Folder;
25801
25907
  type index_gen$6_GeneratePasswordRequest = GeneratePasswordRequest;
25802
25908
  type index_gen$6_GetSecretByNameRequest = GetSecretByNameRequest;
25803
25909
  type index_gen$6_GetSecretRequest = GetSecretRequest;
25804
25910
  type index_gen$6_GetSecretVersionByNameRequest = GetSecretVersionByNameRequest;
25805
25911
  type index_gen$6_GetSecretVersionRequest = GetSecretVersionRequest;
25912
+ type index_gen$6_ListFoldersRequest = ListFoldersRequest;
25913
+ type index_gen$6_ListFoldersRequestOrderBy = ListFoldersRequestOrderBy;
25914
+ type index_gen$6_ListFoldersResponse = ListFoldersResponse;
25806
25915
  type index_gen$6_ListSecretVersionsByNameRequest = ListSecretVersionsByNameRequest;
25807
25916
  type index_gen$6_ListSecretVersionsRequest = ListSecretVersionsRequest;
25808
25917
  type index_gen$6_ListSecretVersionsResponse = ListSecretVersionsResponse;
@@ -25829,17 +25938,23 @@ declare namespace index_gen$6 {
25829
25938
  index_gen$6_AccessSecretVersionRequest as AccessSecretVersionRequest,
25830
25939
  index_gen$6_AccessSecretVersionResponse as AccessSecretVersionResponse,
25831
25940
  index_gen$6_AddSecretOwnerRequest as AddSecretOwnerRequest,
25941
+ index_gen$6_CreateFolderRequest as CreateFolderRequest,
25832
25942
  index_gen$6_CreateSecretRequest as CreateSecretRequest,
25833
25943
  index_gen$6_CreateSecretVersionRequest as CreateSecretVersionRequest,
25944
+ index_gen$6_DeleteFolderRequest as DeleteFolderRequest,
25834
25945
  index_gen$6_DeleteSecretRequest as DeleteSecretRequest,
25835
25946
  index_gen$6_DestroySecretVersionRequest as DestroySecretVersionRequest,
25836
25947
  index_gen$6_DisableSecretVersionRequest as DisableSecretVersionRequest,
25837
25948
  index_gen$6_EnableSecretVersionRequest as EnableSecretVersionRequest,
25949
+ index_gen$6_Folder as Folder,
25838
25950
  index_gen$6_GeneratePasswordRequest as GeneratePasswordRequest,
25839
25951
  index_gen$6_GetSecretByNameRequest as GetSecretByNameRequest,
25840
25952
  index_gen$6_GetSecretRequest as GetSecretRequest,
25841
25953
  index_gen$6_GetSecretVersionByNameRequest as GetSecretVersionByNameRequest,
25842
25954
  index_gen$6_GetSecretVersionRequest as GetSecretVersionRequest,
25955
+ index_gen$6_ListFoldersRequest as ListFoldersRequest,
25956
+ index_gen$6_ListFoldersRequestOrderBy as ListFoldersRequestOrderBy,
25957
+ index_gen$6_ListFoldersResponse as ListFoldersResponse,
25843
25958
  index_gen$6_ListSecretVersionsByNameRequest as ListSecretVersionsByNameRequest,
25844
25959
  index_gen$6_ListSecretVersionsRequest as ListSecretVersionsRequest,
25845
25960
  index_gen$6_ListSecretVersionsResponse as ListSecretVersionsResponse,
@@ -26095,7 +26210,7 @@ declare namespace index$4 {
26095
26210
 
26096
26211
  type DomainLastStatusRecordStatus = 'unknown_record_status' | 'valid' | 'invalid' | 'not_found';
26097
26212
  type DomainStatus = 'unknown' | 'checked' | 'unchecked' | 'invalid' | 'locked' | 'revoked' | 'pending';
26098
- type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce' | 'spam';
26213
+ type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce' | 'spam' | 'mailbox_full';
26099
26214
  type EmailRcptType = 'unknown_rcpt_type' | 'to' | 'cc' | 'bcc';
26100
26215
  type EmailStatus = 'unknown' | 'new' | 'sending' | 'sent' | 'failed' | 'canceled';
26101
26216
  type ListEmailsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'status_desc' | 'status_asc' | 'mail_from_desc' | 'mail_from_asc' | 'mail_rcpt_desc' | 'mail_rcpt_asc' | 'subject_desc' | 'subject_asc';
@@ -1,4 +1,4 @@
1
- const version = 'v1.22.0';
1
+ const version = 'v1.24.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.23.0",
3
+ "version": "1.25.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": "a21da9b7b7cc1919caa208589e77f0bb340cc8f8"
38
+ "gitHead": "cc0d0071fb6bece0aca35e5ad96e869dea2c6234"
39
39
  }