@azure/keyvault-admin 4.2.0 → 4.2.1-alpha.20220705.4

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 (29) hide show
  1. package/dist/index.js +54 -93
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/keyvault-admin/src/accessControlClient.js +15 -14
  4. package/dist-esm/keyvault-admin/src/accessControlClient.js.map +1 -1
  5. package/dist-esm/keyvault-admin/src/backupClient.js +4 -2
  6. package/dist-esm/keyvault-admin/src/backupClient.js.map +1 -1
  7. package/dist-esm/keyvault-admin/src/challengeAuthenticationCallbacks.js +12 -5
  8. package/dist-esm/keyvault-admin/src/challengeAuthenticationCallbacks.js.map +1 -1
  9. package/dist-esm/keyvault-admin/src/constants.js +1 -5
  10. package/dist-esm/keyvault-admin/src/constants.js.map +1 -1
  11. package/dist-esm/keyvault-admin/src/generated/keyVaultClientContext.js +1 -2
  12. package/dist-esm/keyvault-admin/src/generated/keyVaultClientContext.js.map +1 -1
  13. package/dist-esm/keyvault-admin/src/lro/backup/operation.js +3 -7
  14. package/dist-esm/keyvault-admin/src/lro/backup/operation.js.map +1 -1
  15. package/dist-esm/keyvault-admin/src/lro/restore/operation.js +3 -7
  16. package/dist-esm/keyvault-admin/src/lro/restore/operation.js.map +1 -1
  17. package/dist-esm/keyvault-admin/src/lro/selectiveKeyRestore/operation.js +3 -7
  18. package/dist-esm/keyvault-admin/src/lro/selectiveKeyRestore/operation.js.map +1 -1
  19. package/dist-esm/keyvault-admin/src/tracing.js +10 -0
  20. package/dist-esm/keyvault-admin/src/tracing.js.map +1 -0
  21. package/dist-esm/keyvault-common/src/index.js +0 -1
  22. package/dist-esm/keyvault-common/src/index.js.map +1 -1
  23. package/dist-esm/keyvault-common/src/parseKeyvaultIdentifier.js.map +1 -1
  24. package/package.json +10 -10
  25. package/CHANGELOG.md +0 -106
  26. package/dist-esm/keyvault-admin/src/tracingHelpers.js +0 -42
  27. package/dist-esm/keyvault-admin/src/tracingHelpers.js.map +0 -1
  28. package/dist-esm/keyvault-common/src/tracingHelpers.js +0 -42
  29. package/dist-esm/keyvault-common/src/tracingHelpers.js.map +0 -1
@@ -1,11 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import { KeyVaultAdminPollOperation, } from "../keyVaultAdminPoller";
4
- import { createTraceFunction } from "../../tracingHelpers";
5
- /**
6
- * @internal
7
- */
8
- const withTrace = createTraceFunction("Azure.KeyVault.Admin.KeyVaultSelectiveKeyRestorePoller");
4
+ import { tracingClient } from "../../tracing";
9
5
  /**
10
6
  * The selective restore Key Vault's poll operation.
11
7
  */
@@ -21,13 +17,13 @@ export class KeyVaultSelectiveKeyRestorePollOperation extends KeyVaultAdminPollO
21
17
  * Tracing the selectiveRestore operation
22
18
  */
23
19
  selectiveRestore(keyName, options) {
24
- return withTrace("selectiveRestore", options, (updatedOptions) => this.client.selectiveKeyRestoreOperation(this.vaultUrl, keyName, updatedOptions));
20
+ return tracingClient.withSpan("KeyVaultSelectiveKeyRestorePoller.selectiveRestore", options, (updatedOptions) => this.client.selectiveKeyRestoreOperation(this.vaultUrl, keyName, updatedOptions));
25
21
  }
26
22
  /**
27
23
  * Tracing the restoreStatus operation.
28
24
  */
29
25
  restoreStatus(jobId, options) {
30
- return withTrace("restoreStatus", options, (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions));
26
+ return tracingClient.withSpan("KeyVaultSelectiveKeyRestorePoller.restoreStatus", options, (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions));
31
27
  }
