@scaleway/sdk-secret 2.1.1 → 2.2.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.
@@ -9,11 +9,7 @@ class API extends API$1 {
9
9
  * type ∈ {'zone','region','global','unspecified'}
10
10
  */
11
11
  static LOCALITY = toApiLocality({
12
- regions: [
13
- "fr-par",
14
- "nl-ams",
15
- "pl-waw"
16
- ]
12
+ regions: ["fr-par", "nl-ams", "pl-waw"]
17
13
  });
18
14
  /**
19
15
  * Create a secret. Create a secret in a given region specified by the `region` parameter.
@@ -67,12 +63,10 @@ class API extends API$1 {
67
63
  *
68
64
  * @param request - The request {@link DeleteSecretRequest}
69
65
  */
70
- deleteSecret = (request) => this.client.fetch(
71
- {
72
- method: "DELETE",
73
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
74
- }
75
- );
66
+ deleteSecret = (request) => this.client.fetch({
67
+ method: "DELETE",
68
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
69
+ });
76
70
  pageOfListSecrets = (request) => this.client.fetch(
77
71
  {
78
72
  method: "GET",
@@ -83,7 +77,10 @@ class API extends API$1 {
83
77
  ["order_by", request.orderBy],
84
78
  ["organization_id", request.organizationId],
85
79
  ["page", request.page],
86
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
80
+ [
81
+ "page_size",
82
+ request.pageSize ?? this.client.settings.defaultPageSize
83
+ ],
87
84
  ["path", request.path],
88
85
  ["project_id", request.projectId],
89
86
  ["scheduled_for_deletion", request.scheduledForDeletion],
@@ -113,7 +110,10 @@ class API extends API$1 {
113
110
  urlParams: urlParams(
114
111
  ["order_by", request.orderBy],
115
112
  ["page", request.page],
116
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
113
+ [
114
+ "page_size",
115
+ request.pageSize ?? this.client.settings.defaultPageSize
116
+ ],
117
117
  ["prefix", request.prefix],
118
118
  ["project_id", request.projectId],
119
119
  ["tags", request.tags],
@@ -157,16 +157,14 @@ class API extends API$1 {
157
157
  *
158
158
  * @param request - The request {@link AddSecretOwnerRequest}
159
159
  */
160
- addSecretOwner = (request) => this.client.fetch(
161
- {
162
- body: JSON.stringify(
163
- marshalAddSecretOwnerRequest(request, this.client.settings)
164
- ),
165
- headers: jsonContentHeaders,
166
- method: "POST",
167
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/add-owner`
168
- }
169
- );
160
+ addSecretOwner = (request) => this.client.fetch({
161
+ body: JSON.stringify(
162
+ marshalAddSecretOwnerRequest(request, this.client.settings)
163
+ ),
164
+ headers: jsonContentHeaders,
165
+ method: "POST",
166
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/add-owner`
167
+ });
170
168
  /**
171
169
  * Create a version. Create a version of a given secret specified by the `region` and `secret_id` parameters.
172
170
  *
@@ -219,19 +217,20 @@ class API extends API$1 {
219
217
  *
220
218
  * @param request - The request {@link DeleteSecretVersionRequest}
221
219
  */
222
- deleteSecretVersion = (request) => this.client.fetch(
223
- {
224
- method: "DELETE",
225
- path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
226
- }
227
- );
220
+ deleteSecretVersion = (request) => this.client.fetch({
221
+ method: "DELETE",
222
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}`
223
+ });
228
224
  pageOfListSecretVersions = (request) => this.client.fetch(
229
225
  {
230
226
  method: "GET",
231
227
  path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions`,
232
228
  urlParams: urlParams(
233
229
  ["page", request.page],
234
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
230
+ [
231
+ "page_size",
232
+ request.pageSize ?? this.client.settings.defaultPageSize
233
+ ],
235
234
  ["status", request.status]
236
235
  )
237
236
  },
@@ -268,7 +267,10 @@ class API extends API$1 {
268
267
  method: "GET",
269
268
  path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${validatePathParam("revision", request.revision)}/access`,
270
269
  urlParams: urlParams(
271
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId],
270
+ [
271
+ "project_id",
272
+ request.projectId ?? this.client.settings.defaultProjectId
273
+ ],
272
274
  ["secret_name", request.secretName],
273
275
  ["secret_path", request.secretPath]
274
276
  )
@@ -311,8 +313,14 @@ class API extends API$1 {
311
313
  path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags`,
312
314
  urlParams: urlParams(
313
315
  ["page", request.page],
314
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
315
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
316
+ [
317
+ "page_size",
318
+ request.pageSize ?? this.client.settings.defaultPageSize
319
+ ],
320
+ [
321
+ "project_id",
322
+ request.projectId ?? this.client.settings.defaultProjectId
323
+ ]
316
324
  )
317
325
  },
318
326
  unmarshalListTagsResponse
@@ -330,8 +338,14 @@ class API extends API$1 {
330
338
  path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`,
331
339
  urlParams: urlParams(
332
340
  ["page", request.page],
333
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
334
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
341
+ [
342
+ "page_size",
343
+ request.pageSize ?? this.client.settings.defaultPageSize
344
+ ],
345
+ [
346
+ "project_id",
347
+ request.projectId ?? this.client.settings.defaultProjectId
348
+ ]
335
349
  )
336
350
  },
337
351
  unmarshalListSecretTypesResponse
@@ -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';
@@ -129,7 +129,10 @@ const unmarshalBrowseSecretsResponse = (data) => {
129
129
  }
130
130
  return {
131
131
  currentPath: data.current_path,
132
- items: unmarshalArrayOfObject(data.items, unmarshalBrowseSecretsResponseItem),
132
+ items: unmarshalArrayOfObject(
133
+ data.items,
134
+ unmarshalBrowseSecretsResponseItem
135
+ ),
133
136
  totalCount: data.total_count
134
137
  };
135
138
  };
@@ -70,10 +70,10 @@ export interface SecretVersion {
70
70
  secretId: string;
71
71
  /**
72
72
  * * `unknown_status`: the version is in an invalid state.
73
- * `enabled`: the version is accessible.
74
- * `disabled`: the version is not accessible but can be enabled.
75
- * `scheduled_for_deletion`: the version is scheduled for deletion. It will be deleted in 7 days.
76
- * `deleted`: the version is permanently deleted. It is not possible to recover it.
73
+ * `enabled`: the version is accessible.
74
+ * `disabled`: the version is not accessible but can be enabled.
75
+ * `scheduled_for_deletion`: the version is scheduled for deletion. It will be deleted in 7 days.
76
+ * `deleted`: the version is permanently deleted. It is not possible to recover it.
77
77
  */
78
78
  status: SecretVersionStatus;
79
79
  /**
@@ -124,7 +124,7 @@ export interface Secret {
124
124
  name: string;
125
125
  /**
126
126
  * * `ready`: the secret can be read, modified and deleted.
127
- * `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
127
+ * `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
128
128
  */
129
129
  status: SecretStatus;
130
130
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-secret",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Scaleway SDK secret",
5
5
  "license": "Apache-2.0",
6
6
  "files": [