@azure/keyvault-keys 4.4.0-beta.2 → 4.4.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +37 -1
  2. package/README.md +11 -10
  3. package/dist/index.js +332 -295
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/keyvault-common/src/challengeBasedAuthenticationPolicy.js +14 -25
  6. package/dist-esm/keyvault-common/src/challengeBasedAuthenticationPolicy.js.map +1 -1
  7. package/dist-esm/keyvault-common/src/index.js +1 -0
  8. package/dist-esm/keyvault-common/src/index.js.map +1 -1
  9. package/dist-esm/keyvault-common/src/parseKeyvaultIdentifier.js +1 -1
  10. package/dist-esm/keyvault-common/src/parseKeyvaultIdentifier.js.map +1 -1
  11. package/dist-esm/keyvault-common/src/parseWWWAuthenticate.js +52 -0
  12. package/dist-esm/keyvault-common/src/parseWWWAuthenticate.js.map +1 -0
  13. package/dist-esm/keyvault-common/src/tracingHelpers.js +4 -4
  14. package/dist-esm/keyvault-common/src/tracingHelpers.js.map +1 -1
  15. package/dist-esm/keyvault-keys/src/constants.js +1 -1
  16. package/dist-esm/keyvault-keys/src/constants.js.map +1 -1
  17. package/dist-esm/keyvault-keys/src/cryptography/aesCryptographyProvider.js +7 -7
  18. package/dist-esm/keyvault-keys/src/cryptography/aesCryptographyProvider.js.map +1 -1
  19. package/dist-esm/keyvault-keys/src/cryptography/crypto.js +2 -2
  20. package/dist-esm/keyvault-keys/src/cryptography/crypto.js.map +1 -1
  21. package/dist-esm/keyvault-keys/src/cryptography/models.js.map +1 -1
  22. package/dist-esm/keyvault-keys/src/cryptography/remoteCryptographyProvider.js +11 -12
  23. package/dist-esm/keyvault-keys/src/cryptography/remoteCryptographyProvider.js.map +1 -1
  24. package/dist-esm/keyvault-keys/src/cryptography/rsaCryptographyProvider.js +7 -9
  25. package/dist-esm/keyvault-keys/src/cryptography/rsaCryptographyProvider.js.map +1 -1
  26. package/dist-esm/keyvault-keys/src/cryptographyClient.js +10 -11
  27. package/dist-esm/keyvault-keys/src/cryptographyClient.js.map +1 -1
  28. package/dist-esm/keyvault-keys/src/cryptographyClientModels.js +36 -2
  29. package/dist-esm/keyvault-keys/src/cryptographyClientModels.js.map +1 -1
  30. package/dist-esm/keyvault-keys/src/generated/keyVaultClient.js +4 -50
  31. package/dist-esm/keyvault-keys/src/generated/keyVaultClient.js.map +1 -1
  32. package/dist-esm/keyvault-keys/src/generated/keyVaultClientContext.js +2 -2
  33. package/dist-esm/keyvault-keys/src/generated/keyVaultClientContext.js.map +1 -1
  34. package/dist-esm/keyvault-keys/src/generated/models/index.js +6 -21
  35. package/dist-esm/keyvault-keys/src/generated/models/index.js.map +1 -1
  36. package/dist-esm/keyvault-keys/src/generated/models/mappers.js +36 -29
  37. package/dist-esm/keyvault-keys/src/generated/models/mappers.js.map +1 -1
  38. package/dist-esm/keyvault-keys/src/generated/models/parameters.js +4 -16
  39. package/dist-esm/keyvault-keys/src/generated/models/parameters.js.map +1 -1
  40. package/dist-esm/keyvault-keys/src/identifier.js.map +1 -1
  41. package/dist-esm/keyvault-keys/src/index.js +32 -42
  42. package/dist-esm/keyvault-keys/src/index.js.map +1 -1
  43. package/dist-esm/keyvault-keys/src/keysModels.js +5 -2
  44. package/dist-esm/keyvault-keys/src/keysModels.js.map +1 -1
  45. package/dist-esm/keyvault-keys/src/lro/delete/poller.js.map +1 -1
  46. package/dist-esm/keyvault-keys/src/lro/keyVaultKeyPoller.js +1 -1
  47. package/dist-esm/keyvault-keys/src/lro/keyVaultKeyPoller.js.map +1 -1
  48. package/dist-esm/keyvault-keys/src/lro/recover/poller.js.map +1 -1
  49. package/dist-esm/keyvault-keys/src/transformations.js +12 -13
  50. package/dist-esm/keyvault-keys/src/transformations.js.map +1 -1
  51. package/package.json +16 -32
  52. package/types/keyvault-keys.d.ts +93 -36
@@ -1,11 +1,11 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import { KnownJsonWebKeyType as KnownKeyTypes } from "./generated/models";
3
+ import { KnownJsonWebKeyType as KnownKeyTypes, } from "./generated/models";
4
4
  export { KnownKeyTypes };
5
5
  /**
6
6
  * The latest supported Key Vault service API version
7
7
  */
8
- export const LATEST_API_VERSION = "7.3-preview";
8
+ export const LATEST_API_VERSION = "7.3";
9
9
  /** Known values of {@link KeyOperation} that the service accepts. */
10
10
  export var KnownKeyOperations;
