@scaleway/sdk-secret 2.2.1 → 2.3.1

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,379 +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: [
13
- "fr-par",
14
- "nl-ams",
15
- "pl-waw"
16
- ]
17
- });
18
- /**
19
- * Create a secret. Create a secret in a given region specified by the `region` parameter.
20
- *
21
- * @param request - The request {@link CreateSecretRequest}
22
- * @returns A Promise of Secret
23
- */
24
- createSecret = (request) => this.client.fetch(
25
- {
26
- body: JSON.stringify(
27
- marshalCreateSecretRequest(request, this.client.settings)
28
- ),
29
- headers: jsonContentHeaders,
30
- method: "POST",
31
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`
32
- },
33
- unmarshalSecret
34
- );
35
- /**
36
- * Get metadata using the secret's ID. Retrieve the metadata of a secret specified by the `region` and `secret_id` parameters.
37
- *
38
- * @param request - The request {@link GetSecretRequest}
39
- * @returns A Promise of Secret
40
- */
41
- getSecret = (request) => this.client.fetch(
42
- {
43
- method: "GET",
44
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
45
- },
46
- unmarshalSecret
47
- );
48
- /**
49
- * 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.
50
- *
51
- * @param request - The request {@link UpdateSecretRequest}
52
- * @returns A Promise of Secret
53
- */
54
- updateSecret = (request) => this.client.fetch(
55
- {
56
- body: JSON.stringify(
57
- marshalUpdateSecretRequest(request, this.client.settings)
58
- ),
59
- headers: jsonContentHeaders,
60
- method: "PATCH",
61
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
62
- },
63
- unmarshalSecret
64
- );
65
- /**
66
- * Delete a secret. Delete a given secret specified by the `region` and `secret_id` parameters.
67
- *
68
- * @param request - The request {@link DeleteSecretRequest}
69
- */
70
- deleteSecret = (request) => this.client.fetch(
71
- {
72
- method: "DELETE",
73
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
74
- }
75
- );
76
- pageOfListSecrets = (request) => this.client.fetch(
77
- {
78
- method: "GET",
79
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`,
80
- urlParams: urlParams(
81
- ["ephemeral", request.ephemeral],
82
- ["name", request.name],
83
- ["order_by", request.orderBy],
84
- ["organization_id", request.organizationId],
85
- ["page", request.page],
86
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
87
- ["path", request.path],
88
- ["project_id", request.projectId],
89
- ["scheduled_for_deletion", request.scheduledForDeletion],
90
- ["tags", request.tags],
91
- ["type", request.type]
92
- )
93
- },
94
- unmarshalListSecretsResponse
95
- );
96
- /**
97
- * 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`.
98
- *
99
- * @param request - The request {@link ListSecretsRequest}
100
- * @returns A Promise of ListSecretsResponse
101
- */
102
- listSecrets = (request) => enrichForPagination("secrets", this.pageOfListSecrets, request);
103
- /**
104
- * 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`.
105
- *
106
- * @param request - The request {@link BrowseSecretsRequest}
107
- * @returns A Promise of BrowseSecretsResponse
108
- */
109
- browseSecrets = (request) => this.client.fetch(
110
- {
111
- method: "GET",
112
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/browse`,
113
- urlParams: urlParams(
114
- ["order_by", request.orderBy],
115
- ["page", request.page],
116
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
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
- {
162
- body: JSON.stringify(
163
- marshalAddSecretOwnerRequest(request, this.client.settings)
164
- ),
165
- headers: jsonContentHeaders,
166
- method: "POST",
167
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/add-owner`
168
- }
169
- );
170
- /**
171
- * Create a version. Create a version of a given secret specified by the `region` and `secret_id` parameters.
172
- *
173
- * @param request - The request {@link CreateSecretVersionRequest}
174
- * @returns A Promise of SecretVersion
175
- */
176
- createSecretVersion = (request) => this.client.fetch(
177
- {
178
- body: JSON.stringify(
179
- marshalCreateSecretVersionRequest(request, this.client.settings)
180
- ),
181
- headers: jsonContentHeaders,
182
- method: "POST",
183
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`
184
- },
185
- unmarshalSecretVersion
186
- );
187
- /**
188
- * 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.
189
- *
190
- * @param request - The request {@link GetSecretVersionRequest}
191
- * @returns A Promise of SecretVersion
192
- */
193
- getSecretVersion = (request) => this.client.fetch(
194
- {
195
- method: "GET",
196
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
197
- },
198
- unmarshalSecretVersion
199
- );
200
- /**
201
- * Update metadata of a version. Edit the metadata of a secret's given version, specified by the `region`, `secret_id` and `revision` parameters.
202
- *
203
- * @param request - The request {@link UpdateSecretVersionRequest}
204
- * @returns A Promise of SecretVersion
205
- */
206
- updateSecretVersion = (request) => this.client.fetch(
207
- {
208
- body: JSON.stringify(
209
- marshalUpdateSecretVersionRequest(request, this.client.settings)
210
- ),
211
- headers: jsonContentHeaders,
212
- method: "PATCH",
213
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
214
- },
215
- unmarshalSecretVersion
216
- );
217
- /**
218
- * Delete a version. Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone.
219
- *
220
- * @param request - The request {@link DeleteSecretVersionRequest}
221
- */
222
- deleteSecretVersion = (request) => this.client.fetch(
223
- {
224
- method: "DELETE",
225
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
226
- }
227
- );
228
- pageOfListSecretVersions = (request) => this.client.fetch(
229
- {
230
- method: "GET",
231
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`,
232
- urlParams: urlParams(
233
- ["page", request.page],
234
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
235
- ["status", request.status]
236
- )
237
- },
238
- unmarshalListSecretVersionsResponse
239
- );
240
- /**
241
- * 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.
242
- *
243
- * @param request - The request {@link ListSecretVersionsRequest}
244
- * @returns A Promise of ListSecretVersionsResponse
245
- */
246
- listSecretVersions = (request) => enrichForPagination("versions", this.pageOfListSecretVersions, request);
247
- /**
248
- * 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.
249
- *
250
- * @param request - The request {@link AccessSecretVersionRequest}
251
- * @returns A Promise of AccessSecretVersionResponse
252
- */
253
- accessSecretVersion = (request) => this.client.fetch(
254
- {
255
- method: "GET",
256
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/access`
257
- },
258
- unmarshalAccessSecretVersionResponse
259
- );
260
- /**
261
- * 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.
262
- *
263
- * @param request - The request {@link AccessSecretVersionByPathRequest}
264
- * @returns A Promise of AccessSecretVersionResponse
265
- */
266
- accessSecretVersionByPath = (request) => this.client.fetch(
267
- {
268
- method: "GET",
269
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${validatePathParam("revision", request.revision)}/access`,
270
- urlParams: urlParams(
271
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId],
272
- ["secret_name", request.secretName],
273
- ["secret_path", request.secretPath]
274
- )
275
- },
276
- unmarshalAccessSecretVersionResponse
277
- );
278
- /**
279
- * Enable a version. Make a specific version accessible. You must specify the `region`, `secret_id` and `revision` parameters.
280
- *
281
- * @param request - The request {@link EnableSecretVersionRequest}
282
- * @returns A Promise of SecretVersion
283
- */
284
- enableSecretVersion = (request) => this.client.fetch(
285
- {
286
- body: "{}",
287
- headers: jsonContentHeaders,
288
- method: "POST",
289
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/enable`
290
- },
291
- unmarshalSecretVersion
292
- );
293
- /**
294
- * Disable a version. Make a specific version inaccessible. You must specify the `region`, `secret_id` and `revision` parameters.
295
- *
296
- * @param request - The request {@link DisableSecretVersionRequest}
297
- * @returns A Promise of SecretVersion
298
- */
299
- disableSecretVersion = (request) => this.client.fetch(
300
- {
301
- body: "{}",
302
- headers: jsonContentHeaders,
303
- method: "POST",
304
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/disable`
305
- },
306
- unmarshalSecretVersion
307
- );
308
- pageOfListTags = (request = {}) => this.client.fetch(
309
- {
310
- method: "GET",
311
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags`,
312
- urlParams: urlParams(
313
- ["page", request.page],
314
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
315
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
316
- )
317
- },
318
- unmarshalListTagsResponse
319
- );
320
- /**
321
- * List tags. List all tags associated with secrets within a given Project.
322
- *
323
- * @param request - The request {@link ListTagsRequest}
324
- * @returns A Promise of ListTagsResponse
325
- */
326
- listTags = (request = {}) => enrichForPagination("tags", this.pageOfListTags, request);
327
- pageOfListSecretTypes = (request = {}) => this.client.fetch(
328
- {
329
- method: "GET",
330
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`,
331
- urlParams: urlParams(
332
- ["page", request.page],
333
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
334
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
335
- )
336
- },
337
- unmarshalListSecretTypesResponse
338
- );
339
- /**
340
- * List secret types. List all secret types created within a given Project.
341
- *
342
- * @param request - The request {@link ListSecretTypesRequest}
343
- * @returns A Promise of ListSecretTypesResponse
344
- */
345
- listSecretTypes = (request = {}) => enrichForPagination("types", this.pageOfListSecretTypes, request);
346
- /**
347
- * Restore a version. Restore a secret's version specified by the `region`, `secret_id` and `revision` parameters.
348
- *
349
- * @param request - The request {@link RestoreSecretVersionRequest}
350
- * @returns A Promise of SecretVersion
351
- */
352
- restoreSecretVersion = (request) => this.client.fetch(
353
- {
354
- body: "{}",
355
- headers: jsonContentHeaders,
356
- method: "POST",
357
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/restore`
358
- },
359
- unmarshalSecretVersion
360
- );
361
- /**
362
- * Restore a secret. Restore a secret and all its versions scheduled for deletion specified by the `region` and `secret_id` parameters.
363
- *
364
- * @param request - The request {@link RestoreSecretRequest}
365
- * @returns A Promise of Secret
366
- */
367
- restoreSecret = (request) => this.client.fetch(
368
- {
369
- body: "{}",
370
- headers: jsonContentHeaders,
371
- method: "POST",
372
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/restore`
373
- },
374
- unmarshalSecret
375
- );
376
- }
377
- export {
378
- 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);
379
268
  };
