@azure-tools/communication-short-codes 1.0.0-beta.3 → 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.
@@ -1,9 +1,12 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /// <reference lib="esnext.asynciterable" />
1
4
  import { isTokenCredential } from "@azure/core-auth";
2
- import { createSpan, logger } from "./utils";
3
5
  import { isKeyCredential, parseClientArguments } from "@azure/communication-common";
4
6
  import { ShortCodesClient as ShortCodesGeneratedClient } from "./generated/src";
5
- import { SpanStatusCode } from "@azure/core-tracing";
6
7
  import { createCommunicationAuthPolicy } from "@azure/communication-common";
8
+ import { logger } from "./utils";
9
+ import { tracingClient } from "./generated/src/tracing";
7
10
  const isShortCodesClientOptions = (options) => options && !isKeyCredential(options) && !isTokenCredential(options);
8
11
  export class ShortCodesClient {
9
12
  constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
@@ -21,14 +24,14 @@ export class ShortCodesClient {
21
24
  this.client.pipeline.addPolicy(authPolicy);
22
25
  }
23
26
  listShortCodes(options = {}) {
24
- const { span, updatedOptions } = createSpan("ShortCodesClient-listShortCodes", options);
27
+ const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listShortCodes", options);
25
28
  try {
26
29
  return this.client.shortCodesOperations.listShortCodes(updatedOptions);
27
30
  }
28
31
  catch (e) {
29
32
  span.setStatus({
30
- code: SpanStatusCode.ERROR,
31
- message: e.message,
33
+ status: "error",
34
+ error: e,
32
35
  });
33
36
  throw e;
34
37
  }
@@ -36,63 +39,30 @@ export class ShortCodesClient {
36
39
  span.end();
37
40
  }
38
41
  }
39
- async upsertUSProgramBrief(programBriefId, options = {}) {
40
- const { span, updatedOptions } = createSpan("ShortCodesClient-upsertUSProgramBrief", options);
41
- try {
42
- return await this.client.shortCodesOperations.upsertUSProgramBrief(programBriefId, updatedOptions);
43
- }
44
- catch (e) {
45
- span.setStatus({
46
- code: SpanStatusCode.ERROR,
47
- message: e.message,
48
- });
49
- throw e;
50
- }
51
- finally {
52
- span.end();
53
- }
42
+ upsertUSProgramBrief(programBriefId, options = {}) {
43
+ return tracingClient.withSpan("ShortCodesClient-upsertUSProgramBrief", options, (updatedOptions) => {
44
+ return this.client.shortCodesOperations.upsertUSProgramBrief(programBriefId, updatedOptions);
45
+ });
54
46
  }
55
- async deleteUSProgramBrief(programBriefId, options) {
56
- const { span, updatedOptions } = createSpan("ShortCodesClient-deleteUSProgramBrief", options);
57
- try {
58
- return await this.client.shortCodesOperations.deleteUSProgramBrief(programBriefId, updatedOptions);
59
- }
60
- catch (e) {
61
- span.setStatus({
62
- code: SpanStatusCode.ERROR,
63
- message: e.message,
64
- });
65
- throw e;
66
- }
67
- finally {
68
- span.end();
69
- }
47
+ deleteUSProgramBrief(programBriefId, options = {}) {
48
+ return tracingClient.withSpan("ShortCodesClient-deleteUSProgramBrief", options, (updatedOptions) => {
49
+ return this.client.shortCodesOperations.deleteUSProgramBrief(programBriefId, updatedOptions);
50
+ });
70
51
  }
71
- async getUSProgramBrief(programBriefId, options) {
72
- const { span, updatedOptions } = createSpan("ShortCodesClient-getUSProgramBrief", options);
73
- try {
74
- return await this.client.shortCodesOperations.getUSProgramBrief(programBriefId, updatedOptions);
75
- }
76
- catch (e) {
77
- span.setStatus({
78
- code: SpanStatusCode.ERROR,
79
- message: e.message,
80
- });
81
- throw e;
82
- }
83
- finally {
84
- span.end();
85
- }
52
+ getUSProgramBrief(programBriefId, options = {}) {
53
+ return tracingClient.withSpan("ShortCodesClient-getUSProgramBrief", options, (updatedOptions) => {
54
+ return this.client.shortCodesOperations.getUSProgramBrief(programBriefId, updatedOptions);
55
+ });
86
56
  }
87
57
  listUSProgramBriefs(options = {}) {
88
- const { span, updatedOptions } = createSpan("ShortCodesClient-listUSProgramBriefs", options);
58
+ const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listUSProgramBriefs", options);
89
59
  try {
90
60
  return this.client.shortCodesOperations.listUSProgramBriefs(updatedOptions);
91
61
  }
92
62
  catch (e) {
93
63
  span.setStatus({
94
- code: SpanStatusCode.ERROR,
95
- message: e.message,
64
+ status: "error",
65
+ error: e,
96
66
  });
97
67
  throw e;
98
68
  }
@@ -100,47 +70,25 @@ export class ShortCodesClient {
100
70
  span.end();
101
71
  }
102
72
  }
103
- async submitUSProgramBrief(programBriefId, options) {
104
- const { span, updatedOptions } = createSpan("ShortCodesClient-submitUSProgramBrief", options);
105
- try {
106
- return await this.client.shortCodesOperations.submitUSProgramBrief(programBriefId, updatedOptions);
107
- }
108
- catch (e) {
109
- span.setStatus({
110
- code: SpanStatusCode.ERROR,
111
- message: e.message,
112
- });
113
- throw e;
114
- }
115
- finally {
116
- span.end();
117
- }
73
+ submitUSProgramBrief(programBriefId, options = {}) {
74
+ return tracingClient.withSpan("ShortCodesClient-submitUSProgramBrief", options, (updatedOptions) => {
75
+ return this.client.shortCodesOperations.submitUSProgramBrief(programBriefId, updatedOptions);
76
+ });
118
77
  }
119
- async getUSProgramBriefAttachment(programBriefId, attachmentId, options) {
120
- const { span, updatedOptions } = createSpan("ShortCodesClient-getUSProgramBriefAttachment", options);
121
- try {
122
- return await this.client.shortCodesOperations.getUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
123
- }
124
- catch (e) {
125
- span.setStatus({
126
- code: SpanStatusCode.ERROR,
127
- message: e.message,
128
- });
129
- throw e;
130
- }
131
- finally {
132
- span.end();
133
- }
78
+ getUSProgramBriefAttachment(programBriefId, attachmentId, options = {}) {
79
+ return tracingClient.withSpan("ShortCodesClient-getUSProgramBriefAttachment", options, (updatedOptions) => {
80
+ return this.client.shortCodesOperations.getUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
81
+ });
134
82
  }
135
83
  listUSProgramBriefAttachments(programBriefId, options = {}) {
136
- const { span, updatedOptions } = createSpan("ShortCodesClient-listUSProgramBriefAttachments", options);
84
+ const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listUSProgramBriefAttachments", options);
137
85
  try {
138
86
  return this.client.shortCodesOperations.listUSProgramBriefAttachments(programBriefId, updatedOptions);
139
87
  }
140
88
  catch (e) {
141
89
  span.setStatus({
142
- code: SpanStatusCode.ERROR,
143
- message: e.message,
90
+ status: "error",
91
+ error: e,
144
92
  });
145
93
  throw e;
146
94
  }
@@ -148,37 +96,15 @@ export class ShortCodesClient {
148
96
  span.end();
149
97
  }
150
98
  }
151
- async deleteUSProgramBriefAttachment(programBriefId, attachmentId, options) {
152
- const { span, updatedOptions } = createSpan("ShortCodesClient-deleteUSProgramBriefAttachment", options);
153
- try {
154
- return await this.client.shortCodesOperations.deleteUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
155
- }
156
- catch (e) {
157
- span.setStatus({
158
- code: SpanStatusCode.ERROR,
159
- message: e.message,
160
- });
161
- throw e;
162
- }
163
- finally {
164
- span.end();
165
- }
99
+ deleteUSProgramBriefAttachment(programBriefId, attachmentId, options = {}) {
100
+ return tracingClient.withSpan("ShortCodesClient-deleteUSProgramBriefAttachment", options, (updatedOptions) => {
101
+ return this.client.shortCodesOperations.deleteUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
102
+ });
166
103
  }
167
- async createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, fileName, fileType, fileContent, attachmentType, options = {}) {
168
- const { span, updatedOptions } = createSpan("ShortCodesClient-createOrReplaceUSProgramBriefAttachment", options);
169
- try {
170
- return await this.client.shortCodesOperations.createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, attachmentId, fileName, fileType, fileContent, attachmentType, updatedOptions);
171
- }
172
- catch (e) {
173
- span.setStatus({
174
- code: SpanStatusCode.ERROR,
175
- message: e.message,
176
- });
177
- throw e;
178
- }
179
- finally {
180
- span.end();
181
- }
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
+ });
182
108
  }
183
109
  }
184
110
  //# sourceMappingURL=shortCodesClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../src/shortCodesClient.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAM5E,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;QAEjB,MAAM,uBAAuB,mCACxB,OAAO,GACP;YACD,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,IAAI;aACpB;SACF,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAA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ACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,cAAc,CACf,CAAC;SACH;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\" />\nimport { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\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 { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport {\n ProgramBriefAttachment,\n ShortCode,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n USProgramBrief,\n} from \"./generated/src/models/\";\nimport { createSpan, logger } from \"./utils\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { ShortCodesClient as ShortCodesGeneratedClient } from \"./generated/src\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\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 } = createSpan(\"ShortCodesClient-listShortCodes\", options);\n try {\n return this.client.shortCodesOperations.listShortCodes(updatedOptions);\n } catch (e: any) {\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<USProgramBrief> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-upsertUSProgramBrief\", options);\n try {\n return await this.client.shortCodesOperations.upsertUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n } catch (e: any) {\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<void> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-deleteUSProgramBrief\", options);\n try {\n return await this.client.shortCodesOperations.deleteUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n } catch (e: any) {\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.shortCodesOperations.getUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n } catch (e: any) {\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.shortCodesOperations.listUSProgramBriefs(updatedOptions);\n } catch (e: any) {\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<USProgramBrief> {\n const { span, updatedOptions } = createSpan(\"ShortCodesClient-submitUSProgramBrief\", options);\n try {\n return await this.client.shortCodesOperations.submitUSProgramBrief(\n programBriefId,\n updatedOptions\n );\n } catch (e: any) {\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 getUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options?: ShortCodesGetUSProgramBriefAttachmentOptionalParams\n ): Promise<ProgramBriefAttachment> {\n const { span, updatedOptions } = createSpan(\n \"ShortCodesClient-getUSProgramBriefAttachment\",\n options\n );\n try {\n return await this.client.shortCodesOperations.getUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions\n );\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 listUSProgramBriefAttachments(\n programBriefId: string,\n options: ShortCodesGetUSProgramBriefAttachmentsOptionalParams = {}\n ): PagedAsyncIterableIterator<ProgramBriefAttachment> {\n const { span, updatedOptions } = createSpan(\n \"ShortCodesClient-listUSProgramBriefAttachments\",\n options\n );\n try {\n return this.client.shortCodesOperations.listUSProgramBriefAttachments(\n programBriefId,\n updatedOptions\n );\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 deleteUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options?: ShortCodesDeleteUSProgramBriefAttachmentOptionalParams\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\n \"ShortCodesClient-deleteUSProgramBriefAttachment\",\n options\n );\n try {\n return await this.client.shortCodesOperations.deleteUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions\n );\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 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 const { span, updatedOptions } = createSpan(\n \"ShortCodesClient-createOrReplaceUSProgramBriefAttachment\",\n options\n );\n try {\n return await this.client.shortCodesOperations.createOrReplaceUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n attachmentId,\n fileName,\n fileType,\n fileContent,\n attachmentType,\n updatedOptions\n );\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,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;QAEjB,MAAM,uBAAuB,mCACxB,OAAO,GACP;YACD,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,IAAI;aACpB;SACF,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAI,yBAAyB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QAC1E,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,IAA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AI;YACF,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,6BAA6B,CACnE,cAAc,EACd,cAAc,CACf,CAAC;SACH;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAEM,8BAA8B,CACnC,cAAsB,EACtB,YAAoB,EACpB,UAAkE,EAAE;QAEpE,OAAO,aAAa,CAAC,QAAQ,CAC3B,iDAAiD,EACjD,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,8BAA8B,CACpE,cAAc,EACd,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAEM,uCAAuC,CAC5C,cAAsB,EACtB,YAAoB,EACpB,QAAgB,EAChB,QAAkB,EAClB,WAAmB,EACnB,cAA8B,EAC9B,UAA2E,EAAE;QAE7E,OAAO,aAAa,CAAC,QAAQ,CAC3B,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,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- export const SDK_VERSION = "1.0.0-beta.3";
3
+ export const SDK_VERSION = "1.0.0-beta.4";
4
4
  //# sourceMappingURL=constants.js.map
@@ -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.3\";\n"]}
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"]}
@@ -2,5 +2,4 @@
2
2
  // Licensed under the MIT license.