11
11
  (function (KnownKeyOperations) {
@@ -27,8 +27,11 @@ export var KnownKeyOperations;
27
27
  /** Known values of {@link KeyExportEncryptionAlgorithm} that the service accepts. */
28
28
  export var KnownKeyExportEncryptionAlgorithm;
29
29
  (function (KnownKeyExportEncryptionAlgorithm) {
30
+ /** CKM_RSA_AES_KEY_WRAP Key Export Encryption Algorithm */
30
31
  KnownKeyExportEncryptionAlgorithm["CkmRsaAesKeyWrap"] = "CKM_RSA_AES_KEY_WRAP";
32
+ /** RSA_AES_KEY_WRAP_256 Key Export Encryption Algorithm */
31
33
  KnownKeyExportEncryptionAlgorithm["RsaAesKeyWrap256"] = "RSA_AES_KEY_WRAP_256";
34
+ /** RSA_AES_KEY_WRAP_384 Key Export Encryption Algorithm */
32
35
  KnownKeyExportEncryptionAlgorithm["RsaAesKeyWrap384"] = "RSA_AES_KEY_WRAP_384";
33
36
  })(KnownKeyExportEncryptionAlgorithm || (KnownKeyExportEncryptionAlgorithm = {}));
34
37
  //# sourceMappingURL=keysModels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keysModels.js","sourceRoot":"","sources":["../../../src/keysModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAGL,mBAAmB,IAAI,aAAa,EAErC,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAW,aAAa,EAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAmiBhD,qEAAqE;AACrE,MAAM,CAAN,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B,8BAA8B;IAC9B,yCAAmB,CAAA;IACnB,8BAA8B;IAC9B,yCAAmB,CAAA;IACnB,2BAA2B;IAC3B,mCAAa,CAAA;IACb,6BAA6B;IAC7B,uCAAiB,CAAA;IACjB,8BAA8B;IAC9B,yCAAmB,CAAA;IACnB,gCAAgC;IAChC,6CAAuB,CAAA;IACvB,6BAA6B;IAC7B,uCAAiB,CAAA;AACnB,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB,QAe7B;AAED,qFAAqF;AACrF,MAAM,CAAN,IAAY,iCAIX;AAJD,WAAY,iCAAiC;IAC3C,8EAAyC,CAAA;IACzC,8EAAyC,CAAA;IACzC,8EAAyC,CAAA;AAC3C,CAAC,EAJW,iCAAiC,KAAjC,iCAAiC,QAI5C","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as coreHttp from \"@azure/core-http\";\nimport {\n DeletionRecoveryLevel,\n JsonWebKeyType as KeyType,\n KnownJsonWebKeyType as KnownKeyTypes,\n JsonWebKeyOperation as KeyOperation\n} from \"./generated/models\";\nimport { KeyCurveName } from \"./cryptographyClientModels\";\n\nexport { KeyType, KnownKeyTypes, KeyOperation };\n\n/**\n * The latest supported Key Vault service API version\n */\nexport const LATEST_API_VERSION = \"7.3-preview\";\n\n/**\n * The optional parameters accepted by the KeyVault's KeyClient\n */\nexport interface KeyClientOptions extends coreHttp.PipelineOptions {\n /**\n * The version of the KeyVault's service API to make calls against.\n */\n serviceVersion?: string;\n}\n\n/**\n * The optional parameters accepted by the KeyVault's CryptographyClient\n */\nexport interface CryptographyClientOptions extends KeyClientOptions {}\n\n/**\n * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18\n */\nexport interface JsonWebKey {\n /**\n * Key identifier.\n */\n kid?: string;\n /**\n * JsonWebKey Key Type (kty), as defined in\n * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:\n * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', \"oct-HSM\"\n */\n kty?: KeyType;\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n *\n * @deprecated Use {@link key_ops} instead. keyOps will be removed in version 5.x of `@azure/keyvault-keys`.\n */\n keyOps?: KeyOperation[];\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n */\n key_ops?: KeyOperation[];\n /**\n * RSA modulus.\n */\n n?: Uint8Array;\n /**\n * RSA public exponent.\n */\n e?: Uint8Array;\n /**\n * RSA private exponent, or the D component of an EC private key.\n */\n d?: Uint8Array;\n /**\n * RSA private key parameter.\n */\n dp?: Uint8Array;\n /**\n * RSA private key parameter.\n */\n dq?: Uint8Array;\n /**\n * RSA private key parameter.\n */\n qi?: Uint8Array;\n /**\n * RSA secret prime.\n */\n p?: Uint8Array;\n /**\n * RSA secret prime, with `p < q`.\n */\n q?: Uint8Array;\n /**\n * Symmetric key.\n */\n k?: Uint8Array;\n /**\n * HSM Token, used with 'Bring Your Own Key'.\n */\n t?: Uint8Array;\n /**\n * Elliptic curve name. For valid values, see KeyCurveName. Possible values include:\n * 'P-256', 'P-384', 'P-521', 'P-256K'\n */\n crv?: KeyCurveName;\n /**\n * X component of an EC public key.\n */\n x?: Uint8Array;\n /**\n * Y component of an EC public key.\n */\n y?: Uint8Array;\n}\n\n/**\n * An interface representing a Key Vault Key, with its name, value and {@link KeyProperties}.\n */\nexport interface KeyVaultKey {\n /**\n * The key value.\n */\n key?: JsonWebKey;\n /**\n * The name of the key.\n */\n name: string;\n /**\n * Key identifier.\n */\n id?: string;\n /**\n * JsonWebKey Key Type (kty), as defined in\n * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:\n * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', \"oct-HSM\"\n */\n keyType?: KeyType;\n /**\n * Operations allowed on this key\n */\n keyOperations?: KeyOperation[];\n /**\n * The properties of the key.\n */\n properties: KeyProperties;\n}\n\n/**\n * An interface representing the Properties of {@link KeyVaultKey}\n */\nexport interface KeyProperties {\n /**\n * Key identifier.\n */\n id?: string;\n /**\n * The name of the key.\n */\n name: string;\n /**\n * The vault URI.\n */\n vaultUrl: string;\n /**\n * The version of the key. May be undefined.\n */\n version?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n expiresOn?: Date;\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Creation time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly createdOn?: Date;\n /**\n * Last updated time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly updatedOn?: Date;\n /**\n * Reflects the deletion recovery level currently in effect for keys in the current vault.\n * If it contains 'Purgeable' the key can be permanently deleted by a privileged\n * user; otherwise, only the system can purge the key, at the end of the\n * retention interval. Possible values include: 'Purgeable',\n * 'Recoverable+Purgeable', 'Recoverable',\n * 'Recoverable+ProtectedSubscription'\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly recoveryLevel?: DeletionRecoveryLevel;\n /**\n * The retention dates of the softDelete data.\n * The value should be `>=7` and `<=90` when softDelete enabled.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n recoverableDays?: number;\n\n /**\n * True if the secret's lifetime is managed by\n * key vault. If this is a secret backing a certificate, then managed will be\n * true.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly managed?: boolean;\n\n /**\n * Indicates whether the private key can be exported.\n */\n exportable?: boolean;\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * An interface representing a deleted Key Vault Key.\n */\nexport interface DeletedKey {\n /**\n * The key value.\n */\n key?: JsonWebKey;\n /**\n * The name of the key.\n */\n name: string;\n /**\n * Key identifier.\n */\n id?: string;\n /**\n * JsonWebKey Key Type (kty), as defined in\n * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:\n * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', \"oct-HSM\"\n */\n keyType?: KeyType;\n /**\n * Operations allowed on this key\n */\n keyOperations?: KeyOperation[];\n /**\n * The properties of the key.\n */\n properties: KeyProperties & {\n /**\n * The url of the recovery object, used to\n * identify and recover the deleted key.\n */\n readonly recoveryId?: string;\n /**\n * The time when the key is scheduled to be purged, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly scheduledPurgeDate?: Date;\n /**\n * The time when the key was deleted, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n deletedOn?: Date;\n };\n}\n\n/**\n * The policy rules under which a key can be exported.\n */\nexport interface KeyReleasePolicy {\n /**\n * Content type and version of key release policy.\n *\n * Defaults to \"application/json; charset=utf-8\" if omitted.\n */\n contentType?: string;\n\n /** Blob encoding the policy rules under which the key can be released. */\n data?: Uint8Array;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createKey}\n */\nexport interface CreateKeyOptions extends coreHttp.OperationOptions {\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n */\n keyOps?: KeyOperation[];\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n /**\n * The key size in bits. For example: 2048, 3072, or 4096 for RSA.\n */\n keySize?: number;\n /**\n * Elliptic curve name. For valid values, see KeyCurveName.\n * Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K'\n */\n curve?: KeyCurveName;\n /**\n * Whether to import as a hardware key (HSM) or software key.\n */\n hsm?: boolean;\n\n /**\n * Indicates whether the private key can be exported.\n */\n exportable?: boolean;\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteKey} and {@link beginRecoverDeletedKey}\n */\nexport interface KeyPollerOptions extends coreHttp.OperationOptions {\n /**\n * Time between each polling\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteKey}\n */\nexport interface BeginDeleteKeyOptions extends KeyPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRecoverDeletedKey}\n */\nexport interface BeginRecoverDeletedKeyOptions extends KeyPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createEcKey}\n */\nexport interface CreateEcKeyOptions extends CreateKeyOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createRsaKey}\n */\nexport interface CreateRsaKeyOptions extends CreateKeyOptions {\n /** The public exponent for a RSA key. */\n publicExponent?: number;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createOctKey}\n */\nexport interface CreateOctKeyOptions extends CreateKeyOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link importKey}\n */\nexport interface ImportKeyOptions extends coreHttp.OperationOptions {\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Whether to import as a hardware key (HSM) or software key.\n */\n hardwareProtected?: boolean;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n expiresOn?: Date;\n\n /**\n * Indicates whether the private key can be exported.\n */\n exportable?: boolean;\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * Options for {@link updateKeyProperties}.\n */\nexport interface UpdateKeyPropertiesOptions extends coreHttp.OperationOptions {\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n */\n keyOps?: KeyOperation[];\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n expiresOn?: Date;\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n * Only valid if the key is marked exportable, which cannot be changed after key creation.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * Options for {@link getKey}.\n */\nexport interface GetKeyOptions extends coreHttp.OperationOptions {\n /**\n * The version of the secret to retrieve. If not\n * specified the latest version of the secret will be retrieved.\n */\n version?: string;\n}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listKeys}.\n */\nexport interface ListKeysOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listPropertiesOfKeys}.\n */\nexport interface ListPropertiesOfKeysOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listPropertiesOfKeyVersions}.\n */\nexport interface ListPropertiesOfKeyVersionsOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listDeletedKeys}.\n */\nexport interface ListDeletedKeysOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link getDeletedKey}.\n */\nexport interface GetDeletedKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link purgeDeletedKey}.\n */\nexport interface PurgeDeletedKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link recoverDeletedKey}.\n */\nexport interface RecoverDeletedKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link deleteKey}.\n */\nexport interface DeleteKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link backupKey}.\n */\nexport interface BackupKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link restoreKeyBackup}.\n */\nexport interface RestoreKeyBackupOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing the options of the cryptography API methods, go to the {@link CryptographyClient} for more information.\n */\nexport interface CryptographyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link KeyClient.getRandomBytes}\n */\nexport interface GetRandomBytesOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link KeyClient.releaseKey}\n */\nexport interface ReleaseKeyOptions extends coreHttp.OperationOptions {\n /** A client provided nonce for freshness. */\n nonce?: string;\n\n /** The {@link KeyExportEncryptionAlgorithm} to for protecting the exported key material. */\n algorithm?: KeyExportEncryptionAlgorithm;\n\n /**\n * The version of the key to release. Defaults to the latest version of the key if omitted.\n */\n version?: string;\n}\n\n/**\n * Result of the {@link KeyClient.releaseKey} operation.\n */\nexport interface ReleaseKeyResult {\n /** A signed token containing the released key. */\n value: string;\n}\n\n/** Known values of {@link KeyOperation} that the service accepts. */\nexport enum KnownKeyOperations {\n /** Key operation - encrypt */\n Encrypt = \"encrypt\",\n /** Key operation - decrypt */\n Decrypt = \"decrypt\",\n /** Key operation - sign */\n Sign = \"sign\",\n /** Key operation - verify */\n Verify = \"verify\",\n /** Key operation - wrapKey */\n WrapKey = \"wrapKey\",\n /** Key operation - unwrapKey */\n UnwrapKey = \"unwrapKey\",\n /** Key operation - import */\n Import = \"import\"\n}\n\n/** Known values of {@link KeyExportEncryptionAlgorithm} that the service accepts. */\nexport enum KnownKeyExportEncryptionAlgorithm {\n CkmRsaAesKeyWrap = \"CKM_RSA_AES_KEY_WRAP\",\n RsaAesKeyWrap256 = \"RSA_AES_KEY_WRAP_256\",\n RsaAesKeyWrap384 = \"RSA_AES_KEY_WRAP_384\"\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Defines values for KeyEncryptionAlgorithm.\n * {@link KnownKeyExportEncryptionAlgorithm} can be used interchangeably with KeyEncryptionAlgorithm,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **CKM_RSA_AES_KEY_WRAP** \\\n * **RSA_AES_KEY_WRAP_256** \\\n * **RSA_AES_KEY_WRAP_384**\n */\nexport type KeyExportEncryptionAlgorithm = string;\n/* eslint-enable tsdoc/syntax */\n\n/**\n * Result of the {@link KeyClient.getRandomBytes} operation.\n */\nexport interface RandomBytes {\n /** The random bytes returned by the service. */\n bytes: Uint8Array;\n}\n\n/**\n * Options for {@link KeyClient.getCryptographyClient}.\n */\nexport interface GetCryptographyClientOptions {\n /**\n * The version of the key to use for cryptographic operations.\n *\n * When undefined, the latest version of the key will be used.\n */\n keyVersion?: string;\n}\n\n/**\n * Options for {@link KeyClient.rotateKey}\n */\nexport interface RotateKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * The properties of a key rotation policy that the client can set for a given key.\n *\n * You may also reset the key rotation policy to its default values by setting lifetimeActions to an empty array.\n */\nexport interface KeyRotationPolicyProperties {\n /**\n * Optional key expiration period used to define the duration after which a newly rotated key will expire, defined as an ISO 8601 duration.\n */\n expiresIn?: string;\n\n /**\n * Actions that will be performed by Key Vault over the lifetime of a key.\n *\n * You may also pass an empty array to restore to its default values.\n */\n lifetimeActions?: KeyRotationLifetimeAction[];\n}\n\n/**\n * The complete key rotation policy that belongs to a key.\n */\nexport interface KeyRotationPolicy extends KeyRotationPolicyProperties {\n /**\n * The identifier of the Key Rotation Policy.\n * May be undefined if a policy has not been explicitly set.\n */\n readonly id?: string;\n\n /**\n * The created time in UTC.\n * May be undefined if a policy has not been explicitly set.\n */\n readonly createdOn?: Date;\n\n /**\n * The last updated time in UTC.\n * May be undefined if a policy has not been explicitly set.\n */\n readonly updatedOn?: Date;\n}\n\n/**\n * An action and its corresponding trigger that will be performed by Key Vault over the lifetime of a key.\n */\nexport interface KeyRotationLifetimeAction {\n /**\n * Time after creation to attempt the specified action, defined as an ISO 8601 duration.\n */\n timeAfterCreate?: string;\n\n /**\n * Time before expiry to attempt the specified action, defined as an ISO 8601 duration.\n */\n timeBeforeExpiry?: string;\n\n /**\n * The action that will be executed.\n */\n action: KeyRotationPolicyAction;\n}\n\n/**\n * The action that will be executed.\n */\nexport type KeyRotationPolicyAction = \"Rotate\" | \"Notify\";\n\n/**\n * Options for {@link KeyClient.updateKeyRotationPolicy}\n */\nexport interface UpdateKeyRotationPolicyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link KeyClient.getRotationPolicy}\n */\nexport interface GetKeyRotationPolicyOptions extends coreHttp.OperationOptions {}\n"]}
1
+ {"version":3,"file":"keysModels.js","sourceRoot":"","sources":["../../../src/keysModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAIL,mBAAmB,IAAI,aAAa,GACrC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAW,aAAa,EAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAqiBxC,qEAAqE;AACrE,MAAM,CAAN,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B,8BAA8B;IAC9B,yCAAmB,CAAA;IACnB,8BAA8B;IAC9B,yCAAmB,CAAA;IACnB,2BAA2B;IAC3B,mCAAa,CAAA;IACb,6BAA6B;IAC7B,uCAAiB,CAAA;IACjB,8BAA8B;IAC9B,yCAAmB,CAAA;IACnB,gCAAgC;IAChC,6CAAuB,CAAA;IACvB,6BAA6B;IAC7B,uCAAiB,CAAA;AACnB,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB,QAe7B;AAED,qFAAqF;AACrF,MAAM,CAAN,IAAY,iCAOX;AAPD,WAAY,iCAAiC;IAC3C,2DAA2D;IAC3D,8EAAyC,CAAA;IACzC,2DAA2D;IAC3D,8EAAyC,CAAA;IACzC,2DAA2D;IAC3D,8EAAyC,CAAA;AAC3C,CAAC,EAPW,iCAAiC,KAAjC,iCAAiC,QAO5C","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as coreHttp from \"@azure/core-http\";\n\nimport {\n DeletionRecoveryLevel,\n JsonWebKeyOperation as KeyOperation,\n JsonWebKeyType as KeyType,\n KnownJsonWebKeyType as KnownKeyTypes,\n} from \"./generated/models\";\n\nimport { KeyCurveName } from \"./cryptographyClientModels\";\n\nexport { KeyType, KnownKeyTypes, KeyOperation };\n\n/**\n * The latest supported Key Vault service API version\n */\nexport const LATEST_API_VERSION = \"7.3\";\n\n/**\n * The optional parameters accepted by the KeyVault's KeyClient\n */\nexport interface KeyClientOptions extends coreHttp.PipelineOptions {\n /**\n * The version of the KeyVault's service API to make calls against.\n */\n serviceVersion?: string;\n}\n\n/**\n * The optional parameters accepted by the KeyVault's CryptographyClient\n */\nexport interface CryptographyClientOptions extends KeyClientOptions {}\n\n/**\n * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18\n */\nexport interface JsonWebKey {\n /**\n * Key identifier.\n */\n kid?: string;\n /**\n * JsonWebKey Key Type (kty), as defined in\n * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:\n * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', \"oct-HSM\"\n */\n kty?: KeyType;\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n */\n keyOps?: KeyOperation[];\n /**\n * RSA modulus.\n */\n n?: Uint8Array;\n /**\n * RSA public exponent.\n */\n e?: Uint8Array;\n /**\n * RSA private exponent, or the D component of an EC private key.\n */\n d?: Uint8Array;\n /**\n * RSA private key parameter.\n */\n dp?: Uint8Array;\n /**\n * RSA private key parameter.\n */\n dq?: Uint8Array;\n /**\n * RSA private key parameter.\n */\n qi?: Uint8Array;\n /**\n * RSA secret prime.\n */\n p?: Uint8Array;\n /**\n * RSA secret prime, with `p < q`.\n */\n q?: Uint8Array;\n /**\n * Symmetric key.\n */\n k?: Uint8Array;\n /**\n * HSM Token, used with 'Bring Your Own Key'.\n */\n t?: Uint8Array;\n /**\n * Elliptic curve name. For valid values, see KeyCurveName. Possible values include:\n * 'P-256', 'P-384', 'P-521', 'P-256K'\n */\n crv?: KeyCurveName;\n /**\n * X component of an EC public key.\n */\n x?: Uint8Array;\n /**\n * Y component of an EC public key.\n */\n y?: Uint8Array;\n}\n\n/**\n * An interface representing a Key Vault Key, with its name, value and {@link KeyProperties}.\n */\nexport interface KeyVaultKey {\n /**\n * The key value.\n */\n key?: JsonWebKey;\n /**\n * The name of the key.\n */\n name: string;\n /**\n * Key identifier.\n */\n id?: string;\n /**\n * JsonWebKey Key Type (kty), as defined in\n * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:\n * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', \"oct-HSM\"\n */\n keyType?: KeyType;\n /**\n * Operations allowed on this key\n */\n keyOperations?: KeyOperation[];\n /**\n * The properties of the key.\n */\n properties: KeyProperties;\n}\n\n/**\n * An interface representing the Properties of {@link KeyVaultKey}\n */\nexport interface KeyProperties {\n /**\n * Key identifier.\n */\n id?: string;\n /**\n * The name of the key.\n */\n name: string;\n /**\n * The vault URI.\n */\n vaultUrl: string;\n /**\n * The version of the key. May be undefined.\n */\n version?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n expiresOn?: Date;\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Creation time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly createdOn?: Date;\n /**\n * Last updated time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly updatedOn?: Date;\n /**\n * Reflects the deletion recovery level currently in effect for keys in the current vault.\n * If it contains 'Purgeable' the key can be permanently deleted by a privileged\n * user; otherwise, only the system can purge the key, at the end of the\n * retention interval. Possible values include: 'Purgeable',\n * 'Recoverable+Purgeable', 'Recoverable',\n * 'Recoverable+ProtectedSubscription'\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly recoveryLevel?: DeletionRecoveryLevel;\n /**\n * The retention dates of the softDelete data.\n * The value should be `>=7` and `<=90` when softDelete enabled.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n recoverableDays?: number;\n\n /**\n * True if the secret's lifetime is managed by\n * key vault. If this is a secret backing a certificate, then managed will be\n * true.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly managed?: boolean;\n\n /**\n * Indicates whether the private key can be exported.\n */\n exportable?: boolean;\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * An interface representing a deleted Key Vault Key.\n */\nexport interface DeletedKey {\n /**\n * The key value.\n */\n key?: JsonWebKey;\n /**\n * The name of the key.\n */\n name: string;\n /**\n * Key identifier.\n */\n id?: string;\n /**\n * JsonWebKey Key Type (kty), as defined in\n * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:\n * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', \"oct-HSM\"\n */\n keyType?: KeyType;\n /**\n * Operations allowed on this key\n */\n keyOperations?: KeyOperation[];\n /**\n * The properties of the key.\n */\n properties: KeyProperties & {\n /**\n * The url of the recovery object, used to\n * identify and recover the deleted key.\n */\n readonly recoveryId?: string;\n /**\n * The time when the key is scheduled to be purged, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly scheduledPurgeDate?: Date;\n /**\n * The time when the key was deleted, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n deletedOn?: Date;\n };\n}\n\n/**\n * The policy rules under which a key can be exported.\n */\nexport interface KeyReleasePolicy {\n /**\n * Content type and version of key release policy.\n *\n * Defaults to \"application/json; charset=utf-8\" if omitted.\n */\n contentType?: string;\n\n /**\n * The policy rules under which the key can be released. Encoded based on the {@link KeyReleasePolicy.contentType}.\n *\n * For more information regarding the release policy grammar for Azure Key Vault, please refer to:\n * - https://aka.ms/policygrammarkeys for Azure Key Vault release policy grammar.\n * - https://aka.ms/policygrammarmhsm for Azure Managed HSM release policy grammar.\n */\n encodedPolicy?: Uint8Array;\n\n /** Marks a release policy as immutable. An immutable release policy cannot be changed or updated after being marked immutable. */\n immutable?: boolean;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createKey}\n */\nexport interface CreateKeyOptions extends coreHttp.OperationOptions {\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n */\n keyOps?: KeyOperation[];\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n /**\n * The key size in bits. For example: 2048, 3072, or 4096 for RSA.\n */\n keySize?: number;\n /**\n * Elliptic curve name. For valid values, see KeyCurveName.\n * Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K'\n */\n curve?: KeyCurveName;\n /**\n * Whether to import as a hardware key (HSM) or software key.\n */\n hsm?: boolean;\n\n /**\n * Indicates whether the private key can be exported.\n */\n exportable?: boolean;\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteKey} and {@link beginRecoverDeletedKey}\n */\nexport interface KeyPollerOptions extends coreHttp.OperationOptions {\n /**\n * Time between each polling\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteKey}\n */\nexport interface BeginDeleteKeyOptions extends KeyPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRecoverDeletedKey}\n */\nexport interface BeginRecoverDeletedKeyOptions extends KeyPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createEcKey}\n */\nexport interface CreateEcKeyOptions extends CreateKeyOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createRsaKey}\n */\nexport interface CreateRsaKeyOptions extends CreateKeyOptions {\n /** The public exponent for a RSA key. */\n publicExponent?: number;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link createOctKey}\n */\nexport interface CreateOctKeyOptions extends CreateKeyOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link importKey}\n */\nexport interface ImportKeyOptions extends coreHttp.OperationOptions {\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Whether to import as a hardware key (HSM) or software key.\n */\n hardwareProtected?: boolean;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n expiresOn?: Date;\n\n /**\n * Indicates whether the private key can be exported.\n */\n exportable?: boolean;\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * Options for {@link updateKeyProperties}.\n */\nexport interface UpdateKeyPropertiesOptions extends coreHttp.OperationOptions {\n /**\n * Json web key operations. For more\n * information on possible key operations, see KeyOperation.\n */\n keyOps?: KeyOperation[];\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n expiresOn?: Date;\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n\n /**\n * A {@link KeyReleasePolicy} object specifying the rules under which the key can be exported.\n * Only valid if the key is marked exportable, which cannot be changed after key creation.\n */\n releasePolicy?: KeyReleasePolicy;\n}\n\n/**\n * Options for {@link getKey}.\n */\nexport interface GetKeyOptions extends coreHttp.OperationOptions {\n /**\n * The version of the secret to retrieve. If not\n * specified the latest version of the secret will be retrieved.\n */\n version?: string;\n}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listKeys}.\n */\nexport interface ListKeysOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listPropertiesOfKeys}.\n */\nexport interface ListPropertiesOfKeysOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listPropertiesOfKeyVersions}.\n */\nexport interface ListPropertiesOfKeyVersionsOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing optional parameters for KeyClient paged operations passed to {@link listDeletedKeys}.\n */\nexport interface ListDeletedKeysOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link getDeletedKey}.\n */\nexport interface GetDeletedKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link purgeDeletedKey}.\n */\nexport interface PurgeDeletedKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link recoverDeletedKey}.\n */\nexport interface RecoverDeletedKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link deleteKey}.\n */\nexport interface DeleteKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link backupKey}.\n */\nexport interface BackupKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link restoreKeyBackup}.\n */\nexport interface RestoreKeyBackupOptions extends coreHttp.OperationOptions {}\n\n/**\n * An interface representing the options of the cryptography API methods, go to the {@link CryptographyClient} for more information.\n */\nexport interface CryptographyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link KeyClient.getRandomBytes}\n */\nexport interface GetRandomBytesOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link KeyClient.releaseKey}\n */\nexport interface ReleaseKeyOptions extends coreHttp.OperationOptions {\n /** A client provided nonce for freshness. */\n nonce?: string;\n\n /** The {@link KeyExportEncryptionAlgorithm} to for protecting the exported key material. */\n algorithm?: KeyExportEncryptionAlgorithm;\n\n /**\n * The version of the key to release. Defaults to the latest version of the key if omitted.\n */\n version?: string;\n}\n\n/**\n * Result of the {@link KeyClient.releaseKey} operation.\n */\nexport interface ReleaseKeyResult {\n /** A signed token containing the released key. */\n value: string;\n}\n\n/** Known values of {@link KeyOperation} that the service accepts. */\nexport enum KnownKeyOperations {\n /** Key operation - encrypt */\n Encrypt = \"encrypt\",\n /** Key operation - decrypt */\n Decrypt = \"decrypt\",\n /** Key operation - sign */\n Sign = \"sign\",\n /** Key operation - verify */\n Verify = \"verify\",\n /** Key operation - wrapKey */\n WrapKey = \"wrapKey\",\n /** Key operation - unwrapKey */\n UnwrapKey = \"unwrapKey\",\n /** Key operation - import */\n Import = \"import\",\n}\n\n/** Known values of {@link KeyExportEncryptionAlgorithm} that the service accepts. */\nexport enum KnownKeyExportEncryptionAlgorithm {\n /** CKM_RSA_AES_KEY_WRAP Key Export Encryption Algorithm */\n CkmRsaAesKeyWrap = \"CKM_RSA_AES_KEY_WRAP\",\n /** RSA_AES_KEY_WRAP_256 Key Export Encryption Algorithm */\n RsaAesKeyWrap256 = \"RSA_AES_KEY_WRAP_256\",\n /** RSA_AES_KEY_WRAP_384 Key Export Encryption Algorithm */\n RsaAesKeyWrap384 = \"RSA_AES_KEY_WRAP_384\",\n}\n\n/* eslint-disable tsdoc/syntax */\n/**\n * Defines values for KeyEncryptionAlgorithm.\n * {@link KnownKeyExportEncryptionAlgorithm} can be used interchangeably with KeyEncryptionAlgorithm,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **CKM_RSA_AES_KEY_WRAP** \\\n * **RSA_AES_KEY_WRAP_256** \\\n * **RSA_AES_KEY_WRAP_384**\n */\nexport type KeyExportEncryptionAlgorithm = string;\n/* eslint-enable tsdoc/syntax */\n\n/**\n * Options for {@link KeyClient.getCryptographyClient}.\n */\nexport interface GetCryptographyClientOptions {\n /**\n * The version of the key to use for cryptographic operations.\n *\n * When undefined, the latest version of the key will be used.\n */\n keyVersion?: string;\n}\n\n/**\n * Options for {@link KeyClient.rotateKey}\n */\nexport interface RotateKeyOptions extends coreHttp.OperationOptions {}\n\n/**\n * The properties of a key rotation policy that the client can set for a given key.\n *\n * You may also reset the key rotation policy to its default values by setting lifetimeActions to an empty array.\n */\nexport interface KeyRotationPolicyProperties {\n /**\n * Optional key expiration period used to define the duration after which a newly rotated key will expire, defined as an ISO 8601 duration.\n */\n expiresIn?: string;\n\n /**\n * Actions that will be performed by Key Vault over the lifetime of a key.\n *\n * You may also pass an empty array to restore to its default values.\n */\n lifetimeActions?: KeyRotationLifetimeAction[];\n}\n\n/**\n * The complete key rotation policy that belongs to a key.\n */\nexport interface KeyRotationPolicy extends KeyRotationPolicyProperties {\n /**\n * The identifier of the Key Rotation Policy.\n * May be undefined if a policy has not been explicitly set.\n */\n readonly id?: string;\n\n /**\n * The created time in UTC.\n * May be undefined if a policy has not been explicitly set.\n */\n readonly createdOn?: Date;\n\n /**\n * The last updated time in UTC.\n * May be undefined if a policy has not been explicitly set.\n */\n readonly updatedOn?: Date;\n}\n\n/**\n * An action and its corresponding trigger that will be performed by Key Vault over the lifetime of a key.\n */\nexport interface KeyRotationLifetimeAction {\n /**\n * Time after creation to attempt the specified action, defined as an ISO 8601 duration.\n */\n timeAfterCreate?: string;\n\n /**\n * Time before expiry to attempt the specified action, defined as an ISO 8601 duration.\n */\n timeBeforeExpiry?: string;\n\n /**\n * The action that will be executed.\n */\n action: KeyRotationPolicyAction;\n}\n\n/**\n * The action that will be executed.\n */\nexport type KeyRotationPolicyAction = \"Rotate\" | \"Notify\";\n\n/**\n * Options for {@link KeyClient.updateKeyRotationPolicy}\n */\nexport interface UpdateKeyRotationPolicyOptions extends coreHttp.OperationOptions {}\n\n/**\n * Options for {@link KeyClient.getRotationPolicy}\n */\nexport interface GetKeyRotationPolicyOptions extends coreHttp.OperationOptions {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../../src/lro/delete/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAA4B,MAAM,sBAAsB,CAAC;AAEnF;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAA0D;IAC7F,YAAY,OAAiC;QAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE9F,IAAI,KAA8C,CAAC;QAEnD,IAAI,UAAU,EAAE;YACd,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;SACtC;QAED,MAAM,SAAS,GAAG,IAAI,sBAAsB,iCAErC,KAAK,KACR,IAAI,KAEN,QAAQ,EACR,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DeleteKeyPollOperation, DeleteKeyPollOperationState } from \"./operation\";\nimport { DeletedKey } from \"../../keysModels\";\nimport { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from \"../keyVaultKeyPoller\";\n\n/**\n * Class that creates a poller that waits until a key finishes being deleted.\n */\nexport class DeleteKeyPoller extends KeyVaultKeyPoller<DeleteKeyPollOperationState, DeletedKey> {\n constructor(options: KeyVaultKeyPollerOptions) {\n const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;\n\n let state: DeleteKeyPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new DeleteKeyPollOperation(\n {\n ...state,\n name\n },\n vaultUrl,\n client,\n operationOptions\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
1
+ {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../../src/lro/delete/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAA4B,MAAM,sBAAsB,CAAC;AAEnF;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAA0D;IAC7F,YAAY,OAAiC;QAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE9F,IAAI,KAA8C,CAAC;QAEnD,IAAI,UAAU,EAAE;YACd,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;SACtC;QAED,MAAM,SAAS,GAAG,IAAI,sBAAsB,iCAErC,KAAK,KACR,IAAI,KAEN,QAAQ,EACR,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DeleteKeyPollOperation, DeleteKeyPollOperationState } from \"./operation\";\nimport { DeletedKey } from \"../../keysModels\";\nimport { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from \"../keyVaultKeyPoller\";\n\n/**\n * Class that creates a poller that waits until a key finishes being deleted.\n */\nexport class DeleteKeyPoller extends KeyVaultKeyPoller<DeleteKeyPollOperationState, DeletedKey> {\n constructor(options: KeyVaultKeyPollerOptions) {\n const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;\n\n let state: DeleteKeyPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new DeleteKeyPollOperation(\n {\n ...state,\n name,\n },\n vaultUrl,\n client,\n operationOptions\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
@@ -48,7 +48,7 @@ export class KeyVaultKeyPollOperation {
48
48
  */
49
49
  toString() {
50
50
  return JSON.stringify({
51
- state: this.state
51
+ state: this.state,
52
52
  });
53
53
  }
54
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"keyVaultKeyPoller.js","sourceRoot":"","sources":["../../../../src/lro/keyVaultKeyPoller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAoB,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAqC,MAAM,iBAAiB,CAAC;AAyB5E;;GAEG;AACH,MAAM,OAAgB,iBAGpB,SAAQ,MAAuB;IAHjC;;QAIE;;WAEG;QACI,iBAAY,GAAW,IAAI,CAAC;IAQrC,CAAC;IANC;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;CACF;AASD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAGnC,YAAmB,KAAa,EAAE,UAA2C,EAAE;QAA5D,UAAK,GAAL,KAAK,CAAQ;QAFxB,kBAAa,GAAW,EAAE,CAAC;QAGjC,IAAI,OAAO,CAAC,aAAa,EAAE;YACzB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;SAC5C;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { delay, OperationOptions } from \"@azure/core-http\";\nimport { Poller, PollOperation, PollOperationState } from \"@azure/core-lro\";\nimport { KeyVaultClient } from \"../generated/keyVaultClient\";\n\n/**\n * Common parameters to a Key Vault Key Poller.\n */\nexport interface KeyVaultKeyPollerOptions {\n vaultUrl: string;\n client: KeyVaultClient;\n name: string;\n operationOptions?: OperationOptions;\n intervalInMs?: number;\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the state of a Key Vault Key Poller's operation.\n */\nexport interface KeyVaultKeyPollOperationState<TResult> extends PollOperationState<TResult> {\n /**\n * The name of the key.\n */\n name: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Key Pollers.\n */\nexport abstract class KeyVaultKeyPoller<\n TState extends KeyVaultKeyPollOperationState<TResult>,\n TResult\n> extends Poller<TState, TResult> {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n public intervalInMs: number = 2000;\n\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n async delay(): Promise<void> {\n return delay(this.intervalInMs);\n }\n}\n\n/**\n * Optional parameters to the KeyVaultKeyPollOperation\n */\nexport interface KeyVaultKeyPollOperationOptions {\n cancelMessage?: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Key Poller operations.\n */\nexport class KeyVaultKeyPollOperation<TState, TResult> implements PollOperation<TState, TResult> {\n private cancelMessage: string = \"\";\n\n constructor(public state: TState, options: KeyVaultKeyPollOperationOptions = {}) {\n if (options.cancelMessage) {\n this.cancelMessage = options.cancelMessage;\n }\n }\n\n /**\n * Meant to reach to the service and update the Poller operation.\n */\n public async update(): Promise<PollOperation<TState, TResult>> {\n throw new Error(\"Operation not supported.\");\n }\n\n /**\n * Meant to reach to the service and cancel the Poller operation.\n */\n public async cancel(): Promise<PollOperation<TState, TResult>> {\n throw new Error(this.cancelMessage);\n }\n\n /**\n * Serializes the Poller operation.\n */\n public toString(): string {\n return JSON.stringify({\n state: this.state\n });\n }\n}\n"]}
1
+ {"version":3,"file":"keyVaultKeyPoller.js","sourceRoot":"","sources":["../../../../src/lro/keyVaultKeyPoller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAoB,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAqC,MAAM,iBAAiB,CAAC;AAyB5E;;GAEG;AACH,MAAM,OAAgB,iBAGpB,SAAQ,MAAuB;IAHjC;;QAIE;;WAEG;QACI,iBAAY,GAAW,IAAI,CAAC;IAQrC,CAAC;IANC;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;CACF;AASD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAGnC,YAAmB,KAAa,EAAE,UAA2C,EAAE;QAA5D,UAAK,GAAL,KAAK,CAAQ;QAFxB,kBAAa,GAAW,EAAE,CAAC;QAGjC,IAAI,OAAO,CAAC,aAAa,EAAE;YACzB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;SAC5C;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { delay, OperationOptions } from \"@azure/core-http\";\nimport { Poller, PollOperation, PollOperationState } from \"@azure/core-lro\";\nimport { KeyVaultClient } from \"../generated/keyVaultClient\";\n\n/**\n * Common parameters to a Key Vault Key Poller.\n */\nexport interface KeyVaultKeyPollerOptions {\n vaultUrl: string;\n client: KeyVaultClient;\n name: string;\n operationOptions?: OperationOptions;\n intervalInMs?: number;\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the state of a Key Vault Key Poller's operation.\n */\nexport interface KeyVaultKeyPollOperationState<TResult> extends PollOperationState<TResult> {\n /**\n * The name of the key.\n */\n name: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Key Pollers.\n */\nexport abstract class KeyVaultKeyPoller<\n TState extends KeyVaultKeyPollOperationState<TResult>,\n TResult\n> extends Poller<TState, TResult> {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n public intervalInMs: number = 2000;\n\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n async delay(): Promise<void> {\n return delay(this.intervalInMs);\n }\n}\n\n/**\n * Optional parameters to the KeyVaultKeyPollOperation\n */\nexport interface KeyVaultKeyPollOperationOptions {\n cancelMessage?: string;\n}\n\n/**\n * Common properties and methods of the Key Vault Key Poller operations.\n */\nexport class KeyVaultKeyPollOperation<TState, TResult> implements PollOperation<TState, TResult> {\n private cancelMessage: string = \"\";\n\n constructor(public state: TState, options: KeyVaultKeyPollOperationOptions = {}) {\n if (options.cancelMessage) {\n this.cancelMessage = options.cancelMessage;\n }\n }\n\n /**\n * Meant to reach to the service and update the Poller operation.\n */\n public async update(): Promise<PollOperation<TState, TResult>> {\n throw new Error(\"Operation not supported.\");\n }\n\n /**\n * Meant to reach to the service and cancel the Poller operation.\n */\n public async cancel(): Promise<PollOperation<TState, TResult>> {\n throw new Error(this.cancelMessage);\n }\n\n /**\n * Serializes the Poller operation.\n */\n public toString(): string {\n return JSON.stringify({\n state: this.state,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../../src/lro/recover/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,8BAA8B,EAAuC,MAAM,aAAa,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAA4B,MAAM,sBAAsB,CAAC;AAEnF;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAG5C;IACC,YAAY,OAAiC;QAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE9F,IAAI,KAAsD,CAAC;QAE3D,IAAI,UAAU,EAAE;YACd,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;SACtC;QAED,MAAM,SAAS,GAAG,IAAI,8BAA8B,iCAE7C,KAAK,KACR,IAAI,KAEN,QAAQ,EACR,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RecoverDeletedKeyPollOperation, RecoverDeletedKeyPollOperationState } from \"./operation\";\nimport { KeyVaultKey } from \"../../keysModels\";\nimport { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from \"../keyVaultKeyPoller\";\n\n/**\n * Class that deletes a poller that waits until a key finishes being deleted\n */\nexport class RecoverDeletedKeyPoller extends KeyVaultKeyPoller<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(options: KeyVaultKeyPollerOptions) {\n const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;\n\n let state: RecoverDeletedKeyPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new RecoverDeletedKeyPollOperation(\n {\n ...state,\n name\n },\n vaultUrl,\n client,\n operationOptions\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
1
+ {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../../../src/lro/recover/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,8BAA8B,EAAuC,MAAM,aAAa,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAA4B,MAAM,sBAAsB,CAAC;AAEnF;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAG5C;IACC,YAAY,OAAiC;QAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE9F,IAAI,KAAsD,CAAC;QAE3D,IAAI,UAAU,EAAE;YACd,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;SACtC;QAED,MAAM,SAAS,GAAG,IAAI,8BAA8B,iCAE7C,KAAK,KACR,IAAI,KAEN,QAAQ,EACR,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RecoverDeletedKeyPollOperation, RecoverDeletedKeyPollOperationState } from \"./operation\";\nimport { KeyVaultKey } from \"../../keysModels\";\nimport { KeyVaultKeyPoller, KeyVaultKeyPollerOptions } from \"../keyVaultKeyPoller\";\n\n/**\n * Class that deletes a poller that waits until a key finishes being deleted\n */\nexport class RecoverDeletedKeyPoller extends KeyVaultKeyPoller<\n RecoverDeletedKeyPollOperationState,\n KeyVaultKey\n> {\n constructor(options: KeyVaultKeyPollerOptions) {\n const { vaultUrl, client, name, operationOptions, intervalInMs = 2000, resumeFrom } = options;\n\n let state: RecoverDeletedKeyPollOperationState | undefined;\n\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n\n const operation = new RecoverDeletedKeyPollOperation(\n {\n ...state,\n name,\n },\n vaultUrl,\n client,\n operationOptions\n );\n\n super(operation);\n\n this.intervalInMs = intervalInMs;\n }\n}\n"]}
@@ -6,14 +6,13 @@ import { parseKeyVaultKeyIdentifier } from "./identifier";
6
6
  * Shapes the exposed {@link KeyVaultKey} based on either a received key bundle or deleted key bundle.
7
7
  */
8
8
  export function getKeyFromKeyBundle(bundle) {
9
- var _a;
10
9
  const keyBundle = bundle;
11
10
  const deletedKeyBundle = bundle;
12
11
  const parsedId = parseKeyVaultKeyIdentifier(keyBundle.key.kid);
13
12
  const attributes = keyBundle.attributes || {};
14
13
  delete keyBundle.attributes;
15
14
  const resultObject = {
16
- key: Object.assign(Object.assign({}, keyBundle.key), { key_ops: (_a = keyBundle.key) === null || _a === void 0 ? void 0 : _a.keyOps }),
15
+ key: keyBundle.key,
17
16
  id: keyBundle.key ? keyBundle.key.kid : undefined,
18
17
  name: parsedId.name,
19
18
  keyOperations: keyBundle.key ? keyBundle.key.keyOps : undefined,
@@ -33,8 +32,8 @@ export function getKeyFromKeyBundle(bundle) {
33
32
  version: parsedId.version,
34
33
  name: parsedId.name,
35
34
  managed: keyBundle.managed,
36
- id: keyBundle.key ? keyBundle.key.kid : undefined
37
- }
35
+ id: keyBundle.key ? keyBundle.key.kid : undefined,
36
+ },
38
37
  };
39
38
  if (deletedKeyBundle.recoveryId) {
40
39
  resultObject.properties.recoveryId = deletedKeyBundle.recoveryId;
@@ -51,11 +50,11 @@ export function getDeletedKeyFromDeletedKeyItem(keyItem) {
51
50
  const commonProperties = getKeyPropertiesFromKeyItem(keyItem);
52
51
  return {
53
52
  key: {
54
- kid: keyItem.kid
53
+ kid: keyItem.kid,
55
54
  },
56
55
  id: keyItem.kid,
57
56
  name: commonProperties.name,
58
- properties: Object.assign(Object.assign({}, commonProperties), { recoveryId: keyItem.recoveryId, scheduledPurgeDate: keyItem.scheduledPurgeDate, deletedOn: keyItem.deletedDate })
57
+ properties: Object.assign(Object.assign({}, commonProperties), { recoveryId: keyItem.recoveryId, scheduledPurgeDate: keyItem.scheduledPurgeDate, deletedOn: keyItem.deletedDate }),
59
58
  };
60
59
  }
61
60
  /**
@@ -78,7 +77,7 @@ export function getKeyPropertiesFromKeyItem(keyItem) {
78
77
  tags: keyItem.tags,
79
78
  updatedOn: attributes.updated,
80
79
  vaultUrl: parsedId.vaultUrl,
81
- version: parsedId.version
80
+ version: parsedId.version,
82
81
  };
83
82
  return resultObject;
84
83
  }
@@ -90,12 +89,12 @@ export const keyRotationTransformations = {
90
89
  var _a;
91
90
  const policy = {
92
91
  attributes: {
93
- expiryTime: parameters.expiresIn
92
+ expiryTime: parameters.expiresIn,
94
93
  },
95
94
  lifetimeActions: (_a = parameters.lifetimeActions) === null || _a === void 0 ? void 0 : _a.map((action) => {
96
95
  const generatedAction = {
97
96
  action: { type: action.action },
98
- trigger: {}
97
+ trigger: {},
99
98
  };
100
99
  if (action.timeAfterCreate) {
101
100
  generatedAction.trigger.timeAfterCreate = action.timeAfterCreate;
@@ -104,7 +103,7 @@ export const keyRotationTransformations = {
104
103
  generatedAction.trigger.timeBeforeExpiry = action.timeBeforeExpiry;
105
104
  }
106
105
  return generatedAction;
107
- })
106
+ }),
108
107
  };
109
108
  return policy;
110
109
  },
@@ -120,11 +119,11 @@ export const keyRotationTransformations = {
120
119
  return {
121
120
  action: action.action.type,
122
121
  timeAfterCreate: (_a = action.trigger) === null || _a === void 0 ? void 0 : _a.timeAfterCreate,
123
- timeBeforeExpiry: (_b = action.trigger) === null || _b === void 0 ? void 0 : _b.timeBeforeExpiry
122
+ timeBeforeExpiry: (_b = action.trigger) === null || _b === void 0 ? void 0 : _b.timeBeforeExpiry,
124
123
  };
125
- })
124
+ }),
126
125
  };
127
126
  return policy;
128
- }
127
+ },
129
128
  };
130
129
  //# sourceMappingURL=transformations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../../src/transformations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAS1D;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAoC;;IAEpC,MAAM,SAAS,GAAG,MAAmB,CAAC;IACtC,MAAM,gBAAgB,GAAG,MAA0B,CAAC;IAEpD,MAAM,QAAQ,GAAG,0BAA0B,CAAC,SAAS,CAAC,GAAI,CAAC,GAAI,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAkB,SAAS,CAAC,UAAU,IAAI,EAAE,CAAC;IAC7D,OAAO,SAAS,CAAC,UAAU,CAAC;IAE5B,MAAM,YAAY,GAA6B;QAC7C,GAAG,kCAAO,SAAS,CAAC,GAAG,KAAE,OAAO,EAAE,MAAA,SAAS,CAAC,GAAG,0CAAE,MAAM,GAAE;QACzD,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;QACjD,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,aAAa,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QAC/D,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;QACtD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS,CAAC,IAAI;YAEpB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,SAAS,EAAE,UAAU,CAA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,EAAE;iBACZ,CAAC;gBAEF,IAAI,MAAM,CAAC,eAAe,EAAE;oBAC1B,eAAe,CAAC,OAAQ,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;iBACnE;gBAED,IAAI,MAAM,CAAC,gBAAgB,EAAE;oBAC3B,eAAe,CAAC,OAAQ,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;iBACrE;gBAED,OAAO,eAAe,CAAC;YACzB,CAAC,CAAC;SACH,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,iBAAiB,CAAC,SAA0B;;QAC1C,MAAM,MAAM,GAAsB;YAChC,EAAE,EAAE,SAAS,CAAC,EAAE;YAChB,SAAS,EAAE,MAAA,SAAS,CAAC,UAAU,0CAAE,OAAO;YACxC,SAAS,EAAE,MAAA,SAAS,CAAC,UAAU,0CAAE,OAAO;YACxC,SAAS,EAAE,MAAA,SAAS,CAAC,UAAU,0CAAE,UAAU;YAC3C,eAAe,EAAE,MAAA,SAAS,CAAC,eAAe,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;gBACzD,OAAO;oBACL,MAAM,EAAE,MAAM,CAAC,MAAO,CAAC,IAAK;oBAC5B,eAAe,EAAE,MAAA,MAAM,CAAC,OAAO,0CAAE,eAAe;oBAChD,gBAAgB,EAAE,MAAA,MAAM,CAAC,OAAO,0CAAE,gBAAgB;iBACnD,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DeletedKeyBundle,\n DeletedKeyItem,\n KeyAttributes,\n KeyBundle,\n KeyItem,\n KeyRotationPolicy as GeneratedPolicy,\n LifetimeActions\n} from \"./generated/models\";\nimport { parseKeyVaultKeyIdentifier } from \"./identifier\";\nimport {\n DeletedKey,\n KeyVaultKey,\n KeyProperties,\n KeyRotationPolicy,\n KeyRotationPolicyProperties\n} from \"./keysModels\";\n\n/**\n * @internal\n * Shapes the exposed {@link KeyVaultKey} based on either a received key bundle or deleted key bundle.\n */\nexport function getKeyFromKeyBundle(\n bundle: KeyBundle | DeletedKeyBundle\n): KeyVaultKey | DeletedKey {\n const keyBundle = bundle as KeyBundle;\n const deletedKeyBundle = bundle as DeletedKeyBundle;\n\n const parsedId = parseKeyVaultKeyIdentifier(keyBundle.key!.kid!);\n\n const attributes: KeyAttributes = keyBundle.attributes || {};\n delete keyBundle.attributes;\n\n const resultObject: KeyVaultKey | DeletedKey = {\n key: { ...keyBundle.key, key_ops: keyBundle.key?.keyOps },\n id: keyBundle.key ? keyBundle.key.kid : undefined,\n name: parsedId.name,\n keyOperations: keyBundle.key ? keyBundle.key.keyOps : undefined,\n keyType: keyBundle.key ? keyBundle.key.kty : undefined,\n properties: {\n tags: keyBundle.tags,\n\n enabled: attributes.enabled,\n notBefore: attributes.notBefore,\n expiresOn: attributes.expires,\n createdOn: attributes.created,\n updatedOn: attributes.updated,\n recoverableDays: attributes.recoverableDays,\n recoveryLevel: attributes.recoveryLevel,\n exportable: attributes.exportable,\n releasePolicy: keyBundle.releasePolicy,\n\n vaultUrl: parsedId.vaultUrl,\n version: parsedId.version,\n name: parsedId.name,\n managed: keyBundle.managed,\n\n id: keyBundle.key ? keyBundle.key.kid : undefined\n }\n };\n\n if (deletedKeyBundle.recoveryId) {\n (resultObject as any).properties.recoveryId = deletedKeyBundle.recoveryId;\n (resultObject as any).properties.scheduledPurgeDate = deletedKeyBundle.scheduledPurgeDate;\n (resultObject as any).properties.deletedOn = deletedKeyBundle.deletedDate;\n }\n\n return resultObject;\n}\n\n/**\n * @internal\n * Shapes the exposed {@link DeletedKey} based on a received KeyItem.\n */\nexport function getDeletedKeyFromDeletedKeyItem(keyItem: DeletedKeyItem): DeletedKey {\n const commonProperties = getKeyPropertiesFromKeyItem(keyItem);\n\n return {\n key: {\n kid: keyItem.kid\n },\n id: keyItem.kid,\n name: commonProperties.name,\n properties: {\n ...commonProperties,\n recoveryId: keyItem.recoveryId,\n scheduledPurgeDate: keyItem.scheduledPurgeDate,\n deletedOn: keyItem.deletedDate\n }\n };\n}\n\n/**\n * @internal\n * Shapes the exposed {@link KeyProperties} based on a received KeyItem.\n */\nexport function getKeyPropertiesFromKeyItem(keyItem: KeyItem): KeyProperties {\n const parsedId = parseKeyVaultKeyIdentifier(keyItem.kid!);\n const attributes = keyItem.attributes || {};\n\n const resultObject: KeyProperties = {\n createdOn: attributes.created,\n enabled: attributes?.enabled,\n expiresOn: attributes?.expires,\n id: keyItem.kid,\n managed: keyItem.managed,\n name: parsedId.name,\n notBefore: attributes?.notBefore,\n recoverableDays: attributes?.recoverableDays,\n recoveryLevel: attributes?.recoveryLevel,\n tags: keyItem.tags,\n updatedOn: attributes.updated,\n vaultUrl: parsedId.vaultUrl,\n version: parsedId.version\n };\n\n return resultObject;\n}\n\n/**\n * @internal\n */\nexport const keyRotationTransformations = {\n propertiesToGenerated: function(\n parameters: KeyRotationPolicyProperties\n ): Partial<GeneratedPolicy> {\n const policy: GeneratedPolicy = {\n attributes: {\n expiryTime: parameters.expiresIn\n },\n lifetimeActions: parameters.lifetimeActions?.map((action) => {\n const generatedAction: LifetimeActions = {\n action: { type: action.action },\n trigger: {}\n };\n\n if (action.timeAfterCreate) {\n generatedAction.trigger!.timeAfterCreate = action.timeAfterCreate;\n }\n\n if (action.timeBeforeExpiry) {\n generatedAction.trigger!.timeBeforeExpiry = action.timeBeforeExpiry;\n }\n\n return generatedAction;\n })\n };\n return policy;\n },\n generatedToPublic(generated: GeneratedPolicy): KeyRotationPolicy {\n const policy: KeyRotationPolicy = {\n id: generated.id,\n createdOn: generated.attributes?.created,\n updatedOn: generated.attributes?.updated,\n expiresIn: generated.attributes?.expiryTime,\n lifetimeActions: generated.lifetimeActions?.map((action) => {\n return {\n action: action.action!.type!,\n timeAfterCreate: action.trigger?.timeAfterCreate,\n timeBeforeExpiry: action.trigger?.timeBeforeExpiry\n };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AC,gBAAgB,EAAE;oBAC3B,eAAe,CAAC,OAAQ,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;iBACrE;gBAED,OAAO,eAAe,CAAC;YACzB,CAAC,CAAC;SACH,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,iBAAiB,CAAC,SAA0B;;QAC1C,MAAM,MAAM,GAAsB;YAChC,EAAE,EAAE,SAAS,CAAC,EAAE;YAChB,SAAS,EAAE,MAAA,SAAS,CAAC,UAAU,0CAAE,OAAO;YACxC,SAAS,EAAE,MAAA,SAAS,CAAC,UAAU,0CAAE,OAAO;YACxC,SAAS,EAAE,MAAA,SAAS,CAAC,UAAU,0CAAE,UAAU;YAC3C,eAAe,EAAE,MAAA,SAAS,CAAC,eAAe,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;gBACzD,OAAO;oBACL,MAAM,EAAE,MAAM,CAAC,MAAO,CAAC,IAAK;oBAC5B,eAAe,EAAE,MAAA,MAAM,CAAC,OAAO,0CAAE,eAAe;oBAChD,gBAAgB,EAAE,MAAA,MAAM,CAAC,OAAO,0CAAE,gBAAgB;iBACnD,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DeletedKeyBundle,\n DeletedKeyItem,\n KeyAttributes,\n KeyBundle,\n KeyItem,\n KeyRotationPolicy as GeneratedPolicy,\n LifetimeActions,\n} from \"./generated/models\";\nimport { parseKeyVaultKeyIdentifier } from \"./identifier\";\nimport {\n DeletedKey,\n KeyVaultKey,\n KeyProperties,\n KeyRotationPolicy,\n KeyRotationPolicyProperties,\n} from \"./keysModels\";\n\n/**\n * @internal\n * Shapes the exposed {@link KeyVaultKey} based on either a received key bundle or deleted key bundle.\n */\nexport function getKeyFromKeyBundle(\n bundle: KeyBundle | DeletedKeyBundle\n): KeyVaultKey | DeletedKey {\n const keyBundle = bundle as KeyBundle;\n const deletedKeyBundle = bundle as DeletedKeyBundle;\n\n const parsedId = parseKeyVaultKeyIdentifier(keyBundle.key!.kid!);\n\n const attributes: KeyAttributes = keyBundle.attributes || {};\n delete keyBundle.attributes;\n\n const resultObject: KeyVaultKey | DeletedKey = {\n key: keyBundle.key,\n id: keyBundle.key ? keyBundle.key.kid : undefined,\n name: parsedId.name,\n keyOperations: keyBundle.key ? keyBundle.key.keyOps : undefined,\n keyType: keyBundle.key ? keyBundle.key.kty : undefined,\n properties: {\n tags: keyBundle.tags,\n\n enabled: attributes.enabled,\n notBefore: attributes.notBefore,\n expiresOn: attributes.expires,\n createdOn: attributes.created,\n updatedOn: attributes.updated,\n recoverableDays: attributes.recoverableDays,\n recoveryLevel: attributes.recoveryLevel,\n exportable: attributes.exportable,\n releasePolicy: keyBundle.releasePolicy,\n\n vaultUrl: parsedId.vaultUrl,\n version: parsedId.version,\n name: parsedId.name,\n managed: keyBundle.managed,\n\n id: keyBundle.key ? keyBundle.key.kid : undefined,\n },\n };\n\n if (deletedKeyBundle.recoveryId) {\n (resultObject as any).properties.recoveryId = deletedKeyBundle.recoveryId;\n (resultObject as any).properties.scheduledPurgeDate = deletedKeyBundle.scheduledPurgeDate;\n (resultObject as any).properties.deletedOn = deletedKeyBundle.deletedDate;\n }\n\n return resultObject;\n}\n\n/**\n * @internal\n * Shapes the exposed {@link DeletedKey} based on a received KeyItem.\n */\nexport function getDeletedKeyFromDeletedKeyItem(keyItem: DeletedKeyItem): DeletedKey {\n const commonProperties = getKeyPropertiesFromKeyItem(keyItem);\n\n return {\n key: {\n kid: keyItem.kid,\n },\n id: keyItem.kid,\n name: commonProperties.name,\n properties: {\n ...commonProperties,\n recoveryId: keyItem.recoveryId,\n scheduledPurgeDate: keyItem.scheduledPurgeDate,\n deletedOn: keyItem.deletedDate,\n },\n };\n}\n\n/**\n * @internal\n * Shapes the exposed {@link KeyProperties} based on a received KeyItem.\n */\nexport function getKeyPropertiesFromKeyItem(keyItem: KeyItem): KeyProperties {\n const parsedId = parseKeyVaultKeyIdentifier(keyItem.kid!);\n const attributes = keyItem.attributes || {};\n\n const resultObject: KeyProperties = {\n createdOn: attributes.created,\n enabled: attributes?.enabled,\n expiresOn: attributes?.expires,\n id: keyItem.kid,\n managed: keyItem.managed,\n name: parsedId.name,\n notBefore: attributes?.notBefore,\n recoverableDays: attributes?.recoverableDays,\n recoveryLevel: attributes?.recoveryLevel,\n tags: keyItem.tags,\n updatedOn: attributes.updated,\n vaultUrl: parsedId.vaultUrl,\n version: parsedId.version,\n };\n\n return resultObject;\n}\n\n/**\n * @internal\n */\nexport const keyRotationTransformations = {\n propertiesToGenerated: function (\n parameters: KeyRotationPolicyProperties\n ): Partial<GeneratedPolicy> {\n const policy: GeneratedPolicy = {\n attributes: {\n expiryTime: parameters.expiresIn,\n },\n lifetimeActions: parameters.lifetimeActions?.map((action) => {\n const generatedAction: LifetimeActions = {\n action: { type: action.action },\n trigger: {},\n };\n\n if (action.timeAfterCreate) {\n generatedAction.trigger!.timeAfterCreate = action.timeAfterCreate;\n }\n\n if (action.timeBeforeExpiry) {\n generatedAction.trigger!.timeBeforeExpiry = action.timeBeforeExpiry;\n }\n\n return generatedAction;\n }),\n };\n return policy;\n },\n generatedToPublic(generated: GeneratedPolicy): KeyRotationPolicy {\n const policy: KeyRotationPolicy = {\n id: generated.id,\n createdOn: generated.attributes?.created,\n updatedOn: generated.attributes?.updated,\n expiresIn: generated.attributes?.expiryTime,\n lifetimeActions: generated.lifetimeActions?.map((action) => {\n return {\n action: action.action!.type!,\n timeAfterCreate: action.trigger?.timeAfterCreate,\n timeBeforeExpiry: action.trigger?.timeBeforeExpiry,\n };\n }),\n };\n return policy;\n },\n};\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure/keyvault-keys",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "4.4.0-beta.2",
5
+ "version": "4.4.0",
6
6
  "license": "MIT",
7
7
  "description": "Isomorphic client library for Azure KeyVault's keys.",
8
8
  "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-keys/README.md",
@@ -45,16 +45,18 @@
45
45
  "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
46
46
  "build:minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js 2>&1",
47
47
  "build:samples": "echo Obsolete.",
48
- "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
49
- "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
50
- "build:nodebrowser": "rollup -c 2>&1",
51
- "build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
48
+ "build:node": "tsc -p . && npm run bundle",
49
+ "build:browser": "tsc -p . && npm run bundle",
50
+ "build:nodebrowser": "npm run bundle",
51
+ "build:test": "tsc -p . && npm run bundle",
52
52
  "build": "npm run clean && tsc -p . && npm run build:nodebrowser && api-extractor run --local",
53
+ "bundle": "dev-tool run bundle --polyfill-node=false",
53
54
  "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
54
55
  "clean": "rimraf dist dist-* types *.tgz *.log dist-browser statistics.html coverage && rimraf src/**/*.js && rimraf test/**/*.js",
55
56
  "execute:samples": "dev-tool samples run samples-dev",
56
57
  "extract-api": "tsc -p . && api-extractor run --local",
57
58
  "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
59
+ "generate:client": "autorest --typescript swagger/README.md",
58
60
  "integration-test:browser": "karma start --single-run",
59
61
  "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace \"dist-esm/**/*.spec.js\"",
60
62
  "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace \"dist-esm/**/*.spec.js\"",
@@ -62,15 +64,13 @@
62
64
  "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
63
65
  "lint": "eslint package.json api-extractor.json src test --ext .ts",
64
66
  "pack": "npm pack 2>&1",
65
- "regenerate": "npx autorest swagger/README.md --typescript",
66
67
  "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
67
68
  "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
68
69
  "test": "npm run clean && npm run build:test && npm run unit-test",
69
70
  "unit-test:browser": "karma start --single-run",
70
- "unit-test:node": "mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace \"dist-test/index.node.js\"",
71
+ "unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
71
72
  "unit-test:node:no-timeout": "mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace \"dist-test/index.node.js\"",
72
- "unit-test": "npm run unit-test:node && npm run unit-test:browser",
73
- "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src"
73
+ "unit-test": "npm run unit-test:node && npm run unit-test:browser"
74
74
  },
75
75
  "sideEffects": false,
76
76
  "//metadata": {
@@ -114,25 +114,15 @@
114
114
  "devDependencies": {
115
115
  "@azure/dev-tool": "^1.0.0",
116
116
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
117
- "@azure/identity": "2.0.0-beta.7",
117
+ "@azure/identity": "^2.0.1",
118
118
  "@azure/test-utils": "^1.0.0",
119
119
  "@azure-tools/test-recorder": "^1.0.0",
120
120
  "@microsoft/api-extractor": "^7.18.11",
121
- "@rollup/plugin-commonjs": "11.0.2",
122
- "@rollup/plugin-json": "^4.0.0",
123
- "@rollup/plugin-multi-entry": "^3.0.0",
124
- "@rollup/plugin-node-resolve": "^8.0.0",
125
- "@rollup/plugin-replace": "^2.2.0",
126
- "@types/chai": "^4.1.6",
127
- "@types/chai-as-promised": "^7.1.0",
128
121
  "@types/mocha": "^7.0.2",
129
122
  "@types/node": "^12.0.0",
130
123
  "@types/sinon": "^9.0.4",
131
- "assert": "^1.4.1",
132
- "chai": "^4.2.0",
133
- "chai-as-promised": "^7.1.1",
134
- "chai-exclude": "^2.0.2",
135
124
  "cross-env": "^7.0.2",
125
+ "dayjs": "^1.10.7",
136
126
  "dotenv": "^8.2.0",
137
127
  "eslint": "^7.15.0",
138
128
  "esm": "^3.2.18",
@@ -150,20 +140,14 @@
150
140
  "karma-mocha-reporter": "^2.2.5",
151
141
  "karma-sourcemap-loader": "^0.3.8",
152
142
  "mocha": "^7.1.1",
153
- "mocha-junit-reporter": "^1.18.0",
154
- "nyc": "^14.0.0",
155
- "prettier": "^1.16.4",
156
- "puppeteer": "^10.2.0",
143
+ "mocha-junit-reporter": "^2.0.0",
144
+ "nyc": "^15.0.0",
145
+ "prettier": "^2.5.1",
146
+ "puppeteer": "^13.5.1",
157
147
  "rimraf": "^3.0.0",
158
- "rollup": "^1.16.3",
159
- "rollup-plugin-shim": "^1.0.0",
160
- "rollup-plugin-sourcemaps": "^0.4.2",
161
- "rollup-plugin-terser": "^5.1.1",
162
- "rollup-plugin-visualizer": "^4.0.4",
163
148
  "sinon": "^9.0.2",
164
149
  "source-map-support": "^0.5.9",
165
150
  "typescript": "~4.2.0",
166
- "url": "^0.11.0",
167
- "typedoc": "0.15.2"
151
+ "url": "^0.11.0"
168
152
  }
169
153
  }