@scaleway/sdk-secret 2.2.0 → 2.3.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.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Secret.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
93
94
  ## License
94
95
 
95
96
  This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
-
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v1beta1/index.gen.js";
2
- export {
3
- index_gen as Secretv1beta1
4
- };
1
+ import { index_gen_exports } from "./v1beta1/index.gen.js";
2
+ export { index_gen_exports as Secretv1beta1 };
@@ -1,393 +1,269 @@
1
- import { API as API$1, toApiLocality, validatePathParam, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
- import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalBrowseSecretsResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse, unmarshalListTagsResponse, unmarshalListSecretTypesResponse } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
5
- };
6
- class API extends API$1 {
7
- /**
8
- * Locality of this API.
9
- * type {'zone','region','global','unspecified'}
10
- */
11
- static LOCALITY = toApiLocality({
12
- regions: ["fr-par", "nl-ams", "pl-waw"]
13
- });
14
- /**
15
- * Create a secret. Create a secret in a given region specified by the `region` parameter.
16
- *
17
- * @param request - The request {@link CreateSecretRequest}
18
- * @returns A Promise of Secret
19
- */
20
- createSecret = (request) => this.client.fetch(
21
- {
22
- body: JSON.stringify(
23
- marshalCreateSecretRequest(request, this.client.settings)
24
- ),
25
- headers: jsonContentHeaders,
26
- method: "POST",
27
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`
28
- },
29
- unmarshalSecret
30
- );
31
- /**
32
- * Get metadata using the secret's ID. Retrieve the metadata of a secret specified by the `region` and `secret_id` parameters.
33
- *
34
- * @param request - The request {@link GetSecretRequest}
35
- * @returns A Promise of Secret
36
- */
37
- getSecret = (request) => this.client.fetch(
38
- {
39
- method: "GET",
40
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
41
- },
42
- unmarshalSecret
43
- );
44
- /**
45
- * Update metadata of a secret. Edit a secret's metadata such as name, tag(s), description and ephemeral policy. The secret to update is specified by the `secret_id` and `region` parameters.
46
- *
47
- * @param request - The request {@link UpdateSecretRequest}
48
- * @returns A Promise of Secret
49
- */
50
- updateSecret = (request) => this.client.fetch(
51
- {
52
- body: JSON.stringify(
53
- marshalUpdateSecretRequest(request, this.client.settings)
54
- ),
55
- headers: jsonContentHeaders,
56
- method: "PATCH",
57
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
58
- },
59
- unmarshalSecret
60
- );
61
- /**
62
- * Delete a secret. Delete a given secret specified by the `region` and `secret_id` parameters.
63
- *
64
- * @param request - The request {@link DeleteSecretRequest}
65
- */
66
- deleteSecret = (request) => this.client.fetch({
67
- method: "DELETE",
68
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
69
- });
70
- pageOfListSecrets = (request) => this.client.fetch(
71
- {
72
- method: "GET",
73
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`,
74
- urlParams: urlParams(
75
- ["ephemeral", request.ephemeral],
76
- ["name", request.name],
77
- ["order_by", request.orderBy],
78
- ["organization_id", request.organizationId],
79
- ["page", request.page],
80
- [
81
- "page_size",
82
- request.pageSize ?? this.client.settings.defaultPageSize
83
- ],
84
- ["path", request.path],
85
- ["project_id", request.projectId],
86
- ["scheduled_for_deletion", request.scheduledForDeletion],
87
- ["tags", request.tags],
88
- ["type", request.type]
89
- )
90
- },
91
- unmarshalListSecretsResponse
92
- );
93
- /**
94
- * List secrets. Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
95
- *
96
- * @param request - The request {@link ListSecretsRequest}
97
- * @returns A Promise of ListSecretsResponse
98
- */
99
- listSecrets = (request) => enrichForPagination("secrets", this.pageOfListSecrets, request);
100
- /**
101
- * Browse secrets. Retrieve the list of secrets and folders for the given prefix. You must specify either the `organization_id` or the `project_id` and the `region`.
102
- *
103
- * @param request - The request {@link BrowseSecretsRequest}
104
- * @returns A Promise of BrowseSecretsResponse
105
- */
106
- browseSecrets = (request) => this.client.fetch(
107
- {
108
- method: "GET",
109
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/browse`,
110
- urlParams: urlParams(
111
- ["order_by", request.orderBy],
112
- ["page", request.page],
113
- [
114
- "page_size",
115
- request.pageSize ?? this.client.settings.defaultPageSize
116
- ],
117
- ["prefix", request.prefix],
118
- ["project_id", request.projectId],
119
- ["tags", request.tags],
120
- ["type", request.type]
121
- )
122
- },
123
- unmarshalBrowseSecretsResponse
124
- );
125
- /**
126
- * Enable secret protection. Enable secret protection for a given secret specified by the `secret_id` parameter. Enabling secret protection means that your secret can be read and modified, but it cannot be deleted.
127
- *
128
- * @param request - The request {@link ProtectSecretRequest}
129
- * @returns A Promise of Secret
130
- */
131
- protectSecret = (request) => this.client.fetch(
132
- {
133
- body: "{}",
134
- headers: jsonContentHeaders,
135
- method: "POST",
136
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/protect`
137
- },
138
- unmarshalSecret
139
- );
140
- /**
141
- * Disable secret protection. Disable secret protection for a given secret specified by the `secret_id` parameter. Disabling secret protection means that your secret can be read, modified and deleted.
142
- *
143
- * @param request - The request {@link UnprotectSecretRequest}
144
- * @returns A Promise of Secret
145
- */
146
- unprotectSecret = (request) => this.client.fetch(
147
- {
148
- body: "{}",
149
- headers: jsonContentHeaders,
150
- method: "POST",
151
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/unprotect`
152
- },
153
- unmarshalSecret
154
- );
155
- /**
156
- * Allow a product to use the secret.
157
- *
158
- * @param request - The request {@link AddSecretOwnerRequest}
159
- */
160
- addSecretOwner = (request) => this.client.fetch({
161
- body: JSON.stringify(
162
- marshalAddSecretOwnerRequest(request, this.client.settings)
163
- ),
164
- headers: jsonContentHeaders,
165
- method: "POST",
166
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/add-owner`
167
- });
168
- /**
169
- * Create a version. Create a version of a given secret specified by the `region` and `secret_id` parameters.
170
- *
171
- * @param request - The request {@link CreateSecretVersionRequest}
172
- * @returns A Promise of SecretVersion
173
- */
174
- createSecretVersion = (request) => this.client.fetch(
175
- {
176
- body: JSON.stringify(
177
- marshalCreateSecretVersionRequest(request, this.client.settings)
178
- ),
179
- headers: jsonContentHeaders,
180
- method: "POST",
181
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`
182
- },
183
- unmarshalSecretVersion
184
- );
185
- /**
186
- * Get metadata of a secret's version using the secret's ID. Retrieve the metadata of a secret's given version specified by the `region`, `secret_id` and `revision` parameters.
187
- *
188
- * @param request - The request {@link GetSecretVersionRequest}
189
- * @returns A Promise of SecretVersion
190
- */
191
- getSecretVersion = (request) => this.client.fetch(
192
- {
193
- method: "GET",
194
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
195
- },
196
- unmarshalSecretVersion
197
- );
198
- /**
199
- * Update metadata of a version. Edit the metadata of a secret's given version, specified by the `region`, `secret_id` and `revision` parameters.
200
- *
201
- * @param request - The request {@link UpdateSecretVersionRequest}
202
- * @returns A Promise of SecretVersion
203
- */
204
- updateSecretVersion = (request) => this.client.fetch(
205
- {
206
- body: JSON.stringify(
207
- marshalUpdateSecretVersionRequest(request, this.client.settings)
208
- ),
209
- headers: jsonContentHeaders,
210
- method: "PATCH",
211
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
212
- },
213
- unmarshalSecretVersion
214
- );
215
- /**
216
- * Delete a version. Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone.
217
- *
218
- * @param request - The request {@link DeleteSecretVersionRequest}
219
- */
220
- deleteSecretVersion = (request) => this.client.fetch({
221
- method: "DELETE",
222
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
223
- });
224
- pageOfListSecretVersions = (request) => this.client.fetch(
225
- {
226
- method: "GET",
227
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`,
228
- urlParams: urlParams(
229
- ["page", request.page],
230
- [
231
- "page_size",
232
- request.pageSize ?? this.client.settings.defaultPageSize
233
- ],
234
- ["status", request.status]
235
- )
236
- },
237
- unmarshalListSecretVersionsResponse
238
- );
239
- /**
240
- * List versions of a secret using the secret's ID. Retrieve the list of a given secret's versions specified by the `secret_id` and `region` parameters.
241
- *
242
- * @param request - The request {@link ListSecretVersionsRequest}
243
- * @returns A Promise of ListSecretVersionsResponse
244
- */
245
- listSecretVersions = (request) => enrichForPagination("versions", this.pageOfListSecretVersions, request);
246
- /**
247
- * Access a secret's version using the secret's ID. Access sensitive data in a secret's version specified by the `region`, `secret_id` and `revision` parameters.
248
- *
249
- * @param request - The request {@link AccessSecretVersionRequest}
250
- * @returns A Promise of AccessSecretVersionResponse
251
- */
252
- accessSecretVersion = (request) => this.client.fetch(
253
- {
254
- method: "GET",
255
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/access`
256
- },
257
- unmarshalAccessSecretVersionResponse
258
- );
259
- /**
260
- * Access a secret's version using the secret's name and path. Access sensitive data in a secret's version specified by the `region`, `secret_name`, `secret_path` and `revision` parameters.
261
- *
262
- * @param request - The request {@link AccessSecretVersionByPathRequest}
263
- * @returns A Promise of AccessSecretVersionResponse
264
- */
265
- accessSecretVersionByPath = (request) => this.client.fetch(
266
- {
267
- method: "GET",
268
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${validatePathParam("revision", request.revision)}/access`,
269
- urlParams: urlParams(
270
- [
271
- "project_id",
272
- request.projectId ?? this.client.settings.defaultProjectId
273
- ],
274
- ["secret_name", request.secretName],
275
- ["secret_path", request.secretPath]
276
- )
277
- },
278
- unmarshalAccessSecretVersionResponse
279
- );
280
- /**
281
- * Enable a version. Make a specific version accessible. You must specify the `region`, `secret_id` and `revision` parameters.
282
- *
283
- * @param request - The request {@link EnableSecretVersionRequest}
284
- * @returns A Promise of SecretVersion
285
- */
286
- enableSecretVersion = (request) => this.client.fetch(
287
- {
288
- body: "{}",
289
- headers: jsonContentHeaders,
290
- method: "POST",
291
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/enable`
292
- },
293
- unmarshalSecretVersion
294
- );
295
- /**
296
- * Disable a version. Make a specific version inaccessible. You must specify the `region`, `secret_id` and `revision` parameters.
297
- *
298
- * @param request - The request {@link DisableSecretVersionRequest}
299
- * @returns A Promise of SecretVersion
300
- */
301
- disableSecretVersion = (request) => this.client.fetch(
302
- {
303
- body: "{}",
304
- headers: jsonContentHeaders,
305
- method: "POST",
306
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/disable`
307
- },
308
- unmarshalSecretVersion
309
- );
310
- pageOfListTags = (request = {}) => this.client.fetch(
311
- {
312
- method: "GET",
313
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags`,
314
- urlParams: urlParams(
315
- ["page", request.page],
316
- [
317
- "page_size",
318
- request.pageSize ?? this.client.settings.defaultPageSize
319
- ],
320
- [
321
- "project_id",
322
- request.projectId ?? this.client.settings.defaultProjectId
323
- ]
324
- )
325
- },
326
- unmarshalListTagsResponse
327
- );
328
- /**
329
- * List tags. List all tags associated with secrets within a given Project.
330
- *
331
- * @param request - The request {@link ListTagsRequest}
332
- * @returns A Promise of ListTagsResponse
333
- */
334
- listTags = (request = {}) => enrichForPagination("tags", this.pageOfListTags, request);
335
- pageOfListSecretTypes = (request = {}) => this.client.fetch(
336
- {
337
- method: "GET",
338
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`,
339
- urlParams: urlParams(
340
- ["page", request.page],
341
- [
342
- "page_size",
343
- request.pageSize ?? this.client.settings.defaultPageSize
344
- ],
345
- [
346
- "project_id",
347
- request.projectId ?? this.client.settings.defaultProjectId
348
- ]
349
- )
350
- },
351
- unmarshalListSecretTypesResponse
352
- );
353
- /**
354
- * List secret types. List all secret types created within a given Project.
355
- *
356
- * @param request - The request {@link ListSecretTypesRequest}
357
- * @returns A Promise of ListSecretTypesResponse
358
- */
359
- listSecretTypes = (request = {}) => enrichForPagination("types", this.pageOfListSecretTypes, request);
360
- /**
361
- * Restore a version. Restore a secret's version specified by the `region`, `secret_id` and `revision` parameters.
362
- *
363
- * @param request - The request {@link RestoreSecretVersionRequest}
364
- * @returns A Promise of SecretVersion
365
- */
366
- restoreSecretVersion = (request) => this.client.fetch(
367
- {
368
- body: "{}",
369
- headers: jsonContentHeaders,
370
- method: "POST",
371
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/restore`
372
- },
373
- unmarshalSecretVersion
374
- );
375
- /**
376
- * Restore a secret. Restore a secret and all its versions scheduled for deletion specified by the `region` and `secret_id` parameters.
377
- *
378
- * @param request - The request {@link RestoreSecretRequest}
379
- * @returns A Promise of Secret
380
- */
381
- restoreSecret = (request) => this.client.fetch(
382
- {
383
- body: "{}",
384
- headers: jsonContentHeaders,
385
- method: "POST",
386
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/restore`
387
- },
388
- unmarshalSecret
389
- );
390
- }
391
- export {
392
- API
1
+ import { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalBrowseSecretsResponse, unmarshalListSecretTypesResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * Secret Manager API.
6
+
7
+ This API allows you to manage your Secret Manager services, for storing, accessing and sharing sensitive data such as passwords, API keys and certificates.
8
+ */
9
+ var API$1 = class extends API {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = toApiLocality({ regions: [
15
+ "fr-par",
16
+ "nl-ams",
17
+ "pl-waw"
18
+ ] });
19
+ /**
20
+ * Create a secret. Create a secret in a given region specified by the `region` parameter.
21
+ *
22
+ * @param request - The request {@link CreateSecretRequest}
23
+ * @returns A Promise of Secret
24
+ */
25
+ createSecret = (request) => this.client.fetch({
26
+ body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)),
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`
30
+ }, unmarshalSecret);
31
+ /**
32
+ * Get metadata using the secret's ID. Retrieve the metadata of a secret specified by the `region` and `secret_id` parameters.
33
+ *
34
+ * @param request - The request {@link GetSecretRequest}
35
+ * @returns A Promise of Secret
36
+ */
37
+ getSecret = (request) => this.client.fetch({
38
+ method: "GET",
39
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
40
+ }, unmarshalSecret);
41
+ /**
42
+ * Update metadata of a secret. Edit a secret's metadata such as name, tag(s), description and ephemeral policy. The secret to update is specified by the `secret_id` and `region` parameters.
43
+ *
44
+ * @param request - The request {@link UpdateSecretRequest}
45
+ * @returns A Promise of Secret
46
+ */
47
+ updateSecret = (request) => this.client.fetch({
48
+ body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
49
+ headers: jsonContentHeaders,
50
+ method: "PATCH",
51
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
52
+ }, unmarshalSecret);
53
+ /**
54
+ * Delete a secret. Delete a given secret specified by the `region` and `secret_id` parameters.
55
+ *
56
+ * @param request - The request {@link DeleteSecretRequest}
57
+ */
58
+ deleteSecret = (request) => this.client.fetch({
59
+ method: "DELETE",
60
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
61
+ });
62
+ pageOfListSecrets = (request) => this.client.fetch({
63
+ method: "GET",
64
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`,
65
+ urlParams: urlParams(["ephemeral", request.ephemeral], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["path", request.path], ["project_id", request.projectId], ["scheduled_for_deletion", request.scheduledForDeletion], ["tags", request.tags], ["type", request.type])
66
+ }, unmarshalListSecretsResponse);
67
+ /**
68
+ * List secrets. Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
69
+ *
70
+ * @param request - The request {@link ListSecretsRequest}
71
+ * @returns A Promise of ListSecretsResponse
72
+ */
73
+ listSecrets = (request) => enrichForPagination("secrets", this.pageOfListSecrets, request);
74
+ /**
75
+ * Browse secrets. Retrieve the list of secrets and folders for the given prefix. You must specify either the `organization_id` or the `project_id` and the `region`.
76
+ *
77
+ * @param request - The request {@link BrowseSecretsRequest}
78
+ * @returns A Promise of BrowseSecretsResponse
79
+ */
80
+ browseSecrets = (request) => this.client.fetch({
81
+ method: "GET",
82
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/browse`,
83
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["prefix", request.prefix], ["project_id", request.projectId], ["tags", request.tags], ["type", request.type])
84
+ }, unmarshalBrowseSecretsResponse);
85
+ /**
86
+ * Enable secret protection. Enable secret protection for a given secret specified by the `secret_id` parameter. Enabling secret protection means that your secret can be read and modified, but it cannot be deleted.
87
+ *
88
+ * @param request - The request {@link ProtectSecretRequest}
89
+ * @returns A Promise of Secret
90
+ */
91
+ protectSecret = (request) => this.client.fetch({
92
+ body: "{}",
93
+ headers: jsonContentHeaders,
94
+ method: "POST",
95
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/protect`
96
+ }, unmarshalSecret);
97
+ /**
98
+ * Disable secret protection. Disable secret protection for a given secret specified by the `secret_id` parameter. Disabling secret protection means that your secret can be read, modified and deleted.
99
+ *
100
+ * @param request - The request {@link UnprotectSecretRequest}
101
+ * @returns A Promise of Secret
102
+ */
103
+ unprotectSecret = (request) => this.client.fetch({
104
+ body: "{}",
105
+ headers: jsonContentHeaders,
106
+ method: "POST",
107
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/unprotect`
108
+ }, unmarshalSecret);
109
+ /**
110
+ * Allow a product to use the secret.
111
+ *
112
+ * @param request - The request {@link AddSecretOwnerRequest}
113
+ */
114
+ addSecretOwner = (request) => this.client.fetch({
115
+ body: JSON.stringify(marshalAddSecretOwnerRequest(request, this.client.settings)),
116
+ headers: jsonContentHeaders,
117
+ method: "POST",
118
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/add-owner`
119
+ });
120
+ /**
121
+ * Create a version. Create a version of a given secret specified by the `region` and `secret_id` parameters.
122
+ *
123
+ * @param request - The request {@link CreateSecretVersionRequest}
124
+ * @returns A Promise of SecretVersion
125
+ */
126
+ createSecretVersion = (request) => this.client.fetch({
127
+ body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)),
128
+ headers: jsonContentHeaders,
129
+ method: "POST",
130
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`
131
+ }, unmarshalSecretVersion);
132
+ /**
133
+ * Get metadata of a secret's version using the secret's ID. Retrieve the metadata of a secret's given version specified by the `region`, `secret_id` and `revision` parameters.
134
+ *
135
+ * @param request - The request {@link GetSecretVersionRequest}
136
+ * @returns A Promise of SecretVersion
137
+ */
138
+ getSecretVersion = (request) => this.client.fetch({
139
+ method: "GET",
140
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
141
+ }, unmarshalSecretVersion);
142
+ /**
143
+ * Update metadata of a version. Edit the metadata of a secret's given version, specified by the `region`, `secret_id` and `revision` parameters.
144
+ *
145
+ * @param request - The request {@link UpdateSecretVersionRequest}
146
+ * @returns A Promise of SecretVersion
147
+ */
148
+ updateSecretVersion = (request) => this.client.fetch({
149
+ body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)),
150
+ headers: jsonContentHeaders,
151
+ method: "PATCH",
152
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
153
+ }, unmarshalSecretVersion);
154
+ /**
155
+ * Delete a version. Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone.
156
+ *
157
+ * @param request - The request {@link DeleteSecretVersionRequest}
158
+ */
159
+ deleteSecretVersion = (request) => this.client.fetch({
160
+ method: "DELETE",
161
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
162
+ });
163
+ pageOfListSecretVersions = (request) => this.client.fetch({
164
+ method: "GET",
165
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`,
166
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["status", request.status])
167
+ }, unmarshalListSecretVersionsResponse);
168
+ /**
169
+ * List versions of a secret using the secret's ID. Retrieve the list of a given secret's versions specified by the `secret_id` and `region` parameters.
170
+ *
171
+ * @param request - The request {@link ListSecretVersionsRequest}
172
+ * @returns A Promise of ListSecretVersionsResponse
173
+ */
174
+ listSecretVersions = (request) => enrichForPagination("versions", this.pageOfListSecretVersions, request);
175
+ /**
176
+ * Access a secret's version using the secret's ID. Access sensitive data in a secret's version specified by the `region`, `secret_id` and `revision` parameters.
177
+ *
178
+ * @param request - The request {@link AccessSecretVersionRequest}
179
+ * @returns A Promise of AccessSecretVersionResponse
180
+ */
181
+ accessSecretVersion = (request) => this.client.fetch({
182
+ method: "GET",
183
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/access`
184
+ }, unmarshalAccessSecretVersionResponse);
185
+ /**
186
+ * Access a secret's version using the secret's name and path. Access sensitive data in a secret's version specified by the `region`, `secret_name`, `secret_path` and `revision` parameters.
187
+ *
188
+ * @param request - The request {@link AccessSecretVersionByPathRequest}
189
+ * @returns A Promise of AccessSecretVersionResponse
190
+ */
191
+ accessSecretVersionByPath = (request) => this.client.fetch({
192
+ method: "GET",
193
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${validatePathParam("revision", request.revision)}/access`,
194
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId], ["secret_name", request.secretName], ["secret_path", request.secretPath])
195
+ }, unmarshalAccessSecretVersionResponse);
196
+ /**
197
+ * Enable a version. Make a specific version accessible. You must specify the `region`, `secret_id` and `revision` parameters.
198
+ *
199
+ * @param request - The request {@link EnableSecretVersionRequest}
200
+ * @returns A Promise of SecretVersion
201
+ */
202
+ enableSecretVersion = (request) => this.client.fetch({
203
+ body: "{}",
204
+ headers: jsonContentHeaders,
205
+ method: "POST",
206
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/enable`
207
+ }, unmarshalSecretVersion);
208
+ /**
209
+ * Disable a version. Make a specific version inaccessible. You must specify the `region`, `secret_id` and `revision` parameters.
210
+ *
211
+ * @param request - The request {@link DisableSecretVersionRequest}
212
+ * @returns A Promise of SecretVersion
213
+ */
214
+ disableSecretVersion = (request) => this.client.fetch({
215
+ body: "{}",
216
+ headers: jsonContentHeaders,
217
+ method: "POST",
218
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/disable`
219
+ }, unmarshalSecretVersion);
220
+ pageOfListTags = (request = {}) => this.client.fetch({
221
+ method: "GET",
222
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags`,
223
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
224
+ }, unmarshalListTagsResponse);
225
+ /**
226
+ * List tags. List all tags associated with secrets within a given Project.
227
+ *
228
+ * @param request - The request {@link ListTagsRequest}
229
+ * @returns A Promise of ListTagsResponse
230
+ */
231
+ listTags = (request = {}) => enrichForPagination("tags", this.pageOfListTags, request);
232
+ pageOfListSecretTypes = (request = {}) => this.client.fetch({
233
+ method: "GET",
234
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`,
235
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
236
+ }, unmarshalListSecretTypesResponse);
237
+ /**
238
+ * List secret types. List all secret types created within a given Project.
239
+ *
240
+ * @param request - The request {@link ListSecretTypesRequest}
241
+ * @returns A Promise of ListSecretTypesResponse
242
+ */
243
+ listSecretTypes = (request = {}) => enrichForPagination("types", this.pageOfListSecretTypes, request);
244
+ /**
245
+ * Restore a version. Restore a secret's version specified by the `region`, `secret_id` and `revision` parameters.
246
+ *
247
+ * @param request - The request {@link RestoreSecretVersionRequest}
248
+ * @returns A Promise of SecretVersion
249
+ */
250
+ restoreSecretVersion = (request) => this.client.fetch({
251
+ body: "{}",
252
+ headers: jsonContentHeaders,
253
+ method: "POST",
254
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/restore`
255
+ }, unmarshalSecretVersion);
256
+ /**
257
+ * Restore a secret. Restore a secret and all its versions scheduled for deletion specified by the `region` and `secret_id` parameters.
258
+ *
259
+ * @param request - The request {@link RestoreSecretRequest}
260
+ * @returns A Promise of Secret
261
+ */
262
+ restoreSecret = (request) => this.client.fetch({
263
+ body: "{}",
264
+ headers: jsonContentHeaders,
265
+ method: "POST",
266
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/restore`
267
+ }, unmarshalSecret);
393
268
  };
