@sphereon/ssi-sdk.kms-rest-client 0.34.1-feature.IDK.11.296 → 0.34.1-feature.IDK.11.298

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/dist/index.d.cts CHANGED
@@ -3922,6 +3922,7 @@ declare class KmsRestClient implements IAgentPlugin {
3922
3922
  private assertedAgentBaseUrl;
3923
3923
  private createHeaders;
3924
3924
  private addSearchParams;
3925
+ private handleHttpError;
3925
3926
  }
3926
3927
 
3927
3928
  export { type AwsAssumeRoleCredentials, AwsAssumeRoleCredentialsFromJSON, AwsAssumeRoleCredentialsFromJSONTyped, AwsAssumeRoleCredentialsToJSON, AwsAssumeRoleCredentialsToJSONTyped, type AwsClientConfiguration, AwsClientConfigurationFromJSON, AwsClientConfigurationFromJSONTyped, AwsClientConfigurationToJSON, AwsClientConfigurationToJSONTyped, type AwsKmsSetting, AwsKmsSettingFromJSON, AwsKmsSettingFromJSONTyped, AwsKmsSettingToJSON, AwsKmsSettingToJSONTyped, type AwsStaticCredentials, AwsStaticCredentialsFromJSON, AwsStaticCredentialsFromJSONTyped, AwsStaticCredentialsToJSON, AwsStaticCredentialsToJSONTyped, type AwsWebIdentityTokenCredentials, AwsWebIdentityTokenCredentialsFromJSON, AwsWebIdentityTokenCredentialsFromJSONTyped, AwsWebIdentityTokenCredentialsToJSON, AwsWebIdentityTokenCredentialsToJSONTyped, type AzureClientSecretCredentialOpts, AzureClientSecretCredentialOptsFromJSON, AzureClientSecretCredentialOptsFromJSONTyped, AzureClientSecretCredentialOptsToJSON, AzureClientSecretCredentialOptsToJSONTyped, type AzureCredentialOpts, AzureCredentialOptsFromJSON, AzureCredentialOptsFromJSONTyped, AzureCredentialOptsToJSON, AzureCredentialOptsToJSONTyped, type AzureKeyVaultSetting, AzureKeyVaultSettingFromJSON, AzureKeyVaultSettingFromJSONTyped, AzureKeyVaultSettingToJSON, AzureKeyVaultSettingToJSONTyped, type CoseKey, CoseKeyFromJSON, CoseKeyFromJSONTyped, type CoseKeyPair, CoseKeyPairFromJSON, CoseKeyPairFromJSONTyped, CoseKeyPairToJSON, CoseKeyPairToJSONTyped, CoseKeyToJSON, CoseKeyToJSONTyped, CoseKeyType, CoseKeyTypeFromJSON, CoseKeyTypeFromJSONTyped, CoseKeyTypeToJSON, CoseKeyTypeToJSONTyped, type CreateKeyProvider, CreateKeyProviderFromJSON, CreateKeyProviderFromJSONTyped, CreateKeyProviderToJSON, CreateKeyProviderToJSONTyped, type CreateRawSignature, CreateRawSignatureFromJSON, CreateRawSignatureFromJSONTyped, type CreateRawSignatureResponse, CreateRawSignatureResponseFromJSON, CreateRawSignatureResponseFromJSONTyped, CreateRawSignatureResponseToJSON, CreateRawSignatureResponseToJSONTyped, CreateRawSignatureToJSON, CreateRawSignatureToJSONTyped, type CreateSimpleSignature, CreateSimpleSignatureFromJSON, CreateSimpleSignatureFromJSONTyped, CreateSimpleSignatureToJSON, CreateSimpleSignatureToJSONTyped, CryptoAlg, CryptoAlgFromJSON, CryptoAlgFromJSONTyped, CryptoAlgToJSON, CryptoAlgToJSONTyped, Curve, CurveFromJSON, CurveFromJSONTyped, CurveToJSON, CurveToJSONTyped, DigestAlg, DigestAlgFromJSON, DigestAlgFromJSONTyped, DigestAlgToJSON, DigestAlgToJSONTyped, type ErrorResponse, ErrorResponseFromJSON, ErrorResponseFromJSONTyped, ErrorResponseToJSON, ErrorResponseToJSONTyped, type GenerateKey, GenerateKeyFromJSON, GenerateKeyFromJSONTyped, type GenerateKeyGlobal, GenerateKeyGlobalFromJSON, GenerateKeyGlobalFromJSONTyped, GenerateKeyGlobalToJSON, GenerateKeyGlobalToJSONTyped, type GenerateKeyResponse, GenerateKeyResponseFromJSON, GenerateKeyResponseFromJSONTyped, GenerateKeyResponseToJSON, GenerateKeyResponseToJSONTyped, GenerateKeyToJSON, GenerateKeyToJSONTyped, type GetKeyResponse, GetKeyResponseFromJSON, GetKeyResponseFromJSONTyped, GetKeyResponseToJSON, GetKeyResponseToJSONTyped, type IKmsRestClient, type IRequiredContext, IdentifierMethod, IdentifierMethodFromJSON, IdentifierMethodFromJSONTyped, IdentifierMethodToJSON, IdentifierMethodToJSONTyped, type JoseKeyPair, JoseKeyPairFromJSON, JoseKeyPairFromJSONTyped, JoseKeyPairToJSON, JoseKeyPairToJSONTyped, type Jwk, JwkFromJSON, JwkFromJSONTyped, JwkKeyType, JwkKeyTypeFromJSON, JwkKeyTypeFromJSONTyped, JwkKeyTypeToJSON, JwkKeyTypeToJSONTyped, JwkToJSON, JwkToJSONTyped, JwkUse, JwkUseFromJSON, JwkUseFromJSONTyped, JwkUseToJSON, JwkUseToJSONTyped, KeyEncoding, KeyEncodingFromJSON, KeyEncodingFromJSONTyped, KeyEncodingToJSON, KeyEncodingToJSONTyped, type KeyInfo, KeyInfoFromJSON, KeyInfoFromJSONTyped, KeyInfoToJSON, KeyInfoToJSONTyped, KeyOperations, KeyOperationsFromJSON, KeyOperationsFromJSONTyped, KeyOperationsToJSON, KeyOperationsToJSONTyped, type KeyProvider, KeyProviderFromJSON, KeyProviderFromJSONTyped, type KeyProviderResponse, KeyProviderResponseFromJSON, KeyProviderResponseFromJSONTyped, KeyProviderResponseToJSON, KeyProviderResponseToJSONTyped, KeyProviderToJSON, KeyProviderToJSONTyped, KeyProviderType, KeyProviderTypeFromJSON, KeyProviderTypeFromJSONTyped, KeyProviderTypeToJSON, KeyProviderTypeToJSONTyped, type KeyResolver, KeyResolverFromJSON, KeyResolverFromJSONTyped, KeyResolverToJSON, KeyResolverToJSONTyped, KeyType, KeyTypeFromJSON, KeyTypeFromJSONTyped, KeyTypeToJSON, KeyTypeToJSONTyped, KeyVisibility, KeyVisibilityFromJSON, KeyVisibilityFromJSONTyped, KeyVisibilityToJSON, KeyVisibilityToJSONTyped, type KmsClientCreateRawSignatureArgs, type KmsClientDeleteKeyArgs, type KmsClientGenerateKeyArgs, type KmsClientGetKeyArgs, type KmsClientGetKeyProviderArgs, type KmsClientIsValidRawSignatureArgs, type KmsClientListKeyProvidersArgs, type KmsClientListKeysArgs, type KmsClientListResolversArgs, type KmsClientProviderDeleteKeyArgs, type KmsClientProviderGenerateKeyArgs, type KmsClientProviderGetKeyArgs, type KmsClientProviderListKeysArgs, type KmsClientProviderStoreKeyArgs, type KmsClientResolveKeyArgs, type KmsClientStoreKeyArgs, KmsRestClient, type KmsRestClientArgs, type ListKeyProvidersResponse, ListKeyProvidersResponseFromJSON, ListKeyProvidersResponseFromJSONTyped, ListKeyProvidersResponseToJSON, ListKeyProvidersResponseToJSONTyped, type ListKeysResponse, ListKeysResponseFromJSON, ListKeysResponseFromJSONTyped, ListKeysResponseToJSON, ListKeysResponseToJSONTyped, type ListResolversResponse, ListResolversResponseFromJSON, ListResolversResponseFromJSONTyped, ListResolversResponseToJSON, ListResolversResponseToJSONTyped, LookupMode, LookupModeFromJSON, LookupModeFromJSONTyped, LookupModeToJSON, LookupModeToJSONTyped, type ManagedKeyInfo, ManagedKeyInfoFromJSON, ManagedKeyInfoFromJSONTyped, ManagedKeyInfoToJSON, ManagedKeyInfoToJSONTyped, type ManagedKeyPair, ManagedKeyPairFromJSON, ManagedKeyPairFromJSONTyped, ManagedKeyPairToJSON, ManagedKeyPairToJSONTyped, MaskGenFunction, MaskGenFunctionFromJSON, MaskGenFunctionFromJSONTyped, MaskGenFunctionToJSON, MaskGenFunctionToJSONTyped, type ProviderCapabilities, ProviderCapabilitiesFromJSON, ProviderCapabilitiesFromJSONTyped, ProviderCapabilitiesToJSON, ProviderCapabilitiesToJSONTyped, type ResolvePublicKey, ResolvePublicKeyFromJSON, ResolvePublicKeyFromJSONTyped, ResolvePublicKeyToJSON, ResolvePublicKeyToJSONTyped, type ResolvedKeyInfo, ResolvedKeyInfoFromJSON, ResolvedKeyInfoFromJSONTyped, ResolvedKeyInfoToJSON, ResolvedKeyInfoToJSONTyped, type Resolver, ResolverFromJSON, ResolverFromJSONTyped, ResolverToJSON, ResolverToJSONTyped, type RestClientAuthenticationOpts, type SignInput, SignInputFromJSON, SignInputFromJSONTyped, SignInputModeEnum, SignInputToJSON, SignInputToJSONTyped, type SignOutput, SignOutputFromJSON, SignOutputFromJSONTyped, SignOutputToJSON, SignOutputToJSONTyped, type Signature, SignatureAlgorithm, SignatureAlgorithmFromJSON, SignatureAlgorithmFromJSONTyped, SignatureAlgorithmToJSON, SignatureAlgorithmToJSONTyped, SignatureFromJSON, SignatureFromJSONTyped, SignatureToJSON, SignatureToJSONTyped, type StoreKey, StoreKeyFromJSON, StoreKeyFromJSONTyped, type StoreKeyResponse, StoreKeyResponseFromJSON, StoreKeyResponseFromJSONTyped, StoreKeyResponseToJSON, StoreKeyResponseToJSONTyped, StoreKeyToJSON, StoreKeyToJSONTyped, type UpdateKeyProvider, UpdateKeyProviderFromJSON, UpdateKeyProviderFromJSONTyped, UpdateKeyProviderToJSON, UpdateKeyProviderToJSONTyped, type VerifyRawSignature, VerifyRawSignatureFromJSON, VerifyRawSignatureFromJSONTyped, type VerifyRawSignatureResponse, VerifyRawSignatureResponseFromJSON, VerifyRawSignatureResponseFromJSONTyped, VerifyRawSignatureResponseToJSON, VerifyRawSignatureResponseToJSONTyped, VerifyRawSignatureToJSON, VerifyRawSignatureToJSONTyped, type VerifySimpleSignature, VerifySimpleSignatureFromJSON, VerifySimpleSignatureFromJSONTyped, VerifySimpleSignatureToJSON, VerifySimpleSignatureToJSONTyped, instanceOfAwsAssumeRoleCredentials, instanceOfAwsClientConfiguration, instanceOfAwsKmsSetting, instanceOfAwsStaticCredentials, instanceOfAwsWebIdentityTokenCredentials, instanceOfAzureClientSecretCredentialOpts, instanceOfAzureCredentialOpts, instanceOfAzureKeyVaultSetting, instanceOfCoseKey, instanceOfCoseKeyPair, instanceOfCoseKeyType, instanceOfCreateKeyProvider, instanceOfCreateRawSignature, instanceOfCreateRawSignatureResponse, instanceOfCreateSimpleSignature, instanceOfCryptoAlg, instanceOfCurve, instanceOfDigestAlg, instanceOfErrorResponse, instanceOfGenerateKey, instanceOfGenerateKeyGlobal, instanceOfGenerateKeyResponse, instanceOfGetKeyResponse, instanceOfIdentifierMethod, instanceOfJoseKeyPair, instanceOfJwk, instanceOfJwkKeyType, instanceOfJwkUse, instanceOfKeyEncoding, instanceOfKeyInfo, instanceOfKeyOperations, instanceOfKeyProvider, instanceOfKeyProviderResponse, instanceOfKeyProviderType, instanceOfKeyResolver, instanceOfKeyType, instanceOfKeyVisibility, instanceOfListKeyProvidersResponse, instanceOfListKeysResponse, instanceOfListResolversResponse, instanceOfLookupMode, instanceOfManagedKeyInfo, instanceOfManagedKeyPair, instanceOfMaskGenFunction, instanceOfProviderCapabilities, instanceOfResolvePublicKey, instanceOfResolvedKeyInfo, instanceOfResolver, instanceOfSignInput, instanceOfSignOutput, instanceOfSignature, instanceOfSignatureAlgorithm, instanceOfStoreKey, instanceOfStoreKeyResponse, instanceOfUpdateKeyProvider, instanceOfVerifyRawSignature, instanceOfVerifyRawSignatureResponse, instanceOfVerifySimpleSignature, type kmsClientGetResolverArgs, plugin_schema as schema };