3
3
  export * from "./constants";
4
4
  export * from "./logger";
5
- export * from "./tracing";
6
5
  //# sourceMappingURL=index.js.map
@@ -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;AACzB,cAAc,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./constants\";\nexport * from \"./logger\";\nexport * from \"./tracing\";\n"]}
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/communication-short-codes",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "SDK for Azure Communication Services which facilitates short code management.",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,7 @@
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
11
  "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
12
- "build:autorest": "autorest --typescript --version=3.0.6267 --v3 ./swagger/README.md && rushx format",
12
+ "build:autorest": "autorest --typescript ./swagger/README.md && rushx format",
13
13
  "build:clean": "rush update --recheck && rush rebuild && npm run build",
14
14
  "build:browser": "tsc -p . && dev-tool run bundle",
15
15
  "build:node": "tsc -p . && dev-tool run bundle",
@@ -60,13 +60,13 @@
60
60
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
61
61
  "dependencies": {
62
62
  "@azure/abort-controller": "^1.0.0",
63
- "@azure/communication-common": "^2.0.0",
63
+ "@azure/communication-common": "^2.1.0",
64
64
  "@azure/core-auth": "^1.3.0",
65
65
  "@azure/core-client": "^1.3.2",
66
66
  "@azure/core-lro": "^2.2.0",
67
67
  "@azure/core-paging": "^1.1.1",
68
68
  "@azure/core-rest-pipeline": "^1.3.2",
69
- "@azure/core-tracing": "1.0.0-preview.13",
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"
@@ -104,7 +104,7 @@
104
104
  "prettier": "^2.5.1",
105
105
  "rimraf": "^3.0.0",
106
106
  "sinon": "^9.0.2",
107
- "typescript": "~4.2.0"
107
+ "typescript": "~4.6.0"
108
108
  },