32
28
  /**
33
29
  * Reaches to the service and updates the selective restore poll operation.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../../src/lro/selectiveKeyRestore/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,0BAA0B,GAE3B,MAAM,wBAAwB,CAAC;AAchC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,GAAG,CAAC,CAAC,OAAO,CAAC;QAE9B,IAAI,KAAK,CAAC,WAAW,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE;YACpC,MAAM,IAAI,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,aAAa,CAAC,CAAC;SAClD;QAED,IAAI,KAAK,CAAC,WAAW,EAAE;YACrB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS;gBACT,OAAO;aACR,CAAC;SACH;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n KeyVaultAdminPollOperation,\n KeyVaultAdminPollOperationState,\n} from \"../keyVaultAdminPoller\";\nimport {\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"../../backupClientModels\";\nimport {\n RestoreOperation,\n RestoreStatusResponse,\n SelectiveKeyRestoreOperationOptionalParams,\n SelectiveKeyRestoreOperationResponse,\n} from \"../../generated/models\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { KeyVaultClient } from \"../../generated/keyVaultClient\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { createTraceFunction } from \"../../tracingHelpers\";\n\n/**\n * @internal\n */\nconst withTrace = createTraceFunction(\"Azure.KeyVault.Admin.KeyVaultSelectiveKeyRestorePoller\");\n/**\n * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {}\n\n/**\n * An internal interface representing the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestorePollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {\n /**\n * The name of a Key Vault Key.\n */\n keyName: string;\n /**\n * The Folder name of the blob where the previous successful full backup was stored\n */\n folderName: string;\n /**\n * The URI of the blob storage account where the previous successful full backup was stored.\n */\n folderUri: string;\n /**\n * The SAS token.\n */\n sasToken: string;\n}\n\n/**\n * The selective restore Key Vault's poll operation.\n */\nexport class KeyVaultSelectiveKeyRestorePollOperation extends KeyVaultAdminPollOperation<\n KeyVaultSelectiveKeyRestorePollOperationState,\n string\n> {\n constructor(\n public state: KeyVaultSelectiveKeyRestorePollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginSelectiveKeyRestoreOptions = {}\n ) {\n super(state, { cancelMessage: \"Cancelling a selective Key Vault restore is not supported.\" });\n }\n\n /**\n * Tracing the selectiveRestore operation\n */\n private selectiveRestore(\n keyName: string,\n options: SelectiveKeyRestoreOperationOptionalParams\n ): Promise<SelectiveKeyRestoreOperationResponse> {\n return withTrace(\"selectiveRestore\", options, (updatedOptions) =>\n this.client.selectiveKeyRestoreOperation(this.vaultUrl, keyName, updatedOptions)\n );\n }\n\n /**\n * Tracing the restoreStatus operation.\n */\n private restoreStatus(jobId: string, options: OperationOptions): Promise<RestoreStatusResponse> {\n return withTrace(\"restoreStatus\", options, (updatedOptions) =>\n this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions)\n );\n }\n\n /**\n * Reaches to the service and updates the selective restore poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultSelectiveKeyRestorePollOperationState) => void;\n } = {}\n ): Promise<KeyVaultSelectiveKeyRestorePollOperation> {\n const state = this.state;\n const { keyName, folderUri, sasToken, folderName } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const selectiveRestoreOperation = await this.selectiveRestore(keyName, {\n ...this.requestOptions,\n restoreBlobDetails: {\n folder: folderName,\n sasTokenParameters: {\n storageResourceUri: folderUri,\n token: sasToken,\n },\n },\n });\n this.mapState(selectiveRestoreOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full restore operation.`);\n }\n const serviceOperation = await this.restoreStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: RestoreOperation): void {\n const state = this.state;\n const { startTime, jobId, endTime, error, status, statusDetails } = serviceOperation;\n\n if (!startTime) {\n throw new Error(`Missing \"startTime\" from the selective restore operation.`);\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../../src/lro/selectiveKeyRestore/operation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,0BAA0B,GAE3B,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA+B9C;;GAEG;AACH,MAAM,OAAO,wCAAyC,SAAQ,0BAG7D;IACC,YACS,KAAoD,EACnD,QAAgB,EAChB,MAAsB,EACtB,iBAA0D,EAAE;QAEpE,KAAK,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,4DAA4D,EAAE,CAAC,CAAC;QALvF,UAAK,GAAL,KAAK,CAA+C;QACnD,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAgB;QACtB,mBAAc,GAAd,cAAc,CAA8C;IAGtE,CAAC;IAED;;OAEG;IACK,gBAAgB,CACtB,OAAe,EACf,OAAmD;QAEnD,OAAO,aAAa,CAAC,QAAQ,CAC3B,oDAAoD,EACpD,OAAO,EACP,CAAC,cAAc,EAAE,EAAE,CACjB,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,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ED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,QAAQ,CAAC,gBAAkC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC;QAErF,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;SAC9E;QAED,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;QACvB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;QACpC,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,OAAO,CAAC;QAE9B,IAAI,KAAK,CAAC,WAAW,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE;YACpC,MAAM,IAAI,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,aAAa,CAAC,CAAC;SAClD;QAED,IAAI,KAAK,CAAC,WAAW,EAAE;YACrB,KAAK,CAAC,MAAM,GAAG;gBACb,SAAS;gBACT,OAAO;aACR,CAAC;SACH;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n KeyVaultAdminPollOperation,\n KeyVaultAdminPollOperationState,\n} from \"../keyVaultAdminPoller\";\nimport {\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"../../backupClientModels\";\nimport {\n RestoreOperation,\n RestoreStatusResponse,\n SelectiveKeyRestoreOperationOptionalParams,\n SelectiveKeyRestoreOperationResponse,\n} from \"../../generated/models\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { KeyVaultClient } from \"../../generated/keyVaultClient\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"../../tracing\";\n\n/**\n * An interface representing the publicly available properties of the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {}\n\n/**\n * An internal interface representing the state of a restore Key Vault's poll operation.\n */\nexport interface KeyVaultSelectiveKeyRestorePollOperationState\n extends KeyVaultAdminPollOperationState<KeyVaultSelectiveKeyRestoreResult> {\n /**\n * The name of a Key Vault Key.\n */\n keyName: string;\n /**\n * The Folder name of the blob where the previous successful full backup was stored\n */\n folderName: string;\n /**\n * The URI of the blob storage account where the previous successful full backup was stored.\n */\n folderUri: string;\n /**\n * The SAS token.\n */\n sasToken: string;\n}\n\n/**\n * The selective restore Key Vault's poll operation.\n */\nexport class KeyVaultSelectiveKeyRestorePollOperation extends KeyVaultAdminPollOperation<\n KeyVaultSelectiveKeyRestorePollOperationState,\n string\n> {\n constructor(\n public state: KeyVaultSelectiveKeyRestorePollOperationState,\n private vaultUrl: string,\n private client: KeyVaultClient,\n private requestOptions: KeyVaultBeginSelectiveKeyRestoreOptions = {}\n ) {\n super(state, { cancelMessage: \"Cancelling a selective Key Vault restore is not supported.\" });\n }\n\n /**\n * Tracing the selectiveRestore operation\n */\n private selectiveRestore(\n keyName: string,\n options: SelectiveKeyRestoreOperationOptionalParams\n ): Promise<SelectiveKeyRestoreOperationResponse> {\n return tracingClient.withSpan(\n \"KeyVaultSelectiveKeyRestorePoller.selectiveRestore\",\n options,\n (updatedOptions) =>\n this.client.selectiveKeyRestoreOperation(this.vaultUrl, keyName, updatedOptions)\n );\n }\n\n /**\n * Tracing the restoreStatus operation.\n */\n private restoreStatus(jobId: string, options: OperationOptions): Promise<RestoreStatusResponse> {\n return tracingClient.withSpan(\n \"KeyVaultSelectiveKeyRestorePoller.restoreStatus\",\n options,\n (updatedOptions) => this.client.restoreStatus(this.vaultUrl, jobId, updatedOptions)\n );\n }\n\n /**\n * Reaches to the service and updates the selective restore poll operation.\n */\n async update(\n options: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: KeyVaultSelectiveKeyRestorePollOperationState) => void;\n } = {}\n ): Promise<KeyVaultSelectiveKeyRestorePollOperation> {\n const state = this.state;\n const { keyName, folderUri, sasToken, folderName } = state;\n\n if (options.abortSignal) {\n this.requestOptions.abortSignal = options.abortSignal;\n }\n\n if (!state.isStarted) {\n const selectiveRestoreOperation = await this.selectiveRestore(keyName, {\n ...this.requestOptions,\n restoreBlobDetails: {\n folder: folderName,\n sasTokenParameters: {\n storageResourceUri: folderUri,\n token: sasToken,\n },\n },\n });\n this.mapState(selectiveRestoreOperation);\n } else if (!state.isCompleted) {\n if (!state.jobId) {\n throw new Error(`Missing \"jobId\" from the full restore operation.`);\n }\n const serviceOperation = await this.restoreStatus(state.jobId, this.requestOptions);\n this.mapState(serviceOperation);\n }\n\n return this;\n }\n\n private mapState(serviceOperation: RestoreOperation): void {\n const state = this.state;\n const { startTime, jobId, endTime, error, status, statusDetails } = serviceOperation;\n\n if (!startTime) {\n throw new Error(`Missing \"startTime\" from the selective restore operation.`);\n }\n\n state.isStarted = true;\n state.jobId = jobId;\n state.endTime = endTime;\n state.startTime = startTime;\n state.status = status;\n state.statusDetails = statusDetails;\n state.isCompleted = !!endTime;\n\n if (state.isCompleted && error?.code) {\n throw new Error(error?.message || statusDetails);\n }\n\n if (state.isCompleted) {\n state.result = {\n startTime,\n endTime,\n };\n }\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { SDK_VERSION } from "./constants";
4
+ import { createTracingClient } from "@azure/core-tracing";
5
+ export const tracingClient = createTracingClient({
6
+ namespace: "Microsoft.KeyVault",
7
+ packageName: "@azure/keyvault-admin",
8
+ packageVersion: SDK_VERSION,
9
+ });
10
+ //# sourceMappingURL=tracing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../src/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC/C,SAAS,EAAE,oBAAoB;IAC/B,WAAW,EAAE,uBAAuB;IACpC,cAAc,EAAE,WAAW;CAC5B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SDK_VERSION } from \"./constants\";\nimport { createTracingClient } from \"@azure/core-tracing\";\n\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.KeyVault\",\n packageName: \"@azure/keyvault-admin\",\n packageVersion: SDK_VERSION,\n});\n"]}
@@ -2,6 +2,5 @@
2
2
  // Licensed under the MIT license.
3
3
  export * from "./challengeBasedAuthenticationPolicy";
4
4
  export * from "./parseKeyvaultIdentifier";
5
- export * from "./tracingHelpers";
6
5
  export * from "./parseWWWAuthenticate";
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../keyvault-common/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./challengeBasedAuthenticationPolicy\";\nexport * from \"./parseKeyvaultIdentifier\";\nexport * from \"./tracingHelpers\";\nexport * from \"./parseWWWAuthenticate\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../keyvault-common/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./challengeBasedAuthenticationPolicy\";\nexport * from \"./parseKeyvaultIdentifier\";\nexport * from \"./parseWWWAuthenticate\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parseKeyvaultIdentifier.js","sourceRoot":"","sources":["../../../../keyvault-common/src/parseKeyvaultIdentifier.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAgB3B,MAAM,UAAU,uBAAuB,CACrC,UAAkB,EAClB,UAA8B;IAE9B,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE;QACvE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE;QACvE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,IAAI,OAAO,CAAC;IACZ,IAAI;QACF,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KAC7C;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,WAAW,UAAU,gBAAgB,UAAU,mBAAmB,CAAC,CAAC;KACrF;IAED,mDAAmD;IACnD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAClD,MAAM,IAAI,KAAK,CACb,WAAW,UAAU,gBAAgB,UAAU,6BAA6B,QAAQ,CAAC,MAAM,EAAE,CAC9F,CAAC;KACH;IAED,IAAI,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CACb,WAAW,UAAU,gBAAgB,UAAU,4BAA4B,UAAU,aAAa,QAAQ,CAAC,CAAC,CAAC,GAAG,CACjH,CAAC;KACH;IAED,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChE,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as url from \"url\";\n\nexport interface ParsedKeyVaultEntityIdentifier {\n /**\n * The vault URI.\n */\n vaultUrl: string;\n /**\n * The version of key/secret/certificate. May be undefined.\n */\n version?: string;\n /**\n * The name of key/secret/certificate.\n */\n name: string;\n}\nexport function parseKeyvaultIdentifier(\n collection: string,\n identifier: string | undefined\n): ParsedKeyVaultEntityIdentifier {\n if (typeof collection !== \"string\" || !(collection = collection.trim())) {\n throw new Error(\"Invalid collection argument\");\n }\n\n if (typeof identifier !== \"string\" || !(identifier = identifier.trim())) {\n throw new Error(\"Invalid identifier argument\");\n }\n\n let baseUri;\n try {\n baseUri = url.parse(identifier, true, true);\n } catch (e) {\n throw new Error(`Invalid ${collection} identifier: ${identifier}. Not a valid URI`);\n }\n\n // Path is of the form '/collection/name[/version]'\n const segments = (baseUri.pathname || \"\").split(\"/\");\n if (segments.length !== 3 && segments.length !== 4) {\n throw new Error(\n `Invalid ${collection} identifier: ${identifier}. Bad number of segments: ${segments.length}`\n );\n }\n\n if (collection !== segments[1]) {\n throw new Error(\n `Invalid ${collection} identifier: ${identifier}. segment [1] should be \"${collection}\", found \"${segments[1]}\"`\n );\n }\n\n const vaultUrl = `${baseUri.protocol}//${baseUri.host}`;\n const name = segments[2];\n const version = segments.length === 4 ? segments[3] : undefined;\n return {\n vaultUrl,\n name,\n version,\n };\n}\n"]}
1
+ {"version":3,"file":"parseKeyvaultIdentifier.js","sourceRoot":"","sources":["../../../../keyvault-common/src/parseKeyvaultIdentifier.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAgB3B,MAAM,UAAU,uBAAuB,CACrC,UAAkB,EAClB,UAA8B;IAE9B,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE;QACvE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE;QACvE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,IAAI,OAAO,CAAC;IACZ,IAAI;QACF,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KAC7C;IAAC,OAAO,CAAM,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,WAAW,UAAU,gBAAgB,UAAU,mBAAmB,CAAC,CAAC;KACrF;IAED,mDAAmD;IACnD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAClD,MAAM,IAAI,KAAK,CACb,WAAW,UAAU,gBAAgB,UAAU,6BAA6B,QAAQ,CAAC,MAAM,EAAE,CAC9F,CAAC;KACH;IAED,IAAI,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CACb,WAAW,UAAU,gBAAgB,UAAU,4BAA4B,UAAU,aAAa,QAAQ,CAAC,CAAC,CAAC,GAAG,CACjH,CAAC;KACH;IAED,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChE,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as url from \"url\";\n\nexport interface ParsedKeyVaultEntityIdentifier {\n /**\n * The vault URI.\n */\n vaultUrl: string;\n /**\n * The version of key/secret/certificate. May be undefined.\n */\n version?: string;\n /**\n * The name of key/secret/certificate.\n */\n name: string;\n}\nexport function parseKeyvaultIdentifier(\n collection: string,\n identifier: string | undefined\n): ParsedKeyVaultEntityIdentifier {\n if (typeof collection !== \"string\" || !(collection = collection.trim())) {\n throw new Error(\"Invalid collection argument\");\n }\n\n if (typeof identifier !== \"string\" || !(identifier = identifier.trim())) {\n throw new Error(\"Invalid identifier argument\");\n }\n\n let baseUri;\n try {\n baseUri = url.parse(identifier, true, true);\n } catch (e: any) {\n throw new Error(`Invalid ${collection} identifier: ${identifier}. Not a valid URI`);\n }\n\n // Path is of the form '/collection/name[/version]'\n const segments = (baseUri.pathname || \"\").split(\"/\");\n if (segments.length !== 3 && segments.length !== 4) {\n throw new Error(\n `Invalid ${collection} identifier: ${identifier}. Bad number of segments: ${segments.length}`\n );\n }\n\n if (collection !== segments[1]) {\n throw new Error(\n `Invalid ${collection} identifier: ${identifier}. segment [1] should be \"${collection}\", found \"${segments[1]}\"`\n );\n }\n\n const vaultUrl = `${baseUri.protocol}//${baseUri.host}`;\n const name = segments[2];\n const version = segments.length === 4 ? segments[3] : undefined;\n return {\n vaultUrl,\n name,\n version,\n };\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure/keyvault-admin",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "4.2.0",
5
+ "version": "4.2.1-alpha.20220705.4",
6
6
  "license": "MIT",
7
7
  "description": "Isomorphic client library for Azure KeyVault's administrative functions.",
8
8
  "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-admin/README.md",
@@ -74,7 +74,7 @@
74
74
  "constantPaths": [
75
75
  {
76
76
  "path": "src/generated/keyVaultClientContext.ts",
77
- "prefix": "packageVersion"
77
+ "prefix": "packageDetails"
78
78
  },
79
79
  {
80
80
  "path": "src/constants.ts",
@@ -109,7 +109,7 @@
109
109
  "@azure/core-lro": "^2.2.0",
110
110
  "@azure/core-paging": "^1.1.1",
111
111
  "@azure/core-rest-pipeline": "^1.1.0",
112
- "@azure/core-tracing": "1.0.0-preview.13",
112
+ "@azure/core-tracing": "^1.0.0",
113
113
  "@azure/logger": "^1.0.0",
114
114
  "@types/uuid": "^8.0.0",
115
115
  "tslib": "^2.2.0",
@@ -117,20 +117,20 @@
117
117
  },
118
118
  "devDependencies": {
119
119
  "@azure/abort-controller": "^1.0.0",
120
- "@azure/core-util": "^1.0.0-beta.1",
121
- "@azure/dev-tool": "^1.0.0",
122
- "@azure/eslint-plugin-azure-sdk": "^3.0.0",
120
+ "@azure/core-util": "^1.0.0",
121
+ "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
122
+ "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
123
123
  "@azure/identity": "^2.0.1",
124
124
  "@azure/keyvault-keys": "^4.2.1",
125
- "@azure/test-utils": "^1.0.0",
125
+ "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
126
126
  "@azure-tools/test-recorder": "^1.0.0",
127
- "@microsoft/api-extractor": "^7.18.11",
127
+ "@microsoft/api-extractor": "7.18.11",
128
128
  "@types/mocha": "^7.0.2",
129
129
  "@types/node": "^12.0.0",
130
130
  "@types/sinon": "^9.0.4",
131
131
  "cross-env": "^7.0.2",
132
132
  "dotenv": "^8.2.0",
133
- "eslint": "^7.15.0",
133
+ "eslint": "^8.0.0",
134
134
  "esm": "^3.2.18",
135
135
  "mocha": "^7.1.1",
136
136
  "mocha-junit-reporter": "^2.0.0",
@@ -139,6 +139,6 @@
139
139
  "rimraf": "^3.0.0",
140
140
  "sinon": "^9.0.2",
141
141
  "source-map-support": "^0.5.9",
142
- "typescript": "~4.2.0"
142
+ "typescript": "~4.6.0"
143
143
  }
144
144
  }
package/CHANGELOG.md DELETED
@@ -1,106 +0,0 @@
1
- # Release History
2
-
3
- ## 4.2.0 (2022-03-24)
4
-
5
- ### Other Changes
6
-
7
- - This release updates `BackupClient` and `AccessControlClient` to support service version 7.3 by default.
8
-
9
- ## 4.2.0-beta.2 (2021-11-09)
10
-
11
- ### Features Added
12
-
13
- - Support multi-tenant authentication against Key Vault and Managed HSM when using @azure/identity 2.0.0 or newer.
14
-
15
- ### Other Changes
16
-
17
- - Updated the latest service version to 7.3.
18
-
19
- ## 4.2.0-beta.1 (2021-08-10)
20
-
21
- - Move generated client to use @azure/core-rest-pipeline. For more information about Core V2, please refer to [the documentation](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core#core-v1-and-core-v2).
22
-
23
- - With this change, the response types no longer contain the raw response `_response`. To access the raw response, an `onResponse` callback has to be passed in the request options bag.
24
-
25
- ```typescript
26
- let rawResponse: FullOperationResponse | undefined;
27
- await client.getRoleDefinition(globalScope, "roleDefinitionName", {
28
- onResponse: (response) => (rawResponse = response),
29
- });
30
- ```
31
-
32
- ## 4.1.0 (2021-07-29)
33
-
34
- ### New Features
35
-
36
- - Support for Node.js 8 and IE 11 has been dropped. Please see our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
37
- - Changed TS compilation target to ES2017 to produce smaller bundles and use more native platform features.
38
- - Updated our internal core package dependencies to their latest versions to add support for Opentelemetry 1.0.0, which is compatible with the latest versions of our other client libraries.
39
-
40
- ## 4.1.0-beta.1 (2021-07-07)
41
-
42
- ### Features Added
43
-
44
- - With the dropping of support for Node.js versions that are no longer in LTS, the dependency on `@types/node` has been updated to version 12. Read our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
45
-
46
- ## 4.0.1 (2021-06-15)
47
-
48
- ### Bug Fixes
49
-
50
- - Fixed an issue where bundling could fail when importing this library due to an incorrectly set import.
51
-
52
- ## 4.0.0 (2021-06-15)
53
-
54
- This release marks the general availability of the `@azure/keyvault-admin` package.
55
-
56
- ### New Features
57
-
58
- - The `KeyVaultAccessControlClient` provides support for managing role-based access control (RBAC) operations.
59
- - Both role assignments and custom role definitions are supported with the ability to create, read, update, and delete custom role definitions and assignments.
60
- - The `KeyVaultBackupClient` provides support for back up and restore operations for the entire Key Vault Managed HSM instance.
61
- - Full Managed HSM backup and restore operations are supported.
62
- - Selective Key Restore from a previous backup is also supported.
63
-
64
- ### Changes since 4.0.0-beta.3:
65
-
66
- - Added the "KeyVault" prefix to all of the Key Vault Admin client operations.
67
- - Made the AesGcmDecryptParameters authenticationTag required.
68
- - Collapsed `KeyVaultRoleAssignmentPropertiesWithScope` to `KeyVaultRoleAssignmentProperties`.
69
- - Renamed `KeyVaultKeyId` to `KeyVaultKeyIdentifier`.
70
- - Renamed `beginRestore`'s `blobStorageUri` to `folderUri`.
71
- - Removed `folderName` from `beginRestore`. Now the folder name will be inferred from the `folderUri`.
72
- - Renamed `beginSelectiveRestore`'s `blobStorageUri` to `folderUri`.
73
- - Removed `folderName` from `beginSelectiveRestore`. Now the folder name will be inferred from the `folderUri`.
74
- - Reordered the parameters of `beginSelectiveRestore` to `keyName`, `folderUrl`, `sasToken`, `[options]`.
75
- - Renamed `KeyVaultBackupResult`'s `backupFolderUri` to `folderUri`.
76
- - Renamed `beginSelectiveRestore` to `beginSelectiveKeyRestore`.
77
- - Renamed `KeyVaultBeginSelectiveRestoreOptions` to `KeyVaultBeginSelectiveKeyRestoreOptions`.
78
- - Renamed `KeyVaultSelectiveRestoreOperationState` to `KeyVaultSelectiveKeyRestoreOperationState`.
79
- - Renamed `KeyVaultSelectiveRestoreResult` to `KeyVaultSelectiveKeyRestoreResult`.
80
- - `deleteRoleAssignment` and `deleteRoleDefinition` will no longer throw an exception when the resource no longer exist and return no result.
81
-
82
- ## 4.0.0-beta.3 (2021-04-06)
83
-
84
- - Updated the Latest service version to 7.2.
85
- - Long Running Operations will now use the `status` field to determine whether the operation failed.
86
- - Improved tracing across the various KeyVault libraries. By switching to a consistent naming convention, ensuring spans are always closed appropriately, and setting the correct status when an operation errors developers can expect an improved experience when enabling distributed tracing.
87
- - We now ensure tracing spans are properly closed with an appropriate status when an operation throws an exception.
88
- - If a traced operation throws an exception we will now properly record the exception message in the tracing span.
89
- - Finally, naming conventions have been standardized across the KeyVault libraries taking the format of `Azure.KeyVault.<PACKAGE NAME>.<CLIENT NAME>`.
90
- - Fixed an issue where retrying a failed initial Key Vault request may result in an empty body.
91
-
92
- ## 4.0.0-beta.2 (2021-02-09)
93
-
94
- - [Breaking] Removed `dist-browser` from the published package. To bundle the Azure SDK libraries for the browsers, please read our bundling guide: [link](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Bundling.md).
95
- - Updated the Key Vault Admin Long Running Operation Pollers to follow a more compact and meaningful approach moving forward.
96
- - Bug fix: The logging of HTTP requests wasn't properly working - now it has been fixed and tests have been written that verify the fix.
97
- - [Breaking] Return `BackupResult` and `RestoreResult` from backup/restore long running operations which will contain additional information about the operation as well any relevant data.
98
- - Backup / Restore polling will now correctly propagate any errors to the awaited call.
99
- - Add support for custom role definitions - creating, updating, and deleting role definitions are now supported.
100
-
101
- ## 4.0.0-beta.1 (2020-09-11)
102
-
103
- The @azure/keyvault-admin package provides two clients, `KeyVaultAccessControlClient` and `KeyVaultBackupClient`.
104
-
105
- - The `KeyVaultAccessControlClient` allows working with role-based access control (RBAC) operations, meaning assigning, deleting and retrieving role assignments, and retrieving role definitions.
106
- - The `KeyVaultBackupClient` allows generating full backups and restores of Key Vault instances, and selective restores of keys.
@@ -1,42 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { SpanStatusCode, createSpanFunction } from "@azure/core-tracing";
4
- /**
5
- * Returns a function that can be used for tracing options.
6
- *
7
- * @param prefix - The prefix to use, likely the name of the class / client.
8
- *
9
- * @example const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient")
10
- *
11
- * @internal
12
- */
13
- export function createTraceFunction(prefix) {
14
- const createSpan = createSpanFunction({
15
- namespace: "Microsoft.KeyVault",
16
- packagePrefix: prefix,
17
- });
18
- return async function (operationName, options, cb) {
19
- const { updatedOptions, span } = createSpan(operationName, options);
20
- try {
21
- // NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly
22
- // close the span.
23
- const result = await cb(updatedOptions, span);
24
- // otel 0.16+ needs this or else the code ends up being set as UNSET
25
- span.setStatus({
26
- code: SpanStatusCode.OK,
27
- });
28
- return result;
29
- }
30
- catch (err) {
31
- span.setStatus({
32
- code: SpanStatusCode.ERROR,
33
- message: err.message,
34
- });
35
- throw err;
36
- }
37
- finally {
38
- span.end();
39
- }
40
- };
41
- }
42
- //# sourceMappingURL=tracingHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracingHelpers.js","sourceRoot":"","sources":["../../../src/tracingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAQ,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAsB/E;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,MAAM,UAAU,GAAG,kBAAkB,CAAC;QACpC,SAAS,EAAE,oBAAoB;QAC/B,aAAa,EAAE,MAAM;KACtB,CAAC,CAAC;IAEH,OAAO,KAAK,WAAW,aAAa,EAAE,OAAO,EAAE,EAAE;QAC/C,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAEpE,IAAI;YACF,6GAA6G;YAC7G,kBAAkB;YAClB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YAE9C,oEAAoE;YACpE,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,EAAE;aACxB,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;aACrB,CAAC,CAAC;YACH,MAAM,GAAG,CAAC;SACX;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Span, SpanStatusCode, createSpanFunction } from \"@azure/core-tracing\";\nimport { OperationOptions } from \"@azure/core-client\";\n\n/**\n * An interface representing a function that is traced.\n *\n * A traced function will automatically create and close tracing '\n * spans as needed and will handle setting the status / errors as a\n * result of calling the underlying callback.\n *\n * use {@link createTraceFunction} to add tracing to a block of code.\n *\n * @internal\n */\nexport interface TracedFunction {\n <TOptions extends OperationOptions, TReturn>(\n operationName: string,\n options: TOptions,\n cb: (options: TOptions, span: Span) => Promise<TReturn>\n ): Promise<TReturn>;\n}\n\n/**\n * Returns a function that can be used for tracing options.\n *\n * @param prefix - The prefix to use, likely the name of the class / client.\n *\n * @example const withTrace = createTraceFunction(\"Azure.KeyVault.Certificates.CertificateClient\")\n *\n * @internal\n */\nexport function createTraceFunction(prefix: string): TracedFunction {\n const createSpan = createSpanFunction({\n namespace: \"Microsoft.KeyVault\",\n packagePrefix: prefix,\n });\n\n return async function (operationName, options, cb) {\n const { updatedOptions, span } = createSpan(operationName, options);\n\n try {\n // NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly\n // close the span.\n const result = await cb(updatedOptions, span);\n\n // otel 0.16+ needs this or else the code ends up being set as UNSET\n span.setStatus({\n code: SpanStatusCode.OK,\n });\n return result;\n } catch (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n throw err;\n } finally {\n span.end();\n }\n };\n}\n"]}
@@ -1,42 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { SpanStatusCode, createSpanFunction } from "@azure/core-tracing";
4
- /**
5
- * Returns a function that can be used for tracing options.
6
- *
7
- * @param prefix - The prefix to use, likely the name of the class / client.
8
- *
9
- * @example const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient")
10
- *
11
- * @internal
12
- */
13
- export function createTraceFunction(prefix) {
14
- const createSpan = createSpanFunction({
15
- namespace: "Microsoft.KeyVault",
16
- packagePrefix: prefix,
17
- });
18
- return async function (operationName, options, cb) {
19
- const { updatedOptions, span } = createSpan(operationName, options);
20
- try {
21
- // NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly
22
- // close the span.
23
- const result = await cb(updatedOptions, span);
24
- // otel 0.16+ needs this or else the code ends up being set as UNSET
25
- span.setStatus({
26
- code: SpanStatusCode.OK,
27
- });
28
- return result;
29
- }
30
- catch (err) {
31
- span.setStatus({
32
- code: SpanStatusCode.ERROR,
33
- message: err.message,
34
- });
35
- throw err;
36
- }
37
- finally {
38
- span.end();
39
- }
40
- };
41
- }
42
- //# sourceMappingURL=tracingHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracingHelpers.js","sourceRoot":"","sources":["../../../../keyvault-common/src/tracingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAQ,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAsB/E;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,MAAM,UAAU,GAAG,kBAAkB,CAAC;QACpC,SAAS,EAAE,oBAAoB;QAC/B,aAAa,EAAE,MAAM;KACtB,CAAC,CAAC;IAEH,OAAO,KAAK,WAAW,aAAa,EAAE,OAAO,EAAE,EAAE;QAC/C,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAEpE,IAAI;YACF,6GAA6G;YAC7G,kBAAkB;YAClB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YAE9C,oEAAoE;YACpE,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,EAAE;aACxB,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;aACrB,CAAC,CAAC;YACH,MAAM,GAAG,CAAC;SACX;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Span, SpanStatusCode, createSpanFunction } from \"@azure/core-tracing\";\nimport { OperationOptions } from \"@azure/core-http\";\n\n/**\n * An interface representing a function that is traced.\n *\n * A traced function will automatically create and close tracing '\n * spans as needed and will handle setting the status / errors as a\n * result of calling the underlying callback.\n *\n * use {@link createTraceFunction} to add tracing to a block of code.\n *\n * @internal\n */\nexport interface TracedFunction {\n <TOptions extends OperationOptions, TReturn>(\n operationName: string,\n options: TOptions,\n cb: (options: TOptions, span: Span) => Promise<TReturn>\n ): Promise<TReturn>;\n}\n\n/**\n * Returns a function that can be used for tracing options.\n *\n * @param prefix - The prefix to use, likely the name of the class / client.\n *\n * @example const withTrace = createTraceFunction(\"Azure.KeyVault.Certificates.CertificateClient\")\n *\n * @internal\n */\nexport function createTraceFunction(prefix: string): TracedFunction {\n const createSpan = createSpanFunction({\n namespace: \"Microsoft.KeyVault\",\n packagePrefix: prefix,\n });\n\n return async function (operationName, options, cb) {\n const { updatedOptions, span } = createSpan(operationName, options);\n\n try {\n // NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly\n // close the span.\n const result = await cb(updatedOptions, span);\n\n // otel 0.16+ needs this or else the code ends up being set as UNSET\n span.setStatus({\n code: SpanStatusCode.OK,\n });\n return result;\n } catch (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n throw err;\n } finally {\n span.end();\n }\n };\n}\n"]}