package/dist/index.d.ts CHANGED
@@ -3922,6 +3922,7 @@ declare class KmsRestClient implements IAgentPlugin {
3922
3922
  private assertedAgentBaseUrl;
3923
3923
  private createHeaders;
3924
3924
  private addSearchParams;
3925
+ private handleHttpError;
3925
3926
  }
3926
3927
 
3927
3928
  export { type AwsAssumeRoleCredentials, AwsAssumeRoleCredentialsFromJSON, AwsAssumeRoleCredentialsFromJSONTyped, AwsAssumeRoleCredentialsToJSON, AwsAssumeRoleCredentialsToJSONTyped, type AwsClientConfiguration, AwsClientConfigurationFromJSON, AwsClientConfigurationFromJSONTyped, AwsClientConfigurationToJSON, AwsClientConfigurationToJSONTyped, type AwsKmsSetting, AwsKmsSettingFromJSON, AwsKmsSettingFromJSONTyped, AwsKmsSettingToJSON, AwsKmsSettingToJSONTyped, type AwsStaticCredentials, AwsStaticCredentialsFromJSON, AwsStaticCredentialsFromJSONTyped, AwsStaticCredentialsToJSON, AwsStaticCredentialsToJSONTyped, type AwsWebIdentityTokenCredentials, AwsWebIdentityTokenCredentialsFromJSON, AwsWebIdentityTokenCredentialsFromJSONTyped, AwsWebIdentityTokenCredentialsToJSON, AwsWebIdentityTokenCredentialsToJSONTyped, type AzureClientSecretCredentialOpts, AzureClientSecretCredentialOptsFromJSON, AzureClientSecretCredentialOptsFromJSONTyped, AzureClientSecretCredentialOptsToJSON, AzureClientSecretCredentialOptsToJSONTyped, type AzureCredentialOpts, AzureCredentialOptsFromJSON, AzureCredentialOptsFromJSONTyped, AzureCredentialOptsToJSON, AzureCredentialOptsToJSONTyped, type AzureKeyVaultSetting, AzureKeyVaultSettingFromJSON, AzureKeyVaultSettingFromJSONTyped, AzureKeyVaultSettingToJSON, AzureKeyVaultSettingToJSONTyped, type CoseKey, CoseKeyFromJSON, CoseKeyFromJSONTyped, type CoseKeyPair, CoseKeyPairFromJSON, CoseKeyPairFromJSONTyped, CoseKeyPairToJSON, CoseKeyPairToJSONTyped, CoseKeyToJSON, CoseKeyToJSONTyped, CoseKeyType, CoseKeyTypeFromJSON, CoseKeyTypeFromJSONTyped, CoseKeyTypeToJSON, CoseKeyTypeToJSONTyped, type CreateKeyProvider, CreateKeyProviderFromJSON, CreateKeyProviderFromJSONTyped, CreateKeyProviderToJSON, CreateKeyProviderToJSONTyped, type CreateRawSignature, CreateRawSignatureFromJSON, CreateRawSignatureFromJSONTyped, type CreateRawSignatureResponse, CreateRawSignatureResponseFromJSON, CreateRawSignatureResponseFromJSONTyped, CreateRawSignatureResponseToJSON, CreateRawSignatureResponseToJSONTyped, CreateRawSignatureToJSON, CreateRawSignatureToJSONTyped, type CreateSimpleSignature, CreateSimpleSignatureFromJSON, CreateSimpleSignatureFromJSONTyped, CreateSimpleSignatureToJSON, CreateSimpleSignatureToJSONTyped, CryptoAlg, CryptoAlgFromJSON, CryptoAlgFromJSONTyped, CryptoAlgToJSON, CryptoAlgToJSONTyped, Curve, CurveFromJSON, CurveFromJSONTyped, CurveToJSON, CurveToJSONTyped, DigestAlg, DigestAlgFromJSON, DigestAlgFromJSONTyped, DigestAlgToJSON, DigestAlgToJSONTyped, type ErrorResponse, ErrorResponseFromJSON, ErrorResponseFromJSONTyped, ErrorResponseToJSON, ErrorResponseToJSONTyped, type GenerateKey, GenerateKeyFromJSON, GenerateKeyFromJSONTyped, type GenerateKeyGlobal, GenerateKeyGlobalFromJSON, GenerateKeyGlobalFromJSONTyped, GenerateKeyGlobalToJSON, GenerateKeyGlobalToJSONTyped, type GenerateKeyResponse, GenerateKeyResponseFromJSON, GenerateKeyResponseFromJSONTyped, GenerateKeyResponseToJSON, GenerateKeyResponseToJSONTyped, GenerateKeyToJSON, GenerateKeyToJSONTyped, type GetKeyResponse, GetKeyResponseFromJSON, GetKeyResponseFromJSONTyped, GetKeyResponseToJSON, GetKeyResponseToJSONTyped, type IKmsRestClient, type IRequiredContext, IdentifierMethod, IdentifierMethodFromJSON, IdentifierMethodFromJSONTyped, IdentifierMethodToJSON, IdentifierMethodToJSONTyped, type JoseKeyPair, JoseKeyPairFromJSON, JoseKeyPairFromJSONTyped, JoseKeyPairToJSON, JoseKeyPairToJSONTyped, type Jwk, JwkFromJSON, JwkFromJSONTyped, JwkKeyType, JwkKeyTypeFromJSON, JwkKeyTypeFromJSONTyped, JwkKeyTypeToJSON, JwkKeyTypeToJSONTyped, JwkToJSON, JwkToJSONTyped, JwkUse, JwkUseFromJSON, JwkUseFromJSONTyped, JwkUseToJSON, JwkUseToJSONTyped, KeyEncoding, KeyEncodingFromJSON, KeyEncodingFromJSONTyped, KeyEncodingToJSON, KeyEncodingToJSONTyped, type KeyInfo, KeyInfoFromJSON, KeyInfoFromJSONTyped, KeyInfoToJSON, KeyInfoToJSONTyped, KeyOperations, KeyOperationsFromJSON, KeyOperationsFromJSONTyped, KeyOperationsToJSON, KeyOperationsToJSONTyped, type KeyProvider, KeyProviderFromJSON, KeyProviderFromJSONTyped, type KeyProviderResponse, KeyProviderResponseFromJSON, KeyProviderResponseFromJSONTyped, KeyProviderResponseToJSON, KeyProviderResponseToJSONTyped, KeyProviderToJSON, KeyProviderToJSONTyped, KeyProviderType, KeyProviderTypeFromJSON, KeyProviderTypeFromJSONTyped, KeyProviderTypeToJSON, KeyProviderTypeToJSONTyped, type KeyResolver, KeyResolverFromJSON, KeyResolverFromJSONTyped, KeyResolverToJSON, KeyResolverToJSONTyped, KeyType, KeyTypeFromJSON, KeyTypeFromJSONTyped, KeyTypeToJSON, KeyTypeToJSONTyped, KeyVisibility, KeyVisibilityFromJSON, KeyVisibilityFromJSONTyped, KeyVisibilityToJSON, KeyVisibilityToJSONTyped, type KmsClientCreateRawSignatureArgs, type KmsClientDeleteKeyArgs, type KmsClientGenerateKeyArgs, type KmsClientGetKeyArgs, type KmsClientGetKeyProviderArgs, type KmsClientIsValidRawSignatureArgs, type KmsClientListKeyProvidersArgs, type KmsClientListKeysArgs, type KmsClientListResolversArgs, type KmsClientProviderDeleteKeyArgs, type KmsClientProviderGenerateKeyArgs, type KmsClientProviderGetKeyArgs, type KmsClientProviderListKeysArgs, type KmsClientProviderStoreKeyArgs, type KmsClientResolveKeyArgs, type KmsClientStoreKeyArgs, KmsRestClient, type KmsRestClientArgs, type ListKeyProvidersResponse, ListKeyProvidersResponseFromJSON, ListKeyProvidersResponseFromJSONTyped, ListKeyProvidersResponseToJSON, ListKeyProvidersResponseToJSONTyped, type ListKeysResponse, ListKeysResponseFromJSON, ListKeysResponseFromJSONTyped, ListKeysResponseToJSON, ListKeysResponseToJSONTyped, type ListResolversResponse, ListResolversResponseFromJSON, ListResolversResponseFromJSONTyped, ListResolversResponseToJSON, ListResolversResponseToJSONTyped, LookupMode, LookupModeFromJSON, LookupModeFromJSONTyped, LookupModeToJSON, LookupModeToJSONTyped, type ManagedKeyInfo, ManagedKeyInfoFromJSON, ManagedKeyInfoFromJSONTyped, ManagedKeyInfoToJSON, ManagedKeyInfoToJSONTyped, type ManagedKeyPair, ManagedKeyPairFromJSON, ManagedKeyPairFromJSONTyped, ManagedKeyPairToJSON, ManagedKeyPairToJSONTyped, MaskGenFunction, MaskGenFunctionFromJSON, MaskGenFunctionFromJSONTyped, MaskGenFunctionToJSON, MaskGenFunctionToJSONTyped, type ProviderCapabilities, ProviderCapabilitiesFromJSON, ProviderCapabilitiesFromJSONTyped, ProviderCapabilitiesToJSON, ProviderCapabilitiesToJSONTyped, type ResolvePublicKey, ResolvePublicKeyFromJSON, ResolvePublicKeyFromJSONTyped, ResolvePublicKeyToJSON, ResolvePublicKeyToJSONTyped, type ResolvedKeyInfo, ResolvedKeyInfoFromJSON, ResolvedKeyInfoFromJSONTyped, ResolvedKeyInfoToJSON, ResolvedKeyInfoToJSONTyped, type Resolver, ResolverFromJSON, ResolverFromJSONTyped, ResolverToJSON, ResolverToJSONTyped, type RestClientAuthenticationOpts, type SignInput, SignInputFromJSON, SignInputFromJSONTyped, SignInputModeEnum, SignInputToJSON, SignInputToJSONTyped, type SignOutput, SignOutputFromJSON, SignOutputFromJSONTyped, SignOutputToJSON, SignOutputToJSONTyped, type Signature, SignatureAlgorithm, SignatureAlgorithmFromJSON, SignatureAlgorithmFromJSONTyped, SignatureAlgorithmToJSON, SignatureAlgorithmToJSONTyped, SignatureFromJSON, SignatureFromJSONTyped, SignatureToJSON, SignatureToJSONTyped, type StoreKey, StoreKeyFromJSON, StoreKeyFromJSONTyped, type StoreKeyResponse, StoreKeyResponseFromJSON, StoreKeyResponseFromJSONTyped, StoreKeyResponseToJSON, StoreKeyResponseToJSONTyped, StoreKeyToJSON, StoreKeyToJSONTyped, type UpdateKeyProvider, UpdateKeyProviderFromJSON, UpdateKeyProviderFromJSONTyped, UpdateKeyProviderToJSON, UpdateKeyProviderToJSONTyped, type VerifyRawSignature, VerifyRawSignatureFromJSON, VerifyRawSignatureFromJSONTyped, type VerifyRawSignatureResponse, VerifyRawSignatureResponseFromJSON, VerifyRawSignatureResponseFromJSONTyped, VerifyRawSignatureResponseToJSON, VerifyRawSignatureResponseToJSONTyped, VerifyRawSignatureToJSON, VerifyRawSignatureToJSONTyped, type VerifySimpleSignature, VerifySimpleSignatureFromJSON, VerifySimpleSignatureFromJSONTyped, VerifySimpleSignatureToJSON, VerifySimpleSignatureToJSONTyped, instanceOfAwsAssumeRoleCredentials, instanceOfAwsClientConfiguration, instanceOfAwsKmsSetting, instanceOfAwsStaticCredentials, instanceOfAwsWebIdentityTokenCredentials, instanceOfAzureClientSecretCredentialOpts, instanceOfAzureCredentialOpts, instanceOfAzureKeyVaultSetting, instanceOfCoseKey, instanceOfCoseKeyPair, instanceOfCoseKeyType, instanceOfCreateKeyProvider, instanceOfCreateRawSignature, instanceOfCreateRawSignatureResponse, instanceOfCreateSimpleSignature, instanceOfCryptoAlg, instanceOfCurve, instanceOfDigestAlg, instanceOfErrorResponse, instanceOfGenerateKey, instanceOfGenerateKeyGlobal, instanceOfGenerateKeyResponse, instanceOfGetKeyResponse, instanceOfIdentifierMethod, instanceOfJoseKeyPair, instanceOfJwk, instanceOfJwkKeyType, instanceOfJwkUse, instanceOfKeyEncoding, instanceOfKeyInfo, instanceOfKeyOperations, instanceOfKeyProvider, instanceOfKeyProviderResponse, instanceOfKeyProviderType, instanceOfKeyResolver, instanceOfKeyType, instanceOfKeyVisibility, instanceOfListKeyProvidersResponse, instanceOfListKeysResponse, instanceOfListResolversResponse, instanceOfLookupMode, instanceOfManagedKeyInfo, instanceOfManagedKeyPair, instanceOfMaskGenFunction, instanceOfProviderCapabilities, instanceOfResolvePublicKey, instanceOfResolvedKeyInfo, instanceOfResolver, instanceOfSignInput, instanceOfSignOutput, instanceOfSignature, instanceOfSignatureAlgorithm, instanceOfStoreKey, instanceOfStoreKeyResponse, instanceOfUpdateKeyProvider, instanceOfVerifyRawSignature, instanceOfVerifyRawSignatureResponse, instanceOfVerifySimpleSignature, type kmsClientGetResolverArgs, plugin_schema as schema };