109
109
  "//metadata": {
110
110
  "constantPaths": [
@@ -1,40 +0,0 @@
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 * as coreClient from "@azure/core-client";
9
- export class ShortCodesClientContext extends coreClient.ServiceClient {
10
- /**
11
- * Initializes a new instance of the ShortCodesClientContext class.
12
- * @param endpoint The communication resource, for example https://resourcename.communication.azure.com
13
- * @param options The parameter options
14
- */
15
- constructor(endpoint, options) {
16
- if (endpoint === undefined) {
17
- throw new Error("'endpoint' cannot be null");
18
- }
19
- // Initializing default values for options
20
- if (!options) {
21
- options = {};
22
- }
23
- const defaults = {
24
- requestContentType: "application/json; charset=utf-8"
25
- };
26
- const packageDetails = `azsdk-js-communication-short-codes/1.0.0-beta.3`;
27
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
28
- ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
29
- : `${packageDetails}`;
30
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
31
- userAgentPrefix
32
- }, baseUri: options.endpoint || "{endpoint}" });
33
- super(optionsWithDefaults);
34
- // Parameter assignments
35
- this.endpoint = endpoint;
36
- // Assigning values to Constant parameters
37
- this.apiVersion = options.apiVersion || "2021-10-25-preview";
38
- }
39
- }
40
- //# sourceMappingURL=shortCodesClientContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shortCodesClientContext.js","sourceRoot":"","sources":["../../../../src/generated/src/shortCodesClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,MAAM,OAAO,uBAAwB,SAAQ,UAAU,CAAC,aAAa;IAInE;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAwC;QACpE,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAmC;YAC/C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,iDAAiD,CAAC;QACzE,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,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,YAAY,GAC1C,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC/D,CAAC;CACF","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 { ShortCodesClientOptionalParams } from \"./models\";\n\nexport class ShortCodesClientContext extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the ShortCodesClientContext 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.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 baseUri: options.endpoint || \"{endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-25-preview\";\n }\n}\n"]}
@@ -1,14 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { createSpanFunction } from "@azure/core-tracing";
4
- /**
5
- * Creates a span using the global tracer.
6
- * @internal
7
- * @param name - The name of the operation being performed.
8
- * @param tracingOptions - The options for the underlying http request.
9
- */
10
- export const createSpan = createSpanFunction({
11
- packagePrefix: "Azure.Communication",
12
- namespace: "Microsoft.Communication",
13
- });
14
- //# sourceMappingURL=tracing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../src/utils/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;IAC3C,aAAa,EAAE,qBAAqB;IACpC,SAAS,EAAE,yBAAyB;CACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createSpanFunction } from \"@azure/core-tracing\";\n\n/**\n * Creates a span using the global tracer.\n * @internal\n * @param name - The name of the operation being performed.\n * @param tracingOptions - The options for the underlying http request.\n */\nexport const createSpan = createSpanFunction({\n packagePrefix: \"Azure.Communication\",\n namespace: \"Microsoft.Communication\",\n});\n"]}