269
+ export { API$1 as API };
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './marshalling.gen.js';
3
3
  export type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BasicCredentials, BrowseSecretsRequest, BrowseSecretsRequestOrderBy, BrowseSecretsResponse, BrowseSecretsResponseItem, BrowseSecretsResponseItemFolderDetails, BrowseSecretsResponseItemSecretDetails, CreateSecretRequest, CreateSecretVersionRequest, DatabaseCredentials, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, EphemeralPolicy, EphemeralPolicyAction, EphemeralProperties, GetSecretRequest, GetSecretVersionRequest, ListSecretsRequest, ListSecretsRequestOrderBy, ListSecretsResponse, ListSecretTypesRequest, ListSecretTypesResponse, ListSecretVersionsRequest, ListSecretVersionsResponse, ListTagsRequest, ListTagsResponse, Product, ProtectSecretRequest, RestoreSecretRequest, RestoreSecretVersionRequest, Secret, SecretStatus, SecretType, SecretVersion, SecretVersionStatus, SSHKey, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest, } from './types.gen.js';
4
4
  export * as ValidationRules from './validation-rules.gen.js';
@@ -1,20 +1,22 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalBrowseSecretsResponse, unmarshalListSecretTypesResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion } from "./marshalling.gen.js";
3
- import * as validationRules_gen from "./validation-rules.gen.js";
4
- export {
5
- API,
6
- validationRules_gen as ValidationRules,
7
- marshalAddSecretOwnerRequest,
8
- marshalCreateSecretRequest,
9
- marshalCreateSecretVersionRequest,
10
- marshalUpdateSecretRequest,
11
- marshalUpdateSecretVersionRequest,
12
- unmarshalAccessSecretVersionResponse,
13
- unmarshalBrowseSecretsResponse,
14
- unmarshalListSecretTypesResponse,
15
- unmarshalListSecretVersionsResponse,
16
- unmarshalListSecretsResponse,
17
- unmarshalListTagsResponse,
18
- unmarshalSecret,
19
- unmarshalSecretVersion
20
- };
3
+ import { API } from "./api.gen.js";
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
6
+ API: () => API,
7
+ ValidationRules: () => validation_rules_gen_exports,
8
+ marshalAddSecretOwnerRequest: () => marshalAddSecretOwnerRequest,
9
+ marshalCreateSecretRequest: () => marshalCreateSecretRequest,
10
+ marshalCreateSecretVersionRequest: () => marshalCreateSecretVersionRequest,
11
+ marshalUpdateSecretRequest: () => marshalUpdateSecretRequest,
12
+ marshalUpdateSecretVersionRequest: () => marshalUpdateSecretVersionRequest,
13
+ unmarshalAccessSecretVersionResponse: () => unmarshalAccessSecretVersionResponse,
14
+ unmarshalBrowseSecretsResponse: () => unmarshalBrowseSecretsResponse,
15
+ unmarshalListSecretTypesResponse: () => unmarshalListSecretTypesResponse,
16
+ unmarshalListSecretVersionsResponse: () => unmarshalListSecretVersionsResponse,
17
+ unmarshalListSecretsResponse: () => unmarshalListSecretsResponse,
18
+ unmarshalListTagsResponse: () => unmarshalListTagsResponse,
19
+ unmarshalSecret: () => unmarshalSecret,
20
+ unmarshalSecretVersion: () => unmarshalSecretVersion
21
+ });
22
+ export { index_gen_exports };
@@ -1,238 +1,167 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalEphemeralProperties = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- action: data.action,
10
- expiresAt: unmarshalDate(data.expires_at),
11
- expiresOnceAccessed: data.expires_once_accessed
12
- };
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalEphemeralProperties = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`);
4
+ return {
5
+ action: data.action,
6
+ expiresAt: unmarshalDate(data.expires_at),
7
+ expiresOnceAccessed: data.expires_once_accessed
8
+ };
13
9
  };
14
10
  const unmarshalSecretVersion = (data) => {
15
- if (!isJSONObject(data)) {
16
- throw new TypeError(
17
- `Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`
18
- );
19
- }
20
- return {
21
- createdAt: unmarshalDate(data.created_at),
22
- deletedAt: unmarshalDate(data.deleted_at),
23
- deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
24
- description: data.description,
25
- ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : void 0,
26
- latest: data.latest,
27
- region: data.region,
28
- revision: data.revision,
29
- secretId: data.secret_id,
30
- status: data.status,
31
- updatedAt: unmarshalDate(data.updated_at)
32
- };
11
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
12
+ return {
13
+ createdAt: unmarshalDate(data.created_at),
14
+ deletedAt: unmarshalDate(data.deleted_at),
15
+ deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
16
+ description: data.description,
17
+ ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : void 0,
18
+ latest: data.latest,
19
+ region: data.region,
20
+ revision: data.revision,
21
+ secretId: data.secret_id,
22
+ status: data.status,
23
+ updatedAt: unmarshalDate(data.updated_at)
24
+ };
33
25
  };
34
- const unmarshalEphemeralPolicy = (data) => {
35
- if (!isJSONObject(data)) {
36
- throw new TypeError(
37
- `Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`
38
- );
39
- }
40
- return {
41
- action: data.action,
42
- expiresOnceAccessed: data.expires_once_accessed,
43
- timeToLive: data.time_to_live
44
- };
26
+ var unmarshalEphemeralPolicy = (data) => {
27
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`);
28
+ return {
29
+ action: data.action,
30
+ expiresOnceAccessed: data.expires_once_accessed,
31
+ timeToLive: data.time_to_live
32
+ };
45
33
  };