package/dist/index.js CHANGED
@@ -3276,13 +3276,9 @@ var KmsRestClient = class _KmsRestClient {
3276
3276
  });
3277
3277
  logger.debug(`get resolver response: ${response}`);
3278
3278
  if (!response.ok) {
3279
- return Promise.reject(await response.json());
3280
- }
3281
- try {
3282
- return ResolverFromJSONTyped(await response.json(), false);
3283
- } catch (error) {
3284
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3279
+ return this.handleHttpError(url, response);
3285
3280
  }
3281
+ return ResolverFromJSONTyped(await response.json(), false);
3286
3282
  }
3287
3283
  /** {@inheritDoc IKmsRestClient.kmsListResolvers} */
3288
3284
  async kmsClientListResolvers(args) {
@@ -3293,13 +3289,9 @@ var KmsRestClient = class _KmsRestClient {
3293
3289
  });
3294
3290
  logger.debug(`list resolvers response: ${response}`);
3295
3291
  if (!response.ok) {
3296
- return Promise.reject(await response.json());
3297
- }
3298
- try {
3299
- return ListResolversResponseFromJSONTyped(await response.json(), false);
3300
- } catch (error) {
3301
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3292
+ return this.handleHttpError(url, response);
3302
3293
  }
3294
+ return ListResolversResponseFromJSONTyped(await response.json(), false);
3303
3295
  }
