@azure/communication-identity 1.4.0-alpha.20250826.1 → 1.4.0-alpha.20250901.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/communicationIdentityClient.js +10 -31
- package/dist/browser/communicationIdentityClient.js.map +1 -1
- package/dist/browser/generated/src/identityRestClient.js +3 -15
- package/dist/browser/generated/src/identityRestClient.js.map +1 -1
- package/dist/browser/generated/src/operations/communicationIdentityOperations.js +8 -12
- package/dist/browser/generated/src/operations/communicationIdentityOperations.js.map +1 -1
- package/dist/browser/generated/src/operations/entraIdAssignment.js +4 -5
- package/dist/browser/generated/src/operations/entraIdAssignment.js.map +1 -1
- package/dist/browser/generated/src/operations/entraIdAssignments.js +43 -26
- package/dist/browser/generated/src/operations/entraIdAssignments.js.map +1 -1
- package/dist/browser/generated/src/operations/entraIdToken.js +1 -2
- package/dist/browser/generated/src/operations/entraIdToken.js.map +1 -1
- package/dist/browser/generated/src/operations/teamsExtensionAssignment.js +4 -8
- package/dist/browser/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
- package/dist/browser/generated/src/operations/teamsExtensionToken.js +1 -2
- package/dist/browser/generated/src/operations/teamsExtensionToken.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +4 -2
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/communicationIdentityClient.js +10 -31
- package/dist/commonjs/communicationIdentityClient.js.map +1 -1
- package/dist/commonjs/generated/src/identityRestClient.js +3 -15
- package/dist/commonjs/generated/src/identityRestClient.js.map +1 -1
- package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js +8 -12
- package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js.map +1 -1
- package/dist/commonjs/generated/src/operations/entraIdAssignment.js +4 -5
- package/dist/commonjs/generated/src/operations/entraIdAssignment.js.map +1 -1
- package/dist/commonjs/generated/src/operations/entraIdAssignments.js +42 -26
- package/dist/commonjs/generated/src/operations/entraIdAssignments.js.map +1 -1
- package/dist/commonjs/generated/src/operations/entraIdToken.js +1 -2
- package/dist/commonjs/generated/src/operations/entraIdToken.js.map +1 -1
- package/dist/commonjs/generated/src/operations/teamsExtensionAssignment.js +4 -8
- package/dist/commonjs/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
- package/dist/commonjs/generated/src/operations/teamsExtensionToken.js +1 -2
- package/dist/commonjs/generated/src/operations/teamsExtensionToken.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +4 -2
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/communicationIdentityClient.js +10 -31
- package/dist/esm/communicationIdentityClient.js.map +1 -1
- package/dist/esm/generated/src/identityRestClient.js +3 -15
- package/dist/esm/generated/src/identityRestClient.js.map +1 -1
- package/dist/esm/generated/src/operations/communicationIdentityOperations.js +8 -12
- package/dist/esm/generated/src/operations/communicationIdentityOperations.js.map +1 -1
- package/dist/esm/generated/src/operations/entraIdAssignment.js +4 -5
- package/dist/esm/generated/src/operations/entraIdAssignment.js.map +1 -1
- package/dist/esm/generated/src/operations/entraIdAssignments.js +43 -26
- package/dist/esm/generated/src/operations/entraIdAssignments.js.map +1 -1
- package/dist/esm/generated/src/operations/entraIdToken.js +1 -2
- package/dist/esm/generated/src/operations/entraIdToken.js.map +1 -1
- package/dist/esm/generated/src/operations/teamsExtensionAssignment.js +4 -8
- package/dist/esm/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
- package/dist/esm/generated/src/operations/teamsExtensionToken.js +1 -2
- package/dist/esm/generated/src/operations/teamsExtensionToken.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +4 -2
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/communicationIdentityClient.js +10 -31
- package/dist/react-native/communicationIdentityClient.js.map +1 -1
- package/dist/react-native/generated/src/identityRestClient.js +3 -15
- package/dist/react-native/generated/src/identityRestClient.js.map +1 -1
- package/dist/react-native/generated/src/operations/communicationIdentityOperations.js +8 -12
- package/dist/react-native/generated/src/operations/communicationIdentityOperations.js.map +1 -1
- package/dist/react-native/generated/src/operations/entraIdAssignment.js +4 -5
- package/dist/react-native/generated/src/operations/entraIdAssignment.js.map +1 -1
- package/dist/react-native/generated/src/operations/entraIdAssignments.js +43 -26
- package/dist/react-native/generated/src/operations/entraIdAssignments.js.map +1 -1
- package/dist/react-native/generated/src/operations/entraIdToken.js +1 -2
- package/dist/react-native/generated/src/operations/entraIdToken.js.map +1 -1
- package/dist/react-native/generated/src/operations/teamsExtensionAssignment.js +4 -8
- package/dist/react-native/generated/src/operations/teamsExtensionAssignment.js.map +1 -1
- package/dist/react-native/generated/src/operations/teamsExtensionToken.js +1 -2
- package/dist/react-native/generated/src/operations/teamsExtensionToken.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +4 -2
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/package.json +38 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entraIdAssignments.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/entraIdAssignments.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAatD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;IAChB,MAAM,CAAqB;IAE5C;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,UAAU,CACf,IAAsE,EACtE,OAAgD;QAEhD,MAAM,IAAI,GAAG,IAAI,CAAC,e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UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { EntraIdAssignments } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n EntraAssignment,\n EntraAssignmentCreateOrUpdateRequest,\n EntraIdAssignmentsUpdateNextOptionalParams,\n EntraIdAssignmentsUpdateOptionalParams,\n EntraIdAssignmentsUpdateResponse,\n EntraIdAssignmentsListOptionalParams,\n EntraIdAssignmentsListResponse,\n EntraIdAssignmentsUpdateNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing EntraIdAssignments operations. */\nexport class EntraIdAssignmentsImpl implements EntraIdAssignments {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class EntraIdAssignments class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Updates Entra access assignments in bulk.\n * @param body Set of assignments to be added, updated or removed.\n * @param options The options parameters.\n */\n public listUpdate(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n ): PagedAsyncIterableIterator<EntraAssignment> {\n const iter = this.updatePagingAll(body, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.updatePagingPage(body, options, settings);\n },\n };\n }\n\n private async *updatePagingPage(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<EntraAssignment[]> {\n let result: EntraIdAssignmentsUpdateResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._update(body, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._updateNext(body, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *updatePagingAll(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n ): AsyncIterableIterator<EntraAssignment> {\n for await (const page of this.updatePagingPage(body, options)) {\n yield* page;\n }\n }\n\n /**\n * Updates Entra access assignments in bulk.\n * @param body Set of assignments to be added, updated or removed.\n * @param options The options parameters.\n */\n private async _update(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n ): Promise<EntraIdAssignmentsUpdateResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient._update\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { body, options },\n updateOperationSpec,\n ) as Promise<EntraIdAssignmentsUpdateResponse>;\n },\n );\n }\n\n /**\n * Lists Entra access assignments.\n * @param options The options parameters.\n */\n async list(\n options?: EntraIdAssignmentsListOptionalParams,\n ): Promise<EntraIdAssignmentsListResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.list\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n listOperationSpec,\n ) as Promise<EntraIdAssignmentsListResponse>;\n },\n );\n }\n\n /**\n * UpdateNext\n * @param body Set of assignments to be added, updated or removed.\n * @param nextLink The nextLink from the previous successful call to the Update method.\n * @param options The options parameters.\n */\n private async _updateNext(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n nextLink: string,\n options?: EntraIdAssignmentsUpdateNextOptionalParams,\n ): Promise<EntraIdAssignmentsUpdateNextResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient._updateNext\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { body, nextLink, options },\n updateNextOperationSpec,\n ) as Promise<EntraIdAssignmentsUpdateNextResponse>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst updateOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignmentsResponse,\n },\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.body5,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignmentsResponse,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst updateNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignmentsResponse,\n },\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"entraIdAssignments.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/entraIdAssignments.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAatD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;IAGjC;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,UAAU,CACf,IAAsE,EACtE,OAAgD;QAEhD,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YACxD,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,gBAAgB,CAC7B,IAAsE,EACtE,OAAgD,EAChD,QAAuB;;YAEvB,IAAI,MAAwC,CAAC;YAC7C,IA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IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,2BAA2B;IACjC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wBAAwB;SAC7C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,uBAAuB,GAA6B;IACxD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wBAAwB;SAC7C;QACD,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { EntraIdAssignments } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n EntraAssignment,\n EntraAssignmentCreateOrUpdateRequest,\n EntraIdAssignmentsUpdateNextOptionalParams,\n EntraIdAssignmentsUpdateOptionalParams,\n EntraIdAssignmentsUpdateResponse,\n EntraIdAssignmentsListOptionalParams,\n EntraIdAssignmentsListResponse,\n EntraIdAssignmentsUpdateNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing EntraIdAssignments operations. */\nexport class EntraIdAssignmentsImpl implements EntraIdAssignments {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class EntraIdAssignments class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Updates Entra access assignments in bulk.\n * @param body Set of assignments to be added, updated or removed.\n * @param options The options parameters.\n */\n public listUpdate(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n ): PagedAsyncIterableIterator<EntraAssignment> {\n const iter = this.updatePagingAll(body, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.updatePagingPage(body, options, settings);\n },\n };\n }\n\n private async *updatePagingPage(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<EntraAssignment[]> {\n let result: EntraIdAssignmentsUpdateResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._update(body, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._updateNext(body, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *updatePagingAll(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n ): AsyncIterableIterator<EntraAssignment> {\n for await (const page of this.updatePagingPage(body, options)) {\n yield* page;\n }\n }\n\n /**\n * Updates Entra access assignments in bulk.\n * @param body Set of assignments to be added, updated or removed.\n * @param options The options parameters.\n */\n private async _update(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n options?: EntraIdAssignmentsUpdateOptionalParams,\n ): Promise<EntraIdAssignmentsUpdateResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient._update\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { body, options },\n updateOperationSpec,\n ) as Promise<EntraIdAssignmentsUpdateResponse>;\n },\n );\n }\n\n /**\n * Lists Entra access assignments.\n * @param options The options parameters.\n */\n async list(\n options?: EntraIdAssignmentsListOptionalParams,\n ): Promise<EntraIdAssignmentsListResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.list\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n listOperationSpec,\n ) as Promise<EntraIdAssignmentsListResponse>;\n },\n );\n }\n\n /**\n * UpdateNext\n * @param body Set of assignments to be added, updated or removed.\n * @param nextLink The nextLink from the previous successful call to the Update method.\n * @param options The options parameters.\n */\n private async _updateNext(\n body: { [propertyName: string]: EntraAssignmentCreateOrUpdateRequest },\n nextLink: string,\n options?: EntraIdAssignmentsUpdateNextOptionalParams,\n ): Promise<EntraIdAssignmentsUpdateNextResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient._updateNext\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { body, nextLink, options },\n updateNextOperationSpec,\n ) as Promise<EntraIdAssignmentsUpdateNextResponse>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst updateOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignmentsResponse,\n },\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.body5,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/assignments\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignmentsResponse,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst updateNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EntraAssignmentsResponse,\n },\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer,\n};\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing EntraIdToken operations. */
|
|
13
13
|
export class EntraIdTokenImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class EntraIdToken class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class EntraIdTokenImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async exchange(body, options) {
|
|
28
|
-
return tracingClient.withSpan("IdentityRestClient.exchange", options
|
|
27
|
+
return tracingClient.withSpan("IdentityRestClient.exchange", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ body, options }, exchangeOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entraIdToken.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/entraIdToken.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,gDAAgD;AAChD,MAAM,OAAO,gBAAgB;
|
|
1
|
+
{"version":3,"file":"entraIdToken.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/entraIdToken.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,gDAAgD;AAChD,MAAM,OAAO,gBAAgB;IAG3B;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CACZ,IAA6B,EAC7B,OAA4C;QAE5C,OAAO,aAAa,CAAC,QAAQ,CAC3B,6BAA6B,EAC7B,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,IAAI,EAAE,OAAO,EAAE,EACjB,qBAAqB,CACmB,CAAC;QAC7C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,oCAAoC;IAC1C,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,sCAAsC;SAC3D;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { EntraIdToken } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n EntraIdTokenExchangeOptionalParams,\n EntraIdTokenExchangeResponse,\n} from \"../models/index.js\";\n\n/** Class containing EntraIdToken operations. */\nexport class EntraIdTokenImpl implements EntraIdToken {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class EntraIdToken class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Exchanges an Entra ID token for an ACS user access token.\n * @param body Request payload for the token exchange.\n * @param options The options parameters.\n */\n async exchange(\n body: Record<string, unknown>,\n options?: EntraIdTokenExchangeOptionalParams,\n ): Promise<EntraIdTokenExchangeResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.exchange\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { body, options },\n exchangeOperationSpec,\n ) as Promise<EntraIdTokenExchangeResponse>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst exchangeOperationSpec: coreClient.OperationSpec = {\n path: \"/access/entra/:exchangeAccessToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentityAccessTokenResult,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.body3,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing TeamsExtensionAssignment operations. */
|
|
13
13
|
export class TeamsExtensionAssignmentImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class TeamsExtensionAssignment class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -26,7 +25,7 @@ export class TeamsExtensionAssignmentImpl {
|
|
|
26
25
|
* @param options The options parameters.
|
|
27
26
|
*/
|
|
28
27
|
async get(tenantId, objectId, options) {
|
|
29
|
-
return tracingClient.withSpan("IdentityRestClient.get", options
|
|
28
|
+
return tracingClient.withSpan("IdentityRestClient.get", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
30
29
|
return this.client.sendOperationRequest({ tenantId, objectId, options }, getOperationSpec);
|
|
31
30
|
});
|
|
32
31
|
}
|
|
@@ -38,7 +37,7 @@ export class TeamsExtensionAssignmentImpl {
|
|
|
38
37
|
* @param options The options parameters.
|
|
39
38
|
*/
|
|
40
39
|
async upsert(tenantId, objectId, principalType, options) {
|
|
41
|
-
return tracingClient.withSpan("IdentityRestClient.upsert", options
|
|
40
|
+
return tracingClient.withSpan("IdentityRestClient.upsert", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
42
41
|
return this.client.sendOperationRequest({ tenantId, objectId, principalType, options }, upsertOperationSpec);
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -49,7 +48,7 @@ export class TeamsExtensionAssignmentImpl {
|
|
|
49
48
|
* @param options The options parameters.
|
|
50
49
|
*/
|
|
51
50
|
async delete(tenantId, objectId, options) {
|
|
52
|
-
return tracingClient.withSpan("IdentityRestClient.delete", options
|
|
51
|
+
return tracingClient.withSpan("IdentityRestClient.delete", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
53
52
|
return this.client.sendOperationRequest({ tenantId, objectId, options }, deleteOperationSpec);
|
|
54
53
|
});
|
|
55
54
|
}
|
|
@@ -95,10 +94,7 @@ const upsertOperationSpec = {
|
|
|
95
94
|
principalType: ["principalType"],
|
|
96
95
|
clientIds: ["options", "clientIds"],
|
|
97
96
|
},
|
|
98
|
-
mapper: {
|
|
99
|
-
...Mappers.TeamsExtensionAssignmentCreateOrUpdateRequest,
|
|
100
|
-
required: true,
|
|
101
|
-
},
|
|
97
|
+
mapper: Object.assign(Object.assign({}, Mappers.TeamsExtensionAssignmentCreateOrUpdateRequest), { required: true }),
|
|
102
98
|
},
|
|
103
99
|
queryParameters: [Parameters.apiVersion],
|
|
104
100
|
urlParameters: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teamsExtensionAssignment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/teamsExtensionAssignment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAWtD,4DAA4D;AAC5D,MAAM,OAAO,4BAA4B;
|
|
1
|
+
{"version":3,"file":"teamsExtensionAssignment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/teamsExtensionAssignment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAWtD,4DAA4D;AAC5D,MAAM,OAAO,4BAA4B;IAGvC;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CACP,QAAgB,EAChB,QAAgB,EAChB,OAAmD;QAEnD,OAAO,aAAa,CAAC,QAAQ,CAC3B,wBAAwB,EACxB,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC/B,gBAAgB,CAC+B,CAAC;QACpD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CACV,QAAgB,EAChB,QAAgB,EAChB,aAA0C,EAC1C,OAAsD;QAEtD,OAAO,aAAa,CAAC,QAAQ,C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,kEAAkE;IACxE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gCAAgC;SACrD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gCAAgC;SACrD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,WAAW,EAAE;QACX,aAAa,EAAE;YACb,aAAa,EAAE,CAAC,eAAe,CAAC;YAChC,SAAS,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;SACpC;QACD,MAAM,kCACD,OAAO,CAAC,6CAA6C,KACxD,QAAQ,EAAE,IAAI,GACf;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE;QACb,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,mBAAmB,GAA6B;IACpD,IAAI,EAAE,kEAAkE;IACxE,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE;QACT,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE;QACb,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { TeamsExtensionAssignment } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n TeamsExtensionAssignmentGetOptionalParams,\n TeamsExtensionAssignmentGetResponse,\n TeamsExtensionPrincipalType,\n TeamsExtensionAssignmentUpsertOptionalParams,\n TeamsExtensionAssignmentUpsertResponse,\n TeamsExtensionAssignmentDeleteOptionalParams,\n} from \"../models/index.js\";\n\n/** Class containing TeamsExtensionAssignment operations. */\nexport class TeamsExtensionAssignmentImpl implements TeamsExtensionAssignment {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class TeamsExtensionAssignment class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Get Teams Phone access assignment by object id.\n * @param tenantId Tenant Id we want to get the assignment for.\n * @param objectId Object Id we want to get the assignment for.\n * @param options The options parameters.\n */\n async get(\n tenantId: string,\n objectId: string,\n options?: TeamsExtensionAssignmentGetOptionalParams,\n ): Promise<TeamsExtensionAssignmentGetResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { tenantId, objectId, options },\n getOperationSpec,\n ) as Promise<TeamsExtensionAssignmentGetResponse>;\n },\n );\n }\n\n /**\n * Creates or replaces a Teams Phone access assignment.\n * @param tenantId Tenant Id we want to update the assignment for.\n * @param objectId Object Id we want to update the assignment for.\n * @param principalType The type of principal the assignment is for.\n * @param options The options parameters.\n */\n async upsert(\n tenantId: string,\n objectId: string,\n principalType: TeamsExtensionPrincipalType,\n options?: TeamsExtensionAssignmentUpsertOptionalParams,\n ): Promise<TeamsExtensionAssignmentUpsertResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.upsert\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { tenantId, objectId, principalType, options },\n upsertOperationSpec,\n ) as Promise<TeamsExtensionAssignmentUpsertResponse>;\n },\n );\n }\n\n /**\n * Removes a Teams Phone access assignment.\n * @param tenantId Tenant Id we want to remove the assignment for.\n * @param objectId Object Id we want to remove the assignment for.\n * @param options The options parameters.\n */\n async delete(\n tenantId: string,\n objectId: string,\n options?: TeamsExtensionAssignmentDeleteOptionalParams,\n ): Promise<void> {\n return tracingClient.withSpan(\n \"IdentityRestClient.delete\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { tenantId, objectId, options },\n deleteOperationSpec,\n ) as Promise<void>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/access/teamsExtension/tenants/{tenantId}/assignments/{objectId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.TeamsExtensionAssignmentResponse,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.tenantId,\n Parameters.objectId,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst upsertOperationSpec: coreClient.OperationSpec = {\n path: \"/access/teamsExtension/tenants/{tenantId}/assignments/{objectId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.TeamsExtensionAssignmentResponse,\n },\n 201: {\n bodyMapper: Mappers.TeamsExtensionAssignmentResponse,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n principalType: [\"principalType\"],\n clientIds: [\"options\", \"clientIds\"],\n },\n mapper: {\n ...Mappers.TeamsExtensionAssignmentCreateOrUpdateRequest,\n required: true,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.tenantId,\n Parameters.objectId,\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/access/teamsExtension/tenants/{tenantId}/assignments/{objectId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.tenantId,\n Parameters.objectId,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing TeamsExtensionToken operations. */
|
|
13
13
|
export class TeamsExtensionTokenImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class TeamsExtensionToken class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class TeamsExtensionTokenImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async exchange(body, options) {
|
|
28
|
-
return tracingClient.withSpan("IdentityRestClient.exchange", options
|
|
27
|
+
return tracingClient.withSpan("IdentityRestClient.exchange", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ body, options }, exchangeOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teamsExtensionToken.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/teamsExtensionToken.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,uDAAuD;AACvD,MAAM,OAAO,uBAAuB;
|
|
1
|
+
{"version":3,"file":"teamsExtensionToken.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/teamsExtensionToken.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,uDAAuD;AACvD,MAAM,OAAO,uBAAuB;IAGlC;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CACZ,IAA6B,EAC7B,OAAmD;QAEnD,OAAO,aAAa,CAAC,QAAQ,CAC3B,6BAA6B,EAC7B,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,IAAI,EAAE,OAAO,EAAE,EACjB,qBAAqB,CAC0B,CAAC;QACpD,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,6CAA6C;IACnD,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,sCAAsC;SAC3D;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { TeamsExtensionToken } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { IdentityRestClient } from \"../identityRestClient.js\";\nimport {\n TeamsExtensionTokenExchangeOptionalParams,\n TeamsExtensionTokenExchangeResponse,\n} from \"../models/index.js\";\n\n/** Class containing TeamsExtensionToken operations. */\nexport class TeamsExtensionTokenImpl implements TeamsExtensionToken {\n private readonly client: IdentityRestClient;\n\n /**\n * Initialize a new instance of the class TeamsExtensionToken class.\n * @param client Reference to the service client\n */\n constructor(client: IdentityRestClient) {\n this.client = client;\n }\n\n /**\n * Exchanges a Teams Phone token for an ACS user access token.\n * @param body Request payload for the token exchange.\n * @param options The options parameters.\n */\n async exchange(\n body: Record<string, unknown>,\n options?: TeamsExtensionTokenExchangeOptionalParams,\n ): Promise<TeamsExtensionTokenExchangeResponse> {\n return tracingClient.withSpan(\n \"IdentityRestClient.exchange\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { body, options },\n exchangeOperationSpec,\n ) as Promise<TeamsExtensionTokenExchangeResponse>;\n },\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst exchangeOperationSpec: coreClient.OperationSpec = {\n path: \"/access/teamsExtension/:exchangeAccessToken\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CommunicationIdentityAccessTokenResult,\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n },\n },\n requestBody: Parameters.body3,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
|
|
@@ -14,16 +14,18 @@ const pageMap = new WeakMap();
|
|
|
14
14
|
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
15
15
|
*/
|
|
16
16
|
export function getContinuationToken(page) {
|
|
17
|
+
var _a;
|
|
17
18
|
if (typeof page !== "object" || page === null) {
|
|
18
19
|
return undefined;
|
|
19
20
|
}
|
|
20
|
-
return pageMap.get(page)
|
|
21
|
+
return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
|
|
21
22
|
}
|
|
22
23
|
export function setContinuationToken(page, continuationToken) {
|
|
24
|
+
var _a;
|
|
23
25
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
|
-
const pageInfo = pageMap.get(page)
|
|
28
|
+
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
27
29
|
pageInfo.continuationToken = continuationToken;
|
|
28
30
|
pageMap.set(page, pageInfo);
|
|
29
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../../../src/generated/src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa
|
|
1
|
+
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../../../src/generated/src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,0CAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAa,EACb,iBAAqC;;IAErC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport interface PageInfo {\n continuationToken?: string;\n}\n\nconst pageMap = new WeakMap<object, PageInfo>();\n\n/**\n * Given the last `.value` produced by the `byPage` iterator,\n * returns a continuation token that can be used to begin paging from\n * that point later.\n * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.\n * @returns The continuation token that can be passed into byPage() during future calls.\n */\nexport function getContinuationToken(page: unknown): string | undefined {\n if (typeof page !== \"object\" || page === null) {\n return undefined;\n }\n return pageMap.get(page)?.continuationToken;\n}\n\nexport function setContinuationToken(\n page: unknown,\n continuationToken: string | undefined,\n): void {\n if (typeof page !== \"object\" || page === null || !continuationToken) {\n return;\n }\n const pageInfo = pageMap.get(page) ?? {};\n pageInfo.continuationToken = continuationToken;\n pageMap.set(page, pageInfo);\n}\n"]}
|
|
@@ -13,24 +13,17 @@ const isCommunicationIdentityClientOptions = (options) => options && !(0, core_a
|
|
|
13
13
|
* Client class for interacting with Azure Communication Services User Token Management.
|
|
14
14
|
*/
|
|
15
15
|
class CommunicationIdentityClient {
|
|
16
|
-
/**
|
|
17
|
-
* A reference to the auto-generated UserToken HTTP client.
|
|
18
|
-
*/
|
|
19
|
-
client;
|
|
20
16
|
constructor(connectionStringOrEndpoint, credentialOrOptions, maybeOptions = {}) {
|
|
21
17
|
const { url, credential } = (0, communication_common_1.parseClientArguments)(connectionStringOrEndpoint, credentialOrOptions);
|
|
22
18
|
const options = isCommunicationIdentityClientOptions(credentialOrOptions)
|
|
23
19
|
? credentialOrOptions
|
|
24
20
|
: maybeOptions;
|
|
25
|
-
const internalPipelineOptions = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
loggingOptions: {
|
|
29
|
-
logger: logger_js_1.logger.info,
|
|
30
|
-
},
|
|
21
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
22
|
+
loggingOptions: {
|
|
23
|
+
logger: logger_js_1.logger.info,
|
|
31
24
|
},
|
|
32
|
-
};
|
|
33
|
-
this.client = new identityRestClient_js_1.IdentityRestClient(url, { endpoint: url,
|
|
25
|
+
});
|
|
26
|
+
this.client = new identityRestClient_js_1.IdentityRestClient(url, Object.assign({ endpoint: url }, internalPipelineOptions));
|
|
34
27
|
const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
|
|
35
28
|
this.client.pipeline.addPolicy(authPolicy);
|
|
36
29
|
}
|
|
@@ -43,7 +36,7 @@ class CommunicationIdentityClient {
|
|
|
43
36
|
*/
|
|
44
37
|
getToken(user, scopes, options = {}) {
|
|
45
38
|
return tracing_js_1.tracingClient.withSpan("CommunicationIdentity-issueToken", options, (updatedOptions) => {
|
|
46
|
-
return this.client.communicationIdentityOperations.issueAccessToken(user.communicationUserId, scopes, { expiresInMinutes: options.tokenExpiresInMinutes,
|
|
39
|
+
return this.client.communicationIdentityOperations.issueAccessToken(user.communicationUserId, scopes, Object.assign({ expiresInMinutes: options.tokenExpiresInMinutes }, updatedOptions));
|
|
47
40
|
});
|
|
48
41
|
}
|
|
49
42
|
/**
|
|
@@ -65,9 +58,7 @@ class CommunicationIdentityClient {
|
|
|
65
58
|
*/
|
|
66
59
|
getUserDetail(user, options = {}) {
|
|
67
60
|
return tracing_js_1.tracingClient.withSpan("CommunicationIdentity-getUser", options, async (updatedOptions) => {
|
|
68
|
-
const result = await this.client.communicationIdentityOperations.get(user.communicationUserId, {
|
|
69
|
-
...updatedOptions,
|
|
70
|
-
});
|
|
61
|
+
const result = await this.client.communicationIdentityOperations.get(user.communicationUserId, Object.assign({}, updatedOptions));
|
|
71
62
|
return {
|
|
72
63
|
user: { communicationUserId: result.id },
|
|
73
64
|
customId: result.customId,
|
|
@@ -82,11 +73,7 @@ class CommunicationIdentityClient {
|
|
|
82
73
|
*/
|
|
83
74
|
createUser(options = {}) {
|
|
84
75
|
return tracing_js_1.tracingClient.withSpan("CommunicationIdentity-createUser", options, async (updatedOptions) => {
|
|
85
|
-
const result = await this.client.communicationIdentityOperations.create({
|
|
86
|
-
expiresInMinutes: undefined,
|
|
87
|
-
customId: options.customId,
|
|
88
|
-
...updatedOptions,
|
|
89
|
-
});
|
|
76
|
+
const result = await this.client.communicationIdentityOperations.create(Object.assign({ expiresInMinutes: undefined, customId: options.customId }, updatedOptions));
|
|
90
77
|
return {
|
|
91
78
|
communicationUserId: result.identity.id,
|
|
92
79
|
};
|
|
@@ -100,16 +87,8 @@ class CommunicationIdentityClient {
|
|
|
100
87
|
*/
|
|
101
88
|
createUserAndToken(scopes, options = {}) {
|
|
102
89
|
return tracing_js_1.tracingClient.withSpan("CommunicationIdentity-createUserAndToken", options, async (updatedOptions) => {
|
|
103
|
-
const { identity, accessToken } = await this.client.communicationIdentityOperations.create({
|
|
104
|
-
|
|
105
|
-
expiresInMinutes: options.tokenExpiresInMinutes,
|
|
106
|
-
customId: options.customId,
|
|
107
|
-
...updatedOptions,
|
|
108
|
-
});
|
|
109
|
-
return {
|
|
110
|
-
...accessToken,
|
|
111
|
-
user: { communicationUserId: identity.id },
|
|
112
|
-
};
|
|
90
|
+
const { identity, accessToken } = await this.client.communicationIdentityOperations.create(Object.assign({ createTokenWithScopes: scopes, expiresInMinutes: options.tokenExpiresInMinutes, customId: options.customId }, updatedOptions));
|
|
91
|
+
return Object.assign(Object.assign({}, accessToken), { user: { communicationUserId: identity.id } });
|
|
113
92
|
});
|
|
114
93
|
}
|
|
115
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communicationIdentityClient.js","sourceRoot":"","sources":["../../src/communicationIdentityClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAclC,sEAIqC;AAGrC,gDAAqD;AACrD,iFAA2E;AAC3E,kDAA4C;AAC5C,2DAA2D;AAE3D,MAAM,oCAAoC,GAAG,CAC3C,OAAY,EACmC,EAAE,CACjD,OAAO,IAAI,CAAC,IAAA,6BAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,sCAAe,EAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAa,2BAA2B;IACtC;;OAEG;IACc,MAAM,CAAqB;IAiC5C,YACE,0BAAkC,EAClC,mBAA0F,EAC1F,eAAmD,EAAE;QAErD,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAA,2CAAoB,EAC9C,0BAA0B,EAC1B,mBAAmB,CACpB,CAAC;QACF,MAAM,OAAO,GAAG,oCAAoC,CAAC,mBAAmB,CAAC;YACvE,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,YAAY,CAAC;QAEjB,MAAM,uBAAuB,GAAkC;YAC7D,GAAG,OAAO;YACV,GAAG;gBACD,cAAc,EAAE;oBACd,MAAM,EAAE,kBAAM,CAAC,IAAI;iBACpB;aACF;SACF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAI,0CAAkB,CAA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E9B,OAAO,0BAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,MAAM,CACtD,IAAI,CAAC,mBAAmB,EACxB,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CACzB,OAAoC;QAEpC,OAAO,0BAAa,CAAC,QAAQ,CAC3B,4CAA4C,EAC5C,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC;YACrE,OAAO,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,4BAA4B,CAC7E,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAxOD,kEAwOC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CommunicationAccessToken,\n CommunicationIdentityClientOptions,\n CommunicationUserToken,\n GetTokenForTeamsUserOptions,\n CreateUserAndTokenOptions,\n GetTokenOptions,\n TokenScope,\n CreateUserOptions,\n CommunicationUserDetail,\n} from \"./models.js\";\nimport type { CommunicationUserIdentifier } from \"@azure/communication-common\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport type { InternalClientPipelineOptions, OperationOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { IdentityRestClient } from \"./generated/src/identityRestClient.js\";\nimport { logger } from \"./common/logger.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\nconst isCommunicationIdentityClientOptions = (\n options: any,\n): options is CommunicationIdentityClientOptions =>\n options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services User Token Management.\n */\nexport class CommunicationIdentityClient {\n /**\n * A reference to the auto-generated UserToken HTTP client.\n */\n private readonly client: IdentityRestClient;\n\n /**\n * Initializes a new instance of the CommunicationIdentity class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: CommunicationIdentityClientOptions);\n\n /**\n * Initializes a new instance of the CommunicationIdentity class using an Azure KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the AzureKeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: CommunicationIdentityClientOptions,\n );\n /**\n * Initializes a new instance of the CommunicationIdentity class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net)\n * @param credential - TokenCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: CommunicationIdentityClientOptions,\n );\n\n public constructor(\n connectionStringOrEndpoint: string,\n credentialOrOptions?: KeyCredential | CommunicationIdentityClientOptions | TokenCredential,\n maybeOptions: CommunicationIdentityClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(\n connectionStringOrEndpoint,\n credentialOrOptions,\n );\n const options = isCommunicationIdentityClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new IdentityRestClient(url, { endpoint: url, ...internalPipelineOptions });\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Creates a scoped user token.\n *\n * @param user - The user whose tokens are being issued.\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public getToken(\n user: CommunicationUserIdentifier,\n scopes: TokenScope[],\n options: GetTokenOptions = {},\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\"CommunicationIdentity-issueToken\", options, (updatedOptions) => {\n return this.client.communicationIdentityOperations.issueAccessToken(\n user.communicationUserId,\n scopes,\n { expiresInMinutes: options.tokenExpiresInMinutes, ...updatedOptions },\n );\n });\n }\n\n /**\n * Revokes all data and tokens created for a user.\n *\n * @param user - The user whose tokens are being revoked.\n * @param options - Additional options for the request.\n */\n public revokeTokens(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-revokeTokens\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.revokeAccessTokens(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Get an identity by its id.\n *\n * @param user - The user to get.\n * @param options - Additional options for the request.\n */\n public getUserDetail(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<CommunicationUserDetail> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.get(\n user.communicationUserId,\n {\n ...updatedOptions,\n },\n );\n\n return {\n user: { communicationUserId: result.id },\n customId: result.customId,\n lastTokenIssuedAt: result.lastTokenIssuedAt,\n };\n },\n );\n }\n\n /**\n * Creates a single user.\n *\n * @param options - Additional options for the request.\n */\n public createUser(options: CreateUserOptions = {}): Promise<CommunicationUserIdentifier> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.create({\n expiresInMinutes: undefined,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n communicationUserId: result.identity.id,\n };\n },\n );\n }\n\n /**\n * Creates a single user and a token simultaneously.\n *\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public createUserAndToken(\n scopes: TokenScope[],\n options: CreateUserAndTokenOptions = {},\n ): Promise<CommunicationUserToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUserAndToken\",\n options,\n async (updatedOptions) => {\n const { identity, accessToken } = await this.client.communicationIdentityOperations.create({\n createTokenWithScopes: scopes,\n expiresInMinutes: options.tokenExpiresInMinutes,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n ...accessToken!,\n user: { communicationUserId: identity.id },\n };\n },\n );\n }\n\n /**\n * Triggers revocation event for user and deletes all its data.\n *\n * @param user - The user being deleted.\n * @param options - Additional options for the request.\n */\n public deleteUser(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-deleteUser\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.delete(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Exchanges an Azure AD access token of a Teams user for a new Communication Identity access token with a matching expiration time.\n *\n * @param options - Options used to exchange an Azure AD access token of a Teams user for a new Communication Identity access token.\n */\n public getTokenForTeamsUser(\n options: GetTokenForTeamsUserOptions,\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getTokenForTeamsUser\",\n options,\n (updatedOptions) => {\n const { teamsUserAadToken, clientId, userObjectId } = updatedOptions;\n return this.client.communicationIdentityOperations.exchangeTeamsUserAccessToken(\n teamsUserAadToken,\n clientId,\n userObjectId,\n updatedOptions,\n );\n },\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"communicationIdentityClient.js","sourceRoot":"","sources":["../../src/communicationIdentityClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAclC,sEAIqC;AAGrC,gDAAqD;AACrD,iFAA2E;AAC3E,kDAA4C;AAC5C,2DA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qC,EAAE;QAEvC,OAAO,0BAAa,CAAC,QAAQ,CAC3B,0CAA0C,EAC1C,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,MAAM,iBACxF,qBAAqB,EAAE,MAAM,EAC7B,gBAAgB,EAAE,OAAO,CAAC,qBAAqB,EAC/C,QAAQ,EAAE,OAAO,CAAC,QAAQ,IACvB,cAAc,EACjB,CAAC;YACH,uCACK,WAAY,KACf,IAAI,EAAE,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,EAAE,IAC1C;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,UAAU,CACf,IAAiC,EACjC,UAA4B,EAAE;QAE9B,OAAO,0BAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,MAAM,CACtD,IAAI,CAAC,mBAAmB,EACxB,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CACzB,OAAoC;QAEpC,OAAO,0BAAa,CAAC,QAAQ,CAC3B,4CAA4C,EAC5C,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC;YACrE,OAAO,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,4BAA4B,CAC7E,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAxOD,kEAwOC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CommunicationAccessToken,\n CommunicationIdentityClientOptions,\n CommunicationUserToken,\n GetTokenForTeamsUserOptions,\n CreateUserAndTokenOptions,\n GetTokenOptions,\n TokenScope,\n CreateUserOptions,\n CommunicationUserDetail,\n} from \"./models.js\";\nimport type { CommunicationUserIdentifier } from \"@azure/communication-common\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport type { InternalClientPipelineOptions, OperationOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { IdentityRestClient } from \"./generated/src/identityRestClient.js\";\nimport { logger } from \"./common/logger.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\nconst isCommunicationIdentityClientOptions = (\n options: any,\n): options is CommunicationIdentityClientOptions =>\n options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services User Token Management.\n */\nexport class CommunicationIdentityClient {\n /**\n * A reference to the auto-generated UserToken HTTP client.\n */\n private readonly client: IdentityRestClient;\n\n /**\n * Initializes a new instance of the CommunicationIdentity class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: CommunicationIdentityClientOptions);\n\n /**\n * Initializes a new instance of the CommunicationIdentity class using an Azure KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the AzureKeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: CommunicationIdentityClientOptions,\n );\n /**\n * Initializes a new instance of the CommunicationIdentity class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net)\n * @param credential - TokenCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: CommunicationIdentityClientOptions,\n );\n\n public constructor(\n connectionStringOrEndpoint: string,\n credentialOrOptions?: KeyCredential | CommunicationIdentityClientOptions | TokenCredential,\n maybeOptions: CommunicationIdentityClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(\n connectionStringOrEndpoint,\n credentialOrOptions,\n );\n const options = isCommunicationIdentityClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new IdentityRestClient(url, { endpoint: url, ...internalPipelineOptions });\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Creates a scoped user token.\n *\n * @param user - The user whose tokens are being issued.\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public getToken(\n user: CommunicationUserIdentifier,\n scopes: TokenScope[],\n options: GetTokenOptions = {},\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\"CommunicationIdentity-issueToken\", options, (updatedOptions) => {\n return this.client.communicationIdentityOperations.issueAccessToken(\n user.communicationUserId,\n scopes,\n { expiresInMinutes: options.tokenExpiresInMinutes, ...updatedOptions },\n );\n });\n }\n\n /**\n * Revokes all data and tokens created for a user.\n *\n * @param user - The user whose tokens are being revoked.\n * @param options - Additional options for the request.\n */\n public revokeTokens(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-revokeTokens\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.revokeAccessTokens(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Get an identity by its id.\n *\n * @param user - The user to get.\n * @param options - Additional options for the request.\n */\n public getUserDetail(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<CommunicationUserDetail> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.get(\n user.communicationUserId,\n {\n ...updatedOptions,\n },\n );\n\n return {\n user: { communicationUserId: result.id },\n customId: result.customId,\n lastTokenIssuedAt: result.lastTokenIssuedAt,\n };\n },\n );\n }\n\n /**\n * Creates a single user.\n *\n * @param options - Additional options for the request.\n */\n public createUser(options: CreateUserOptions = {}): Promise<CommunicationUserIdentifier> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUser\",\n options,\n async (updatedOptions) => {\n const result = await this.client.communicationIdentityOperations.create({\n expiresInMinutes: undefined,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n communicationUserId: result.identity.id,\n };\n },\n );\n }\n\n /**\n * Creates a single user and a token simultaneously.\n *\n * @param scopes - Scopes to include in the token.\n * @param options - Additional options for the request.\n */\n public createUserAndToken(\n scopes: TokenScope[],\n options: CreateUserAndTokenOptions = {},\n ): Promise<CommunicationUserToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-createUserAndToken\",\n options,\n async (updatedOptions) => {\n const { identity, accessToken } = await this.client.communicationIdentityOperations.create({\n createTokenWithScopes: scopes,\n expiresInMinutes: options.tokenExpiresInMinutes,\n customId: options.customId,\n ...updatedOptions,\n });\n return {\n ...accessToken!,\n user: { communicationUserId: identity.id },\n };\n },\n );\n }\n\n /**\n * Triggers revocation event for user and deletes all its data.\n *\n * @param user - The user being deleted.\n * @param options - Additional options for the request.\n */\n public deleteUser(\n user: CommunicationUserIdentifier,\n options: OperationOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-deleteUser\",\n options,\n async (updatedOptions) => {\n await this.client.communicationIdentityOperations.delete(\n user.communicationUserId,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Exchanges an Azure AD access token of a Teams user for a new Communication Identity access token with a matching expiration time.\n *\n * @param options - Options used to exchange an Azure AD access token of a Teams user for a new Communication Identity access token.\n */\n public getTokenForTeamsUser(\n options: GetTokenForTeamsUserOptions,\n ): Promise<CommunicationAccessToken> {\n return tracingClient.withSpan(\n \"CommunicationIdentity-getTokenForTeamsUser\",\n options,\n (updatedOptions) => {\n const { teamsUserAadToken, clientId, userObjectId } = updatedOptions;\n return this.client.communicationIdentityOperations.exchangeTeamsUserAccessToken(\n teamsUserAadToken,\n clientId,\n userObjectId,\n updatedOptions,\n );\n },\n );\n }\n}\n"]}
|
|
@@ -12,14 +12,13 @@ const tslib_1 = require("tslib");
|
|
|
12
12
|
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
|
|
13
13
|
const index_js_1 = require("./operations/index.js");
|
|
14
14
|
class IdentityRestClient extends coreClient.ServiceClient {
|
|
15
|
-
endpoint;
|
|
16
|
-
apiVersion;
|
|
17
15
|
/**
|
|
18
16
|
* Initializes a new instance of the IdentityRestClient class.
|
|
19
17
|
* @param endpoint The communication resource, for example https://my-resource.communication.azure.com
|
|
20
18
|
* @param options The parameter options
|
|
21
19
|
*/
|
|
22
20
|
constructor(endpoint, options) {
|
|
21
|
+
var _a, _b;
|
|
23
22
|
if (endpoint === undefined) {
|
|
24
23
|
throw new Error("'endpoint' cannot be null");
|
|
25
24
|
}
|
|
@@ -34,14 +33,9 @@ class IdentityRestClient extends coreClient.ServiceClient {
|
|
|
34
33
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
35
34
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
36
35
|
: `${packageDetails}`;
|
|
37
|
-
const optionsWithDefaults = {
|
|
38
|
-
...defaults,
|
|
39
|
-
...options,
|
|
40
|
-
userAgentOptions: {
|
|
36
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
41
37
|
userAgentPrefix,
|
|
42
|
-
},
|
|
43
|
-
endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}",
|
|
44
|
-
};
|
|
38
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
|
|
45
39
|
super(optionsWithDefaults);
|
|
46
40
|
// Parameter assignments
|
|
47
41
|
this.endpoint = endpoint;
|
|
@@ -81,12 +75,6 @@ class IdentityRestClient extends coreClient.ServiceClient {
|
|
|
81
75
|
};
|
|
82
76
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
83
77
|
}
|
|
84
|
-
communicationIdentityOperations;
|
|
85
|
-
teamsExtensionToken;
|
|
86
|
-
teamsExtensionAssignment;
|
|
87
|
-
entraIdToken;
|
|
88
|
-
entraIdAssignments;
|
|
89
|
-
entraIdAssignment;
|
|
90
78
|
}
|
|
91
79
|
exports.IdentityRestClient = IdentityRestClient;
|
|
92
80
|
//# sourceMappingURL=identityRestClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityRestClient.js","sourceRoot":"","sources":["../../../../src/generated/src/identityRestClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AAMjD,oDAO+B;AAW/B,MAAa,kBAAmB,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"identityRestClient.js","sourceRoot":"","sources":["../../../../src/generated/src/identityRestClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AAMjD,oDAO+B;AAW/B,MAAa,kBAAmB,SAAQ,UAAU,CAAC,aAAa;IAI9D;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAA0C;;QACtE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QA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E,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAQF;AAtFD,gDAsFC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n CommunicationIdentityOperationsImpl,\n TeamsExtensionTokenImpl,\n TeamsExtensionAssignmentImpl,\n EntraIdTokenImpl,\n EntraIdAssignmentsImpl,\n EntraIdAssignmentImpl,\n} from \"./operations/index.js\";\nimport {\n CommunicationIdentityOperations,\n TeamsExtensionToken,\n TeamsExtensionAssignment,\n EntraIdToken,\n EntraIdAssignments,\n EntraIdAssignment,\n} from \"./operationsInterfaces/index.js\";\nimport { IdentityRestClientOptionalParams } from \"./models/index.js\";\n\nexport class IdentityRestClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the IdentityRestClient class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: IdentityRestClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: IdentityRestClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-identity/1.4.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2025-03-02-preview\";\n this.communicationIdentityOperations =\n new CommunicationIdentityOperationsImpl(this);\n this.teamsExtensionToken = new TeamsExtensionTokenImpl(this);\n this.teamsExtensionAssignment = new TeamsExtensionAssignmentImpl(this);\n this.entraIdToken = new EntraIdTokenImpl(this);\n this.entraIdAssignments = new EntraIdAssignmentsImpl(this);\n this.entraIdAssignment = new EntraIdAssignmentImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n communicationIdentityOperations: CommunicationIdentityOperations;\n teamsExtensionToken: TeamsExtensionToken;\n teamsExtensionAssignment: TeamsExtensionAssignment;\n entraIdToken: EntraIdToken;\n entraIdAssignments: EntraIdAssignments;\n entraIdAssignment: EntraIdAssignment;\n}\n"]}
|
|
@@ -15,7 +15,6 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
|
|
|
15
15
|
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
|
|
16
16
|
/** Class containing CommunicationIdentityOperations operations. */
|
|
17
17
|
class CommunicationIdentityOperationsImpl {
|
|
18
|
-
client;
|
|
19
18
|
/**
|
|
20
19
|
* Initialize a new instance of the class CommunicationIdentityOperations class.
|
|
21
20
|
* @param client Reference to the service client
|
|
@@ -29,7 +28,7 @@ class CommunicationIdentityOperationsImpl {
|
|
|
29
28
|
* @param options The options parameters.
|
|
30
29
|
*/
|
|
31
30
|
async create(options) {
|
|
32
|
-
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.create", options
|
|
31
|
+
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.create", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
33
32
|
return this.client.sendOperationRequest({ options }, createOperationSpec);
|
|
34
33
|
});
|
|
35
34
|
}
|
|
@@ -39,7 +38,7 @@ class CommunicationIdentityOperationsImpl {
|
|
|
39
38
|
* @param options The options parameters.
|
|
40
39
|
*/
|
|
41
40
|
async delete(id, options) {
|
|
42
|
-
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.delete", options
|
|
41
|
+
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.delete", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
43
42
|
return this.client.sendOperationRequest({ id, options }, deleteOperationSpec);
|
|
44
43
|
});
|
|
45
44
|
}
|
|
@@ -49,7 +48,7 @@ class CommunicationIdentityOperationsImpl {
|
|
|
49
48
|
* @param options The options parameters.
|
|
50
49
|
*/
|
|
51
50
|
async get(id, options) {
|
|
52
|
-
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.get", options
|
|
51
|
+
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.get", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
53
52
|
return this.client.sendOperationRequest({ id, options }, getOperationSpec);
|
|
54
53
|
});
|
|
55
54
|
}
|
|
@@ -59,7 +58,7 @@ class CommunicationIdentityOperationsImpl {
|
|
|
59
58
|
* @param options The options parameters.
|
|
60
59
|
*/
|
|
61
60
|
async revokeAccessTokens(id, options) {
|
|
62
|
-
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.revokeAccessTokens", options
|
|
61
|
+
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.revokeAccessTokens", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
63
62
|
return this.client.sendOperationRequest({ id, options }, revokeAccessTokensOperationSpec);
|
|
64
63
|
});
|
|
65
64
|
}
|
|
@@ -75,7 +74,7 @@ class CommunicationIdentityOperationsImpl {
|
|
|
75
74
|
* @param options The options parameters.
|
|
76
75
|
*/
|
|
77
76
|
async exchangeTeamsUserAccessToken(token, appId, userId, options) {
|
|
78
|
-
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.exchangeTeamsUserAccessToken", options
|
|
77
|
+
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.exchangeTeamsUserAccessToken", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
79
78
|
return this.client.sendOperationRequest({ token, appId, userId, options }, exchangeTeamsUserAccessTokenOperationSpec);
|
|
80
79
|
});
|
|
81
80
|
}
|
|
@@ -86,7 +85,7 @@ class CommunicationIdentityOperationsImpl {
|
|
|
86
85
|
* @param options The options parameters.
|
|
87
86
|
*/
|
|
88
87
|
async issueAccessToken(id, scopes, options) {
|
|
89
|
-
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.issueAccessToken", options
|
|
88
|
+
return tracing_js_1.tracingClient.withSpan("IdentityRestClient.issueAccessToken", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
90
89
|
return this.client.sendOperationRequest({ id, scopes, options }, issueAccessTokenOperationSpec);
|
|
91
90
|
});
|
|
92
91
|
}
|
|
@@ -176,7 +175,7 @@ const exchangeTeamsUserAccessTokenOperationSpec = {
|
|
|
176
175
|
},
|
|
177
176
|
requestBody: {
|
|
178
177
|
parameterPath: { token: ["token"], appId: ["appId"], userId: ["userId"] },
|
|
179
|
-
mapper: {
|
|
178
|
+
mapper: Object.assign(Object.assign({}, Mappers.TeamsUserExchangeTokenRequest), { required: true }),
|
|
180
179
|
},
|
|
181
180
|
queryParameters: [Parameters.apiVersion],
|
|
182
181
|
urlParameters: [Parameters.endpoint],
|
|
@@ -200,10 +199,7 @@ const issueAccessTokenOperationSpec = {
|
|
|
200
199
|
scopes: ["scopes"],
|
|
201
200
|
expiresInMinutes: ["options", "expiresInMinutes"],
|
|
202
201
|
},
|
|
203
|
-
mapper: {
|
|
204
|
-
...Mappers.CommunicationIdentityAccessTokenRequest,
|
|
205
|
-
required: true,
|
|
206
|
-
},
|
|
202
|
+
mapper: Object.assign(Object.assign({}, Mappers.CommunicationIdentityAccessTokenRequest), { required: true }),
|
|
207
203
|
},
|
|
208
204
|
queryParameters: [Parameters.apiVersion],
|
|
209
205
|
urlParameters: [Parameters.endpoint, Parameters.id],
|