46
34
  const unmarshalSecret = (data) => {
47
- if (!isJSONObject(data)) {
48
- throw new TypeError(
49
- `Unmarshalling the type 'Secret' failed as data isn't a dictionary.`
50
- );
51
- }
52
- return {
53
- createdAt: unmarshalDate(data.created_at),
54
- deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
55
- description: data.description,
56
- ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,
57
- id: data.id,
58
- keyId: data.key_id,
59
- managed: data.managed,
60
- name: data.name,
61
- path: data.path,
62
- projectId: data.project_id,
63
- protected: data.protected,
64
- region: data.region,
65
- status: data.status,
66
- tags: data.tags,
67
- type: data.type,
68
- updatedAt: unmarshalDate(data.updated_at),
69
- usedBy: data.used_by,
70
- versionCount: data.version_count
71
- };
35
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
36
+ return {
37
+ createdAt: unmarshalDate(data.created_at),
38
+ deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
39
+ description: data.description,
40
+ ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,
41
+ id: data.id,
42
+ keyId: data.key_id,
43
+ managed: data.managed,
44
+ name: data.name,
45
+ path: data.path,
46
+ projectId: data.project_id,
47
+ protected: data.protected,
48
+ region: data.region,
49
+ status: data.status,
50
+ tags: data.tags,
51
+ type: data.type,
52
+ updatedAt: unmarshalDate(data.updated_at),
53
+ usedBy: data.used_by,
54
+ versionCount: data.version_count
55
+ };
72
56
  };
