@azure-tools/communication-short-codes 1.0.0-beta.1 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +596 -267
- package/dist/index.js.map +1 -1
- package/dist-esm/src/generated/src/index.js +1 -1
- package/dist-esm/src/generated/src/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/mappers.js +153 -91
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +48 -2
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/operations/index.js +1 -1
- package/dist-esm/src/generated/src/operations/index.js.map +1 -1
- package/dist-esm/src/generated/src/operations/shortCodesOperations.js +561 -0
- package/dist-esm/src/generated/src/operations/shortCodesOperations.js.map +1 -0
- package/dist-esm/src/generated/src/operationsInterfaces/index.js +9 -0
- package/dist-esm/src/generated/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/generated/src/operationsInterfaces/shortCodesOperations.js +9 -0
- package/dist-esm/src/generated/src/operationsInterfaces/shortCodesOperations.js.map +1 -0
- package/dist-esm/src/generated/src/shortCodesClient.js +70 -5
- package/dist-esm/src/generated/src/shortCodesClient.js.map +1 -1
- package/dist-esm/src/generated/src/tracing.js +14 -0
- package/dist-esm/src/generated/src/tracing.js.map +1 -0
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/shortCodesClient.js +53 -76
- package/dist-esm/src/shortCodesClient.js.map +1 -1
- package/dist-esm/src/utils/constants.js +1 -1
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/dist-esm/src/utils/index.js +0 -1
- package/dist-esm/src/utils/index.js.map +1 -1
- package/package.json +42 -40
- package/types/communication-short-codes.d.ts +105 -26
- package/CHANGELOG.md +0 -10
- package/dist-esm/src/generated/src/operations/shortCodes.js +0 -341
- package/dist-esm/src/generated/src/operations/shortCodes.js.map +0 -1
- package/dist-esm/src/generated/src/shortCodesClientContext.js +0 -38
- package/dist-esm/src/generated/src/shortCodesClientContext.js.map +0 -1
- package/dist-esm/src/utils/tracing.js +0 -14
- package/dist-esm/src/utils/tracing.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortCodesOperations.js","sourceRoot":"","sources":["../../../../../src/generated/src/operationsInterfaces/shortCodesOperations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","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 { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport {\n ShortCode,\n ShortCodesGetShortCodesOptionalParams,\n USProgramBrief,\n ShortCodesGetUSProgramBriefsOptionalParams,\n ProgramBriefAttachment,\n ShortCodesGetUSProgramBriefAttachmentsOptionalParams,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n ShortCodesUpsertUSProgramBriefResponse,\n ShortCodesDeleteUSProgramBriefOptionalParams,\n ShortCodesGetUSProgramBriefOptionalParams,\n ShortCodesGetUSProgramBriefResponse,\n ShortCodesSubmitUSProgramBriefOptionalParams,\n ShortCodesSubmitUSProgramBriefResponse,\n AttachmentType,\n FileType,\n ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams,\n ShortCodesCreateOrReplaceUSProgramBriefAttachmentResponse,\n ShortCodesGetUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentResponse,\n ShortCodesDeleteUSProgramBriefAttachmentOptionalParams\n} from \"../models\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Interface representing a ShortCodesOperations. */\nexport interface ShortCodesOperations {\n /**\n * Gets the list of short codes for the current resource.\n * @param options The options parameters.\n */\n listShortCodes(\n options?: ShortCodesGetShortCodesOptionalParams\n ): PagedAsyncIterableIterator<ShortCode>;\n /**\n * Gets the list of US Program Briefs for the current resource.\n * @param options The options parameters.\n */\n listUSProgramBriefs(\n options?: ShortCodesGetUSProgramBriefsOptionalParams\n ): PagedAsyncIterableIterator<USProgramBrief>;\n /**\n * Gets the list of attachments from a US Program Brief.\n * @param programBriefId\n * @param options The options parameters.\n */\n listUSProgramBriefAttachments(\n programBriefId: string,\n options?: ShortCodesGetUSProgramBriefAttachmentsOptionalParams\n ): PagedAsyncIterableIterator<ProgramBriefAttachment>;\n /**\n * Creates or updates a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param options The options parameters.\n */\n upsertUSProgramBrief(\n programBriefId: string,\n options?: ShortCodesUpsertUSProgramBriefOptionalParams\n ): Promise<ShortCodesUpsertUSProgramBriefResponse>;\n /**\n * Deletes a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param options The options parameters.\n */\n deleteUSProgramBrief(\n programBriefId: string,\n options?: ShortCodesDeleteUSProgramBriefOptionalParams\n ): Promise<void>;\n /**\n * Get a US Program Brief by id.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param options The options parameters.\n */\n getUSProgramBrief(\n programBriefId: string,\n options?: ShortCodesGetUSProgramBriefOptionalParams\n ): Promise<ShortCodesGetUSProgramBriefResponse>;\n /**\n * Submits a US Program Brief for review.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param options The options parameters.\n */\n submitUSProgramBrief(\n programBriefId: string,\n options?: ShortCodesSubmitUSProgramBriefOptionalParams\n ): Promise<ShortCodesSubmitUSProgramBriefResponse>;\n /**\n * Creates or replace an attachment on a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param attachmentId Attachment Id. Must be a valid GUID\n * @param id Program Brief Attachment Id.\n * @param fileName The name of the file being attached\n * e.g. 'myFile01'\n * @param fileType The type of file being attached\n * e.g. 'pdf', 'jpg', 'png'\n * @param fileContentBase64 File content as base 64 encoded string\n * @param type Attachment type describing the purpose of the attachment\n * e.g. 'callToAction', 'termsOfService'\n * @param options The options parameters.\n */\n createOrReplaceUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n id: string,\n fileName: string,\n fileType: FileType,\n fileContentBase64: string,\n type: AttachmentType,\n options?: ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams\n ): Promise<ShortCodesCreateOrReplaceUSProgramBriefAttachmentResponse>;\n /**\n * Gets a specific an attachment from a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param attachmentId Attachment Id. Must be a valid GUID\n * @param options The options parameters.\n */\n getUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options?: ShortCodesGetUSProgramBriefAttachmentOptionalParams\n ): Promise<ShortCodesGetUSProgramBriefAttachmentResponse>;\n /**\n * Deletes a specific attachment from a US Program Brief.\n * @param programBriefId Program Brief Id. Must be a valid GUID\n * @param attachmentId Attachment Id. Must be a valid GUID\n * @param options The options parameters.\n */\n deleteUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options?: ShortCodesDeleteUSProgramBriefAttachmentOptionalParams\n ): Promise<void>;\n}\n"]}
|
|
@@ -5,17 +5,82 @@
|
|
|
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
|
|
9
|
-
import
|
|
10
|
-
|
|
8
|
+
import * as coreClient from "@azure/core-client";
|
|
9
|
+
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
10
|
+
import { ShortCodesOperationsImpl } from "./operations";
|
|
11
|
+
export class ShortCodesClient extends coreClient.ServiceClient {
|
|
11
12
|
/**
|
|
12
13
|
* Initializes a new instance of the ShortCodesClient class.
|
|
13
14
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
|
14
15
|
* @param options The parameter options
|
|
15
16
|
*/
|
|
16
17
|
constructor(endpoint, options) {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (endpoint === undefined) {
|
|
20
|
+
throw new Error("'endpoint' cannot be null");
|
|
21
|
+
}
|
|
22
|
+
// Initializing default values for options
|
|
23
|
+
if (!options) {
|
|
24
|
+
options = {};
|
|
25
|
+
}
|
|
26
|
+
const defaults = {
|
|
27
|
+
requestContentType: "application/json; charset=utf-8"
|
|
28
|
+
};
|
|
29
|
+
const packageDetails = `azsdk-js-communication-short-codes/1.0.0-beta.4`;
|
|
30
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
31
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
32
|
+
: `${packageDetails}`;
|
|
33
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
34
|
+
userAgentPrefix
|
|
35
|
+
}, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
|
|
36
|
+
super(optionsWithDefaults);
|
|
37
|
+
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
|
38
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
39
|
+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
40
|
+
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
41
|
+
if (!bearerTokenAuthenticationPolicyFound) {
|
|
42
|
+
this.pipeline.removePolicy({
|
|
43
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
44
|
+
});
|
|
45
|
+
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
46
|
+
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
|
47
|
+
challengeCallbacks: {
|
|
48
|
+
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Parameter assignments
|
|
54
|
+
this.endpoint = endpoint;
|
|
55
|
+
// Assigning values to Constant parameters
|
|
56
|
+
this.apiVersion = options.apiVersion || "2022-09-06";
|
|
57
|
+
this.shortCodesOperations = new ShortCodesOperationsImpl(this);
|
|
58
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
59
|
+
}
|
|
60
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
61
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
62
|
+
if (!apiVersion) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const apiVersionPolicy = {
|
|
66
|
+
name: "CustomApiVersionPolicy",
|
|
67
|
+
async sendRequest(request, next) {
|
|
68
|
+
const param = request.url.split("?");
|
|
69
|
+
if (param.length > 1) {
|
|
70
|
+
const newParams = param[1].split("&").map((item) => {
|
|
71
|
+
if (item.indexOf("api-version") > -1) {
|
|
72
|
+
return "api-version=" + apiVersion;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return item;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
79
|
+
}
|
|
80
|
+
return next(request);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
19
84
|
}
|
|
20
85
|
}
|
|
21
86
|
//# sourceMappingURL=shortCodesClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../../../src/generated/src/shortCodesClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../../../src/generated/src/shortCodesClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA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C,OAAO,cAAc,GAAG,UAAU,CAAC;yBACpC;6BAAM;4BACL,OAAO,IAAI,CAAC;yBACb;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBACpD;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","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 * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { ShortCodesOperationsImpl } from \"./operations\";\nimport { ShortCodesOperations } from \"./operationsInterfaces\";\nimport { ShortCodesClientOptionalParams } from \"./models\";\n\nexport class ShortCodesClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the ShortCodesClient 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?: ShortCodesClientOptionalParams) {\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: ShortCodesClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-short-codes/1.0.0-beta.4`;\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 baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2022-09-06\";\n this.shortCodesOperations = new ShortCodesOperationsImpl(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 shortCodesOperations: ShortCodesOperations;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
import { createTracingClient } from "@azure/core-tracing";
|
|
9
|
+
export const tracingClient = createTracingClient({
|
|
10
|
+
namespace: "Microsoft.Communication",
|
|
11
|
+
packageName: "@azure/communication-short-codes",
|
|
12
|
+
packageVersion: "1.0.0-beta.4"
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=tracing.js.map
|
|
@@ -0,0 +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,kCAAkC;IAC/C,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-short-codes\",\n packageVersion: \"1.0.0-beta.4\"\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptions } from \"@azure/core-
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptions } from \"@azure/core-client\";\nimport { ShortCodesGetShortCodesOptionalParams } from \".\";\n\n/**\n * Additional options for the delete US Program Brief request.\n */\nexport interface DeleteUSProgramBriefOptions extends OperationOptions {}\n\n/**\n * Additional options for the Get US Program Brief request.\n */\nexport interface GetUSProgramBriefOptions extends OperationOptions {}\n\n/**\n * Additional options for the Submit US Program Brief request.\n */\nexport interface SubmitUSProgramBriefOptions extends OperationOptions {}\n\n/**\n * Additional options for the List Short Codes request.\n */\nexport interface ListShortCodesOptions extends ShortCodesGetShortCodesOptionalParams {}\n\n/**\n * Additional options for the List US Program Brief request.\n */\nexport interface ListUSProgramBriefsOptions extends OperationOptions {}\n\nexport {\n ShortCode,\n USProgramBrief,\n NumberType,\n ProgramBriefStatus,\n ShortCodeCost,\n ProgramDetails,\n CompanyInformation,\n MessageDetails,\n TrafficDetails,\n ShortCodesGetShortCodesOptionalParams,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n BillingFrequency,\n CallToActionType,\n ContactInformation,\n CustomerCareInformation,\n Recurrence,\n UseCase,\n ReviewNote,\n MessageProtocol,\n MessageDirectionality,\n MessageContentType,\n MessageExampleSequence,\n MessageExample,\n MessageDirection,\n ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams,\n ShortCodesDeleteUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentsOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentOptionalParams,\n ProgramBriefAttachment,\n AttachmentType,\n FileType,\n ProgramBriefAttachmentSummary,\n} from \"./generated/src/models/\";\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
/// <reference lib="esnext.asynciterable" />
|
|
4
|
-
import { parseClientArguments, isKeyCredential, createCommunicationAuthPolicy } from "@azure/communication-common";
|
|
5
4
|
import { isTokenCredential } from "@azure/core-auth";
|
|
6
|
-
import {
|
|
7
|
-
import { logger, createSpan, SDK_VERSION } from "./utils";
|
|
5
|
+
import { isKeyCredential, parseClientArguments } from "@azure/communication-common";
|
|
8
6
|
import { ShortCodesClient as ShortCodesGeneratedClient } from "./generated/src";
|
|
9
|
-
import {
|
|
7
|
+
import { createCommunicationAuthPolicy } from "@azure/communication-common";
|
|
8
|
+
import { logger } from "./utils";
|
|
9
|
+
import { tracingClient } from "./generated/src/tracing";
|
|
10
10
|
const isShortCodesClientOptions = (options) => options && !isKeyCredential(options) && !isTokenCredential(options);
|
|
11
11
|
export class ShortCodesClient {
|
|
12
12
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
@@ -14,34 +14,24 @@ export class ShortCodesClient {
|
|
|
14
14
|
const options = isShortCodesClientOptions(credentialOrOptions)
|
|
15
15
|
? credentialOrOptions
|
|
16
16
|
: maybeOptions;
|
|
17
|
-
const libInfo = `azsdk-js-communication-short-codes/${SDK_VERSION}`;
|
|
18
|
-
if (!options.userAgentOptions) {
|
|
19
|
-
options.userAgentOptions = {};
|
|
20
|
-
}
|
|
21
|
-
if (options.userAgentOptions.userAgentPrefix) {
|
|
22
|
-
options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
options.userAgentOptions.userAgentPrefix = libInfo;
|
|
26
|
-
}
|
|
27
17
|
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
28
18
|
loggingOptions: {
|
|
29
|
-
logger: logger.info
|
|
30
|
-
}
|
|
19
|
+
logger: logger.info,
|
|
20
|
+
},
|
|
31
21
|
});
|
|
22
|
+
this.client = new ShortCodesGeneratedClient(url, internalPipelineOptions);
|
|
32
23
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
33
|
-
|
|
34
|
-
this.client = new ShortCodesGeneratedClient(url, pipeline).shortCodes;
|
|
24
|
+
this.client.pipeline.addPolicy(authPolicy);
|
|
35
25
|
}
|
|
36
26
|
listShortCodes(options = {}) {
|
|
37
|
-
const { span, updatedOptions } =
|
|
27
|
+
const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listShortCodes", options);
|
|
38
28
|
try {
|
|
39
|
-
return this.client.listShortCodes(updatedOptions);
|
|
29
|
+
return this.client.shortCodesOperations.listShortCodes(updatedOptions);
|
|
40
30
|
}
|
|
41
31
|
catch (e) {
|
|
42
32
|
span.setStatus({
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
status: "error",
|
|
34
|
+
error: e,
|
|
45
35
|
});
|
|
46
36
|
throw e;
|
|
47
37
|
}
|
|
@@ -49,63 +39,30 @@ export class ShortCodesClient {
|
|
|
49
39
|
span.end();
|
|
50
40
|
}
|
|
51
41
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
span.setStatus({
|
|
59
|
-
code: SpanStatusCode.ERROR,
|
|
60
|
-
message: e.message
|
|
61
|
-
});
|
|
62
|
-
throw e;
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
span.end();
|
|
66
|
-
}
|
|
42
|
+
upsertUSProgramBrief(programBriefId, options = {}) {
|
|
43
|
+
return tracingClient.withSpan("ShortCodesClient-upsertUSProgramBrief", options, (updatedOptions) => {
|
|
44
|
+
return this.client.shortCodesOperations.upsertUSProgramBrief(programBriefId, updatedOptions);
|
|
45
|
+
});
|
|
67
46
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
span.setStatus({
|
|
75
|
-
code: SpanStatusCode.ERROR,
|
|
76
|
-
message: e.message
|
|
77
|
-
});
|
|
78
|
-
throw e;
|
|
79
|
-
}
|
|
80
|
-
finally {
|
|
81
|
-
span.end();
|
|
82
|
-
}
|
|
47
|
+
deleteUSProgramBrief(programBriefId, options = {}) {
|
|
48
|
+
return tracingClient.withSpan("ShortCodesClient-deleteUSProgramBrief", options, (updatedOptions) => {
|
|
49
|
+
return this.client.shortCodesOperations.deleteUSProgramBrief(programBriefId, updatedOptions);
|
|
50
|
+
});
|
|
83
51
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
span.setStatus({
|
|
91
|
-
code: SpanStatusCode.ERROR,
|
|
92
|
-
message: e.message
|
|
93
|
-
});
|
|
94
|
-
throw e;
|
|
95
|
-
}
|
|
96
|
-
finally {
|
|
97
|
-
span.end();
|
|
98
|
-
}
|
|
52
|
+
getUSProgramBrief(programBriefId, options = {}) {
|
|
53
|
+
return tracingClient.withSpan("ShortCodesClient-getUSProgramBrief", options, (updatedOptions) => {
|
|
54
|
+
return this.client.shortCodesOperations.getUSProgramBrief(programBriefId, updatedOptions);
|
|
55
|
+
});
|
|
99
56
|
}
|
|
100
57
|
listUSProgramBriefs(options = {}) {
|
|
101
|
-
const { span, updatedOptions } =
|
|
58
|
+
const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listUSProgramBriefs", options);
|
|
102
59
|
try {
|
|
103
|
-
return this.client.listUSProgramBriefs(updatedOptions);
|
|
60
|
+
return this.client.shortCodesOperations.listUSProgramBriefs(updatedOptions);
|
|
104
61
|
}
|
|
105
62
|
catch (e) {
|
|
106
63
|
span.setStatus({
|
|
107
|
-
|
|
108
|
-
|
|
64
|
+
status: "error",
|
|
65
|
+
error: e,
|
|
109
66
|
});
|
|
110
67
|
throw e;
|
|
111
68
|
}
|
|
@@ -113,15 +70,25 @@ export class ShortCodesClient {
|
|
|
113
70
|
span.end();
|
|
114
71
|
}
|
|
115
72
|
}
|
|
116
|
-
|
|
117
|
-
|
|
73
|
+
submitUSProgramBrief(programBriefId, options = {}) {
|
|
74
|
+
return tracingClient.withSpan("ShortCodesClient-submitUSProgramBrief", options, (updatedOptions) => {
|
|
75
|
+
return this.client.shortCodesOperations.submitUSProgramBrief(programBriefId, updatedOptions);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
getUSProgramBriefAttachment(programBriefId, attachmentId, options = {}) {
|
|
79
|
+
return tracingClient.withSpan("ShortCodesClient-getUSProgramBriefAttachment", options, (updatedOptions) => {
|
|
80
|
+
return this.client.shortCodesOperations.getUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
listUSProgramBriefAttachments(programBriefId, options = {}) {
|
|
84
|
+
const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listUSProgramBriefAttachments", options);
|
|
118
85
|
try {
|
|
119
|
-
return
|
|
86
|
+
return this.client.shortCodesOperations.listUSProgramBriefAttachments(programBriefId, updatedOptions);
|
|
120
87
|
}
|
|
121
88
|
catch (e) {
|
|
122
89
|
span.setStatus({
|
|
123
|
-
|
|
124
|
-
|
|
90
|
+
status: "error",
|
|
91
|
+
error: e,
|
|
125
92
|
});
|
|
126
93
|
throw e;
|
|
127
94
|
}
|
|
@@ -129,5 +96,15 @@ export class ShortCodesClient {
|
|
|
129
96
|
span.end();
|
|
130
97
|
}
|
|
131
98
|
}
|
|
99
|
+
deleteUSProgramBriefAttachment(programBriefId, attachmentId, options = {}) {
|
|
100
|
+
return tracingClient.withSpan("ShortCodesClient-deleteUSProgramBriefAttachment", options, (updatedOptions) => {
|
|
101
|
+
return this.client.shortCodesOperations.deleteUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, fileName, fileType, fileContent, attachmentType, options = {}) {
|
|
105
|
+
return tracingClient.withSpan("ShortCodesClient-createOrReplaceUSProgramBriefAttachment", options, (updatedOptions) => {
|
|
106
|
+
return this.client.shortCodesOperations.createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, attachmentId, fileName, fileType, fileContent, attachmentType, updatedOptions);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
132
109
|
}
|
|
133
110
|
//# sourceMappingURL=shortCodesClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../src/shortCodesClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAE5C,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAkC,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAGL,yBAAyB,EAE1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAOhF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAcrD,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAsC,EAAE,CACrF,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEtE,MAAM,OAAO,gBAAgB;IAoB3B,YACE,qBAA6B,EAC7B,mBAA+E,EAC/E,eAAwC,EAAE;QAE1C,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,oBAAoB,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;QAC7F,MAAM,OAAO,GAAG,yBAAyB,CAAC,mBAAmB,CAAC;YAC5D,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,YAAY,CAAC;QACjB,MAAM,OAAO,GAAG,sCAAsC,WAAW,EAAE,CAAC;QAEpE,IAAI,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nB,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAEM,mBAAmB,CACxB,UAAsC,EAAE;QAExC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;QAC7F,IAAI;YACF,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;SACxD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;aACnB,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAC/B,cAAsB,EACtB,OAAqC;QAErC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,uCAAuC,EAAE,OAAO,CAAC,CAAC;QAC9F,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;SAC/E;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;aACnB,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport {\n parseClientArguments,\n isKeyCredential,\n createCommunicationAuthPolicy\n} from \"@azure/communication-common\";\nimport { isTokenCredential, KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport {\n PipelineOptions,\n InternalPipelineOptions,\n createPipelineFromOptions,\n RestResponse\n} from \"@azure/core-http\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { logger, createSpan, SDK_VERSION } from \"./utils\";\nimport { ShortCodesClient as ShortCodesGeneratedClient } from \"./generated/src\";\nimport { ShortCodes as GeneratedClient } from \"./generated/src/operations\";\nimport {\n ShortCode,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n USProgramBrief\n} from \"./generated/src/models/\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport {\n DeleteUSProgramBriefOptions,\n GetUSProgramBriefOptions,\n ListShortCodesOptions,\n ListUSProgramBriefsOptions,\n SubmitUSProgramBriefOptions\n} from \"./models\";\n\n/**\n * Client options used to configure the ShortCodesClient API requests.\n */\nexport interface ShortCodesClientOptions extends PipelineOptions {}\n\nconst isShortCodesClientOptions = (options: any): options is ShortCodesClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class ShortCodesClient {\n /**\n * A reference to the auto-generated ShortCodes HTTP client.\n */\n private readonly client: GeneratedClient;\n\n public constructor(connectionString: string, options?: ShortCodesClientOptions);\n\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: ShortCodesClientOptions\n );\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: ShortCodesClientOptions\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | ShortCodesClientOptions,\n maybeOptions: ShortCodesClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isShortCodesClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n const libInfo = `azsdk-js-communication-short-codes/${SDK_VERSION}`;\n\n if (!options.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n if (options.userAgentOptions.userAgentPrefix) {\n options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;\n } else {\n options.userAgentOptions.userAgentPrefix = libInfo;\n }\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info\n }\n }\n };\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy);\n this.client = new ShortCodesGeneratedClient(url, pipeline).shortCodes;\n }\n\n public listShortCodes(\n options: ListShortCodesOptions = {}\n ): PagedAsyncIterableIterator<ShortCode> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-listShortCodes\", options);\n try {\n return this.client.listShortCodes(updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public async upsertUSProgramBrief(\n programBriefId: string,\n options: ShortCodesUpsertUSProgramBriefOptionalParams = {}\n ): Promise<RestResponse> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-upsertUSProgramBrief\", options);\n try {\n return await this.client.upsertUSProgramBrief(programBriefId, updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public async deleteUSProgramBrief(\n programBriefId: string,\n options?: DeleteUSProgramBriefOptions\n ): Promise<RestResponse> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-deleteUSProgramBrief\", options);\n try {\n return await this.client.deleteUSProgramBrief(programBriefId, updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public async getUSProgramBrief(\n programBriefId: string,\n options?: GetUSProgramBriefOptions\n ): Promise<USProgramBrief> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-getUSProgramBrief\", options);\n try {\n return await this.client.getUSProgramBrief(programBriefId, updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public listUSProgramBriefs(\n options: ListUSProgramBriefsOptions = {}\n ): PagedAsyncIterableIterator<USProgramBrief> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-listUSProgramBriefs\", options);\n try {\n return this.client.listUSProgramBriefs(updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public async submitUSProgramBrief(\n programBriefId: string,\n options?: SubmitUSProgramBriefOptions\n ): Promise<RestResponse> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-submitUSProgramBrief\", options);\n try {\n return await this.client.submitUSProgramBrief(programBriefId, updatedOptions);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../src/shortCodesClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAgB5C,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrF,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAsC,EAAE,CACrF,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEtE,MAAM,OAAO,gBAAgB;IAoB3B,YACE,qBAA6B,EAC7B,mBAA+E,EAC/E,eAAwC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0DAA0D,EAC1D,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,uCAAuC,CAC7E,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport {\n AttachmentType,\n DeleteUSProgramBriefOptions,\n FileType,\n GetUSProgramBriefOptions,\n ListShortCodesOptions,\n ListUSProgramBriefsOptions,\n ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams,\n ShortCodesDeleteUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentsOptionalParams,\n SubmitUSProgramBriefOptions,\n} from \"./models\";\nimport { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport {\n ProgramBriefAttachment,\n ShortCode,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n USProgramBrief,\n} from \"./generated/src/models/\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { ShortCodesClient as ShortCodesGeneratedClient } from \"./generated/src\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { logger } from \"./utils\";\nimport { tracingClient } from \"./generated/src/tracing\";\n/**\n * Client options used to configure the ShortCodesClient API requests.\n */\nexport interface ShortCodesClientOptions extends CommonClientOptions {}\n\nconst isShortCodesClientOptions = (options: any): options is ShortCodesClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class ShortCodesClient {\n /**\n * A reference to the auto-generated ShortCodes HTTP client.\n */\n private readonly client: ShortCodesGeneratedClient;\n\n public constructor(connectionString: string, options?: ShortCodesClientOptions);\n\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: ShortCodesClientOptions\n );\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: ShortCodesClientOptions\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | ShortCodesClientOptions,\n maybeOptions: ShortCodesClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isShortCodesClientOptions(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 ShortCodesGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n public listShortCodes(\n options: ListShortCodesOptions = {}\n ): PagedAsyncIterableIterator<ShortCode> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listShortCodes\",\n options\n );\n try {\n return this.client.shortCodesOperations.listShortCodes(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 upsertUSProgramBrief(\n programBriefId: string,\n options: ShortCodesUpsertUSProgramBriefOptionalParams = {}\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-upsertUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.upsertUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n }\n );\n }\n\n public deleteUSProgramBrief(\n programBriefId: string,\n options: DeleteUSProgramBriefOptions = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShortCodesClient-deleteUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.deleteUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n }\n );\n }\n\n public getUSProgramBrief(\n programBriefId: string,\n options: GetUSProgramBriefOptions = {}\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-getUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.getUSProgramBrief(programBriefId, updatedOptions);\n }\n );\n }\n\n public listUSProgramBriefs(\n options: ListUSProgramBriefsOptions = {}\n ): PagedAsyncIterableIterator<USProgramBrief> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listUSProgramBriefs\",\n options\n );\n try {\n return this.client.shortCodesOperations.listUSProgramBriefs(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 submitUSProgramBrief(\n programBriefId: string,\n options: SubmitUSProgramBriefOptions = {}\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-submitUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.submitUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n }\n );\n }\n\n public getUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options: ShortCodesGetUSProgramBriefAttachmentOptionalParams = {}\n ): Promise<ProgramBriefAttachment> {\n return tracingClient.withSpan(\n \"ShortCodesClient-getUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.getUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions\n );\n }\n );\n }\n\n public listUSProgramBriefAttachments(\n programBriefId: string,\n options: ShortCodesGetUSProgramBriefAttachmentsOptionalParams = {}\n ): PagedAsyncIterableIterator<ProgramBriefAttachment> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listUSProgramBriefAttachments\",\n options\n );\n try {\n return this.client.shortCodesOperations.listUSProgramBriefAttachments(\n programBriefId,\n updatedOptions\n );\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 deleteUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options: ShortCodesDeleteUSProgramBriefAttachmentOptionalParams = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShortCodesClient-deleteUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.deleteUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions\n );\n }\n );\n }\n\n public createOrReplaceUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n fileName: string,\n fileType: FileType,\n fileContent: string,\n attachmentType: AttachmentType,\n options: ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams = {}\n ): Promise<ProgramBriefAttachment> {\n return tracingClient.withSpan(\n \"ShortCodesClient-createOrReplaceUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodesOperations.createOrReplaceUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n attachmentId,\n fileName,\n fileType,\n fileContent,\n attachmentType,\n updatedOptions\n );\n }\n );\n }\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.4\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./constants\";\nexport * from \"./logger\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/communication-short-codes",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
4
|
-
"description": "SDK for Azure Communication Services which facilitates short code management
|
|
3
|
+
"version": "1.0.0-beta.4",
|
|
4
|
+
"description": "SDK for Azure Communication Services which facilitates short code management.",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist-esm/src/index.js",
|
|
8
8
|
"types": "types/communication-short-codes.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
|
11
|
-
"build": "npm run clean && tsc -p . &&
|
|
12
|
-
"build:autorest": "autorest --typescript
|
|
11
|
+
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
|
|
12
|
+
"build:autorest": "autorest --typescript ./swagger/README.md && rushx format",
|
|
13
13
|
"build:clean": "rush update --recheck && rush rebuild && npm run build",
|
|
14
|
-
"build:browser": "tsc -p . &&
|
|
15
|
-
"build:node": "tsc -p . &&
|
|
14
|
+
"build:browser": "tsc -p . && dev-tool run bundle",
|
|
15
|
+
"build:node": "tsc -p . && dev-tool run bundle",
|
|
16
16
|
"build:samples": "dev-tool samples publish --force",
|
|
17
|
-
"build:test": "tsc -p . &&
|
|
17
|
+
"build:test": "tsc -p . && dev-tool run bundle",
|
|
18
18
|
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
19
19
|
"clean": "rimraf dist dist-* types *.tgz *.log",
|
|
20
20
|
"execute:samples": "dev-tool samples run samples-dev",
|
|
21
21
|
"extract-api": "tsc -p . && api-extractor run --local",
|
|
22
22
|
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
23
|
-
"integration-test:browser": "
|
|
24
|
-
"integration-test:node": "
|
|
23
|
+
"integration-test:browser": "dev-tool run test:browser",
|
|
24
|
+
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 300000 'dist-esm/test/public/*.spec.js'",
|
|
25
25
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
26
|
-
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
|
|
27
|
-
"lint": "eslint package.json api-extractor.json src test --ext .ts",
|
|
26
|
+
"lint:fix": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js --fix --fix-type [problem,suggestion]",
|
|
27
|
+
"lint": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js",
|
|
28
28
|
"pack": "npm pack 2>&1",
|
|
29
29
|
"test": "rimraf dist-test && npm run build:test && npm run unit-test && npm run integration-test",
|
|
30
30
|
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
|
|
31
31
|
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
|
|
32
32
|
"test:watch": "npm run test -- --watch --reporter min",
|
|
33
|
-
"unit-test:browser": "
|
|
34
|
-
"unit-test:node": "
|
|
35
|
-
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
|
|
36
|
-
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src"
|
|
33
|
+
"unit-test:browser": "dev-tool run test:browser",
|
|
34
|
+
"unit-test:node": "dev-tool run test:node-ts-input -- --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
35
|
+
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
|
|
37
36
|
},
|
|
38
37
|
"files": [
|
|
39
38
|
"dist/",
|
|
@@ -60,38 +59,33 @@
|
|
|
60
59
|
"sideEffects": false,
|
|
61
60
|
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
|
|
62
61
|
"dependencies": {
|
|
63
|
-
"@azure/communication-common": "^1.1.0",
|
|
64
62
|
"@azure/abort-controller": "^1.0.0",
|
|
63
|
+
"@azure/communication-common": "^2.1.0",
|
|
65
64
|
"@azure/core-auth": "^1.3.0",
|
|
66
|
-
"@azure/core-
|
|
65
|
+
"@azure/core-client": "^1.3.2",
|
|
67
66
|
"@azure/core-lro": "^2.2.0",
|
|
68
67
|
"@azure/core-paging": "^1.1.1",
|
|
69
|
-
"@azure/core-
|
|
68
|
+
"@azure/core-rest-pipeline": "^1.3.2",
|
|
69
|
+
"@azure/core-tracing": "^1.0.0",
|
|
70
70
|
"@azure/logger": "^1.0.0",
|
|
71
71
|
"events": "^3.0.0",
|
|
72
72
|
"tslib": "^2.2.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@azure-tools/test-recorder": "^
|
|
75
|
+
"@azure-tools/test-recorder": "^2.0.0",
|
|
76
76
|
"@azure/dev-tool": "^1.0.0",
|
|
77
77
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
78
|
-
"@azure/identity": "2.0.
|
|
78
|
+
"@azure/identity": "^2.0.1",
|
|
79
79
|
"@azure/test-utils": "^1.0.0",
|
|
80
|
-
"@microsoft/api-extractor": "7.
|
|
81
|
-
"@rollup/plugin-commonjs": "11.0.2",
|
|
82
|
-
"@rollup/plugin-json": "^4.0.0",
|
|
83
|
-
"@rollup/plugin-multi-entry": "^3.0.0",
|
|
84
|
-
"@rollup/plugin-node-resolve": "^8.0.0",
|
|
85
|
-
"@rollup/plugin-replace": "^2.2.0",
|
|
80
|
+
"@microsoft/api-extractor": "7.18.11",
|
|
86
81
|
"@types/chai": "^4.1.6",
|
|
87
82
|
"@types/mocha": "^7.0.2",
|
|
88
83
|
"@types/node": "^12.0.0",
|
|
89
84
|
"@types/sinon": "^9.0.4",
|
|
90
|
-
"assert": "^1.4.1",
|
|
91
85
|
"chai": "^4.2.0",
|
|
92
86
|
"cross-env": "^7.0.2",
|
|
93
87
|
"dotenv": "^8.2.0",
|
|
94
|
-
"eslint": "^
|
|
88
|
+
"eslint": "^8.0.0",
|
|
95
89
|
"inherits": "^2.0.3",
|
|
96
90
|
"karma": "^6.2.0",
|
|
97
91
|
"karma-chrome-launcher": "^3.0.0",
|
|
@@ -100,25 +94,33 @@
|
|
|
100
94
|
"karma-env-preprocessor": "^0.1.1",
|
|
101
95
|
"karma-firefox-launcher": "^1.1.0",
|
|
102
96
|
"karma-ie-launcher": "^1.0.0",
|
|
103
|
-
"karma-json-preprocessor": "^0.3.3",
|
|
104
|
-
"karma-json-to-file-reporter": "^1.0.1",
|
|
105
97
|
"karma-junit-reporter": "^2.0.1",
|
|
106
98
|
"karma-mocha": "^2.0.1",
|
|
107
99
|
"karma-mocha-reporter": "^2.2.5",
|
|
108
100
|
"karma-sourcemap-loader": "^0.3.8",
|
|
109
101
|
"mocha": "^7.1.1",
|
|
110
|
-
"mocha-junit-reporter": "^
|
|
111
|
-
"nyc": "^
|
|
112
|
-
"prettier": "^
|
|
102
|
+
"mocha-junit-reporter": "^2.0.0",
|
|
103
|
+
"nyc": "^15.0.0",
|
|
104
|
+
"prettier": "^2.5.1",
|
|
113
105
|
"rimraf": "^3.0.0",
|
|
114
|
-
"rollup": "^1.16.3",
|
|
115
|
-
"rollup-plugin-shim": "^1.0.0",
|
|
116
|
-
"rollup-plugin-sourcemaps": "^0.4.2",
|
|
117
|
-
"rollup-plugin-terser": "^5.1.1",
|
|
118
|
-
"rollup-plugin-visualizer": "^4.0.4",
|
|
119
106
|
"sinon": "^9.0.2",
|
|
120
|
-
"
|
|
121
|
-
|
|
107
|
+
"typescript": "~4.6.0"
|
|
108
|
+
},
|
|
109
|
+
"//metadata": {
|
|
110
|
+
"constantPaths": [
|
|
111
|
+
{
|
|
112
|
+
"path": "src/generated/src/shortCodesClientContext.ts",
|
|
113
|
+
"prefix": "packageDetails"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"path": "src/utils/constants.ts",
|
|
117
|
+
"prefix": "SDK_VERSION"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"path": "swagger/README.md",
|
|
121
|
+
"prefix": "package-version"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
122
124
|
},
|
|
123
125
|
"//sampleConfiguration": {
|
|
124
126
|
"productName": "Azure Communication Services - Short Codes",
|