269
+ export { API$1 as API };
@@ -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,235 +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(data.items, unmarshalBrowseSecretsResponseItem),
133
- totalCount: data.total_count
134
- };
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
+ };
135
99
  };
136
100
  const unmarshalListSecretTypesResponse = (data) => {
137
- if (!isJSONObject(data)) {
138
- throw new TypeError(
139
- `Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`
140
- );
141
- }
142
- return {
143
- totalCount: data.total_count,
144
- types: data.types
145
- };
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
+ };
146
106
  };
147
107
  const unmarshalListSecretVersionsResponse = (data) => {
148
- if (!isJSONObject(data)) {
149
- throw new TypeError(
150
- `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`
151
- );
152
- }
153
- return {
154
- totalCount: data.total_count,
155
- versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)
156
- };
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
+ };
157
113
  };
158
114
  const unmarshalListSecretsResponse = (data) => {
159
- if (!isJSONObject(data)) {
160
- throw new TypeError(
161
- `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`
162
- );
163
- }
164
- return {
165
- secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
166
- totalCount: data.total_count
167
- };
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
+ };
168
120
  };
169
121
  const unmarshalListTagsResponse = (data) => {
170
- if (!isJSONObject(data)) {
171
- throw new TypeError(
172
- `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`
173
- );
174
- }
175
- return {
176
- tags: data.tags,
177
- totalCount: data.total_count
178
- };
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
+ };
179
127
  };