73
57
  const unmarshalAccessSecretVersionResponse = (data) => {
74
- if (!isJSONObject(data)) {
75
- throw new TypeError(
76
- `Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`
77
- );
78
- }
79
- return {
80
- data: data.data,
81
- dataCrc32: data.data_crc32,
82
- revision: data.revision,
83
- secretId: data.secret_id,
84
- type: data.type
85
- };
58
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`);
59
+ return {
60
+ data: data.data,
61
+ dataCrc32: data.data_crc32,
62
+ revision: data.revision,
63
+ secretId: data.secret_id,
64
+ type: data.type
65
+ };
86
66
  };
87
- const unmarshalBrowseSecretsResponseItemFolderDetails = (data) => {
88
- if (!isJSONObject(data)) {
89
- throw new TypeError(
90
- `Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.`
91
- );
92
- }
93
- return {};
67
+ var unmarshalBrowseSecretsResponseItemFolderDetails = (data) => {
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.`);
69
+ return {};
94
70
  };
95
- const unmarshalBrowseSecretsResponseItemSecretDetails = (data) => {
96
- if (!isJSONObject(data)) {
97
- throw new TypeError(
98
- `Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.`
99
- );
100
- }
101
- return {
102
- ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,
103
- id: data.id,
104
- protected: data.protected,
105
- tags: data.tags,
106
- type: data.type,
107
- versionCount: data.version_count
108
- };
71
+ var unmarshalBrowseSecretsResponseItemSecretDetails = (data) => {
72
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.`);
73
+ return {
74
+ ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,
75
+ id: data.id,
76
+ protected: data.protected,
77
+ tags: data.tags,
78
+ type: data.type,
79
+ versionCount: data.version_count
80
+ };
109
81
  };
110
- const unmarshalBrowseSecretsResponseItem = (data) => {
111
- if (!isJSONObject(data)) {
112
- throw new TypeError(
113
- `Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.`
114
- );
115
- }
116
- return {
117
- createdAt: unmarshalDate(data.created_at),
118
- folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : void 0,
119
- name: data.name,
120
- secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : void 0,
121
- updatedAt: unmarshalDate(data.updated_at)
122
- };
82
+ var unmarshalBrowseSecretsResponseItem = (data) => {
83
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.`);
84
+ return {
85
+ createdAt: unmarshalDate(data.created_at),
86
+ folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : void 0,
87
+ name: data.name,
88
+ secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : void 0,
89
+ updatedAt: unmarshalDate(data.updated_at)
90
+ };
123
91
  };
