@scaleway/sdk-key-manager 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 key. Create a key in a given region specified by the `region` parameter. You can use keys to encrypt or decrypt arbitrary payloads, to sign and verify messages or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
@@ -80,12 +76,10 @@ class API extends API$1 {
80
76
  *
81
77
  * @param request - The request {@link DeleteKeyRequest}
82
78
  */
83
- deleteKey = (request) => this.client.fetch(
84
- {
85
- method: "DELETE",
86
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
87
- }
88
- );
79
+ deleteKey = (request) => this.client.fetch({
80
+ method: "DELETE",
81
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
82
+ });
89
83
  /**
90
84
  * Rotate a key. Generate a new version of an existing key with new key material. Previous key versions remain usable to decrypt previously encrypted data, but the key's new version will be used for subsequent encryption operations and data key generation.
91
85
  *
@@ -170,7 +164,10 @@ class API extends API$1 {
170
164
  ["order_by", request.orderBy],
171
165
  ["organization_id", request.organizationId],
172
166
  ["page", request.page],
173
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
167
+ [
168
+ "page_size",
169
+ request.pageSize ?? this.client.settings.defaultPageSize
170
+ ],
174
171
  ["project_id", request.projectId],
175
172
  ["scheduled_for_deletion", request.scheduledForDeletion],
176
173
  ["tags", request.tags],
@@ -247,9 +244,7 @@ class API extends API$1 {
247
244
  */
248
245
  sign = (request) => this.client.fetch(
249
246
  {
250
- body: JSON.stringify(
251
- marshalSignRequest(request, this.client.settings)
252
- ),
247
+ body: JSON.stringify(marshalSignRequest(request, this.client.settings)),
253
248
  headers: jsonContentHeaders,
254
249
  method: "POST",
255
250
  path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/sign`
@@ -295,14 +290,12 @@ class API extends API$1 {
295
290
  *
296
291
  * @param request - The request {@link DeleteKeyMaterialRequest}
297
292
  */
298
- deleteKeyMaterial = (request) => this.client.fetch(
299
- {
300
- body: "{}",
301
- headers: jsonContentHeaders,
302
- method: "POST",
303
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/delete-key-material`
304
- }
305
- );
293
+ deleteKeyMaterial = (request) => this.client.fetch({
294
+ body: "{}",
295
+ headers: jsonContentHeaders,
296
+ method: "POST",
297
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/delete-key-material`
298
+ });
306
299
  /**
307
300
  * Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters.
308
301
  *
@@ -328,9 +321,7 @@ class API extends API$1 {
328
321
  {
329
322
  method: "GET",
330
323
  path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
331
- urlParams: urlParams(
332
- ["usages", request.usages]
333
- )
324
+ urlParams: urlParams(["usages", request.usages])
334
325
  },
335
326
  unmarshalListAlgorithmsResponse
336
327
  );
@@ -1,3 +1,3 @@
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 { CreateKeyRequest, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyRotationPolicy, KeyState, KeyUsage, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UpdateKeyRequest, VerifyRequest, VerifyResponse, } from './types.gen.js';
@@ -104,7 +104,10 @@ const unmarshalListAlgorithmsResponse = (data) => {
104
104
  );
105
105
  }
106
106
  return {
107
- algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm)
107
+ algorithms: unmarshalArrayOfObject(
108
+ data.algorithms,
109
+ unmarshalListAlgorithmsResponseAlgorithm
110
+ )
108
111
  };
109
112
  };
110
113
  const unmarshalListKeysResponse = (data) => {
@@ -156,18 +159,9 @@ const marshalKeyRotationPolicy = (request, defaults) => ({
156
159
  });
157
160
  const marshalKeyUsage = (request, defaults) => ({
158
161
  ...resolveOneOf([
159
- {
160
- param: "symmetric_encryption",
161
- value: request.symmetricEncryption
162
- },
163
- {
164
- param: "asymmetric_encryption",
165
- value: request.asymmetricEncryption
166
- },
167
- {
168
- param: "asymmetric_signing",
169
- value: request.asymmetricSigning
170
- }
162
+ { param: "symmetric_encryption", value: request.symmetricEncryption },
163
+ { param: "asymmetric_encryption", value: request.asymmetricEncryption },
164
+ { param: "asymmetric_signing", value: request.asymmetricSigning }
171
165
  ])
172
166
  });
173
167
  const marshalCreateKeyRequest = (request, defaults) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-key-manager",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Scaleway SDK key-manager",
5
5
  "license": "Apache-2.0",
6
6
  "files": [