180
- const marshalAddSecretOwnerRequest = (request, defaults) => ({
181
- product: request.product
182
- });
183
- const marshalEphemeralPolicy = (request, defaults) => ({
184
- action: request.action,
185
- expires_once_accessed: request.expiresOnceAccessed,
186
- 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
187
133
  });
188
134
  const marshalCreateSecretRequest = (request, defaults) => ({
189
- description: request.description,
190
- ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,
191
- key_id: request.keyId,
192
- name: request.name,
193
- path: request.path,
194
- project_id: request.projectId ?? defaults.defaultProjectId,
195
- protected: request.protected,
196
- tags: request.tags,
197
- 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
198
144
  });
199
145
  const marshalCreateSecretVersionRequest = (request, defaults) => ({
200
- data: request.data,
201
- data_crc32: request.dataCrc32,
202
- description: request.description,
203
- disable_previous: request.disablePrevious
146
+ data: request.data,
147
+ data_crc32: request.dataCrc32,
148
+ description: request.description,
149
+ disable_previous: request.disablePrevious
204
150
  });
205
151
  const marshalUpdateSecretRequest = (request, defaults) => ({
206
- description: request.description,
207
- ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,
208
- name: request.name,
209
- path: request.path,
210
- 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
211
157
  });
212
- const marshalEphemeralProperties = (request, defaults) => ({
213
- action: request.action,
214
- expires_at: request.expiresAt,
215
- 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
216
162
  });
217
163
  const marshalUpdateSecretVersionRequest = (request, defaults) => ({
218
- description: request.description,
219
- 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
220
166
  });
221
- export {
222
- marshalAddSecretOwnerRequest,
223
- marshalCreateSecretRequest,
224
- marshalCreateSecretVersionRequest,
225
- marshalUpdateSecretRequest,
226
- marshalUpdateSecretVersionRequest,
227
- unmarshalAccessSecretVersionResponse,
228
- unmarshalBrowseSecretsResponse,
229
- unmarshalListSecretTypesResponse,
230
- unmarshalListSecretVersionsResponse,
231
- unmarshalListSecretsResponse,
232
- unmarshalListTagsResponse,
233
- unmarshalSecret,
234
- unmarshalSecretVersion
235
- };
167
+ export { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalBrowseSecretsResponse, unmarshalListSecretTypesResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
@@ -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.1",
3
+ "version": "2.3.1",
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.1"
30
+ "@scaleway/sdk-std": "2.2.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.1"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",