3304
3296
  /** {@inheritDoc IKmsRestClient.kmsResolveKey} */
3305
3297
  async kmsClientResolveKey(args) {
@@ -3320,13 +3312,9 @@ var KmsRestClient = class _KmsRestClient {
3320
3312
  });
3321
3313
  logger.debug(`resolve key response: ${response}`);
3322
3314
  if (!response.ok) {
3323
- return Promise.reject(await response.json());
3324
- }
3325
- try {
3326
- return ResolvedKeyInfoFromJSONTyped(await response.json(), false);
3327
- } catch (error) {
3328
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3315
+ return this.handleHttpError(url, response);
3329
3316
  }
3317
+ return ResolvedKeyInfoFromJSONTyped(await response.json(), false);
3330
3318
  }
3331
3319
  /** {@inheritDoc IKmsRestClient.kmsCreateRawSignature} */
3332
3320
  async kmsClientCreateRawSignature(args) {
@@ -3345,13 +3333,9 @@ var KmsRestClient = class _KmsRestClient {
3345
3333
  });
3346
3334
  logger.debug(`create raw signature response: ${response}`);
3347
3335
  if (!response.ok) {
3348
- return Promise.reject(await response.json());
3349
- }
3350
- try {
3351
- return CreateRawSignatureResponseFromJSONTyped(await response.json(), false);
3352
- } catch (error) {
3353
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3336
+ return this.handleHttpError(url, response);
3354
3337
  }
