@azure-rest/communication-job-router 1.1.0-beta.1 → 1.1.0-beta.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/README.md +168 -115
- package/dist/browser/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/browser/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/browser/azureCommunicationRoutingServiceClient.js +40 -0
- package/dist/browser/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.js +29 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/browser/clientDefinitions.d.ts +159 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +13 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +35 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/isUnexpected.js +1 -1
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/logger.js +1 -1
- package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
- package/dist/browser/models.d.ts +562 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +683 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/dist/browser/paginateHelper.js +167 -0
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +245 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/responses.d.ts +616 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.js +43 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.js +33 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +159 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +11 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +35 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +105 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +562 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +683 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +170 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +245 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/responses.d.ts +616 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.js +40 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.js +29 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/esm/clientDefinitions.d.ts +159 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +35 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +102 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +562 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +683 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +167 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +245 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/responses.d.ts +616 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.js +40 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.js +29 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +159 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +11 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +13 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +35 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +102 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +562 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +683 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +167 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +245 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/responses.d.ts +616 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +79 -63
- package/dist/index.js +0 -229
- package/dist/index.js.map +0 -1
- package/dist-esm/src/azureCommunicationRoutingServiceClient.js +0 -42
- package/dist-esm/src/azureCommunicationRoutingServiceClient.js.map +0 -1
- package/dist-esm/src/clientDefinitions.js +0 -4
- package/dist-esm/src/clientDefinitions.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/isUnexpected.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/src/outputModels.js +0 -4
- package/dist-esm/src/outputModels.js.map +0 -1
- package/dist-esm/src/paginateHelper.js +0 -70
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/review/communication-job-router.api.md +0 -2485
- package/types/communication-job-router.d.ts +0 -2677
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport type {\n ClassificationPolicyOutput,\n PagedClassificationPolicyOutput,\n DistributionPolicyOutput,\n PagedDistributionPolicyOutput,\n ExceptionPolicyOutput,\n PagedExceptionPolicyOutput,\n RouterQueueOutput,\n PagedRouterQueueOutput,\n RouterJobOutput,\n ReclassifyJobResultOutput,\n CancelJobResultOutput,\n CompleteJobResultOutput,\n CloseJobResultOutput,\n PagedRouterJobOutput,\n RouterJobPositionDetailsOutput,\n UnassignJobResultOutput,\n AcceptJobOfferResultOutput,\n DeclineJobOfferResultOutput,\n RouterQueueStatisticsOutput,\n RouterWorkerOutput,\n PagedRouterWorkerOutput,\n} from \"./outputModels.js\";\n\nexport interface UpsertClassificationPolicy200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface UpsertClassificationPolicy200Response extends HttpResponse {\n status: \"200\";\n body: ClassificationPolicyOutput;\n headers: RawHttpHeaders & UpsertClassificationPolicy200Headers;\n}\n\nexport interface UpsertClassificationPolicy201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface UpsertClassificationPolicy201Response extends HttpResponse {\n status: \"201\";\n body: ClassificationPolicyOutput;\n headers: RawHttpHeaders & UpsertClassificationPolicy201Headers;\n}\n\nexport interface UpsertClassificationPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UpsertClassificationPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UpsertClassificationPolicyDefaultHeaders;\n}\n\nexport interface GetClassificationPolicy200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetClassificationPolicy200Response extends HttpResponse {\n status: \"200\";\n body: ClassificationPolicyOutput;\n headers: RawHttpHeaders & GetClassificationPolicy200Headers;\n}\n\nexport interface GetClassificationPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetClassificationPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetClassificationPolicyDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteClassificationPolicy204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteClassificationPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteClassificationPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteClassificationPolicyDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListClassificationPolicies200Response extends HttpResponse {\n status: \"200\";\n body: PagedClassificationPolicyOutput;\n}\n\nexport interface ListClassificationPoliciesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListClassificationPoliciesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListClassificationPoliciesDefaultHeaders;\n}\n\nexport interface UpsertDistributionPolicy200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface UpsertDistributionPolicy200Response extends HttpResponse {\n status: \"200\";\n body: DistributionPolicyOutput;\n headers: RawHttpHeaders & UpsertDistributionPolicy200Headers;\n}\n\nexport interface UpsertDistributionPolicy201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface UpsertDistributionPolicy201Response extends HttpResponse {\n status: \"201\";\n body: DistributionPolicyOutput;\n headers: RawHttpHeaders & UpsertDistributionPolicy201Headers;\n}\n\nexport interface UpsertDistributionPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UpsertDistributionPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UpsertDistributionPolicyDefaultHeaders;\n}\n\nexport interface GetDistributionPolicy200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetDistributionPolicy200Response extends HttpResponse {\n status: \"200\";\n body: DistributionPolicyOutput;\n headers: RawHttpHeaders & GetDistributionPolicy200Headers;\n}\n\nexport interface GetDistributionPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetDistributionPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetDistributionPolicyDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteDistributionPolicy204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteDistributionPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteDistributionPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteDistributionPolicyDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListDistributionPolicies200Response extends HttpResponse {\n status: \"200\";\n body: PagedDistributionPolicyOutput;\n}\n\nexport interface ListDistributionPoliciesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListDistributionPoliciesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListDistributionPoliciesDefaultHeaders;\n}\n\nexport interface UpsertExceptionPolicy200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface UpsertExceptionPolicy200Response extends HttpResponse {\n status: \"200\";\n body: ExceptionPolicyOutput;\n headers: RawHttpHeaders & UpsertExceptionPolicy200Headers;\n}\n\nexport interface UpsertExceptionPolicy201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface UpsertExceptionPolicy201Response extends HttpResponse {\n status: \"201\";\n body: ExceptionPolicyOutput;\n headers: RawHttpHeaders & UpsertExceptionPolicy201Headers;\n}\n\nexport interface UpsertExceptionPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UpsertExceptionPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UpsertExceptionPolicyDefaultHeaders;\n}\n\nexport interface GetExceptionPolicy200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetExceptionPolicy200Response extends HttpResponse {\n status: \"200\";\n body: ExceptionPolicyOutput;\n headers: RawHttpHeaders & GetExceptionPolicy200Headers;\n}\n\nexport interface GetExceptionPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetExceptionPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetExceptionPolicyDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteExceptionPolicy204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteExceptionPolicyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteExceptionPolicyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteExceptionPolicyDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListExceptionPolicies200Response extends HttpResponse {\n status: \"200\";\n body: PagedExceptionPolicyOutput;\n}\n\nexport interface ListExceptionPoliciesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListExceptionPoliciesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListExceptionPoliciesDefaultHeaders;\n}\n\nexport interface UpsertQueue200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface UpsertQueue200Response extends HttpResponse {\n status: \"200\";\n body: RouterQueueOutput;\n headers: RawHttpHeaders & UpsertQueue200Headers;\n}\n\nexport interface UpsertQueue201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface UpsertQueue201Response extends HttpResponse {\n status: \"201\";\n body: RouterQueueOutput;\n headers: RawHttpHeaders & UpsertQueue201Headers;\n}\n\nexport interface UpsertQueueDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UpsertQueueDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UpsertQueueDefaultHeaders;\n}\n\nexport interface GetQueue200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetQueue200Response extends HttpResponse {\n status: \"200\";\n body: RouterQueueOutput;\n headers: RawHttpHeaders & GetQueue200Headers;\n}\n\nexport interface GetQueueDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetQueueDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetQueueDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteQueue204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteQueueDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteQueueDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteQueueDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListQueues200Response extends HttpResponse {\n status: \"200\";\n body: PagedRouterQueueOutput;\n}\n\nexport interface ListQueuesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListQueuesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListQueuesDefaultHeaders;\n}\n\nexport interface UpsertJob200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface UpsertJob200Response extends HttpResponse {\n status: \"200\";\n body: RouterJobOutput;\n headers: RawHttpHeaders & UpsertJob200Headers;\n}\n\nexport interface UpsertJob201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface UpsertJob201Response extends HttpResponse {\n status: \"201\";\n body: RouterJobOutput;\n headers: RawHttpHeaders & UpsertJob201Headers;\n}\n\nexport interface UpsertJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UpsertJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UpsertJobDefaultHeaders;\n}\n\nexport interface GetJob200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetJob200Response extends HttpResponse {\n status: \"200\";\n body: RouterJobOutput;\n headers: RawHttpHeaders & GetJob200Headers;\n}\n\nexport interface GetJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetJobDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteJob204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteJobDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Reclassify200Response extends HttpResponse {\n status: \"200\";\n body: ReclassifyJobResultOutput;\n}\n\nexport interface ReclassifyDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ReclassifyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ReclassifyDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Cancel200Response extends HttpResponse {\n status: \"200\";\n body: CancelJobResultOutput;\n}\n\nexport interface CancelDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CancelDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CancelDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Complete200Response extends HttpResponse {\n status: \"200\";\n body: CompleteJobResultOutput;\n}\n\nexport interface CompleteDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CompleteDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CompleteDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Close200Response extends HttpResponse {\n status: \"200\";\n body: CloseJobResultOutput;\n}\n\nexport interface CloseDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CloseDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CloseDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListJobs200Response extends HttpResponse {\n status: \"200\";\n body: PagedRouterJobOutput;\n}\n\nexport interface ListJobsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListJobsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListJobsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetInQueuePosition200Response extends HttpResponse {\n status: \"200\";\n body: RouterJobPositionDetailsOutput;\n}\n\nexport interface GetInQueuePositionDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetInQueuePositionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetInQueuePositionDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Unassign200Response extends HttpResponse {\n status: \"200\";\n body: UnassignJobResultOutput;\n}\n\nexport interface UnassignDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UnassignDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UnassignDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Accept200Response extends HttpResponse {\n status: \"200\";\n body: AcceptJobOfferResultOutput;\n}\n\nexport interface AcceptDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface AcceptDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & AcceptDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface Decline200Response extends HttpResponse {\n status: \"200\";\n body: DeclineJobOfferResultOutput;\n}\n\nexport interface DeclineDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeclineDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeclineDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetQueueStatistics200Response extends HttpResponse {\n status: \"200\";\n body: RouterQueueStatisticsOutput;\n}\n\nexport interface GetQueueStatisticsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetQueueStatisticsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetQueueStatisticsDefaultHeaders;\n}\n\nexport interface UpsertWorker200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface UpsertWorker200Response extends HttpResponse {\n status: \"200\";\n body: RouterWorkerOutput;\n headers: RawHttpHeaders & UpsertWorker200Headers;\n}\n\nexport interface UpsertWorker201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface UpsertWorker201Response extends HttpResponse {\n status: \"201\";\n body: RouterWorkerOutput;\n headers: RawHttpHeaders & UpsertWorker201Headers;\n}\n\nexport interface UpsertWorkerDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface UpsertWorkerDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & UpsertWorkerDefaultHeaders;\n}\n\nexport interface GetWorker200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** The last modified timestamp. */\n \"last-modified\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetWorker200Response extends HttpResponse {\n status: \"200\";\n body: RouterWorkerOutput;\n headers: RawHttpHeaders & GetWorker200Headers;\n}\n\nexport interface GetWorkerDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetWorkerDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetWorkerDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteWorker204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteWorkerDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteWorkerDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteWorkerDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListWorkers200Response extends HttpResponse {\n status: \"200\";\n body: PagedRouterWorkerOutput;\n}\n\nexport interface ListWorkersDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListWorkersDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListWorkersDefaultHeaders;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/communication-job-router",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.1.0-beta.
|
|
5
|
+
"version": "1.1.0-beta.2",
|
|
6
6
|
"description": "Azure client library for Azure Communication Job Router services",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -13,95 +13,75 @@
|
|
|
13
13
|
"isomorphic"
|
|
14
14
|
],
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"module": "./dist
|
|
18
|
-
"types": "./
|
|
16
|
+
"main": "./dist/commonjs/index.js",
|
|
17
|
+
"module": "./dist/esm/index.js",
|
|
18
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
19
19
|
"repository": "github:Azure/azure-sdk-for-js",
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist/",
|
|
25
|
-
"dist-esm/src/",
|
|
26
|
-
"types/communication-job-router.d.ts",
|
|
27
25
|
"README.md",
|
|
28
|
-
"LICENSE"
|
|
29
|
-
"review/*"
|
|
26
|
+
"LICENSE"
|
|
30
27
|
],
|
|
31
28
|
"engines": {
|
|
32
29
|
"node": ">=18.0.0"
|
|
33
30
|
},
|
|
34
31
|
"scripts": {
|
|
35
|
-
"
|
|
36
|
-
"build:browser": "
|
|
37
|
-
"build:
|
|
32
|
+
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
|
33
|
+
"build:browser": "dev-tool run build-package && dev-tool run vendored cross-env ONLY_BROWSER=true rollup -c 2>&1",
|
|
34
|
+
"build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api",
|
|
35
|
+
"build:node": "dev-tool run build-package && dev-tool run vendored cross-env ONLY_NODE=true rollup -c 2>&1",
|
|
38
36
|
"build:samples": "dev-tool samples publish --force",
|
|
39
|
-
"build:test": "
|
|
40
|
-
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
|
|
37
|
+
"build:test": "dev-tool run build-package && dev-tool run bundle",
|
|
41
38
|
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
|
|
42
|
-
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
39
|
+
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
43
40
|
"execute:samples": "dev-tool samples run samples-dev",
|
|
44
|
-
"extract-api": "
|
|
41
|
+
"extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
|
|
45
42
|
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
|
|
46
43
|
"generate:client": "echo skipped",
|
|
47
|
-
"integration-test:browser": "dev-tool run test:browser",
|
|
48
|
-
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
|
|
49
44
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
45
|
+
"integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
46
|
+
"integration-test:node": "dev-tool run test:vitest --esm",
|
|
47
|
+
"lint": "eslint package.json api-extractor.json src test",
|
|
48
|
+
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
|
|
52
49
|
"pack": "npm pack 2>&1",
|
|
50
|
+
"test": "npm rdddun clean && npm run build:test && npm run unit-test",
|
|
53
51
|
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
|
|
54
52
|
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
|
|
55
|
-
"test": "npm rdddun clean && npm run build:test && npm run unit-test",
|
|
56
53
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
57
|
-
"unit-test:
|
|
58
|
-
"unit-test:
|
|
59
|
-
"
|
|
54
|
+
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
55
|
+
"unit-test:node": "dev-tool run test:vitest",
|
|
56
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
60
57
|
},
|
|
61
58
|
"sideEffects": false,
|
|
62
59
|
"autoPublish": false,
|
|
63
60
|
"dependencies": {
|
|
64
|
-
"@azure/core-
|
|
65
|
-
"@azure
|
|
66
|
-
"@azure/core-
|
|
67
|
-
"@azure/
|
|
68
|
-
"@azure/logger": "^1.
|
|
69
|
-
"tslib": "^2.
|
|
70
|
-
"@azure/core-paging": "^1.5.0"
|
|
61
|
+
"@azure-rest/core-client": "^2.3.1",
|
|
62
|
+
"@azure/communication-common": "^2.3.1",
|
|
63
|
+
"@azure/core-auth": "^1.9.0",
|
|
64
|
+
"@azure/core-rest-pipeline": "^1.18.0",
|
|
65
|
+
"@azure/logger": "^1.1.4",
|
|
66
|
+
"tslib": "^2.8.1"
|
|
71
67
|
},
|
|
72
68
|
"devDependencies": {
|
|
73
|
-
"@
|
|
74
|
-
"
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"dotenv": "^16.0.0",
|
|
78
|
-
"eslint": "^8.0.0",
|
|
79
|
-
"mkdirp": "^2.1.2",
|
|
80
|
-
"rimraf": "^5.0.0",
|
|
81
|
-
"source-map-support": "^0.5.9",
|
|
82
|
-
"typescript": "~5.4.5",
|
|
69
|
+
"@azure-tools/test-credential": "^2.0.0",
|
|
70
|
+
"@azure-tools/test-recorder": "^4.1.0",
|
|
71
|
+
"@azure-tools/test-utils-vitest": "^1.0.0",
|
|
72
|
+
"@azure/core-util": "^1.11.0",
|
|
83
73
|
"@azure/dev-tool": "^1.0.0",
|
|
84
74
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
85
|
-
"@azure
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"karma-coverage": "^2.0.0",
|
|
96
|
-
"karma-env-preprocessor": "^0.1.1",
|
|
97
|
-
"karma-firefox-launcher": "^2.1.2",
|
|
98
|
-
"karma-junit-reporter": "^2.0.1",
|
|
99
|
-
"karma-mocha-reporter": "^2.2.5",
|
|
100
|
-
"karma-mocha": "^2.0.1",
|
|
101
|
-
"karma-source-map-support": "~1.4.0",
|
|
102
|
-
"karma-sourcemap-loader": "^0.4.0",
|
|
103
|
-
"karma": "^6.2.0",
|
|
104
|
-
"ts-node": "^10.0.0"
|
|
75
|
+
"@azure/identity": "^4.5.0",
|
|
76
|
+
"@types/node": "^18.0.0",
|
|
77
|
+
"@vitest/browser": "^3.0.3",
|
|
78
|
+
"@vitest/coverage-istanbul": "^3.0.3",
|
|
79
|
+
"autorest": "latest",
|
|
80
|
+
"dotenv": "^16.0.0",
|
|
81
|
+
"eslint": "^9.9.0",
|
|
82
|
+
"playwright": "^1.48.2",
|
|
83
|
+
"typescript": "~5.7.2",
|
|
84
|
+
"vitest": "^3.0.3"
|
|
105
85
|
},
|
|
106
86
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/communication-job-router-rest/README.md",
|
|
107
87
|
"//metadata": {
|
|
@@ -112,14 +92,50 @@
|
|
|
112
92
|
}
|
|
113
93
|
]
|
|
114
94
|
},
|
|
115
|
-
"browser":
|
|
116
|
-
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
|
|
117
|
-
},
|
|
95
|
+
"browser": "./dist/browser/index.js",
|
|
118
96
|
"//sampleConfiguration": {
|
|
119
97
|
"productName": "Azure client library for Azure Communication Job Router services",
|
|
120
98
|
"productSlugs": [
|
|
121
99
|
"azure",
|
|
122
100
|
"azure-communication-services"
|
|
123
101
|
]
|
|
102
|
+
},
|
|
103
|
+
"type": "module",
|
|
104
|
+
"tshy": {
|
|
105
|
+
"exports": {
|
|
106
|
+
"./package.json": "./package.json",
|
|
107
|
+
".": "./src/index.ts"
|
|
108
|
+
},
|
|
109
|
+
"dialects": [
|
|
110
|
+
"esm",
|
|
111
|
+
"commonjs"
|
|
112
|
+
],
|
|
113
|
+
"esmDialects": [
|
|
114
|
+
"browser",
|
|
115
|
+
"react-native"
|
|
116
|
+
],
|
|
117
|
+
"selfLink": false,
|
|
118
|
+
"project": "./tsconfig.src.json"
|
|
119
|
+
},
|
|
120
|
+
"exports": {
|
|
121
|
+
"./package.json": "./package.json",
|
|
122
|
+
".": {
|
|
123
|
+
"browser": {
|
|
124
|
+
"types": "./dist/browser/index.d.ts",
|
|
125
|
+
"default": "./dist/browser/index.js"
|
|
126
|
+
},
|
|
127
|
+
"react-native": {
|
|
128
|
+
"types": "./dist/react-native/index.d.ts",
|
|
129
|
+
"default": "./dist/react-native/index.js"
|
|
130
|
+
},
|
|
131
|
+
"import": {
|
|
132
|
+
"types": "./dist/esm/index.d.ts",
|
|
133
|
+
"default": "./dist/esm/index.js"
|
|
134
|
+
},
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
137
|
+
"default": "./dist/commonjs/index.js"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
124
140
|
}
|
|
125
141
|
}
|
package/dist/index.js
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var coreClient = require('@azure-rest/core-client');
|
|
6
|
-
var coreAuth = require('@azure/core-auth');
|
|
7
|
-
var logger$1 = require('@azure/logger');
|
|
8
|
-
var communicationCommon = require('@azure/communication-common');
|
|
9
|
-
var corePaging = require('@azure/core-paging');
|
|
10
|
-
|
|
11
|
-
// Copyright (c) Microsoft Corporation.
|
|
12
|
-
// Licensed under the MIT license.
|
|
13
|
-
const logger = logger$1.createClientLogger("communication-job-router");
|
|
14
|
-
|
|
15
|
-
// Copyright (c) Microsoft Corporation.
|
|
16
|
-
// Licensed under the MIT license.
|
|
17
|
-
// Implementation
|
|
18
|
-
function createClient(arg1, arg2, arg3) {
|
|
19
|
-
var _a, _b, _c, _d;
|
|
20
|
-
let credentialOrOptions;
|
|
21
|
-
let options;
|
|
22
|
-
const connectionStringOrUrl = arg1;
|
|
23
|
-
// Determine which constructor is being called based on the types of the arguments
|
|
24
|
-
if (coreAuth.isTokenCredential(arg2) || communicationCommon.isKeyCredential(arg2)) {
|
|
25
|
-
credentialOrOptions = arg2;
|
|
26
|
-
options = arg3;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
options = arg2;
|
|
30
|
-
}
|
|
31
|
-
if (options === undefined) {
|
|
32
|
-
options = {};
|
|
33
|
-
}
|
|
34
|
-
// Rest of the function remains the same, using connectionStringOrUrl or endpoint as needed
|
|
35
|
-
const { url, credential } = communicationCommon.parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
36
|
-
const baseUrl = (_a = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _a !== void 0 ? _a : `${url}`;
|
|
37
|
-
options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2024-01-18-preview";
|
|
38
|
-
const userAgentInfo = `azsdk-js-communication-job-router-rest/1.1.0-beta.1`;
|
|
39
|
-
const userAgentPrefix = (options === null || options === void 0 ? void 0 : options.userAgentOptions) && (options === null || options === void 0 ? void 0 : options.userAgentOptions.userAgentPrefix)
|
|
40
|
-
? `${options === null || options === void 0 ? void 0 : options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
41
|
-
: `${userAgentInfo}`;
|
|
42
|
-
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
43
|
-
userAgentPrefix,
|
|
44
|
-
}, loggingOptions: {
|
|
45
|
-
logger: (_d = (_c = options === null || options === void 0 ? void 0 : options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger.info,
|
|
46
|
-
} });
|
|
47
|
-
const client = coreClient.getClient(baseUrl, options);
|
|
48
|
-
const authPolicy = communicationCommon.createCommunicationAuthPolicy(credential);
|
|
49
|
-
client.pipeline.addPolicy(authPolicy);
|
|
50
|
-
return client;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Copyright (c) Microsoft Corporation.
|
|
54
|
-
// Licensed under the MIT license.
|
|
55
|
-
const responseMap = {
|
|
56
|
-
"PATCH /routing/classificationPolicies/{classificationPolicyId}": ["200", "201"],
|
|
57
|
-
"GET /routing/classificationPolicies/{classificationPolicyId}": ["200"],
|
|
58
|
-
"DELETE /routing/classificationPolicies/{classificationPolicyId}": ["204"],
|
|
59
|
-
"GET /routing/classificationPolicies": ["200"],
|
|
60
|
-
"PATCH /routing/distributionPolicies/{distributionPolicyId}": ["200", "201"],
|
|
61
|
-
"GET /routing/distributionPolicies/{distributionPolicyId}": ["200"],
|
|
62
|
-
"DELETE /routing/distributionPolicies/{distributionPolicyId}": ["204"],
|
|
63
|
-
"GET /routing/distributionPolicies": ["200"],
|
|
64
|
-
"PATCH /routing/exceptionPolicies/{exceptionPolicyId}": ["200", "201"],
|
|
65
|
-
"GET /routing/exceptionPolicies/{exceptionPolicyId}": ["200"],
|
|
66
|
-
"DELETE /routing/exceptionPolicies/{exceptionPolicyId}": ["204"],
|
|
67
|
-
"GET /routing/exceptionPolicies": ["200"],
|
|
68
|
-
"PATCH /routing/queues/{queueId}": ["200", "201"],
|
|
69
|
-
"GET /routing/queues/{queueId}": ["200"],
|
|
70
|
-
"DELETE /routing/queues/{queueId}": ["204"],
|
|
71
|
-
"GET /routing/queues": ["200"],
|
|
72
|
-
"PATCH /routing/jobs/{jobId}": ["200", "201"],
|
|
73
|
-
"GET /routing/jobs/{jobId}": ["200"],
|
|
74
|
-
"DELETE /routing/jobs/{jobId}": ["204"],
|
|
75
|
-
"POST /routing/jobs/{jobId}:reclassify": ["200"],
|
|
76
|
-
"POST /routing/jobs/{jobId}:cancel": ["200"],
|
|
77
|
-
"POST /routing/jobs/{jobId}/assignments/{assignmentId}:complete": ["200"],
|
|
78
|
-
"POST /routing/jobs/{jobId}/assignments/{assignmentId}:close": ["200"],
|
|
79
|
-
"GET /routing/jobs": ["200"],
|
|
80
|
-
"GET /routing/jobs/{jobId}/position": ["200"],
|
|
81
|
-
"POST /routing/jobs/{jobId}/assignments/{assignmentId}:unassign": ["200"],
|
|
82
|
-
"POST /routing/workers/{workerId}/offers/{offerId}:accept": ["200"],
|
|
83
|
-
"POST /routing/workers/{workerId}/offers/{offerId}:decline": ["200"],
|
|
84
|
-
"GET /routing/queues/{queueId}/statistics": ["200"],
|
|
85
|
-
"PATCH /routing/workers/{workerId}": ["200", "201"],
|
|
86
|
-
"GET /routing/workers/{workerId}": ["200"],
|
|
87
|
-
"DELETE /routing/workers/{workerId}": ["204"],
|
|
88
|
-
"GET /routing/workers": ["200"],
|
|
89
|
-
};
|
|
90
|
-
function isUnexpected(response) {
|
|
91
|
-
const lroOriginal = response.headers["x-ms-original-url"];
|
|
92
|
-
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
93
|
-
const method = response.request.method;
|
|
94
|
-
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
95
|
-
if (!pathDetails) {
|
|
96
|
-
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
97
|
-
}
|
|
98
|
-
return !pathDetails.includes(response.status);
|
|
99
|
-
}
|
|
100
|
-
function getParametrizedPathSuccess(method, path) {
|
|
101
|
-
var _a, _b, _c, _d;
|
|
102
|
-
const pathParts = path.split("/");
|
|
103
|
-
// Traverse list to match the longest candidate
|
|
104
|
-
// matchedLen: the length of candidate path
|
|
105
|
-
// matchedValue: the matched status code array
|
|
106
|
-
let matchedLen = -1, matchedValue = [];
|
|
107
|
-
// Iterate the responseMap to find a match
|
|
108
|
-
for (const [key, value] of Object.entries(responseMap)) {
|
|
109
|
-
// Extracting the path from the map key which is in format
|
|
110
|
-
// GET /path/foo
|
|
111
|
-
if (!key.startsWith(method)) {
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
const candidatePath = getPathFromMapKey(key);
|
|
115
|
-
// Get each part of the url path
|
|
116
|
-
const candidateParts = candidatePath.split("/");
|
|
117
|
-
// track if we have found a match to return the values found.
|
|
118
|
-
let found = true;
|
|
119
|
-
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
120
|
-
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
121
|
-
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
122
|
-
// If the current part of the candidate is a "template" part
|
|
123
|
-
// Try to use the suffix of pattern to match the path
|
|
124
|
-
// {guid} ==> $
|
|
125
|
-
// {guid}:export ==> :export$
|
|
126
|
-
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
127
|
-
if (!isMatched) {
|
|
128
|
-
found = false;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
// If the candidate part is not a template and
|
|
134
|
-
// the parts don't match mark the candidate as not found
|
|
135
|
-
// to move on with the next candidate path.
|
|
136
|
-
if (candidateParts[i] !== pathParts[j]) {
|
|
137
|
-
found = false;
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// We finished evaluating the current candidate parts
|
|
142
|
-
// Update the matched value if and only if we found the longer pattern
|
|
143
|
-
if (found && candidatePath.length > matchedLen) {
|
|
144
|
-
matchedLen = candidatePath.length;
|
|
145
|
-
matchedValue = value;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return matchedValue;
|
|
149
|
-
}
|
|
150
|
-
function getPathFromMapKey(mapKey) {
|
|
151
|
-
const pathStart = mapKey.indexOf("/");
|
|
152
|
-
return mapKey.slice(pathStart);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Copyright (c) Microsoft Corporation.
|
|
156
|
-
// Licensed under the MIT license.
|
|
157
|
-
/**
|
|
158
|
-
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
159
|
-
* @param client - Client to use for sending the next page requests
|
|
160
|
-
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
161
|
-
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
162
|
-
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
163
|
-
*/
|
|
164
|
-
function paginate(client, initialResponse, options = {}) {
|
|
165
|
-
let firstRun = true;
|
|
166
|
-
const itemName = "value";
|
|
167
|
-
const nextLinkName = "nextLink";
|
|
168
|
-
const { customGetPage } = options;
|
|
169
|
-
const pagedResult = {
|
|
170
|
-
firstPageLink: "",
|
|
171
|
-
getPage: typeof customGetPage === "function"
|
|
172
|
-
? customGetPage
|
|
173
|
-
: async (pageLink) => {
|
|
174
|
-
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
|
|
175
|
-
firstRun = false;
|
|
176
|
-
checkPagingRequest(result);
|
|
177
|
-
const nextLink = getNextLink(result.body, nextLinkName);
|
|
178
|
-
const values = getElements(result.body, itemName);
|
|
179
|
-
return {
|
|
180
|
-
page: values,
|
|
181
|
-
nextPageLink: nextLink,
|
|
182
|
-
};
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
return corePaging.getPagedAsyncIterator(pagedResult);
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Gets for the value of nextLink in the body
|
|
189
|
-
*/
|
|
190
|
-
function getNextLink(body, nextLinkName) {
|
|
191
|
-
if (!nextLinkName) {
|
|
192
|
-
return undefined;
|
|
193
|
-
}
|
|
194
|
-
const nextLink = body[nextLinkName];
|
|
195
|
-
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
196
|
-
throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
|
|
197
|
-
}
|
|
198
|
-
return nextLink;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Gets the elements of the current request in the body.
|
|
202
|
-
*/
|
|
203
|
-
function getElements(body, itemName) {
|
|
204
|
-
const value = body[itemName];
|
|
205
|
-
// value has to be an array according to the x-ms-pageable extension.
|
|
206
|
-
// The fact that this must be an array is used above to calculate the
|
|
207
|
-
// type of elements in the page in PaginateReturn
|
|
208
|
-
if (!Array.isArray(value)) {
|
|
209
|
-
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
210
|
-
}
|
|
211
|
-
return value !== null && value !== void 0 ? value : [];
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Checks if a request failed
|
|
215
|
-
*/
|
|
216
|
-
function checkPagingRequest(response) {
|
|
217
|
-
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
|
|
218
|
-
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
219
|
-
throw coreClient.createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Copyright (c) Microsoft Corporation.
|
|
224
|
-
// Licensed under the MIT license.
|
|
225
|
-
|
|
226
|
-
exports.default = createClient;
|
|
227
|
-
exports.isUnexpected = isUnexpected;
|
|
228
|
-
exports.paginate = paginate;
|
|
229
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/logger.ts","../src/azureCommunicationRoutingServiceClient.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"communication-job-router\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { isTokenCredential, KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"./logger\";\nimport { AzureCommunicationRoutingServiceClient } from \"./clientDefinitions\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\n\n/**\n * Initialize a new instance of `AzureCommunicationRoutingServiceClient`\n * @param connectionString - The connectionString or url of your Communication Services resource.\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n connectionString: string,\n options: ClientOptions,\n): AzureCommunicationRoutingServiceClient;\n\n/**\n * Initialize a new instance of `AzureCommunicationRoutingServiceClient`\n * @param endpoint - Uri of your Communication resource\n * @param credentialOrOptions The key or token credential.\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentialOrOptions?: KeyCredential | TokenCredential,\n options?: ClientOptions,\n): AzureCommunicationRoutingServiceClient;\n\n// Implementation\nexport default function createClient(\n arg1: string,\n arg2?: ClientOptions | (KeyCredential | TokenCredential),\n arg3?: ClientOptions,\n): AzureCommunicationRoutingServiceClient {\n let credentialOrOptions: KeyCredential | TokenCredential | undefined;\n let options: ClientOptions | undefined;\n const connectionStringOrUrl = arg1;\n\n // Determine which constructor is being called based on the types of the arguments\n if (isTokenCredential(arg2) || isKeyCredential(arg2)) {\n credentialOrOptions = arg2 as KeyCredential | TokenCredential;\n options = arg3 as ClientOptions;\n } else {\n options = arg2 as ClientOptions;\n }\n if (options === undefined) {\n options = {};\n }\n\n // Rest of the function remains the same, using connectionStringOrUrl or endpoint as needed\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const baseUrl = options?.baseUrl ?? `${url}`;\n options.apiVersion = options.apiVersion ?? \"2024-01-18-preview\";\n const userAgentInfo = `azsdk-js-communication-job-router-rest/1.1.0-beta.1`;\n const userAgentPrefix =\n options?.userAgentOptions && options?.userAgentOptions.userAgentPrefix\n ? `${options?.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options?.loggingOptions?.logger ?? logger.info,\n },\n };\n\n const client = getClient(baseUrl, options) as AzureCommunicationRoutingServiceClient;\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n client.pipeline.addPolicy(authPolicy);\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n UpsertClassificationPolicy200Response,\n UpsertClassificationPolicy201Response,\n UpsertClassificationPolicyDefaultResponse,\n GetClassificationPolicy200Response,\n GetClassificationPolicyDefaultResponse,\n DeleteClassificationPolicy204Response,\n DeleteClassificationPolicyDefaultResponse,\n ListClassificationPolicies200Response,\n ListClassificationPoliciesDefaultResponse,\n UpsertDistributionPolicy200Response,\n UpsertDistributionPolicy201Response,\n UpsertDistributionPolicyDefaultResponse,\n GetDistributionPolicy200Response,\n GetDistributionPolicyDefaultResponse,\n DeleteDistributionPolicy204Response,\n DeleteDistributionPolicyDefaultResponse,\n ListDistributionPolicies200Response,\n ListDistributionPoliciesDefaultResponse,\n UpsertExceptionPolicy200Response,\n UpsertExceptionPolicy201Response,\n UpsertExceptionPolicyDefaultResponse,\n GetExceptionPolicy200Response,\n GetExceptionPolicyDefaultResponse,\n DeleteExceptionPolicy204Response,\n DeleteExceptionPolicyDefaultResponse,\n ListExceptionPolicies200Response,\n ListExceptionPoliciesDefaultResponse,\n UpsertQueue200Response,\n UpsertQueue201Response,\n UpsertQueueDefaultResponse,\n GetQueue200Response,\n GetQueueDefaultResponse,\n DeleteQueue204Response,\n DeleteQueueDefaultResponse,\n ListQueues200Response,\n ListQueuesDefaultResponse,\n UpsertJob200Response,\n UpsertJob201Response,\n UpsertJobDefaultResponse,\n GetJob200Response,\n GetJobDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n Reclassify200Response,\n ReclassifyDefaultResponse,\n Cancel200Response,\n CancelDefaultResponse,\n Complete200Response,\n CompleteDefaultResponse,\n Close200Response,\n CloseDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n GetInQueuePosition200Response,\n GetInQueuePositionDefaultResponse,\n Unassign200Response,\n UnassignDefaultResponse,\n Accept200Response,\n AcceptDefaultResponse,\n Decline200Response,\n DeclineDefaultResponse,\n GetQueueStatistics200Response,\n GetQueueStatisticsDefaultResponse,\n UpsertWorker200Response,\n UpsertWorker201Response,\n UpsertWorkerDefaultResponse,\n GetWorker200Response,\n GetWorkerDefaultResponse,\n DeleteWorker204Response,\n DeleteWorkerDefaultResponse,\n ListWorkers200Response,\n ListWorkersDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"PATCH /routing/classificationPolicies/{classificationPolicyId}\": [\"200\", \"201\"],\n \"GET /routing/classificationPolicies/{classificationPolicyId}\": [\"200\"],\n \"DELETE /routing/classificationPolicies/{classificationPolicyId}\": [\"204\"],\n \"GET /routing/classificationPolicies\": [\"200\"],\n \"PATCH /routing/distributionPolicies/{distributionPolicyId}\": [\"200\", \"201\"],\n \"GET /routing/distributionPolicies/{distributionPolicyId}\": [\"200\"],\n \"DELETE /routing/distributionPolicies/{distributionPolicyId}\": [\"204\"],\n \"GET /routing/distributionPolicies\": [\"200\"],\n \"PATCH /routing/exceptionPolicies/{exceptionPolicyId}\": [\"200\", \"201\"],\n \"GET /routing/exceptionPolicies/{exceptionPolicyId}\": [\"200\"],\n \"DELETE /routing/exceptionPolicies/{exceptionPolicyId}\": [\"204\"],\n \"GET /routing/exceptionPolicies\": [\"200\"],\n \"PATCH /routing/queues/{queueId}\": [\"200\", \"201\"],\n \"GET /routing/queues/{queueId}\": [\"200\"],\n \"DELETE /routing/queues/{queueId}\": [\"204\"],\n \"GET /routing/queues\": [\"200\"],\n \"PATCH /routing/jobs/{jobId}\": [\"200\", \"201\"],\n \"GET /routing/jobs/{jobId}\": [\"200\"],\n \"DELETE /routing/jobs/{jobId}\": [\"204\"],\n \"POST /routing/jobs/{jobId}:reclassify\": [\"200\"],\n \"POST /routing/jobs/{jobId}:cancel\": [\"200\"],\n \"POST /routing/jobs/{jobId}/assignments/{assignmentId}:complete\": [\"200\"],\n \"POST /routing/jobs/{jobId}/assignments/{assignmentId}:close\": [\"200\"],\n \"GET /routing/jobs\": [\"200\"],\n \"GET /routing/jobs/{jobId}/position\": [\"200\"],\n \"POST /routing/jobs/{jobId}/assignments/{assignmentId}:unassign\": [\"200\"],\n \"POST /routing/workers/{workerId}/offers/{offerId}:accept\": [\"200\"],\n \"POST /routing/workers/{workerId}/offers/{offerId}:decline\": [\"200\"],\n \"GET /routing/queues/{queueId}/statistics\": [\"200\"],\n \"PATCH /routing/workers/{workerId}\": [\"200\", \"201\"],\n \"GET /routing/workers/{workerId}\": [\"200\"],\n \"DELETE /routing/workers/{workerId}\": [\"204\"],\n \"GET /routing/workers\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | UpsertClassificationPolicy200Response\n | UpsertClassificationPolicy201Response\n | UpsertClassificationPolicyDefaultResponse,\n): response is UpsertClassificationPolicyDefaultResponse;\nexport function isUnexpected(\n response: GetClassificationPolicy200Response | GetClassificationPolicyDefaultResponse,\n): response is GetClassificationPolicyDefaultResponse;\nexport function isUnexpected(\n response: DeleteClassificationPolicy204Response | DeleteClassificationPolicyDefaultResponse,\n): response is DeleteClassificationPolicyDefaultResponse;\nexport function isUnexpected(\n response: ListClassificationPolicies200Response | ListClassificationPoliciesDefaultResponse,\n): response is ListClassificationPoliciesDefaultResponse;\nexport function isUnexpected(\n response:\n | UpsertDistributionPolicy200Response\n | UpsertDistributionPolicy201Response\n | UpsertDistributionPolicyDefaultResponse,\n): response is UpsertDistributionPolicyDefaultResponse;\nexport function isUnexpected(\n response: GetDistributionPolicy200Response | GetDistributionPolicyDefaultResponse,\n): response is GetDistributionPolicyDefaultResponse;\nexport function isUnexpected(\n response: DeleteDistributionPolicy204Response | DeleteDistributionPolicyDefaultResponse,\n): response is DeleteDistributionPolicyDefaultResponse;\nexport function isUnexpected(\n response: ListDistributionPolicies200Response | ListDistributionPoliciesDefaultResponse,\n): response is ListDistributionPoliciesDefaultResponse;\nexport function isUnexpected(\n response:\n | UpsertExceptionPolicy200Response\n | UpsertExceptionPolicy201Response\n | UpsertExceptionPolicyDefaultResponse,\n): response is UpsertExceptionPolicyDefaultResponse;\nexport function isUnexpected(\n response: GetExceptionPolicy200Response | GetExceptionPolicyDefaultResponse,\n): response is GetExceptionPolicyDefaultResponse;\nexport function isUnexpected(\n response: DeleteExceptionPolicy204Response | DeleteExceptionPolicyDefaultResponse,\n): response is DeleteExceptionPolicyDefaultResponse;\nexport function isUnexpected(\n response: ListExceptionPolicies200Response | ListExceptionPoliciesDefaultResponse,\n): response is ListExceptionPoliciesDefaultResponse;\nexport function isUnexpected(\n response: UpsertQueue200Response | UpsertQueue201Response | UpsertQueueDefaultResponse,\n): response is UpsertQueueDefaultResponse;\nexport function isUnexpected(\n response: GetQueue200Response | GetQueueDefaultResponse,\n): response is GetQueueDefaultResponse;\nexport function isUnexpected(\n response: DeleteQueue204Response | DeleteQueueDefaultResponse,\n): response is DeleteQueueDefaultResponse;\nexport function isUnexpected(\n response: ListQueues200Response | ListQueuesDefaultResponse,\n): response is ListQueuesDefaultResponse;\nexport function isUnexpected(\n response: UpsertJob200Response | UpsertJob201Response | UpsertJobDefaultResponse,\n): response is UpsertJobDefaultResponse;\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response: DeleteJob204Response | DeleteJobDefaultResponse,\n): response is DeleteJobDefaultResponse;\nexport function isUnexpected(\n response: Reclassify200Response | ReclassifyDefaultResponse,\n): response is ReclassifyDefaultResponse;\nexport function isUnexpected(\n response: Cancel200Response | CancelDefaultResponse,\n): response is CancelDefaultResponse;\nexport function isUnexpected(\n response: Complete200Response | CompleteDefaultResponse,\n): response is CompleteDefaultResponse;\nexport function isUnexpected(\n response: Close200Response | CloseDefaultResponse,\n): response is CloseDefaultResponse;\nexport function isUnexpected(\n response: ListJobs200Response | ListJobsDefaultResponse,\n): response is ListJobsDefaultResponse;\nexport function isUnexpected(\n response: GetInQueuePosition200Response | GetInQueuePositionDefaultResponse,\n): response is GetInQueuePositionDefaultResponse;\nexport function isUnexpected(\n response: Unassign200Response | UnassignDefaultResponse,\n): response is UnassignDefaultResponse;\nexport function isUnexpected(\n response: Accept200Response | AcceptDefaultResponse,\n): response is AcceptDefaultResponse;\nexport function isUnexpected(\n response: Decline200Response | DeclineDefaultResponse,\n): response is DeclineDefaultResponse;\nexport function isUnexpected(\n response: GetQueueStatistics200Response | GetQueueStatisticsDefaultResponse,\n): response is GetQueueStatisticsDefaultResponse;\nexport function isUnexpected(\n response: UpsertWorker200Response | UpsertWorker201Response | UpsertWorkerDefaultResponse,\n): response is UpsertWorkerDefaultResponse;\nexport function isUnexpected(\n response: GetWorker200Response | GetWorkerDefaultResponse,\n): response is GetWorkerDefaultResponse;\nexport function isUnexpected(\n response: DeleteWorker204Response | DeleteWorkerDefaultResponse,\n): response is DeleteWorkerDefaultResponse;\nexport function isUnexpected(\n response: ListWorkers200Response | ListWorkersDefaultResponse,\n): response is ListWorkersDefaultResponse;\nexport function isUnexpected(\n response:\n | UpsertClassificationPolicy200Response\n | UpsertClassificationPolicy201Response\n | UpsertClassificationPolicyDefaultResponse\n | GetClassificationPolicy200Response\n | GetClassificationPolicyDefaultResponse\n | DeleteClassificationPolicy204Response\n | DeleteClassificationPolicyDefaultResponse\n | ListClassificationPolicies200Response\n | ListClassificationPoliciesDefaultResponse\n | UpsertDistributionPolicy200Response\n | UpsertDistributionPolicy201Response\n | UpsertDistributionPolicyDefaultResponse\n | GetDistributionPolicy200Response\n | GetDistributionPolicyDefaultResponse\n | DeleteDistributionPolicy204Response\n | DeleteDistributionPolicyDefaultResponse\n | ListDistributionPolicies200Response\n | ListDistributionPoliciesDefaultResponse\n | UpsertExceptionPolicy200Response\n | UpsertExceptionPolicy201Response\n | UpsertExceptionPolicyDefaultResponse\n | GetExceptionPolicy200Response\n | GetExceptionPolicyDefaultResponse\n | DeleteExceptionPolicy204Response\n | DeleteExceptionPolicyDefaultResponse\n | ListExceptionPolicies200Response\n | ListExceptionPoliciesDefaultResponse\n | UpsertQueue200Response\n | UpsertQueue201Response\n | UpsertQueueDefaultResponse\n | GetQueue200Response\n | GetQueueDefaultResponse\n | DeleteQueue204Response\n | DeleteQueueDefaultResponse\n | ListQueues200Response\n | ListQueuesDefaultResponse\n | UpsertJob200Response\n | UpsertJob201Response\n | UpsertJobDefaultResponse\n | GetJob200Response\n | GetJobDefaultResponse\n | DeleteJob204Response\n | DeleteJobDefaultResponse\n | Reclassify200Response\n | ReclassifyDefaultResponse\n | Cancel200Response\n | CancelDefaultResponse\n | Complete200Response\n | CompleteDefaultResponse\n | Close200Response\n | CloseDefaultResponse\n | ListJobs200Response\n | ListJobsDefaultResponse\n | GetInQueuePosition200Response\n | GetInQueuePositionDefaultResponse\n | Unassign200Response\n | UnassignDefaultResponse\n | Accept200Response\n | AcceptDefaultResponse\n | Decline200Response\n | DeclineDefaultResponse\n | GetQueueStatistics200Response\n | GetQueueStatisticsDefaultResponse\n | UpsertWorker200Response\n | UpsertWorker201Response\n | UpsertWorkerDefaultResponse\n | GetWorker200Response\n | GetWorkerDefaultResponse\n | DeleteWorker204Response\n | DeleteWorkerDefaultResponse\n | ListWorkers200Response\n | ListWorkersDefaultResponse,\n): response is\n | UpsertClassificationPolicyDefaultResponse\n | GetClassificationPolicyDefaultResponse\n | DeleteClassificationPolicyDefaultResponse\n | ListClassificationPoliciesDefaultResponse\n | UpsertDistributionPolicyDefaultResponse\n | GetDistributionPolicyDefaultResponse\n | DeleteDistributionPolicyDefaultResponse\n | ListDistributionPoliciesDefaultResponse\n | UpsertExceptionPolicyDefaultResponse\n | GetExceptionPolicyDefaultResponse\n | DeleteExceptionPolicyDefaultResponse\n | ListExceptionPoliciesDefaultResponse\n | UpsertQueueDefaultResponse\n | GetQueueDefaultResponse\n | DeleteQueueDefaultResponse\n | ListQueuesDefaultResponse\n | UpsertJobDefaultResponse\n | GetJobDefaultResponse\n | DeleteJobDefaultResponse\n | ReclassifyDefaultResponse\n | CancelDefaultResponse\n | CompleteDefaultResponse\n | CloseDefaultResponse\n | ListJobsDefaultResponse\n | GetInQueuePositionDefaultResponse\n | UnassignDefaultResponse\n | AcceptDefaultResponse\n | DeclineDefaultResponse\n | GetQueueStatisticsDefaultResponse\n | UpsertWorkerDefaultResponse\n | GetWorkerDefaultResponse\n | DeleteWorkerDefaultResponse\n | ListWorkersDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number,\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport AzureCommunicationRoutingServiceClient from \"./azureCommunicationRoutingServiceClient\";\n\nexport * from \"./azureCommunicationRoutingServiceClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default AzureCommunicationRoutingServiceClient;\n"],"names":["createClientLogger","isTokenCredential","isKeyCredential","parseClientArguments","getClient","createCommunicationAuthPolicy","getPagedAsyncIterator","createRestError"],"mappings":";;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,0BAA0B,CAAC;;ACJpE;AACA;AAkCA;AACwB,SAAA,YAAY,CAClC,IAAY,EACZ,IAAwD,EACxD,IAAoB,EAAA;;AAEpB,IAAA,IAAI,mBAAgE,CAAC;AACrE,IAAA,IAAI,OAAkC,CAAC;IACvC,MAAM,qBAAqB,GAAG,IAAI,CAAC;;IAGnC,IAAIC,0BAAiB,CAAC,IAAI,CAAC,IAAIC,mCAAe,CAAC,IAAI,CAAC,EAAE;QACpD,mBAAmB,GAAG,IAAuC,CAAC;QAC9D,OAAO,GAAG,IAAqB,CAAC;KACjC;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BAAiB,YAAY,CAAA,gCAAA,CAAkC,CAAC,CAAC;KAClF;AAED,IAAA,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;AAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB,EAAA;AAC/D,IAAA,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;;;;IAKjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,CAAA,CAAE,CAC7F,CAAC;KACH;AAED,IAAA,OAAO,KAAK,KAAL,IAAA,IAAA,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;AAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAA;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAMC,0BAAe,CACnB,CAAA,6CAAA,EAAgD,QAAQ,CAAC,MAAM,CAAE,CAAA,EACjE,QAAQ,CACT,CAAC;KACH;AACH;;AClIA;AACA;;;;;;"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { getClient } from "@azure-rest/core-client";
|
|
4
|
-
import { isTokenCredential } from "@azure/core-auth";
|
|
5
|
-
import { logger } from "./logger";
|
|
6
|
-
import { createCommunicationAuthPolicy, isKeyCredential, parseClientArguments, } from "@azure/communication-common";
|
|
7
|
-
// Implementation
|
|
8
|
-
export default function createClient(arg1, arg2, arg3) {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
10
|
-
let credentialOrOptions;
|
|
11
|
-
let options;
|
|
12
|
-
const connectionStringOrUrl = arg1;
|
|
13
|
-
// Determine which constructor is being called based on the types of the arguments
|
|
14
|
-
if (isTokenCredential(arg2) || isKeyCredential(arg2)) {
|
|
15
|
-
credentialOrOptions = arg2;
|
|
16
|
-
options = arg3;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
options = arg2;
|
|
20
|
-
}
|
|
21
|
-
if (options === undefined) {
|
|
22
|
-
options = {};
|
|
23
|
-
}
|
|
24
|
-
// Rest of the function remains the same, using connectionStringOrUrl or endpoint as needed
|
|
25
|
-
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
26
|
-
const baseUrl = (_a = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _a !== void 0 ? _a : `${url}`;
|
|
27
|
-
options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2024-01-18-preview";
|
|
28
|
-
const userAgentInfo = `azsdk-js-communication-job-router-rest/1.1.0-beta.1`;
|
|
29
|
-
const userAgentPrefix = (options === null || options === void 0 ? void 0 : options.userAgentOptions) && (options === null || options === void 0 ? void 0 : options.userAgentOptions.userAgentPrefix)
|
|
30
|
-
? `${options === null || options === void 0 ? void 0 : options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
31
|
-
: `${userAgentInfo}`;
|
|
32
|
-
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
33
|
-
userAgentPrefix,
|
|
34
|
-
}, loggingOptions: {
|
|
35
|
-
logger: (_d = (_c = options === null || options === void 0 ? void 0 : options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger.info,
|
|
36
|
-
} });
|
|
37
|
-
const client = getClient(baseUrl, options);
|
|
38
|
-
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
39
|
-
client.pipeline.addPolicy(authPolicy);
|
|
40
|
-
return client;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=azureCommunicationRoutingServiceClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azureCommunicationRoutingServiceClient.js","sourceRoot":"","sources":["../../src/azureCommunicationRoutingServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAkC,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAwBrC,iBAAiB;AACjB,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,IAAY,EACZ,IAAwD,EACxD,IAAoB;;IAEpB,IAAI,mBAAgE,CAAC;IACrE,IAAI,OAAkC,CAAC;IACvC,MAAM,qBAAqB,GAAG,IAAI,CAAC;IAEnC,kFAAkF;IAClF,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,mBAAmB,GAAG,IAAuC,CAAC;QAC9D,OAAO,GAAG,IAAqB,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,IAAqB,CAAC;IAClC,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,GAAG,EAAE,CAAC;IACf,CAAC;IAED,2FAA2F;IAC3F,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,oBAAoB,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;IAC7F,MAAM,OAAO,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,GAAG,GAAG,EAAE,CAAC;IAC7C,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,oBAAoB,CAAC;IAChE,MAAM,aAAa,GAAG,qDAAqD,CAAC;IAC5E,MAAM,eAAe,GACnB,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAC,eAAe,CAAA;QACpE,CAAC,CAAC,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QACjE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACvD,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,OAAO,CAA2C,CAAC;IAErF,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAEtC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { isTokenCredential, KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"./logger\";\nimport { AzureCommunicationRoutingServiceClient } from \"./clientDefinitions\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\n\n/**\n * Initialize a new instance of `AzureCommunicationRoutingServiceClient`\n * @param connectionString - The connectionString or url of your Communication Services resource.\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n connectionString: string,\n options: ClientOptions,\n): AzureCommunicationRoutingServiceClient;\n\n/**\n * Initialize a new instance of `AzureCommunicationRoutingServiceClient`\n * @param endpoint - Uri of your Communication resource\n * @param credentialOrOptions The key or token credential.\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentialOrOptions?: KeyCredential | TokenCredential,\n options?: ClientOptions,\n): AzureCommunicationRoutingServiceClient;\n\n// Implementation\nexport default function createClient(\n arg1: string,\n arg2?: ClientOptions | (KeyCredential | TokenCredential),\n arg3?: ClientOptions,\n): AzureCommunicationRoutingServiceClient {\n let credentialOrOptions: KeyCredential | TokenCredential | undefined;\n let options: ClientOptions | undefined;\n const connectionStringOrUrl = arg1;\n\n // Determine which constructor is being called based on the types of the arguments\n if (isTokenCredential(arg2) || isKeyCredential(arg2)) {\n credentialOrOptions = arg2 as KeyCredential | TokenCredential;\n options = arg3 as ClientOptions;\n } else {\n options = arg2 as ClientOptions;\n }\n if (options === undefined) {\n options = {};\n }\n\n // Rest of the function remains the same, using connectionStringOrUrl or endpoint as needed\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const baseUrl = options?.baseUrl ?? `${url}`;\n options.apiVersion = options.apiVersion ?? \"2024-01-18-preview\";\n const userAgentInfo = `azsdk-js-communication-job-router-rest/1.1.0-beta.1`;\n const userAgentPrefix =\n options?.userAgentOptions && options?.userAgentOptions.userAgentPrefix\n ? `${options?.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options?.loggingOptions?.logger ?? logger.info,\n },\n };\n\n const client = getClient(baseUrl, options) as AzureCommunicationRoutingServiceClient;\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n client.pipeline.addPolicy(authPolicy);\n\n return client;\n}\n"]}
|