@azure-tools/communication-alpha-ids 1.0.0-alpha.20250901.2 → 1.0.0-alpha.20251021.1
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/LICENSE +21 -0
- package/dist/browser/alphaIdsClient.js +11 -4
- package/dist/browser/alphaIdsClient.js.map +1 -1
- package/dist/browser/generated/src/alphaIDsClient.js +11 -4
- package/dist/browser/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/browser/generated/src/operations/alphaIds.js +30 -47
- package/dist/browser/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +2 -4
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/browser/generated/src/tracing.js +1 -1
- package/dist/browser/generated/src/tracing.js.map +1 -1
- package/dist/browser/utils/constants.js +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/customPipelinePolicies.js +1 -2
- package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
- package/dist/commonjs/alphaIdsClient.js +11 -4
- package/dist/commonjs/alphaIdsClient.js.map +1 -1
- package/dist/commonjs/generated/src/alphaIDsClient.js +11 -4
- package/dist/commonjs/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/commonjs/generated/src/operations/alphaIds.js +30 -46
- package/dist/commonjs/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +2 -4
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/generated/src/tracing.js +1 -1
- package/dist/commonjs/generated/src/tracing.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
- package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
- package/dist/esm/alphaIdsClient.js +11 -4
- package/dist/esm/alphaIdsClient.js.map +1 -1
- package/dist/esm/generated/src/alphaIDsClient.js +11 -4
- package/dist/esm/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/esm/generated/src/operations/alphaIds.js +30 -47
- package/dist/esm/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +2 -4
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/esm/generated/src/tracing.js +1 -1
- package/dist/esm/generated/src/tracing.js.map +1 -1
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/customPipelinePolicies.js +1 -2
- package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
- package/dist/react-native/alphaIdsClient.js +11 -4
- package/dist/react-native/alphaIdsClient.js.map +1 -1
- package/dist/react-native/generated/src/alphaIDsClient.js +11 -4
- package/dist/react-native/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/react-native/generated/src/operations/alphaIds.js +30 -47
- package/dist/react-native/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +2 -4
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/generated/src/tracing.js +1 -1
- package/dist/react-native/generated/src/tracing.js.map +1 -1
- package/dist/react-native/utils/constants.js +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/customPipelinePolicies.js +1 -2
- package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
- package/package.json +46 -43
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Microsoft
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -7,16 +7,23 @@ import { tracingClient } from "./generated/src/tracing.js";
|
|
|
7
7
|
import { createAlphaIDsPagingPolicy } from "./utils/customPipelinePolicies.js";
|
|
8
8
|
const isAlphaIdsClientOptions = (options) => options && !isKeyCredential(options) && !isTokenCredential(options);
|
|
9
9
|
export class AlphaIdsClient {
|
|
10
|
+
/**
|
|
11
|
+
* A reference to the auto-generated AlphaIDs HTTP client.
|
|
12
|
+
*/
|
|
13
|
+
client;
|
|
10
14
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
11
15
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
12
16
|
const options = isAlphaIdsClientOptions(credentialOrOptions)
|
|
13
17
|
? credentialOrOptions
|
|
14
18
|
: maybeOptions;
|
|
15
|
-
const internalPipelineOptions =
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const internalPipelineOptions = {
|
|
20
|
+
...options,
|
|
21
|
+
...{
|
|
22
|
+
loggingOptions: {
|
|
23
|
+
logger: logger.info,
|
|
24
|
+
},
|
|
18
25
|
},
|
|
19
|
-
}
|
|
26
|
+
};
|
|
20
27
|
this.client = new AlphaIDsGeneratedClient(url, internalPipelineOptions);
|
|
21
28
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
22
29
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIdsClient.js","sourceRoot":"","sources":["../../src/alphaIdsClient.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAO/E,MAAM,uBAAuB,GAAG,CAAC,OAAY,EAAoC,EAAE,CACjF,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEtE,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"alphaIdsClient.js","sourceRoot":"","sources":["../../src/alphaIdsClient.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,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EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,gCAAgC,CACrC,UAAmD,EAAE;QAErD,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,SAAS,CACtD,iDAAiD,EACjD,OAAO,CACR,CAAC;QACF,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gCAAgC,CAAC,cAAc,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\nimport type {\n DynamicAlphaIdConfiguration,\n GetConfigurationOptions,\n UpsertConfigurationOptions,\n ListAlphaIdsOptions,\n GetDynamicAlphaIdCountriesOptions,\n GetPreRegisteredAlphaIdCountriesOptions,\n AlphaId,\n SupportedCountries,\n} from \"./models.js\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { AlphaIDsClient as AlphaIDsGeneratedClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { createAlphaIDsPagingPolicy } from \"./utils/customPipelinePolicies.js\";\n\n/**\n * Client options used to configure the AlphaIdsClient API requests.\n */\nexport interface AlphaIdsClientOptions extends CommonClientOptions {}\n\nconst isAlphaIdsClientOptions = (options: any): options is AlphaIdsClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class AlphaIdsClient {\n /**\n * A reference to the auto-generated AlphaIDs HTTP client.\n */\n private readonly client: AlphaIDsGeneratedClient;\n\n public constructor(connectionString: string, options?: AlphaIdsClientOptions);\n\n public constructor(endpoint: string, credential: KeyCredential, options?: AlphaIdsClientOptions);\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: AlphaIdsClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | AlphaIdsClientOptions,\n maybeOptions: AlphaIdsClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isAlphaIdsClientOptions(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 AlphaIDsGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n // This policy is a temporary workarounds to address compatibility issues with Azure Core V2.\n const alphaIDsPagingPolicy = createAlphaIDsPagingPolicy(url);\n this.client.pipeline.addPolicy(alphaIDsPagingPolicy);\n }\n\n public getDynamicAlphaIdConfiguration(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: GetConfigurationOptions = {},\n ): Promise<DynamicAlphaIdConfiguration> {\n return tracingClient.withSpan(\n \"AlphaIdsClient-getConfiguration\",\n options,\n async (updatedOptions) => {\n return this.client.alphaIds.getDynamicAlphaIdConfiguration(updatedOptions);\n },\n );\n }\n\n public upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpsertConfigurationOptions = {},\n ): Promise<DynamicAlphaIdConfiguration> {\n return tracingClient.withSpan(\n \"AlphaIdsClient-upsertConfiguration\",\n options,\n async (updatedOptions) => {\n return this.client.alphaIds.upsertDynamicAlphaIdConfiguration(enabled, updatedOptions);\n },\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public getAlphaIds(options: ListAlphaIdsOptions = {}): PagedAsyncIterableIterator<AlphaId> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-listAlphaIds\",\n options,\n );\n try {\n return this.client.alphaIds.listAlphaIds(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public getDynamicAlphaIdCountries(\n options: GetDynamicAlphaIdCountriesOptions = {},\n ): Promise<SupportedCountries> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-getDynamicAlphaIdCountries\",\n options,\n );\n try {\n return this.client.alphaIds.getDynamicAlphaIdCountries(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public getPreRegisteredAlphaIdCountries(\n options: GetPreRegisteredAlphaIdCountriesOptions = {},\n ): Promise<SupportedCountries> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-getPreRegisteredAlphaIdCountries\",\n options,\n );\n try {\n return this.client.alphaIds.getPreRegisteredAlphaIdCountries(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n}\n"]}
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
9
|
import { AlphaIdsImpl } from "./operations/index.js";
|
|
10
10
|
export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
11
|
+
endpoint;
|
|
12
|
+
apiVersion;
|
|
11
13
|
/**
|
|
12
14
|
* Initializes a new instance of the AlphaIDsClient class.
|
|
13
15
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
|
14
16
|
* @param options The parameter options
|
|
15
17
|
*/
|
|
16
18
|
constructor(endpoint, options) {
|
|
17
|
-
var _a, _b;
|
|
18
19
|
if (endpoint === undefined) {
|
|
19
20
|
throw new Error("'endpoint' cannot be null");
|
|
20
21
|
}
|
|
@@ -25,13 +26,18 @@ export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
25
26
|
const defaults = {
|
|
26
27
|
requestContentType: "application/json; charset=utf-8"
|
|
27
28
|
};
|
|
28
|
-
const packageDetails = `azsdk-js-communication-alpha-ids/1.0.0-beta.
|
|
29
|
+
const packageDetails = `azsdk-js-communication-alpha-ids/1.0.0-beta.3`;
|
|
29
30
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
30
31
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
31
32
|
: `${packageDetails}`;
|
|
32
|
-
const optionsWithDefaults =
|
|
33
|
+
const optionsWithDefaults = {
|
|
34
|
+
...defaults,
|
|
35
|
+
...options,
|
|
36
|
+
userAgentOptions: {
|
|
33
37
|
userAgentPrefix
|
|
34
|
-
},
|
|
38
|
+
},
|
|
39
|
+
endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}"
|
|
40
|
+
};
|
|
35
41
|
super(optionsWithDefaults);
|
|
36
42
|
// Parameter assignments
|
|
37
43
|
this.endpoint = endpoint;
|
|
@@ -65,5 +71,6 @@ export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
65
71
|
};
|
|
66
72
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
67
73
|
}
|
|
74
|
+
alphaIds;
|
|
68
75
|
}
|
|
69
76
|
//# sourceMappingURL=alphaIDsClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIDsClient.js","sourceRoot":"","sources":["../../../../src/generated/src/alphaIDsClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,OAAO,cAAe,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"alphaIDsClient.js","sourceRoot":"","sources":["../../../../src/generated/src/alphaIDsClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,OAAO,cAAe,SAAQ,UAAU,CAAC,aAAa;IAC1D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAsC;QAClE,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,QAAQ,GAAiC;YAC7C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,+CAA+C,CAAC;QACvE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,GAAG;YAC1B,GAAG,QAAQ;YACX,GAAG,OAAO;YACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB;YACD,QAAQ,EAAE,OAAO,CAAC,QAAQ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F,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ,CAAW;CACpB","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 { AlphaIdsImpl } from \"./operations/index.js\";\nimport { AlphaIds } from \"./operationsInterfaces/index.js\";\nimport { AlphaIDsClientOptionalParams } from \"./models/index.js\";\n\nexport class AlphaIDsClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the AlphaIDsClient class.\n * @param endpoint The communication resource, for example https://resourcename.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: AlphaIDsClientOptionalParams) {\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: AlphaIDsClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-alpha-ids/1.0.0-beta.3`;\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 || \"2023-07-12\";\n this.alphaIds = new AlphaIdsImpl(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 alphaIds: AlphaIds;\n}\n"]}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
9
8
|
import { tracingClient } from "../tracing.js";
|
|
10
9
|
import { setContinuationToken } from "../pagingHelper.js";
|
|
11
10
|
import * as coreClient from "@azure/core-client";
|
|
@@ -14,6 +13,7 @@ import * as Parameters from "../models/parameters.js";
|
|
|
14
13
|
/// <reference lib="esnext.asynciterable" />
|
|
15
14
|
/** Class containing AlphaIds operations. */
|
|
16
15
|
export class AlphaIdsImpl {
|
|
16
|
+
client;
|
|
17
17
|
/**
|
|
18
18
|
* Initialize a new instance of the class AlphaIds class.
|
|
19
19
|
* @param client Reference to the service client
|
|
@@ -35,59 +35,42 @@ export class AlphaIdsImpl {
|
|
|
35
35
|
return this;
|
|
36
36
|
},
|
|
37
37
|
byPage: (settings) => {
|
|
38
|
-
if (settings
|
|
38
|
+
if (settings?.maxPageSize) {
|
|
39
39
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
40
40
|
}
|
|
41
41
|
return this.getAlphaIdsPagingPage(options, settings);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
getAlphaIdsPagingPage(options, settings) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
});
|
|
45
|
+
async *getAlphaIdsPagingPage(options, settings) {
|
|
46
|
+
let result;
|
|
47
|
+
let continuationToken = settings?.continuationToken;
|
|
48
|
+
if (!continuationToken) {
|
|
49
|
+
result = await this._getAlphaIds(options);
|
|
50
|
+
let page = result.alphaIds || [];
|
|
51
|
+
continuationToken = result.nextLink;
|
|
52
|
+
setContinuationToken(page, continuationToken);
|
|
53
|
+
yield page;
|
|
54
|
+
}
|
|
55
|
+
while (continuationToken) {
|
|
56
|
+
result = await this._getAlphaIdsNext(continuationToken, options);
|
|
57
|
+
continuationToken = result.nextLink;
|
|
58
|
+
let page = result.alphaIds || [];
|
|
59
|
+
setContinuationToken(page, continuationToken);
|
|
60
|
+
yield page;
|
|
61
|
+
}
|
|
64
62
|
}
|
|
65
|
-
getAlphaIdsPagingAll(options) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
for (var _d = true, _e = __asyncValues(this.getAlphaIdsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
70
|
-
_c = _f.value;
|
|
71
|
-
_d = false;
|
|
72
|
-
const page = _c;
|
|
73
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
77
|
-
finally {
|
|
78
|
-
try {
|
|
79
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
80
|
-
}
|
|
81
|
-
finally { if (e_1) throw e_1.error; }
|
|
82
|
-
}
|
|
83
|
-
});
|
|
63
|
+
async *getAlphaIdsPagingAll(options) {
|
|
64
|
+
for await (const page of this.getAlphaIdsPagingPage(options)) {
|
|
65
|
+
yield* page;
|
|
66
|
+
}
|
|
84
67
|
}
|
|
85
68
|
/**
|
|
86
69
|
* Gets the list of alpha ids for the current resource.
|
|
87
70
|
* @param options The options parameters.
|
|
88
71
|
*/
|
|
89
72
|
async _getAlphaIds(options) {
|
|
90
|
-
return tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options
|
|
73
|
+
return tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options ?? {}, async (options) => {
|
|
91
74
|
return this.client.sendOperationRequest({ options }, getAlphaIdsOperationSpec);
|
|
92
75
|
});
|
|
93
76
|
}
|
|
@@ -96,7 +79,7 @@ export class AlphaIdsImpl {
|
|
|
96
79
|
* @param options The options parameters.
|
|
97
80
|
*/
|
|
98
81
|
async getDynamicAlphaIdConfiguration(options) {
|
|
99
|
-
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options
|
|
82
|
+
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options ?? {}, async (options) => {
|
|
100
83
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdConfigurationOperationSpec);
|
|
101
84
|
});
|
|
102
85
|
}
|
|
@@ -106,7 +89,7 @@ export class AlphaIdsImpl {
|
|
|
106
89
|
* @param options The options parameters.
|
|
107
90
|
*/
|
|
108
91
|
async upsertDynamicAlphaIdConfiguration(enabled, options) {
|
|
109
|
-
return tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options
|
|
92
|
+
return tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options ?? {}, async (options) => {
|
|
110
93
|
return this.client.sendOperationRequest({ enabled, options }, upsertDynamicAlphaIdConfigurationOperationSpec);
|
|
111
94
|
});
|
|
112
95
|
}
|
|
@@ -115,7 +98,7 @@ export class AlphaIdsImpl {
|
|
|
115
98
|
* @param options The options parameters.
|
|
116
99
|
*/
|
|
117
100
|
async getDynamicAlphaIdCountries(options) {
|
|
118
|
-
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options
|
|
101
|
+
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options ?? {}, async (options) => {
|
|
119
102
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdCountriesOperationSpec);
|
|
120
103
|
});
|
|
121
104
|
}
|
|
@@ -124,7 +107,7 @@ export class AlphaIdsImpl {
|
|
|
124
107
|
* @param options The options parameters.
|
|
125
108
|
*/
|
|
126
109
|
async getPreRegisteredAlphaIdCountries(options) {
|
|
127
|
-
return tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options
|
|
110
|
+
return tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options ?? {}, async (options) => {
|
|
128
111
|
return this.client.sendOperationRequest({ options }, getPreRegisteredAlphaIdCountriesOperationSpec);
|
|
129
112
|
});
|
|
130
113
|
}
|
|
@@ -134,7 +117,7 @@ export class AlphaIdsImpl {
|
|
|
134
117
|
* @param options The options parameters.
|
|
135
118
|
*/
|
|
136
119
|
async _getAlphaIdsNext(nextLink, options) {
|
|
137
|
-
return tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options
|
|
120
|
+
return tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options ?? {}, async (options) => {
|
|
138
121
|
return this.client.sendOperationRequest({ nextLink, options }, getAlphaIdsNextOperationSpec);
|
|
139
122
|
});
|
|
140
123
|
}
|
|
@@ -186,7 +169,7 @@ const upsertDynamicAlphaIdConfigurationOperationSpec = {
|
|
|
186
169
|
},
|
|
187
170
|
requestBody: {
|
|
188
171
|
parameterPath: { enabled: ["enabled"] },
|
|
189
|
-
mapper:
|
|
172
|
+
mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }
|
|
190
173
|
},
|
|
191
174
|
queryParameters: [Parameters.apiVersion],
|
|
192
175
|
urlParameters: [Parameters.endpoint],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIds.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/alphaIds.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;AAkBtD,4CAA4C;AAC5C,4CAA4C;AAC5C,MAAM,OAAO,YAAY;IAGvB;;;OAGG;IACH,YAAY,MAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,YAAY,CACjB,OAA2C;QAE3C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,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,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,qBAAqB,CAClC,OAA2C,EAC3C,QAAuB;;YAEvB,IAAI,MAAmC,CAAC;YACxC,IAAI,iBAAiB,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iB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AS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,kBAAkB;SACvC;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,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gBAAgB;SACrC;QACD,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,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 { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { AlphaIds } 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 { AlphaIDsClient } from \"../alphaIDsClient.js\";\nimport {\n AlphaId,\n AlphaIdsGetAlphaIdsNextOptionalParams,\n AlphaIdsGetAlphaIdsOptionalParams,\n AlphaIdsGetAlphaIdsResponse,\n AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsGetDynamicAlphaIdConfigurationResponse,\n AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsUpsertDynamicAlphaIdConfigurationResponse,\n AlphaIdsGetDynamicAlphaIdCountriesOptionalParams,\n AlphaIdsGetDynamicAlphaIdCountriesResponse,\n AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams,\n AlphaIdsGetPreRegisteredAlphaIdCountriesResponse,\n AlphaIdsGetAlphaIdsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing AlphaIds operations. */\nexport class AlphaIdsImpl implements AlphaIds {\n private readonly client: AlphaIDsClient;\n\n /**\n * Initialize a new instance of the class AlphaIds class.\n * @param client Reference to the service client\n */\n constructor(client: AlphaIDsClient) {\n this.client = client;\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n public listAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): PagedAsyncIterableIterator<AlphaId> {\n const iter = this.getAlphaIdsPagingAll(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.getAlphaIdsPagingPage(options, settings);\n }\n };\n }\n\n private async *getAlphaIdsPagingPage(\n options?: AlphaIdsGetAlphaIdsOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<AlphaId[]> {\n let result: AlphaIdsGetAlphaIdsResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._getAlphaIds(options);\n let page = result.alphaIds || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._getAlphaIdsNext(continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.alphaIds || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *getAlphaIdsPagingAll(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): AsyncIterableIterator<AlphaId> {\n for await (const page of this.getAlphaIdsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n private async _getAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIds\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getAlphaIdsOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsResponse>;\n }\n );\n }\n\n /**\n * Get the Dynamic Alpha ID configuration that's applied for the current resource.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdConfiguration(\n options?: AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Creates or updates Dynamic Alpha ID Configuration for the current resource.\n * @param enabled Indicates whether the use of Dynamic Alpha IDs is supported for a specific resource.\n * @param options The options parameters.\n */\n async upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n options?: AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.upsertDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { enabled, options },\n upsertDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Dynamic Alpha IDs.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdCountries(\n options?: AlphaIdsGetDynamicAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Pre-Registered Alpha IDs.\n * @param options The options parameters.\n */\n async getPreRegisteredAlphaIdCountries(\n options?: AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getPreRegisteredAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getPreRegisteredAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * GetAlphaIdsNext\n * @param nextLink The nextLink from the previous successful call to the GetAlphaIds method.\n * @param options The options parameters.\n */\n private async _getAlphaIdsNext(\n nextLink: string,\n options?: AlphaIdsGetAlphaIdsNextOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsNextResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIdsNext\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { nextLink, options },\n getAlphaIdsNextOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsNextResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAlphaIdsOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\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 upsertDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n requestBody: {\n parameterPath: { enabled: [\"enabled\"] },\n mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getDynamicAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\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 getPreRegisteredAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/pre-registered/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\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 getAlphaIdsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
1
|
+
{"version":3,"file":"alphaIds.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/alphaIds.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;AAkBtD,4CAA4C;AAC5C,4CAA4C;AAC5C,MAAM,OAAO,YAAY;IACN,MAAM,CAAiB;IAExC;;;OAGG;IACH,YAAY,MAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,YAAY,CACjB,OAA2C;QAE3C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,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,EAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;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B;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,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gBAAgB;SACrC;QACD,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,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 { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { AlphaIds } 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 { AlphaIDsClient } from \"../alphaIDsClient.js\";\nimport {\n AlphaId,\n AlphaIdsGetAlphaIdsNextOptionalParams,\n AlphaIdsGetAlphaIdsOptionalParams,\n AlphaIdsGetAlphaIdsResponse,\n AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsGetDynamicAlphaIdConfigurationResponse,\n AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsUpsertDynamicAlphaIdConfigurationResponse,\n AlphaIdsGetDynamicAlphaIdCountriesOptionalParams,\n AlphaIdsGetDynamicAlphaIdCountriesResponse,\n AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams,\n AlphaIdsGetPreRegisteredAlphaIdCountriesResponse,\n AlphaIdsGetAlphaIdsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing AlphaIds operations. */\nexport class AlphaIdsImpl implements AlphaIds {\n private readonly client: AlphaIDsClient;\n\n /**\n * Initialize a new instance of the class AlphaIds class.\n * @param client Reference to the service client\n */\n constructor(client: AlphaIDsClient) {\n this.client = client;\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n public listAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): PagedAsyncIterableIterator<AlphaId> {\n const iter = this.getAlphaIdsPagingAll(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.getAlphaIdsPagingPage(options, settings);\n }\n };\n }\n\n private async *getAlphaIdsPagingPage(\n options?: AlphaIdsGetAlphaIdsOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<AlphaId[]> {\n let result: AlphaIdsGetAlphaIdsResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._getAlphaIds(options);\n let page = result.alphaIds || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._getAlphaIdsNext(continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.alphaIds || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *getAlphaIdsPagingAll(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): AsyncIterableIterator<AlphaId> {\n for await (const page of this.getAlphaIdsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n private async _getAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIds\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getAlphaIdsOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsResponse>;\n }\n );\n }\n\n /**\n * Get the Dynamic Alpha ID configuration that's applied for the current resource.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdConfiguration(\n options?: AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Creates or updates Dynamic Alpha ID Configuration for the current resource.\n * @param enabled Indicates whether the use of Dynamic Alpha IDs is supported for a specific resource.\n * @param options The options parameters.\n */\n async upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n options?: AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.upsertDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { enabled, options },\n upsertDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Dynamic Alpha IDs.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdCountries(\n options?: AlphaIdsGetDynamicAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Pre-Registered Alpha IDs.\n * @param options The options parameters.\n */\n async getPreRegisteredAlphaIdCountries(\n options?: AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getPreRegisteredAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getPreRegisteredAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * GetAlphaIdsNext\n * @param nextLink The nextLink from the previous successful call to the GetAlphaIds method.\n * @param options The options parameters.\n */\n private async _getAlphaIdsNext(\n nextLink: string,\n options?: AlphaIdsGetAlphaIdsNextOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsNextResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIdsNext\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { nextLink, options },\n getAlphaIdsNextOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsNextResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAlphaIdsOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\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 upsertDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n requestBody: {\n parameterPath: { enabled: [\"enabled\"] },\n mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getDynamicAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\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 getPreRegisteredAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/pre-registered/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\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 getAlphaIdsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -14,18 +14,16 @@ 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;
|
|
18
17
|
if (typeof page !== "object" || page === null) {
|
|
19
18
|
return undefined;
|
|
20
19
|
}
|
|
21
|
-
return
|
|
20
|
+
return pageMap.get(page)?.continuationToken;
|
|
22
21
|
}
|
|
23
22
|
export function setContinuationToken(page, continuationToken) {
|
|
24
|
-
var _a;
|
|
25
23
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
|
-
const pageInfo =
|
|
26
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
29
27
|
pageInfo.continuationToken = continuationToken;
|
|
30
28
|
pageMap.set(page, pageInfo);
|
|
31
29
|
}
|
|
@@ -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,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,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,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,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"]}
|
|
@@ -9,6 +9,6 @@ import { createTracingClient } from "@azure/core-tracing";
|
|
|
9
9
|
export const tracingClient = createTracingClient({
|
|
10
10
|
namespace: "Microsoft.Communication",
|
|
11
11
|
packageName: "@azure/communication-alpha-ids",
|
|
12
|
-
packageVersion: "1.0.0-beta.
|
|
12
|
+
packageVersion: "1.0.0-beta.3"
|
|
13
13
|
});
|
|
14
14
|
//# sourceMappingURL=tracing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../../src/generated/src/tracing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC/C,SAAS,EAAE,yBAAyB;IACpC,WAAW,EAAE,gCAAgC;IAC7C,cAAc,EAAE,cAAc;CAC/B,CAAC,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 { createTracingClient } from \"@azure/core-tracing\";\n\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.Communication\",\n packageName: \"@azure/communication-alpha-ids\",\n packageVersion: \"1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../../src/generated/src/tracing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC/C,SAAS,EAAE,yBAAyB;IACpC,WAAW,EAAE,gCAAgC;IAC7C,cAAc,EAAE,cAAc;CAC/B,CAAC,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 { createTracingClient } from \"@azure/core-tracing\";\n\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.Communication\",\n packageName: \"@azure/communication-alpha-ids\",\n packageVersion: \"1.0.0-beta.3\"\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.3\";\n"]}
|
|
@@ -12,9 +12,8 @@ export function createAlphaIDsPagingPolicy(host) {
|
|
|
12
12
|
return {
|
|
13
13
|
name: "alphaIDsPagingPolicy",
|
|
14
14
|
async sendRequest(request, next) {
|
|
15
|
-
var _a;
|
|
16
15
|
const response = await next(request);
|
|
17
|
-
let nextLink =
|
|
16
|
+
let nextLink = response?.parsedBody?.nextLink;
|
|
18
17
|
if (nextLink && !nextLink.startsWith(host)) {
|
|
19
18
|
nextLink = host.endsWith("/") ? nextLink.substring(1) : nextLink;
|
|
20
19
|
const absolutePath = `${host}${nextLink}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPipelinePolicies.js","sourceRoot":"","sources":["../../../src/utils/customPipelinePolicies.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB
|
|
1
|
+
{"version":3,"file":"customPipelinePolicies.js","sourceRoot":"","sources":["../../../src/utils/customPipelinePolicies.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,MAAM,QAAQ,GAA0B,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,QAAQ,GAAW,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC;YAEtD,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;gBACjE,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG,YAAY,CAAC;YAC9C,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullOperationResponse } from \"@azure/core-client\";\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates a `PipelinePolicy` that converts relative URL values in the `nextLink` property to absolute URLs.\n *\n * This is necessary because the Core V2 library does not support paging with relative links at time of writing.\n *\n * @param host - The base URL of the resource.\n * @returns the `PipelinePolicy` that addresses the issue.\n */\nexport function createAlphaIDsPagingPolicy(host: string): PipelinePolicy {\n return {\n name: \"alphaIDsPagingPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const response: FullOperationResponse = await next(request);\n let nextLink: string = response?.parsedBody?.nextLink;\n\n if (nextLink && !nextLink.startsWith(host)) {\n nextLink = host.endsWith(\"/\") ? nextLink.substring(1) : nextLink;\n const absolutePath = `${host}${nextLink}`;\n response.parsedBody.nextLink = absolutePath;\n }\n\n return response;\n },\n };\n}\n"]}
|
|
@@ -10,16 +10,23 @@ const tracing_js_1 = require("./generated/src/tracing.js");
|
|
|
10
10
|
const customPipelinePolicies_js_1 = require("./utils/customPipelinePolicies.js");
|
|
11
11
|
const isAlphaIdsClientOptions = (options) => options && !(0, communication_common_1.isKeyCredential)(options) && !(0, core_auth_1.isTokenCredential)(options);
|
|
12
12
|
class AlphaIdsClient {
|
|
13
|
+
/**
|
|
14
|
+
* A reference to the auto-generated AlphaIDs HTTP client.
|
|
15
|
+
*/
|
|
16
|
+
client;
|
|
13
17
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
14
18
|
const { url, credential } = (0, communication_common_1.parseClientArguments)(connectionStringOrUrl, credentialOrOptions);
|
|
15
19
|
const options = isAlphaIdsClientOptions(credentialOrOptions)
|
|
16
20
|
? credentialOrOptions
|
|
17
21
|
: maybeOptions;
|
|
18
|
-
const internalPipelineOptions =
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
const internalPipelineOptions = {
|
|
23
|
+
...options,
|
|
24
|
+
...{
|
|
25
|
+
loggingOptions: {
|
|
26
|
+
logger: index_js_2.logger.info,
|
|
27
|
+
},
|
|
21
28
|
},
|
|
22
|
-
}
|
|
29
|
+
};
|
|
23
30
|
this.client = new index_js_1.AlphaIDsClient(url, internalPipelineOptions);
|
|
24
31
|
const authPolicy = (0, communication_common_2.createCommunicationAuthPolicy)(credential);
|
|
25
32
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIdsClient.js","sourceRoot":"","sources":["../../src/alphaIdsClient.ts"],"names":[],"mappings":";;;AAaA,sEAAoF;AAEpF,gDAAqD;AAEr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CAAC;QACb,CAAC;IACH,CAAC;IAEM,0BAA0B,CAC/B,UAA6C,EAAE;QAE/C,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,0BAAa,CAAC,SAAS,CACtD,2CAA2C,EAC3C,OAAO,CACR,CAAC;QACF,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,cAAc,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,gCAAgC,CACrC,UAAmD,EAAE;QAErD,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,0BAAa,CAAC,SAAS,CACtD,iDAAiD,EACjD,OAAO,CACR,CAAC;QACF,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gCAAgC,CAAC,cAAc,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;CACF;AAhID,wCAgIC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\nimport type {\n DynamicAlphaIdConfiguration,\n GetConfigurationOptions,\n UpsertConfigurationOptions,\n ListAlphaIdsOptions,\n GetDynamicAlphaIdCountriesOptions,\n GetPreRegisteredAlphaIdCountriesOptions,\n AlphaId,\n SupportedCountries,\n} from \"./models.js\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { AlphaIDsClient as AlphaIDsGeneratedClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { createAlphaIDsPagingPolicy } from \"./utils/customPipelinePolicies.js\";\n\n/**\n * Client options used to configure the AlphaIdsClient API requests.\n */\nexport interface AlphaIdsClientOptions extends CommonClientOptions {}\n\nconst isAlphaIdsClientOptions = (options: any): options is AlphaIdsClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class AlphaIdsClient {\n /**\n * A reference to the auto-generated AlphaIDs HTTP client.\n */\n private readonly client: AlphaIDsGeneratedClient;\n\n public constructor(connectionString: string, options?: AlphaIdsClientOptions);\n\n public constructor(endpoint: string, credential: KeyCredential, options?: AlphaIdsClientOptions);\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: AlphaIdsClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | AlphaIdsClientOptions,\n maybeOptions: AlphaIdsClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isAlphaIdsClientOptions(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 AlphaIDsGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n // This policy is a temporary workarounds to address compatibility issues with Azure Core V2.\n const alphaIDsPagingPolicy = createAlphaIDsPagingPolicy(url);\n this.client.pipeline.addPolicy(alphaIDsPagingPolicy);\n }\n\n public getDynamicAlphaIdConfiguration(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: GetConfigurationOptions = {},\n ): Promise<DynamicAlphaIdConfiguration> {\n return tracingClient.withSpan(\n \"AlphaIdsClient-getConfiguration\",\n options,\n async (updatedOptions) => {\n return this.client.alphaIds.getDynamicAlphaIdConfiguration(updatedOptions);\n },\n );\n }\n\n public upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpsertConfigurationOptions = {},\n ): Promise<DynamicAlphaIdConfiguration> {\n return tracingClient.withSpan(\n \"AlphaIdsClient-upsertConfiguration\",\n options,\n async (updatedOptions) => {\n return this.client.alphaIds.upsertDynamicAlphaIdConfiguration(enabled, updatedOptions);\n },\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public getAlphaIds(options: ListAlphaIdsOptions = {}): PagedAsyncIterableIterator<AlphaId> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-listAlphaIds\",\n options,\n );\n try {\n return this.client.alphaIds.listAlphaIds(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public getDynamicAlphaIdCountries(\n options: GetDynamicAlphaIdCountriesOptions = {},\n ): Promise<SupportedCountries> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-getDynamicAlphaIdCountries\",\n options,\n );\n try {\n return this.client.alphaIds.getDynamicAlphaIdCountries(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public getPreRegisteredAlphaIdCountries(\n options: GetPreRegisteredAlphaIdCountriesOptions = {},\n ): Promise<SupportedCountries> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-getPreRegisteredAlphaIdCountries\",\n options,\n );\n try {\n return this.client.alphaIds.getPreRegisteredAlphaIdCountries(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n}\n"]}
|
|
@@ -12,13 +12,14 @@ 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 AlphaIDsClient extends coreClient.ServiceClient {
|
|
15
|
+
endpoint;
|
|
16
|
+
apiVersion;
|
|
15
17
|
/**
|
|
16
18
|
* Initializes a new instance of the AlphaIDsClient class.
|
|
17
19
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
|
18
20
|
* @param options The parameter options
|
|
19
21
|
*/
|
|
20
22
|
constructor(endpoint, options) {
|
|
21
|
-
var _a, _b;
|
|
22
23
|
if (endpoint === undefined) {
|
|
23
24
|
throw new Error("'endpoint' cannot be null");
|
|
24
25
|
}
|
|
@@ -29,13 +30,18 @@ class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
29
30
|
const defaults = {
|
|
30
31
|
requestContentType: "application/json; charset=utf-8"
|
|
31
32
|
};
|
|
32
|
-
const packageDetails = `azsdk-js-communication-alpha-ids/1.0.0-beta.
|
|
33
|
+
const packageDetails = `azsdk-js-communication-alpha-ids/1.0.0-beta.3`;
|
|
33
34
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
34
35
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
35
36
|
: `${packageDetails}`;
|
|
36
|
-
const optionsWithDefaults =
|
|
37
|
+
const optionsWithDefaults = {
|
|
38
|
+
...defaults,
|
|
39
|
+
...options,
|
|
40
|
+
userAgentOptions: {
|
|
37
41
|
userAgentPrefix
|
|
38
|
-
},
|
|
42
|
+
},
|
|
43
|
+
endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}"
|
|
44
|
+
};
|
|
39
45
|
super(optionsWithDefaults);
|
|
40
46
|
// Parameter assignments
|
|
41
47
|
this.endpoint = endpoint;
|
|
@@ -69,6 +75,7 @@ class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
69
75
|
};
|
|
70
76
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
71
77
|
}
|
|
78
|
+
alphaIds;
|
|
72
79
|
}
|
|
73
80
|
exports.AlphaIDsClient = AlphaIDsClient;
|
|
74
81
|
//# sourceMappingURL=alphaIDsClient.js.map
|