3338
+ return CreateRawSignatureResponseFromJSONTyped(await response.json(), false);
3355
3339
  }
3356
3340
  /** {@inheritDoc IKmsRestClient.kmsIsValidRawSignature} */
3357
3341
  async kmsClientIsValidRawSignature(args) {
@@ -3371,13 +3355,9 @@ var KmsRestClient = class _KmsRestClient {
3371
3355
  });
3372
3356
  logger.debug(`verify raw signature response: ${response}`);
3373
3357
  if (!response.ok) {
3374
- return Promise.reject(await response.json());
3375
- }
3376
- try {
3377
- return VerifyRawSignatureResponseFromJSONTyped(await response.json(), false);
3378
- } catch (error) {
3379
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3358
+ return this.handleHttpError(url, response);
3380
3359
  }
3360
+ return VerifyRawSignatureResponseFromJSONTyped(await response.json(), false);
3381
3361
  }
3382
3362
  /** {@inheritDoc IKmsRestClient.kmsGetKey} */
3383
3363
  async kmsClientGetKey(args) {
@@ -3388,13 +3368,9 @@ var KmsRestClient = class _KmsRestClient {
3388
3368
  });
3389
3369
  logger.debug(`get key response: ${response}`);
3390
3370
  if (!response.ok) {
3391
- return Promise.reject(await response.json());
3392
- }
3393
- try {
3394
- return GetKeyResponseFromJSONTyped(await response.json(), false);
3395
- } catch (error) {
3396
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3371
+ return this.handleHttpError(url, response);
3397
3372
  }