124
92
  const unmarshalBrowseSecretsResponse = (data) => {
125
- if (!isJSONObject(data)) {
126
- throw new TypeError(
127
- `Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.`
128
- );
129
- }
130
- return {
131
- currentPath: data.current_path,
132
- items: unmarshalArrayOfObject(
133
- data.items,
134
- unmarshalBrowseSecretsResponseItem
135
- ),
136
- totalCount: data.total_count
137
- };
93
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.`);
94
+ return {
95
+ currentPath: data.current_path,
96
+ items: unmarshalArrayOfObject(data.items, unmarshalBrowseSecretsResponseItem),
97
+ totalCount: data.total_count
98
+ };
138
99
  };
139
100
  const unmarshalListSecretTypesResponse = (data) => {
140
- if (!isJSONObject(data)) {
141
- throw new TypeError(
142
- `Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`
143
- );
144
- }
145
- return {
146
- totalCount: data.total_count,
147
- types: data.types
148
- };
101
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`);
102
+ return {
103
+ totalCount: data.total_count,
104
+ types: data.types
105
+ };
149
106
  };
150
107
  const unmarshalListSecretVersionsResponse = (data) => {
151
- if (!isJSONObject(data)) {
152
- throw new TypeError(
153
- `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`
154
- );
155
- }
156
- return {
157
- totalCount: data.total_count,
158
- versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)
159
- };
108
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);
109
+ return {
110
+ totalCount: data.total_count,
111
+ versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)
112
+ };
160
113
  };
