@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 +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1beta1/api.gen.js +268 -378
- package/dist/v1beta1/index.gen.js +21 -19
- package/dist/v1beta1/marshalling.gen.js +136 -204
- 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,379 +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
|
-
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 {
|
|
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,235 +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(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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
|
|
219
|
-
|
|
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
|
-
|
|
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.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.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.1
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.1
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|