@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 +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1beta1/api.gen.js +268 -392
- package/dist/v1beta1/index.gen.d.ts +1 -1
- package/dist/v1beta1/index.gen.js +21 -19
- package/dist/v1beta1/marshalling.gen.js +136 -207
- package/dist/v1beta1/types.gen.d.ts +5 -5
- package/dist/v1beta1/validation-rules.gen.js +4 -8
- package/package.json +4 -4
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
package/dist/v1beta1/api.gen.js
CHANGED
|
@@ -1,393 +1,269 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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 {
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
222
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.
|
|
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.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|