3373
+ return GetKeyResponseFromJSONTyped(await response.json(), false);
3398
3374
  }
3399
3375
  /** {@inheritDoc IKmsRestClient.kmsListKeys} */
3400
3376
  async kmsClientListKeys(args) {
@@ -3409,13 +3385,9 @@ var KmsRestClient = class _KmsRestClient {
3409
3385
  });
3410
3386
  logger.debug(`list keys response: ${response}`);
3411
3387
  if (!response.ok) {
3412
- return Promise.reject(await response.json());
3413
- }
3414
- try {
3415
- return ListKeysResponseFromJSONTyped(await response.json(), false);
3416
- } catch (error) {
3417
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3388
+ return this.handleHttpError(url.toString(), response);
3418
3389
  }
3390
+ return ListKeysResponseFromJSONTyped(await response.json(), false);
3419
3391
  }
3420
3392
  /** {@inheritDoc IKmsRestClient.kmsStoreKey} */
3421
3393
  async kmsClientStoreKey(args) {
@@ -3434,13 +3406,9 @@ var KmsRestClient = class _KmsRestClient {
3434
3406
  });
3435
3407
  logger.debug(`store key response: ${response}`);
3436
3408
  if (!response.ok) {
3437
- return Promise.reject(await response.json());
3438
- }
3439
- try {
3440
- return StoreKeyResponseFromJSONTyped(await response.json(), false);
3441
- } catch (error) {
3442
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3409
+ return this.handleHttpError(url, response);
3443
3410
  }