161
114
  const unmarshalListSecretsResponse = (data) => {
162
- if (!isJSONObject(data)) {
163
- throw new TypeError(
164
- `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`
165
- );
166
- }
167
- return {
168
- secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
169
- totalCount: data.total_count
170
- };
115
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
116
+ return {
117
+ secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
118
+ totalCount: data.total_count
119
+ };
171
120
  };
172
121
  const unmarshalListTagsResponse = (data) => {
173
- if (!isJSONObject(data)) {
174
- throw new TypeError(
175
- `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`
176
- );
177
- }
178
- return {
179
- tags: data.tags,
180
- totalCount: data.total_count
181
- };
122
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`);
123
+ return {
124
+ tags: data.tags,
125
+ totalCount: data.total_count
126
+ };
182
127
  };
183
- const marshalAddSecretOwnerRequest = (request, defaults) => ({
184
- product: request.product
185
- });
186
- const marshalEphemeralPolicy = (request, defaults) => ({
187
- action: request.action,
188
- expires_once_accessed: request.expiresOnceAccessed,
189
- time_to_live: request.timeToLive
128
+ const marshalAddSecretOwnerRequest = (request, defaults) => ({ product: request.product });
129
+ var marshalEphemeralPolicy = (request, defaults) => ({
130
+ action: request.action,
131
+ expires_once_accessed: request.expiresOnceAccessed,
132
+ time_to_live: request.timeToLive
190
133
  });
191
134
  const marshalCreateSecretRequest = (request, defaults) => ({
192
- description: request.description,
193
- ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,
194
- key_id: request.keyId,
195
- name: request.name,
196
- path: request.path,
197
- project_id: request.projectId ?? defaults.defaultProjectId,
198
- protected: request.protected,
199
- tags: request.tags,
200
- type: request.type
135
+ description: request.description,
136
+ ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy, defaults) : void 0,
137
+ key_id: request.keyId,
138
+ name: request.name,
139
+ path: request.path,
140
+ project_id: request.projectId ?? defaults.defaultProjectId,
141
+ protected: request.protected,
142
+ tags: request.tags,
143
+ type: request.type
201
144
  });
202
145
  const marshalCreateSecretVersionRequest = (request, defaults) => ({
203
- data: request.data,
204
- data_crc32: request.dataCrc32,
205
- description: request.description,
206
- disable_previous: request.disablePrevious
146
+ data: request.data,
147
+ data_crc32: request.dataCrc32,
148
+ description: request.description,
149
+ disable_previous: request.disablePrevious
207
150
  });
208
151
  const marshalUpdateSecretRequest = (request, defaults) => ({
209
- description: request.description,
210
- ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,
211
- name: request.name,
212
- path: request.path,
213
- tags: request.tags
152
+ description: request.description,
153
+ ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy, defaults) : void 0,
154
+ name: request.name,
155
+ path: request.path,
156
+ tags: request.tags
214
157
  });
215
- const marshalEphemeralProperties = (request, defaults) => ({
216
- action: request.action,
217
- expires_at: request.expiresAt,
218
- expires_once_accessed: request.expiresOnceAccessed
158
+ var marshalEphemeralProperties = (request, defaults) => ({
159
+ action: request.action,
160
+ expires_at: request.expiresAt,
161
+ expires_once_accessed: request.expiresOnceAccessed
219
162
  });
220
163
  const marshalUpdateSecretVersionRequest = (request, defaults) => ({
221
- description: request.description,
222
- ephemeral_properties: request.ephemeralProperties !== void 0 ? marshalEphemeralProperties(request.ephemeralProperties) : void 0
164
+ description: request.description,
165
+ ephemeral_properties: request.ephemeralProperties !== void 0 ? marshalEphemeralProperties(request.ephemeralProperties, defaults) : void 0
223
166
  });
224
- export {
225
- marshalAddSecretOwnerRequest,
226
- marshalCreateSecretRequest,
227
- marshalCreateSecretVersionRequest,
228
- marshalUpdateSecretRequest,
229
- marshalUpdateSecretVersionRequest,
230
- unmarshalAccessSecretVersionResponse,
231
- unmarshalBrowseSecretsResponse,
232
- unmarshalListSecretTypesResponse,
233
- unmarshalListSecretVersionsResponse,
234
- unmarshalListSecretsResponse,
235
- unmarshalListTagsResponse,
236
- unmarshalSecret,
237
- unmarshalSecretVersion
238
- };
167
+ export { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalBrowseSecretsResponse, unmarshalListSecretTypesResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
@@ -70,10 +70,10 @@ export interface SecretVersion {
70
70
  secretId: string;
71
71
  /**
72
72
  * * `unknown_status`: the version is in an invalid state.
73
- * `enabled`: the version is accessible.
74
- * `disabled`: the version is not accessible but can be enabled.
75
- * `scheduled_for_deletion`: the version is scheduled for deletion. It will be deleted in 7 days.
76
- * `deleted`: the version is permanently deleted. It is not possible to recover it.
73
+ * `enabled`: the version is accessible.
74
+ * `disabled`: the version is not accessible but can be enabled.
75
+ * `scheduled_for_deletion`: the version is scheduled for deletion. It will be deleted in 7 days.
76
+ * `deleted`: the version is permanently deleted. It is not possible to recover it.
77
77
  */
78
78
  status: SecretVersionStatus;
79
79
  /**
@@ -124,7 +124,7 @@ export interface Secret {
124
124
  name: string;
125
125
  /**
126
126
  * * `ready`: the secret can be read, modified and deleted.
127
- * `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
127
+ * `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
128
128
  */
129
129
  status: SecretStatus;
130
130
  /**
@@ -1,8 +1,4 @@
1
- const DatabaseCredentials = {
2
- port: {
3
- pattern: /^[0-9]+$/
4
- }
5
- };
6
- export {
7
- DatabaseCredentials
8
- };
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({ DatabaseCredentials: () => DatabaseCredentials });
3
+ const DatabaseCredentials = { port: { pattern: /^[0-9]+$/ } };
4
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-secret",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK secret",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",