3411
+ return StoreKeyResponseFromJSONTyped(await response.json(), false);
3444
3412
  }
3445
3413
  /** {@inheritDoc IKmsRestClient.kmsGenerateKey} */
3446
3414
  async kmsClientGenerateKey(args) {
@@ -3461,13 +3429,9 @@ var KmsRestClient = class _KmsRestClient {
3461
3429
  });
3462
3430
  logger.debug(`generate key response: ${response}`);
3463
3431
  if (!response.ok) {
3464
- return Promise.reject(await response.json());
3465
- }
3466
- try {
3467
- return GenerateKeyResponseFromJSONTyped(await response.json(), false);
3468
- } catch (error) {
3469
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3432
+ return this.handleHttpError(url, response);
3470
3433
  }
3434
+ return GenerateKeyResponseFromJSONTyped(await response.json(), false);
3471
3435
  }
3472
3436
  /** {@inheritDoc IKmsRestClient.kmsDeleteKey} */
3473
3437
  async kmsClientDeleteKey(args) {
@@ -3476,8 +3440,9 @@ var KmsRestClient = class _KmsRestClient {
3476
3440
  const response = await fetch(url, {
3477
3441
  method: "DELETE"
3478
3442
  });
3443
+ logger.debug(`delete key response: ${response}`);
3479
3444
  if (!response.ok) {
3480
- return Promise.reject(await response.json());
3445
+ return this.handleHttpError(url, response);
3481
3446
  }
3482
3447
  return true;
3483
3448
  }
@@ -3490,13 +3455,9 @@ var KmsRestClient = class _KmsRestClient {
3490
3455
  });
3491
3456
  logger.debug(`get provider response: ${response}`);
3492
3457
  if (!response.ok) {
3493
- return Promise.reject(await response.json());
3494
- }
3495
- try {
3496
- return KeyProviderResponseFromJSONTyped(await response.json(), false);
3497
- } catch (error) {
3498
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3458
+ return this.handleHttpError(url, response);
3499
3459
  }
3460
+ return KeyProviderResponseFromJSONTyped(await response.json(), false);
3500
3461
  }
3501
3462
  /** {@inheritDoc IKmsRestClient.kmsListKeyProviders} */
3502
3463
  async kmsClientListKeyProviders(args) {
@@ -3507,13 +3468,9 @@ var KmsRestClient = class _KmsRestClient {
3507
3468
  });
3508
3469
  logger.debug(`list providers response: ${response}`);
3509
3470
  if (!response.ok) {
3510
- return Promise.reject(await response.json());
3511
- }
3512
- try {
3513
- return ListKeyProvidersResponseFromJSONTyped(await response.json(), false);
3514
- } catch (error) {
3515
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3471
+ return this.handleHttpError(url, response);
3516
3472
  }
3473
+ return ListKeyProvidersResponseFromJSONTyped(await response.json(), false);
3517
3474
  }
3518
3475
  /** {@inheritDoc IKmsRestClient.kmsProviderListKeys} */
3519
3476
  async kmsClientProviderListKeys(args) {
@@ -3524,13 +3481,9 @@ var KmsRestClient = class _KmsRestClient {
3524
3481
  });
3525
3482
  logger.debug(`list provider keys response: ${response}`);
3526
3483
  if (!response.ok) {
3527
- return Promise.reject(await response.json());
3528
- }
3529
- try {
3530
- return ListKeysResponseFromJSONTyped(await response.json(), false);
3531
- } catch (error) {
3532
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3484
+ return this.handleHttpError(url, response);
3533
3485
  }
3486
+ return ListKeysResponseFromJSONTyped(await response.json(), false);
3534
3487
  }
3535
3488
  /** {@inheritDoc IKmsRestClient.kmsProviderStoreKey} */
3536
3489
  async kmsClientProviderStoreKey(args) {
@@ -3549,13 +3502,9 @@ var KmsRestClient = class _KmsRestClient {
3549
3502
  });
3550
3503
  logger.debug(`provider store key response: ${response}`);
3551
3504
  if (!response.ok) {
3552
- return Promise.reject(await response.json());
3553
- }
3554
- try {
3555
- return StoreKeyResponseFromJSONTyped(await response.json(), false);
3556
- } catch (error) {
3557
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3505
+ return this.handleHttpError(url, response);
3558
3506
  }
3507
+ return StoreKeyResponseFromJSONTyped(await response.json(), false);
3559
3508
  }
3560
3509
  /** {@inheritDoc IKmsRestClient.kmsProviderGenerateKey} */
3561
3510
  async kmsClientProviderGenerateKey(args) {
@@ -3575,13 +3524,9 @@ var KmsRestClient = class _KmsRestClient {
3575
3524
  });
3576
3525
  logger.debug(`provider generate key response: ${response}`);
3577
3526
  if (!response.ok) {
3578
- return Promise.reject(await response.json());
3579
- }
3580
- try {
3581
- return GenerateKeyResponseFromJSONTyped(await response.json(), false);
3582
- } catch (error) {
3583
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3527
+ return this.handleHttpError(url, response);
3584
3528
  }
3529
+ return GenerateKeyResponseFromJSONTyped(await response.json(), false);
3585
3530
  }
3586
3531
  /** {@inheritDoc IKmsRestClient.kmsProviderGetKey} */
3587
3532
  async kmsClientProviderGetKey(args) {
@@ -3592,13 +3537,9 @@ var KmsRestClient = class _KmsRestClient {
3592
3537
  });
3593
3538
  logger.debug(`get provider key response: ${response}`);
3594
3539
  if (!response.ok) {
3595
- return Promise.reject(await response.json());
3596
- }
3597
- try {
3598
- return GetKeyResponseFromJSONTyped(await response.json(), false);
3599
- } catch (error) {
3600
- return Promise.reject(Error(`request to ${url} returned ${error}`));
3540
+ return this.handleHttpError(url, response);
3601
3541
  }
3542
+ return GetKeyResponseFromJSONTyped(await response.json(), false);
3602
3543
  }
3603
3544
  /** {@inheritDoc IKmsRestClient.kmsProviderDeleteKey} */
3604
3545
  async kmsClientProviderDeleteKey(args) {
@@ -3607,8 +3548,9 @@ var KmsRestClient = class _KmsRestClient {
3607
3548
  const response = await fetch(url, {
3608
3549
  method: "DELETE"
3609
3550
  });
3551
+ logger.debug(`delete key response: ${response}`);
3610
3552
  if (!response.ok) {
3611
- return Promise.reject(await response.json());
3553
+ return this.handleHttpError(url, response);
3612
3554
  }
3613
3555
  return true;
3614
3556
  }
@@ -3640,6 +3582,12 @@ var KmsRestClient = class _KmsRestClient {
3640
3582
  }
3641
3583
  return url;
3642
3584
  }
3585
+ async handleHttpError(url, response) {
3586
+ const contentType = response.headers.get("content-type");
3587
+ const isJson = contentType?.includes("application/json");
3588
+ const responseBody = isJson ? JSON.stringify(await response.json()) : await response.text();
3589
+ return Promise.reject(Error(`request to ${url} returned http error ${response.status} - ${responseBody}`));
3590
+ }
3643
3591
  };
3644
3592
  export {
3645
3593
  AwsAssumeRoleCredentialsFromJSON,